@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | ) { |
| 29 | 29 | // si l'url est une url du site, on la laisse passer sans rien faire |
| 30 | 30 | // c'est encore le plus simple |
| 31 | - $base = $GLOBALS['meta']['adresse_site'] . '/'; |
|
| 31 | + $base = $GLOBALS['meta']['adresse_site'].'/'; |
|
| 32 | 32 | if (strlen($base) and strncmp($redirect, $base, strlen($base)) == 0) { |
| 33 | 33 | return $redirect; |
| 34 | 34 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if ($ancre = _request('var_ajax_ancre')) { |
| 157 | 157 | // pas n'importe quoi quand meme dans la variable ! |
| 158 | 158 | $ancre = str_replace(['<', '"', "'"], ['<', '"', ''], $ancre); |
| 159 | - $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte; |
|
| 159 | + $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte; |
|
| 160 | 160 | } |
| 161 | 161 | } else { |
| 162 | 162 | include_spip('inc/headers'); |
@@ -199,26 +199,26 @@ discard block |
||
| 199 | 199 | $sign = _request('formulaire_action_sign'); |
| 200 | 200 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 201 | 201 | if (empty($sign)) { |
| 202 | - spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires' . _LOG_ERREUR); |
|
| 202 | + spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires'._LOG_ERREUR); |
|
| 203 | 203 | return false; |
| 204 | 204 | } |
| 205 | 205 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 206 | 206 | $secu = $securiser_action($form, $args, '', -1); |
| 207 | 207 | if ($sign !== $secu['hash']) { |
| 208 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires' . _LOG_ERREUR); |
|
| 208 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires'._LOG_ERREUR); |
|
| 209 | 209 | return false; |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | else { |
| 213 | 213 | if (!empty($sign)) { |
| 214 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires' . _LOG_ERREUR); |
|
| 214 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires'._LOG_ERREUR); |
|
| 215 | 215 | return false; |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | include_spip('inc/filtres'); |
| 220 | 220 | if (($args = decoder_contexte_ajax($args, $form)) === false) { |
| 221 | - spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires' . _LOG_ERREUR); |
|
| 221 | + spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires'._LOG_ERREUR); |
|
| 222 | 222 | |
| 223 | 223 | return false; // continuons le hit comme si de rien etait |
| 224 | 224 | } else { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | // on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7 |
| 336 | 336 | // sans cela le formulaire n'est pas actif apres le hit ajax |
| 337 | 337 | // la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe |
| 338 | - $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour; |
|
| 338 | + $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour; |
|
| 339 | 339 | ajax_retour($retour, false); |
| 340 | 340 | |
| 341 | 341 | return true; // on a fini le hit |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | function surligner_mots($page, $surcharge_surligne = '') { |
| 38 | 38 | $surlignejs_engines = [ |
| 39 | 39 | [ |
| 40 | - ',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i', |
|
| 40 | + ','.str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']).',i', |
|
| 41 | 41 | ',recherche=([^&]+),i' |
| 42 | 42 | ], //SPIP |
| 43 | 43 | [',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | //good referrer found or var_recherche is not null |
| 73 | 73 | include_spip('inc/filtres'); |
| 74 | 74 | $script = " |
| 75 | - <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> |
|
| 75 | + <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js'))."'></script> |
|
| 76 | 76 | <script type='text/javascript'> |
| 77 | 77 | var highlighter = function() { |
| 78 | 78 | jQuery(this).SearchHighlight({ |
| 79 | - tag_name:'" . (html5_permis() ? 'mark' : 'span') . "', |
|
| 79 | + tag_name:'" . (html5_permis() ? 'mark' : 'span')."', |
|
| 80 | 80 | style_name:'spip_surligne', |
| 81 | 81 | exact:'whole', |
| 82 | 82 | style_name_suffix:false, |
| 83 | - engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i], |
|
| 83 | + engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site'])."/i,/recherche=([^&]+)/i], |
|
| 84 | 84 | highlight:'.surlignable', |
| 85 | 85 | nohighlight:'.pas_surlignable'" . |
| 86 | 86 | ($surcharge_surligne ? ", |
| 87 | - keys:'$surcharge_surligne'" : '') . ', |
|
| 87 | + keys:'$surcharge_surligne'" : '').', |
|
| 88 | 88 | min_length: 3 |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | // de connexion, et tout risque d'ambiguite |
| 91 | 91 | if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) { |
| 92 | 92 | $nom_cache_desc_sql[$serveur][$objets_sql] = |
| 93 | - _DIR_CACHE . 'sql_desc_' |
|
| 93 | + _DIR_CACHE.'sql_desc_' |
|
| 94 | 94 | . ($serveur ? "{$serveur}_" : '') |
| 95 | - . substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8) |
|
| 95 | + . substr(md5($connexion['db'].':'.$connexion['prefixe'].":$objets_sql"), 0, 8) |
|
| 96 | 96 | . '.txt'; |
| 97 | 97 | // nouveau nom de cache = nouvelle version en memoire |
| 98 | 98 | unset($connexion['tables']); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($connexion['spip_connect_version']) { |
| 121 | 121 | if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) { |
| 122 | 122 | $nom = $GLOBALS['table_des_tables'][$nom]; |
| 123 | - $nom_sql = 'spip_' . $nom; |
|
| 123 | + $nom_sql = 'spip_'.$nom; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | // meme si pas d'abreviation declaree, trouver la table spip_$nom |
| 148 | 148 | // si c'est une table principale, |
| 149 | 149 | // puisqu'on le fait aussi pour les tables auxiliaires |
| 150 | - elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) { |
|
| 151 | - $nom_sql = 'spip_' . $nom; |
|
| 150 | + elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_'.$nom])) { |
|
| 151 | + $nom_sql = 'spip_'.$nom; |
|
| 152 | 152 | $fdesc = &$GLOBALS['tables_principales'][$nom_sql]; |
| 153 | 153 | } elseif ( |
| 154 | 154 | isset($GLOBALS['tables_auxiliaires'][$n = $nom]) |
| 155 | - or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom]) |
|
| 155 | + or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_'.$nom]) |
|
| 156 | 156 | ) { |
| 157 | 157 | $nom_sql = $n; |
| 158 | 158 | $fdesc = &$GLOBALS['tables_auxiliaires'][$n]; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ) { |
| 169 | 169 | if (!$fdesc) { |
| 170 | 170 | $log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG; |
| 171 | - spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level); |
|
| 171 | + spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base'.$log_level); |
|
| 172 | 172 | |
| 173 | 173 | return null; |
| 174 | 174 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $desc['exist'] = true; |
| 181 | 181 | // gerer le cas des cles vides (echec de l'analyse sur une vue par exemple) |
| 182 | 182 | // pour recuperer la declaration de lister_tables_objets_sql() si il y en a une |
| 183 | - if (! $desc['key']) { |
|
| 183 | + if (!$desc['key']) { |
|
| 184 | 184 | spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base'); |
| 185 | 185 | unset($desc['key']); |
| 186 | 186 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (!isset($desc['key']) && !empty($fdesc['key'])) { |
| 198 | 198 | $desc['key'] = $fdesc['key']; |
| 199 | 199 | } |
| 200 | - if (! isset($desc['key'])) { |
|
| 200 | + if (!isset($desc['key'])) { |
|
| 201 | 201 | $desc['key'] = []; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | 108 | // Si l'article est publie, invalider les caches et demander sa reindexation |
| 109 | - $t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 109 | + $t = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id_article)); |
|
| 110 | 110 | $invalideur = $indexation = false; |
| 111 | 111 | if ($t == 'publie') { |
| 112 | 112 | $invalideur = "id='article/$id_article'"; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $id_article, |
| 120 | 120 | [ |
| 121 | 121 | 'data' => $set, |
| 122 | - 'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article], |
|
| 122 | + 'nonvide' => ['titre' => _T('info_nouvel_article').' '._T('info_numero_abbreviation').$id_article], |
|
| 123 | 123 | 'invalideur' => $invalideur, |
| 124 | 124 | 'indexation' => $indexation, |
| 125 | 125 | 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
| 310 | 310 | $statut = $champs['statut'] = $s; |
| 311 | 311 | } else { |
| 312 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 312 | + spip_log("editer_article $id_article refus ".join(' ', $c)); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // En cas de publication, fixer la date a "maintenant" |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | isset($c['id_parent']) |
| 335 | 335 | and $id_parent = $c['id_parent'] |
| 336 | 336 | and $id_parent != $id_rubrique |
| 337 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 337 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent))) |
|
| 338 | 338 | ) { |
| 339 | 339 | $champs['id_rubrique'] = $id_parent; |
| 340 | 340 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | // Si on deplace l'article |
| 436 | 436 | // changer aussi son secteur et sa langue (si heritee) |
| 437 | 437 | if (isset($champs['id_rubrique'])) { |
| 438 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 438 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique'])); |
|
| 439 | 439 | |
| 440 | 440 | $langue = $row_rub['lang']; |
| 441 | 441 | $champs['id_secteur'] = $row_rub['id_secteur']; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | sql_fetsel( |
| 444 | 444 | '1', |
| 445 | 445 | 'spip_articles', |
| 446 | - 'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 446 | + 'id_article='.intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue) |
|
| 447 | 447 | ) |
| 448 | 448 | ) { |
| 449 | 449 | $champs['lang'] = $langue; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | return; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article)); |
|
| 457 | + sql_updateq('spip_articles', $champs, 'id_article='.intval($id_article)); |
|
| 458 | 458 | |
| 459 | 459 | // Changer le statut des rubriques concernees |
| 460 | 460 | |
@@ -475,6 +475,6 @@ discard block |
||
| 475 | 475 | foreach ($plus as $n => $t) { |
| 476 | 476 | $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t); |
| 477 | 477 | } |
| 478 | - set_request('texte', join('', $plus) . _request('texte')); |
|
| 478 | + set_request('texte', join('', $plus)._request('texte')); |
|
| 479 | 479 | } |
| 480 | 480 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $credentials_ldap = ['ldap_dn' => $dn, 'ldap_password' => $pass]; |
| 69 | 69 | |
| 70 | 70 | // Si l'utilisateur figure deja dans la base, y recuperer les infos |
| 71 | - $r = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login) . " AND source='ldap'", '', '', '', '', $serveur); |
|
| 71 | + $r = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login)." AND source='ldap'", '', '', '', '', $serveur); |
|
| 72 | 72 | |
| 73 | 73 | if ($r) { |
| 74 | 74 | return array_merge($r, $credentials_ldap); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($r) { |
| 93 | 93 | return array_merge( |
| 94 | 94 | $credentials_ldap, |
| 95 | - sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($r), '', '', '', '', $serveur) |
|
| 95 | + sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($r), '', '', '', '', $serveur) |
|
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $connexion = spip_connect($serveur); |
| 122 | 122 | if (!is_array($connexion['ldap'])) { |
| 123 | 123 | if ($connexion['authentification']['ldap']) { |
| 124 | - $f = _DIR_CONNECT . $connexion['authentification']['ldap']; |
|
| 124 | + $f = _DIR_CONNECT.$connexion['authentification']['ldap']; |
|
| 125 | 125 | unset($GLOBALS['ldap_link']); |
| 126 | 126 | if (is_readable($f)) { |
| 127 | 127 | include_once($f); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | if (!ldap_bind($link, $dn, session_get('ldap_password'))) { |
| 335 | 335 | return false; |
| 336 | 336 | } |
| 337 | - $encoded_pass = '{MD5}' . base64_encode(pack('H*', md5($new_pass))); |
|
| 337 | + $encoded_pass = '{MD5}'.base64_encode(pack('H*', md5($new_pass))); |
|
| 338 | 338 | $success = ldap_mod_replace($link, $dn, ['userPassword' => $encoded_pass]); |
| 339 | 339 | |
| 340 | 340 | return $success; |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | if (!defined('_DIR_RESTREINT_ABS')) { |
| 31 | 31 | if ( |
| 32 | 32 | defined('_DIR_RESTREINT') |
| 33 | - and @file_exists(_ROOT_RESTREINT . 'inc_version.php') |
|
| 33 | + and @file_exists(_ROOT_RESTREINT.'inc_version.php') |
|
| 34 | 34 | ) { |
| 35 | - include_once _ROOT_RESTREINT . 'inc_version.php'; |
|
| 35 | + include_once _ROOT_RESTREINT.'inc_version.php'; |
|
| 36 | 36 | } else { |
| 37 | 37 | die('inc_version absent ?'); |
| 38 | 38 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } // fond demande dans l'url par page=xxxx ? |
| 44 | 44 | else { |
| 45 | 45 | if (isset($_GET[_SPIP_PAGE])) { |
| 46 | - $fond = (string)$_GET[_SPIP_PAGE]; |
|
| 46 | + $fond = (string) $_GET[_SPIP_PAGE]; |
|
| 47 | 47 | |
| 48 | 48 | // Securite |
| 49 | 49 | if ( |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // lancer les taches sur affichage final, comme le cron |
| 108 | 108 | // mais sans rien afficher |
| 109 | 109 | $GLOBALS['html'] = false; // ne rien afficher |
| 110 | - pipeline('affichage_final' . _PIPELINE_SUFFIX, ''); |
|
| 110 | + pipeline('affichage_final'._PIPELINE_SUFFIX, ''); |
|
| 111 | 111 | exit; // le hit est fini ! |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | // Content-Type ? |
| 125 | 125 | if (!isset($page['entetes']['Content-Type'])) { |
| 126 | 126 | $charset = $GLOBALS['meta']['charset'] ?? 'utf-8'; |
| 127 | - $page['entetes']['Content-Type'] = 'text/html; charset=' . $charset; |
|
| 127 | + $page['entetes']['Content-Type'] = 'text/html; charset='.$charset; |
|
| 128 | 128 | $html = true; |
| 129 | 129 | } else { |
| 130 | 130 | $html = preg_match(',^\s*text/html,', $page['entetes']['Content-Type']); |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | // traitements sur les entetes avant envoi |
| 152 | 152 | // peut servir pour le plugin de stats |
| 153 | - $page['entetes'] = pipeline('affichage_entetes_final' . _PIPELINE_SUFFIX, $page['entetes']); |
|
| 153 | + $page['entetes'] = pipeline('affichage_entetes_final'._PIPELINE_SUFFIX, $page['entetes']); |
|
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | // eval $page et affecte $res |
| 157 | - include _ROOT_RESTREINT . 'public/evaluer_page.php'; |
|
| 157 | + include _ROOT_RESTREINT.'public/evaluer_page.php'; |
|
| 158 | 158 | envoyer_entetes($page['entetes']); |
| 159 | 159 | if ($res === false) { |
| 160 | 160 | include_spip('inc/autoriser'); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // |
| 174 | 174 | // (c'est ici qu'on fait var_recherche, validation, boutons d'admin, |
| 175 | 175 | // cf. public/assembler.php) |
| 176 | - echo pipeline('affichage_final' . _PIPELINE_SUFFIX, $page['texte']); |
|
| 176 | + echo pipeline('affichage_final'._PIPELINE_SUFFIX, $page['texte']); |
|
| 177 | 177 | |
| 178 | 178 | if ($lang) { |
| 179 | 179 | lang_select(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | if ($html and ($affiche_boutons_admin or $debug)) { |
| 190 | 190 | $var_mode_affiche = _request('var_mode_affiche'); |
| 191 | 191 | $var_mode_objet = _request('var_mode_objet'); |
| 192 | - $GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet . 'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : ''); |
|
| 192 | + $GLOBALS['debug_objets'][$var_mode_affiche][$var_mode_objet.'tout'] = ($var_mode_affiche == 'validation' ? $page['texte'] : ''); |
|
| 193 | 193 | echo erreur_squelette(false); |
| 194 | 194 | } |
| 195 | 195 | } else { |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | $exceptions_pluriel = ['forum' => 'forum', 'syndic' => 'syndic']; |
| 61 | 61 | |
| 62 | 62 | $pivot = preg_replace(',[^\w],', '', $pivot); // securite |
| 63 | - $pivots = ($exceptions_pluriel[$pivot] ?? $pivot . 's'); |
|
| 64 | - $liens = 'spip_' . $pivots . '_liens'; |
|
| 65 | - $id_pivot = 'id_' . $pivot; |
|
| 63 | + $pivots = ($exceptions_pluriel[$pivot] ?? $pivot.'s'); |
|
| 64 | + $liens = 'spip_'.$pivots.'_liens'; |
|
| 65 | + $id_pivot = 'id_'.$pivot; |
|
| 66 | 66 | // Creer spip_auteurs_liens |
| 67 | 67 | global $tables_auxiliaires; |
| 68 | 68 | if (!$l) { |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | $l = preg_replace(',[^\w],', '', $l); // securite |
| 75 | 75 | $primary = "id_$l"; |
| 76 | 76 | $objet = ($l == 'syndic' ? 'site' : $l); |
| 77 | - $ls = ($exceptions_pluriel[$l] ?? $l . 's'); |
|
| 78 | - $ancienne_table = 'spip_' . $pivots . '_' . $ls; |
|
| 77 | + $ls = ($exceptions_pluriel[$l] ?? $l.'s'); |
|
| 78 | + $ancienne_table = 'spip_'.$pivots.'_'.$ls; |
|
| 79 | 79 | $pool = 400; |
| 80 | 80 | |
| 81 | 81 | $trouver_table = charger_fonction('trouver_table', 'base'); |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | while ($ids = array_map('reset', sql_allfetsel("$primary", $ancienne_table, '', '', '', "0,$sub_pool"))) { |
| 112 | 112 | $insert = []; |
| 113 | 113 | foreach ($ids as $id) { |
| 114 | - $n = sql_countsel($liens, "objet='$objet' AND id_objet=" . intval($id)); |
|
| 115 | - while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=" . intval($id), '', $id_pivot, "$n,$pool")) { |
|
| 114 | + $n = sql_countsel($liens, "objet='$objet' AND id_objet=".intval($id)); |
|
| 115 | + while ($t = sql_allfetsel($champs, $ancienne_table, "$primary=".intval($id), '', $id_pivot, "$n,$pool")) { |
|
| 116 | 116 | $n += is_countable($t) ? count($t) : 0; |
| 117 | 117 | // empiler en s'assurant a minima de l'unicite |
| 118 | 118 | while ($r = array_shift($t)) { |
| 119 | - $insert[$r[$id_pivot] . ':' . $r['id_objet']] = $r; |
|
| 119 | + $insert[$r[$id_pivot].':'.$r['id_objet']] = $r; |
|
| 120 | 120 | } |
| 121 | 121 | if (count($insert) >= $sub_pool) { |
| 122 | 122 | maj_liens_insertq_multi_check($liens, $insert, $tables_auxiliaires[$liens]); |
@@ -267,13 +267,13 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | // cas particulier spip_auteurs : retablir le collate binary sur le login |
| 269 | 269 | $desc = $trouver_table('spip_auteurs'); |
| 270 | - spip_log('spip_auteurs : ' . var_export($desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 270 | + spip_log('spip_auteurs : '.var_export($desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 271 | 271 | if (stripos($desc['field']['login'], 'BINARY') === false) { |
| 272 | 272 | spip_log('Retablir champ login BINARY sur table spip_auteurs', 'maj'); |
| 273 | 273 | sql_alter('table spip_auteurs change login login VARCHAR(255) BINARY'); |
| 274 | 274 | $trouver_table(''); |
| 275 | 275 | $new_desc = $trouver_table('spip_auteurs'); |
| 276 | - spip_log('Apres conversion spip_auteurs : ' . var_export($new_desc['field'], true), 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 276 | + spip_log('Apres conversion spip_auteurs : '.var_export($new_desc['field'], true), 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | foreach ($tables as $table) { |
@@ -292,27 +292,27 @@ discard block |
||
| 292 | 292 | $data = sql_allfetsel('*', 'spip_urls', '', '', 'date DESC'); |
| 293 | 293 | $urls = []; |
| 294 | 294 | foreach ($data as $d) { |
| 295 | - $key = $d['id_parent'] . '::' . strtolower($d['url']); |
|
| 295 | + $key = $d['id_parent'].'::'.strtolower($d['url']); |
|
| 296 | 296 | if (!isset($urls[$key])) { |
| 297 | 297 | $urls[$key] = true; |
| 298 | 298 | } else { |
| 299 | 299 | spip_log( |
| 300 | - 'Suppression doublon dans spip_urls avant conversion : ' . serialize($d), |
|
| 301 | - 'maj.' . _LOG_INFO_IMPORTANTE |
|
| 300 | + 'Suppression doublon dans spip_urls avant conversion : '.serialize($d), |
|
| 301 | + 'maj.'._LOG_INFO_IMPORTANTE |
|
| 302 | 302 | ); |
| 303 | - sql_delete('spip_urls', 'id_parent=' . sql_quote($d['id_parent']) . ' AND url=' . sql_quote($d['url'])); |
|
| 303 | + sql_delete('spip_urls', 'id_parent='.sql_quote($d['id_parent']).' AND url='.sql_quote($d['url'])); |
|
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | foreach ($desc['field'] as $field => $type) { |
| 308 | 308 | if ($desc['field'][$field] !== $desc_collate[$field]) { |
| 309 | - spip_log("Conversion COLLATE table $table", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 310 | - sql_alter("table $table change $field $field " . $desc_collate[$field]); |
|
| 309 | + spip_log("Conversion COLLATE table $table", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 310 | + sql_alter("table $table change $field $field ".$desc_collate[$field]); |
|
| 311 | 311 | $trouver_table(''); |
| 312 | 312 | $new_desc = $trouver_table($table); |
| 313 | 313 | spip_log( |
| 314 | - "Apres conversion $table : " . var_export($new_desc['field'], true), |
|
| 315 | - 'maj.' . _LOG_INFO_IMPORTANTE |
|
| 314 | + "Apres conversion $table : ".var_export($new_desc['field'], true), |
|
| 315 | + 'maj.'._LOG_INFO_IMPORTANTE |
|
| 316 | 316 | ); |
| 317 | 317 | continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite |
| 318 | 318 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | $GLOBALS['maj'][19236] = [ |
| 330 | 330 | ['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom='version_installee'"], // version base principale |
| 331 | - ['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins |
|
| 331 | + ['sql_updateq', 'spip_meta', ['impt' => 'oui'], "nom LIKE '%_base_version'"], // version base plugins |
|
| 332 | 332 | ['maj_collation_sqlite'], |
| 333 | 333 | ]; |
| 334 | 334 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | spip_log('supprimer sessions auteur'); |
| 346 | 346 | if ($dir = opendir(_DIR_SESSIONS)) { |
| 347 | 347 | while (($f = readdir($dir)) !== false) { |
| 348 | - spip_unlink(_DIR_SESSIONS . $f); |
|
| 348 | + spip_unlink(_DIR_SESSIONS.$f); |
|
| 349 | 349 | if (time() >= _TIME_OUT) { |
| 350 | 350 | return; |
| 351 | 351 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $champs['source'] = $source ?: 'spip'; |
| 94 | 94 | |
| 95 | 95 | $champs['login'] = ''; |
| 96 | - $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 96 | + $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 97 | 97 | $champs['webmestre'] = 'non'; |
| 98 | 98 | if (empty($champs['imessage'])) { |
| 99 | 99 | $champs['imessage'] = 'oui'; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | $champs['pass'] = $c['pass']; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - $statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 316 | + $statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 317 | 317 | |
| 318 | 318 | if ( |
| 319 | 319 | isset($c['statut']) |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | // commencer par traiter les cas particuliers des logins et pass |
| 374 | 374 | // avant les autres ecritures en base |
| 375 | 375 | if (isset($champs['login']) or isset($champs['pass'])) { |
| 376 | - $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 376 | + $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 377 | 377 | include_spip('inc/auth'); |
| 378 | 378 | if (isset($champs['login']) and strlen($champs['login'])) { |
| 379 | 379 | if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) { |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | if (isset($champs['pass']) and strlen($champs['pass'])) { |
| 384 | - $champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 384 | + $champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 385 | 385 | if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) { |
| 386 | 386 | $erreurs[] = 'ecrire:impossible_modifier_pass_auteur'; |
| 387 | 387 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | if (!(is_countable($champs) ? count($champs) : 0)) { |
| 395 | 395 | return implode(' ', array_map('_T', $erreurs)); |
| 396 | 396 | } |
| 397 | - sql_updateq('spip_auteurs', $champs, 'id_auteur=' . $id_auteur); |
|
| 397 | + sql_updateq('spip_auteurs', $champs, 'id_auteur='.$id_auteur); |
|
| 398 | 398 | |
| 399 | 399 | // .. mettre a jour les fichiers .htpasswd et .htpasswd-admin |
| 400 | 400 | if ( |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $l = ''; |
| 54 | 54 | if ( |
| 55 | 55 | $primary = id_table_objet($objet) |
| 56 | - and $trouver_table($l = $table_sql . '_liens', '', true, ['log_missing' => false]) |
|
| 56 | + and $trouver_table($l = $table_sql.'_liens', '', true, ['log_missing' => false]) |
|
| 57 | 57 | and !preg_match(',[^\w],', $primary) |
| 58 | 58 | and !preg_match(',[^\w],', $l) |
| 59 | 59 | ) { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @return int |
| 213 | 213 | */ |
| 214 | 214 | function objet_optimiser_liens($objets_source, $objets_lies) { |
| 215 | - spip_log('objet_optimiser_liens : ' . json_encode($objets_source, JSON_THROW_ON_ERROR) . ', ' . json_encode($objets_lies, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG); |
|
| 215 | + spip_log('objet_optimiser_liens : '.json_encode($objets_source, JSON_THROW_ON_ERROR).', '.json_encode($objets_lies, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG); |
|
| 216 | 216 | return objet_traiter_liaisons('lien_optimise', $objets_source, $objets_lies); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $where_meme_lien = implode(' AND ', $where_meme_lien); |
| 447 | 447 | // on decale les liens de rang_lien>=la valeur inseree pour faire la place |
| 448 | 448 | // sauf sur le meme lien avec un role eventuellement different |
| 449 | - $w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>=' . intval($insertions['rang_lien']), "NOT($where_meme_lien)"]); |
|
| 449 | + $w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>='.intval($insertions['rang_lien']), "NOT($where_meme_lien)"]); |
|
| 450 | 450 | sql_update($table_lien, ['rang_lien' => 'rang_lien+1'], $w); |
| 451 | 451 | } |
| 452 | 452 | |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | $rang = 1; |
| 512 | 512 | foreach ($liens as $lien) { |
| 513 | 513 | if (empty($deja_reordonne[$lien[$primary]][$lien['objet']][$lien['id_objet']])) { |
| 514 | - $where = lien_where($primary, $lien[$primary], $lien['objet'], $lien['id_objet'], ['rang_lien!=' . intval($rang)]); |
|
| 514 | + $where = lien_where($primary, $lien[$primary], $lien['objet'], $lien['id_objet'], ['rang_lien!='.intval($rang)]); |
|
| 515 | 515 | sql_updateq($table_lien, ['rang_lien' => $rang], $where); |
| 516 | 516 | |
| 517 | 517 | if (empty($deja_reordonne[$lien[$primary]])) { |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | addslashes($primary), |
| 588 | 588 | array_map('intval', $id_source), |
| 589 | 589 | $not |
| 590 | - ) : addslashes($primary) . ($not ? '<>' : '=') . intval($id_source)); |
|
| 590 | + ) : addslashes($primary).($not ? '<>' : '=').intval($id_source)); |
|
| 591 | 591 | } elseif ($not) { |
| 592 | 592 | $where[] = '0=1'; |
| 593 | 593 | } // idiot mais quand meme |
@@ -599,14 +599,14 @@ discard block |
||
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | if ($objet !== '*') { |
| 602 | - $where[] = 'objet=' . sql_quote($objet); |
|
| 602 | + $where[] = 'objet='.sql_quote($objet); |
|
| 603 | 603 | } |
| 604 | 604 | if ($id_objet !== '*') { |
| 605 | 605 | $where[] = (is_array($id_objet) ? sql_in( |
| 606 | 606 | 'id_objet', |
| 607 | 607 | array_map('intval', $id_objet), |
| 608 | 608 | $not |
| 609 | - ) : 'id_objet' . ($not ? '<>' : '=') . intval($id_objet)); |
|
| 609 | + ) : 'id_objet'.($not ? '<>' : '=').intval($id_objet)); |
|
| 610 | 610 | } elseif ($not) { |
| 611 | 611 | $where[] = '0=1'; |
| 612 | 612 | } // idiot mais quand meme |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | function lien_rang_where($table_lien, $primary, $id_source, $objet, $id_objet, $cond = []) { |
| 628 | 628 | |
| 629 | 629 | // si on veut compter les rangs autrement que le core ne le fait par defaut, fournir le where adhoc |
| 630 | - if (function_exists($f = 'lien_rang_where_' . $table_lien)) { |
|
| 630 | + if (function_exists($f = 'lien_rang_where_'.$table_lien)) { |
|
| 631 | 631 | return $f($primary, $id_source, $objet, $id_objet, $cond); |
| 632 | 632 | } |
| 633 | 633 | |
@@ -792,8 +792,8 @@ discard block |
||
| 792 | 792 | // il faut les eliminier en repetant la condition dans le where L.objet='xxx' |
| 793 | 793 | "$table_lien AS L |
| 794 | 794 | LEFT JOIN $spip_table_objet AS O |
| 795 | - ON (O.$id_table_objet=L.id_objet AND L.objet=" . sql_quote($type) . ')', |
|
| 796 | - 'L.objet=' . sql_quote($type) . " AND O.$id_table_objet IS NULL" |
|
| 795 | + ON (O.$id_table_objet=L.id_objet AND L.objet=".sql_quote($type).')', |
|
| 796 | + 'L.objet='.sql_quote($type)." AND O.$id_table_objet IS NULL" |
|
| 797 | 797 | ); |
| 798 | 798 | // sur une cle primaire composee, pas d'autres solutions que de virer un a un |
| 799 | 799 | while ($row = sql_fetch($res)) { |
@@ -802,13 +802,13 @@ discard block |
||
| 802 | 802 | } |
| 803 | 803 | $e = sql_delete( |
| 804 | 804 | $table_lien, |
| 805 | - ["$primary=" . $row['id'], 'id_objet=' . $row['id_objet'], 'objet=' . sql_quote($type)] |
|
| 805 | + ["$primary=".$row['id'], 'id_objet='.$row['id_objet'], 'objet='.sql_quote($type)] |
|
| 806 | 806 | ); |
| 807 | 807 | if ($e != false) { |
| 808 | 808 | $dels += $e; |
| 809 | 809 | spip_log( |
| 810 | - 'lien_optimise: Entree ' . $row['id'] . '/' . $row['id_objet'] . "/$type supprimee dans la table $table_lien", |
|
| 811 | - 'genie' . _LOG_INFO_IMPORTANTE |
|
| 810 | + 'lien_optimise: Entree '.$row['id'].'/'.$row['id_objet']."/$type supprimee dans la table $table_lien", |
|
| 811 | + 'genie'._LOG_INFO_IMPORTANTE |
|
| 812 | 812 | ); |
| 813 | 813 | } |
| 814 | 814 | } |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | // sauf sur le meme lien avec un role eventuellement different |
| 913 | 913 | $where_meme_lien = lien_where($primary, $id, $objet, $id_objet); |
| 914 | 914 | $where_meme_lien = implode(' AND ', $where_meme_lien); |
| 915 | - $w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>=' . intval($qualif['rang_lien']), "NOT($where_meme_lien)"]); |
|
| 915 | + $w = lien_rang_where($table_lien, $primary, $id, $objet, $id_objet, ['rang_lien>='.intval($qualif['rang_lien']), "NOT($where_meme_lien)"]); |
|
| 916 | 916 | sql_update($table_lien, ['rang_lien' => 'rang_lien+1'], $w); |
| 917 | 917 | } |
| 918 | 918 | // tous les liens de même rôle recoivent le rang indiqué aussi |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | */ |
| 1005 | 1005 | function lien_propage_date_modif($objet, $ids) { |
| 1006 | 1006 | static $done = []; |
| 1007 | - $hash = md5($objet . serialize($ids)); |
|
| 1007 | + $hash = md5($objet.serialize($ids)); |
|
| 1008 | 1008 | |
| 1009 | 1009 | // sql_updateq, peut être un rien lent. |
| 1010 | 1010 | // On évite de l'appeler 2 fois sur les mêmes choses |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | and isset($desc['field']['date_modif']) |
| 1021 | 1021 | ) { |
| 1022 | 1022 | $primary = id_table_objet($objet); |
| 1023 | - $where = (is_array($ids) ? sql_in($primary, array_map('intval', $ids)) : "$primary=" . intval($ids)); |
|
| 1023 | + $where = (is_array($ids) ? sql_in($primary, array_map('intval', $ids)) : "$primary=".intval($ids)); |
|
| 1024 | 1024 | sql_updateq($table, ['date_modif' => date('Y-m-d H:i:s')], $where); |
| 1025 | 1025 | } |
| 1026 | 1026 | |