@@ -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; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) { |
| 65 | - $fichier = _DIR_IMG . $fichier; |
|
| 65 | + $fichier = _DIR_IMG.$fichier; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // fichier normal |
@@ -158,23 +158,23 @@ discard block |
||
| 158 | 158 | or !$r = verifier_upload_autorise($dest) |
| 159 | 159 | or $r['autozip'] |
| 160 | 160 | ) { |
| 161 | - $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 161 | + $dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1]; |
|
| 162 | 162 | break; |
| 163 | 163 | } |
| 164 | 164 | else { |
| 165 | 165 | $dest = substr($dest, 0, -strlen($m[0])); |
| 166 | - $ext = $m[1] . '.' . $ext; |
|
| 166 | + $ext = $m[1].'.'.$ext; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Si le document "source" est deja au bon endroit, ne rien faire |
| 171 | - if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 171 | + if ($source == ($dir.$dest.'.'.$ext)) { |
|
| 172 | 172 | return $source; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // sinon tourner jusqu'a trouver un numero correct |
| 176 | 176 | $n = 0; |
| 177 | - while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 177 | + while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) { |
|
| 178 | 178 | ; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | function deplacer_fichier_upload($source, $dest, $move = false) { |
| 236 | 236 | // Securite |
| 237 | 237 | if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
| 238 | - $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 238 | + $dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 239 | 239 | } else { |
| 240 | 240 | $dest = preg_replace(',\.\.+,', '.', $dest); |
| 241 | 241 | } |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | default: /* autre */ |
| 319 | 319 | if (!$msg) { |
| 320 | - $msg = _T('pass_erreur') . ' ' . $error |
|
| 321 | - . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 320 | + $msg = _T('pass_erreur').' '.$error |
|
| 321 | + . '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 322 | 322 | } |
| 323 | 323 | break; |
| 324 | 324 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | include_spip('inc/minipres'); |
| 337 | 337 | echo minipres( |
| 338 | 338 | $msg, |
| 339 | - "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 339 | + "<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>' |
|
| 340 | 340 | ); |
| 341 | 341 | exit; |
| 342 | 342 | } |
@@ -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 { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // Si a ce stade on n'a pas de table, il y a un bug |
| 235 | 235 | if (!is_array($this->tableau)) { |
| 236 | 236 | $this->err = true; |
| 237 | - spip_log('erreur datasource ' . var_export($command, true)); |
|
| 237 | + spip_log('erreur datasource '.var_export($command, true)); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // {datapath query.results} |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | isset($this->command['sourcemode']) |
| 277 | 277 | and !in_array($this->command['sourcemode'], ['table', 'array', 'tableau']) |
| 278 | 278 | ) { |
| 279 | - charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true); |
|
| 279 | + charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | # le premier argument peut etre un array, une URL etc. |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | # avons-nous un cache dispo ? |
| 286 | 286 | $cle = null; |
| 287 | 287 | if (is_string($src)) { |
| 288 | - $cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true)); |
|
| 288 | + $cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true)); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $cache = $this->cache_get($cle); |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | if ( |
| 346 | 346 | !$this->err |
| 347 | - and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true) |
|
| 347 | + and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true) |
|
| 348 | 348 | ) { |
| 349 | 349 | $args = $this->command['source']; |
| 350 | 350 | $args[0] = $data; |
@@ -484,13 +484,13 @@ discard block |
||
| 484 | 484 | $tv = '%s'; |
| 485 | 485 | } # {par valeur/xx/yy} ?? |
| 486 | 486 | else { |
| 487 | - $tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')'; |
|
| 487 | + $tv = 'table_valeur(%s, '.var_export($r[1], true).')'; |
|
| 488 | 488 | } |
| 489 | 489 | $sortfunc .= ' |
| 490 | - $a = ' . sprintf($tv, '$aa') . '; |
|
| 491 | - $b = ' . sprintf($tv, '$bb') . '; |
|
| 490 | + $a = ' . sprintf($tv, '$aa').'; |
|
| 491 | + $b = ' . sprintf($tv, '$bb').'; |
|
| 492 | 492 | if ($a <> $b) |
| 493 | - return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;'; |
|
| 493 | + return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;'; |
|
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | function inc_sql_to_array_dist($data) { |
| 644 | 644 | # sortir le connecteur de $data |
| 645 | 645 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 646 | - $serveur = (string)$v[1]; |
|
| 646 | + $serveur = (string) $v[1]; |
|
| 647 | 647 | $req = trim($v[2]); |
| 648 | 648 | if ($s = sql_query($req, $serveur)) { |
| 649 | 649 | $r = []; |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | $json = json_decode($data, true, 512, JSON_THROW_ON_ERROR); |
| 669 | 669 | } catch (JsonException $e) { |
| 670 | 670 | $json = null; |
| 671 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO); |
|
| 671 | + spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO); |
|
| 672 | 672 | } |
| 673 | 673 | return is_array($json) ? (array) $json : []; |
| 674 | 674 | } |
@@ -688,13 +688,13 @@ discard block |
||
| 688 | 688 | $i = 1; |
| 689 | 689 | foreach ($entete as $k => $v) { |
| 690 | 690 | if (trim($v) == '') { |
| 691 | - $v = 'col' . $i; |
|
| 691 | + $v = 'col'.$i; |
|
| 692 | 692 | } // reperer des eventuelles cases vides |
| 693 | 693 | if (is_numeric($v) and $v < 0) { |
| 694 | - $v = '__' . $v; |
|
| 694 | + $v = '__'.$v; |
|
| 695 | 695 | } // ne pas risquer d'ecraser une cle numerique |
| 696 | 696 | if (is_numeric($v)) { |
| 697 | - $v = '_' . $v; |
|
| 697 | + $v = '_'.$v; |
|
| 698 | 698 | } // ne pas risquer d'ecraser une cle numerique |
| 699 | 699 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 700 | 700 | foreach ($csv as &$item) { |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | * @return array|bool |
| 781 | 781 | */ |
| 782 | 782 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 783 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 783 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | /** |
@@ -795,13 +795,13 @@ discard block |
||
| 795 | 795 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 796 | 796 | $a = $glob_to_array($data); |
| 797 | 797 | foreach ($a as &$v) { |
| 798 | - $b = (array)@stat($v); |
|
| 798 | + $b = (array) @stat($v); |
|
| 799 | 799 | foreach ($b as $k => $ignore) { |
| 800 | 800 | if (is_numeric($k)) { |
| 801 | 801 | unset($b[$k]); |
| 802 | 802 | } |
| 803 | 803 | } |
| 804 | - $b['file'] = preg_replace('`/$`', '', $v) ; |
|
| 804 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 805 | 805 | $v = array_merge( |
| 806 | 806 | pathinfo($v), |
| 807 | 807 | $b |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | $xml_array = []; |
| 822 | 822 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 823 | 823 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 824 | - $key .= '-' . uniqid(); |
|
| 824 | + $key .= '-'.uniqid(); |
|
| 825 | 825 | } |
| 826 | 826 | $vars = get_object_vars($object->current()); |
| 827 | 827 | if (isset($vars['@attributes'])) { |
@@ -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 | } |