@@ -23,11 +23,11 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $GLOBALS['maj'][2021_02_18_00] = [ |
| 26 | - ['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ], |
|
| 27 | - ['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ], |
|
| 26 | + ['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"], |
|
| 27 | + ['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"], |
|
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | 30 | $GLOBALS['maj'][2022_02_23_02] = [ |
| 31 | - ['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL" ], |
|
| 32 | - ['sql_delete', "spip_meta","nom='secret_du_site'" ], |
|
| 31 | + ['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL"], |
|
| 32 | + ['sql_delete', "spip_meta", "nom='secret_du_site'"], |
|
| 33 | 33 | ]; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | include_spip('base/abstract_sql'); |
| 64 | - $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email'])); |
|
| 64 | + $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email='.sql_quote($desc['email'])); |
|
| 65 | 65 | // erreur ? |
| 66 | 66 | if (!$res) { |
| 67 | 67 | return _T('titre_probleme_technique'); |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | $login = $login_base; |
| 219 | 219 | |
| 220 | - for ($i = 1;; $i++) { |
|
| 220 | + for ($i = 1; ; $i++) { |
|
| 221 | 221 | if (!sql_countsel('spip_auteurs', "login='$login'")) { |
| 222 | 222 | return $login; |
| 223 | 223 | } |
| 224 | - $login = $login_base . $i; |
|
| 224 | + $login = $login_base.$i; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
@@ -361,11 +361,11 @@ discard block |
||
| 361 | 361 | do { |
| 362 | 362 | // Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer |
| 363 | 363 | // tous les jetons connus pour vérifier le jeton d’un auteur. |
| 364 | - $public = substr(creer_uniqid(), 0, 7) . '.'; |
|
| 365 | - $jeton = $public . creer_uniqid(); |
|
| 366 | - $jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | - sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur)); |
|
| 368 | - } while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 364 | + $public = substr(creer_uniqid(), 0, 7).'.'; |
|
| 365 | + $jeton = $public.creer_uniqid(); |
|
| 366 | + $jeton_chiffre_prefixe = $public.Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | + sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur='.intval($id_auteur)); |
|
| 368 | + } while (sql_countsel('spip_auteurs', 'cookie_oubli='.sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 369 | 369 | |
| 370 | 370 | return $jeton; |
| 371 | 371 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | function auteur_lire_jeton(int $id_auteur, bool $autoInit = false): ?string { |
| 384 | 384 | include_spip('base/abstract_sql'); |
| 385 | - $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur); |
|
| 385 | + $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur='.$id_auteur); |
|
| 386 | 386 | if ($jeton_chiffre_prefixe) { |
| 387 | 387 | include_spip('inc/chiffrer'); |
| 388 | 388 | $jeton_chiffre = substr($jeton_chiffre_prefixe, 8); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $public = substr($jeton, 0, 8); |
| 415 | 415 | |
| 416 | 416 | // Les auteurs qui ont un jetons ressemblant |
| 417 | - $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%')); |
|
| 417 | + $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE '.sql_quote($public.'%')); |
|
| 418 | 418 | foreach ($auteurs as $auteur) { |
| 419 | 419 | $jeton_chiffre = substr($auteur['cookie_oubli'], 8); |
| 420 | 420 | $_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
@@ -433,5 +433,5 @@ discard block |
||
| 433 | 433 | */ |
| 434 | 434 | function auteur_effacer_jeton($id_auteur) { |
| 435 | 435 | include_spip('base/abstract_sql'); |
| 436 | - return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur)); |
|
| 436 | + return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur='.intval($id_auteur)); |
|
| 437 | 437 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $row = sql_fetsel( |
| 50 | 50 | '*', |
| 51 | 51 | 'spip_auteurs', |
| 52 | - 'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'", |
|
| 52 | + 'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'", |
|
| 53 | 53 | '', |
| 54 | 54 | '', |
| 55 | 55 | '', |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | switch (strlen($row['pass'])) { |
| 76 | 76 | case 32: |
| 77 | 77 | // tres anciens mots de passe encodes en md5(alea.pass) |
| 78 | - $md5pass = md5($row['alea_actuel'] . $pass); |
|
| 78 | + $md5pass = md5($row['alea_actuel'].$pass); |
|
| 79 | 79 | if ($row['pass'] !== $md5pass) { |
| 80 | 80 | unset($row); |
| 81 | 81 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | case 64: |
| 84 | 84 | // anciens mots de passe encodes en sha256(alea.pass) |
| 85 | 85 | include_spip('auth/sha256.inc'); |
| 86 | - $shapass = spip_sha256($row['alea_actuel'] . $pass); |
|
| 86 | + $shapass = spip_sha256($row['alea_actuel'].$pass); |
|
| 87 | 87 | if ($row['pass'] !== $shapass) { |
| 88 | 88 | unset($row); |
| 89 | 89 | } |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | and !empty($row['backup_cles']) |
| 100 | 100 | ) { |
| 101 | 101 | if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) { |
| 102 | - spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 102 | + spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE); |
|
| 103 | 103 | $cles->save(); |
| 104 | 104 | } |
| 105 | 105 | else { |
| 106 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR); |
|
| 107 | - sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 106 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR); |
|
| 107 | + sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur'])); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | @sql_update( |
| 149 | 149 | 'spip_auteurs', |
| 150 | 150 | $set, |
| 151 | - 'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote( |
|
| 151 | + 'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote( |
|
| 152 | 152 | $row['pass'], |
| 153 | 153 | $serveur, |
| 154 | 154 | 'text' |
@@ -191,20 +191,20 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | // si force, on ne verifie pas la presence d'un backup chez un webmestre |
| 193 | 193 | if ($force) { |
| 194 | - spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 194 | + spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE); |
|
| 195 | 195 | $secret = $cles->getSecretAuth(true); |
| 196 | 196 | return true; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''"); |
|
| 199 | + $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''"); |
|
| 200 | 200 | $has_backup = array_column($has_backup, 'id_auteur'); |
| 201 | 201 | if (empty($has_backup)) { |
| 202 | - spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 202 | + spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 203 | 203 | $secret = $cles->getSecretAuth(true); |
| 204 | 204 | return true; |
| 205 | 205 | } |
| 206 | 206 | else { |
| 207 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR); |
|
| 207 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR); |
|
| 208 | 208 | return false; |
| 209 | 209 | } |
| 210 | 210 | } |
@@ -221,8 +221,8 @@ discard block |
||
| 221 | 221 | $flux['data'] .= |
| 222 | 222 | '<script type="text/javascript">/*<![CDATA[*/' |
| 223 | 223 | . "$js\n" |
| 224 | - . "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 225 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 224 | + . "var login_info={'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 225 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 226 | 226 | . "'informe_auteur_en_cours':false," |
| 227 | 227 | . "'attente_informe':0};" |
| 228 | 228 | . "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});" |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } else { |
| 266 | 266 | $n = sql_countsel( |
| 267 | 267 | 'spip_auteurs', |
| 268 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 268 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 269 | 269 | '', |
| 270 | 270 | '', |
| 271 | 271 | $serveur |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | if ( |
| 295 | 295 | !$id_auteur = intval($id_auteur) |
| 296 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 296 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 297 | 297 | ) { |
| 298 | 298 | return false; |
| 299 | 299 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $anciens = sql_allfetsel( |
| 309 | 309 | 'id_auteur', |
| 310 | 310 | 'spip_auteurs', |
| 311 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 311 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 312 | 312 | '', |
| 313 | 313 | '', |
| 314 | 314 | '', |
@@ -342,8 +342,8 @@ discard block |
||
| 342 | 342 | $r = sql_getfetsel( |
| 343 | 343 | 'login', |
| 344 | 344 | 'spip_auteurs', |
| 345 | - "statut<>'5poubelle'" . |
|
| 346 | - ' AND (length(pass)>0)' . |
|
| 345 | + "statut<>'5poubelle'". |
|
| 346 | + ' AND (length(pass)>0)'. |
|
| 347 | 347 | " AND (login=$l)", |
| 348 | 348 | '', |
| 349 | 349 | '', |
@@ -362,8 +362,8 @@ discard block |
||
| 362 | 362 | return sql_getfetsel( |
| 363 | 363 | 'login', |
| 364 | 364 | 'spip_auteurs', |
| 365 | - "statut<>'5poubelle'" . |
|
| 366 | - ' AND (length(pass)>0)' . |
|
| 365 | + "statut<>'5poubelle'". |
|
| 366 | + ' AND (length(pass)>0)'. |
|
| 367 | 367 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 368 | 368 | '', |
| 369 | 369 | '', |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | if ( |
| 434 | 434 | !$id_auteur = intval($id_auteur) |
| 435 | - or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 435 | + or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 436 | 436 | ) { |
| 437 | 437 | return false; |
| 438 | 438 | } |
@@ -493,8 +493,8 @@ discard block |
||
| 493 | 493 | or isset($champs['statut']) |
| 494 | 494 | or (isset($options['all']) and $options['all']) |
| 495 | 495 | ) { |
| 496 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 497 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 496 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 497 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 498 | 498 | |
| 499 | 499 | // Cette variable de configuration peut etre posee par un plugin |
| 500 | 500 | // par exemple acces_restreint ; |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | and !@file_exists($htaccess) |
| 505 | 505 | ) { |
| 506 | 506 | spip_unlink($htpasswd); |
| 507 | - spip_unlink($htpasswd . '-admin'); |
|
| 507 | + spip_unlink($htpasswd.'-admin'); |
|
| 508 | 508 | |
| 509 | 509 | return; |
| 510 | 510 | } |
@@ -522,16 +522,16 @@ discard block |
||
| 522 | 522 | ); |
| 523 | 523 | while ($t = sql_fetch($s)) { |
| 524 | 524 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 525 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 525 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 526 | 526 | if ($t['statut'] == '0minirezo') { |
| 527 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 527 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | 530 | } |
| 531 | 531 | sql_free($s); |
| 532 | 532 | if ($p1) { |
| 533 | 533 | ecrire_fichier($htpasswd, $p1); |
| 534 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 534 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 535 | 535 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 536 | 536 | } |
| 537 | 537 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $arg = parametre_url($url_action, 'arg'); |
| 96 | - $confirm = md5("$action:$arg:" . realpath(__FILE__)); |
|
| 96 | + $confirm = md5("$action:$arg:".realpath(__FILE__)); |
|
| 97 | 97 | if (_request('confirm_action') === $confirm) { |
| 98 | 98 | return true; |
| 99 | 99 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } else { |
| 147 | 147 | return generer_url_action( |
| 148 | 148 | $action, |
| 149 | - 'arg=' . rawurlencode($arg) . "&hash=$hash" . (!$r ? '' : "&redirect=$r"), |
|
| 149 | + 'arg='.rawurlencode($arg)."&hash=$hash".(!$r ? '' : "&redirect=$r"), |
|
| 150 | 150 | $mode, |
| 151 | 151 | $public |
| 152 | 152 | ); |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | $hash = calculer_action_auteur("$action-$arg"); |
| 158 | 158 | $att .= " style='margin: 0px; border: 0px'"; |
| 159 | 159 | if ($redirect) { |
| 160 | - $redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", ''', $redirect) . "' />"; |
|
| 160 | + $redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", ''', $redirect)."' />"; |
|
| 161 | 161 | } |
| 162 | - $mode .= $redirect . " |
|
| 162 | + $mode .= $redirect." |
|
| 163 | 163 | <input name='hash' type='hidden' value='$hash' /> |
| 164 | 164 | <input name='arg' type='hidden' value='$arg' />"; |
| 165 | 165 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $pass = $pass ?? ''; |
| 234 | 234 | $entry = "$action:$id_auteur:$pass:$alea"; |
| 235 | 235 | if (!isset($sha[$entry])) { |
| 236 | - $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea)); |
|
| 236 | + $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea)); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return $sha[$entry]; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | // On nettoie l’URL de tous les var_. |
| 352 | 352 | $url = nettoyer_uri_var($url); |
| 353 | 353 | |
| 354 | - $token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea); |
|
| 354 | + $token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea); |
|
| 355 | 355 | return "$id_auteur-$token"; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $n = intval(sql_errno()); |
| 62 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 62 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 63 | 63 | |
| 64 | 64 | return $n ?: 1; |
| 65 | 65 | } |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | // erreur SQL a afficher |
| 86 | 86 | $raison = minipres( |
| 87 | 87 | _T('info_travaux_titre'), |
| 88 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 88 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 89 | 89 | ); |
| 90 | 90 | } elseif (@$raison['statut']) { |
| 91 | 91 | // un simple visiteur n'a pas acces a l'espace prive |
| 92 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 92 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 93 | 93 | $raison = minipres(_T('avis_erreur_connexion'), _T('avis_erreur_visiteur')); |
| 94 | 94 | } else { |
| 95 | 95 | // auteur en fin de droits ... |
@@ -179,8 +179,7 @@ discard block |
||
| 179 | 179 | $where = (is_numeric($id_auteur) |
| 180 | 180 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 181 | 181 | ) ? |
| 182 | - "id_auteur=$id_auteur" : |
|
| 183 | - (!strlen($GLOBALS['connect_login']) ? '' : 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 182 | + "id_auteur=$id_auteur" : (!strlen($GLOBALS['connect_login']) ? '' : 'login='.sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 184 | 183 | |
| 185 | 184 | if (!$where) { |
| 186 | 185 | return ''; |
@@ -222,7 +221,7 @@ discard block |
||
| 222 | 221 | $GLOBALS['connect_login'] = $row['login']; |
| 223 | 222 | $GLOBALS['connect_statut'] = $row['statut']; |
| 224 | 223 | |
| 225 | - $GLOBALS['visiteur_session'] = array_merge((array)$GLOBALS['visiteur_session'], $row); |
|
| 224 | + $GLOBALS['visiteur_session'] = array_merge((array) $GLOBALS['visiteur_session'], $row); |
|
| 226 | 225 | |
| 227 | 226 | // au cas ou : ne pas memoriser les champs sensibles |
| 228 | 227 | unset($GLOBALS['visiteur_session']['pass']); |
@@ -295,7 +294,7 @@ discard block |
||
| 295 | 294 | * @return string |
| 296 | 295 | */ |
| 297 | 296 | function auth_a_loger() { |
| 298 | - $redirect = generer_url_public('login', 'url=' . rawurlencode(self('&', true)), true); |
|
| 297 | + $redirect = generer_url_public('login', 'url='.rawurlencode(self('&', true)), true); |
|
| 299 | 298 | |
| 300 | 299 | // un echec au "bonjour" (login initial) quand le statut est |
| 301 | 300 | // inconnu signale sans doute un probleme de cookies |
@@ -331,7 +330,7 @@ discard block |
||
| 331 | 330 | $date ??= date('Y-m-d H:i:s'); |
| 332 | 331 | |
| 333 | 332 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 334 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 333 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.intval($row['id_auteur'])); |
|
| 335 | 334 | $row['en_ligne'] = $date; |
| 336 | 335 | } |
| 337 | 336 | |
@@ -440,7 +439,7 @@ discard block |
||
| 440 | 439 | if ( |
| 441 | 440 | !$login |
| 442 | 441 | or !$login_base = auth_retrouver_login($login, $serveur) |
| 443 | - or !$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 442 | + or !$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 444 | 443 | ) { |
| 445 | 444 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 446 | 445 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
@@ -550,7 +549,7 @@ discard block |
||
| 550 | 549 | sql_updateq( |
| 551 | 550 | 'spip_auteurs', |
| 552 | 551 | ['prefs' => serialize($p)], |
| 553 | - 'id_auteur=' . intval($auteur['id_auteur']) |
|
| 552 | + 'id_auteur='.intval($auteur['id_auteur']) |
|
| 554 | 553 | ); |
| 555 | 554 | |
| 556 | 555 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -714,7 +713,7 @@ discard block |
||
| 714 | 713 | return false; |
| 715 | 714 | } |
| 716 | 715 | |
| 717 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 716 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 718 | 717 | |
| 719 | 718 | if (!$row) { |
| 720 | 719 | if ( |
@@ -769,11 +768,11 @@ discard block |
||
| 769 | 768 | $retour = $retour ?: _T('icone_retour'); |
| 770 | 769 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 771 | 770 | if ($url) { |
| 772 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 771 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 773 | 772 | } |
| 774 | 773 | |
| 775 | 774 | if ($lien) { |
| 776 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 775 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 777 | 776 | } |
| 778 | 777 | include_spip('inc/minipres'); |
| 779 | 778 | echo minipres($pb, $corps); |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1780,9 +1780,9 @@ discard block |
||
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | 1782 | if ( |
| 1783 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1783 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1784 | 1784 | // deprecated |
| 1785 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1785 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1786 | 1786 | ) { |
| 1787 | 1787 | return $f; |
| 1788 | 1788 | } |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | // inclure le module d'url |
| 1798 | - include_spip('urls/' . $url_type); |
|
| 1798 | + include_spip('urls/'.$url_type); |
|
| 1799 | 1799 | |
| 1800 | 1800 | switch ($quoi) { |
| 1801 | 1801 | case 'page': |
@@ -1826,7 +1826,7 @@ discard block |
||
| 1826 | 1826 | return $f; |
| 1827 | 1827 | } |
| 1828 | 1828 | // sinon on se rabat sur les urls page si ce n'est pas un type demande explicitement |
| 1829 | - if (!$type and $url_type !== 'page'){ |
|
| 1829 | + if (!$type and $url_type !== 'page') { |
|
| 1830 | 1830 | return charger_fonction_url($quoi, 'page'); |
| 1831 | 1831 | } |
| 1832 | 1832 | return ''; |
@@ -1951,8 +1951,8 @@ discard block |
||
| 1951 | 1951 | include_spip('base/connect_sql'); |
| 1952 | 1952 | $id_type = id_table_objet($entite, $public); |
| 1953 | 1953 | |
| 1954 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1955 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1954 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1955 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1956 | 1956 | . (!$args ? '' : "&$args") |
| 1957 | 1957 | . (!$ancre ? '' : "#$ancre"); |
| 1958 | 1958 | } |
@@ -2123,7 +2123,7 @@ discard block |
||
| 2123 | 2123 | !empty($_SERVER['QUERY_STRING']) |
| 2124 | 2124 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2125 | 2125 | ) { |
| 2126 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2126 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2127 | 2127 | } |
| 2128 | 2128 | } |
| 2129 | 2129 | } |
@@ -2158,9 +2158,9 @@ discard block |
||
| 2158 | 2158 | array_shift($myself); |
| 2159 | 2159 | $myself = implode('/', $myself); |
| 2160 | 2160 | } |
| 2161 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2161 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2162 | 2162 | |
| 2163 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2163 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2164 | 2164 | |
| 2165 | 2165 | return $url; |
| 2166 | 2166 | } |
@@ -2199,16 +2199,16 @@ discard block |
||
| 2199 | 2199 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2200 | 2200 | $script ??= ''; |
| 2201 | 2201 | if (!$rel) { |
| 2202 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2202 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2203 | 2203 | } else { |
| 2204 | 2204 | if (!is_string($rel)) { |
| 2205 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2205 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2206 | 2206 | } |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2210 | 2210 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2211 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2211 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2212 | 2212 | } elseif ($args) { |
| 2213 | 2213 | $args = "?$args"; |
| 2214 | 2214 | } |
@@ -2216,7 +2216,7 @@ discard block |
||
| 2216 | 2216 | $args .= "#$ancre"; |
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2219 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | // |
@@ -2298,10 +2298,10 @@ discard block |
||
| 2298 | 2298 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2299 | 2299 | } |
| 2300 | 2300 | if ($args) { |
| 2301 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2301 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2302 | 2302 | } |
| 2303 | 2303 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2304 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2304 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2305 | 2305 | } |
| 2306 | 2306 | |
| 2307 | 2307 | if (!$no_entities) { |
@@ -2313,7 +2313,7 @@ discard block |
||
| 2313 | 2313 | |
| 2314 | 2314 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2315 | 2315 | |
| 2316 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2316 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2317 | 2317 | } |
| 2318 | 2318 | |
| 2319 | 2319 | // Pour les formulaires en methode POST, |
@@ -2348,8 +2348,7 @@ discard block |
||
| 2348 | 2348 | . "><div>\n" |
| 2349 | 2349 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2350 | 2350 | . $corps |
| 2351 | - . (!$submit ? '' : |
|
| 2352 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2351 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2353 | 2352 | . "</div></form>\n"; |
| 2354 | 2353 | } |
| 2355 | 2354 | |
@@ -2374,14 +2373,14 @@ discard block |
||
| 2374 | 2373 | ? generer_url_ecrire(_request('exec')) |
| 2375 | 2374 | : generer_url_public(); |
| 2376 | 2375 | |
| 2377 | - return "\n<form action='" . |
|
| 2378 | - $h . |
|
| 2379 | - "'" . |
|
| 2380 | - $atts . |
|
| 2381 | - ">\n" . |
|
| 2382 | - '<div>' . |
|
| 2383 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2384 | - $corps . |
|
| 2376 | + return "\n<form action='". |
|
| 2377 | + $h. |
|
| 2378 | + "'". |
|
| 2379 | + $atts. |
|
| 2380 | + ">\n". |
|
| 2381 | + '<div>'. |
|
| 2382 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2383 | + $corps. |
|
| 2385 | 2384 | '</div></form>'; |
| 2386 | 2385 | } |
| 2387 | 2386 | |
@@ -2409,7 +2408,7 @@ discard block |
||
| 2409 | 2408 | : generer_url_public('', '', false, false); |
| 2410 | 2409 | $url = parametre_url($url, 'action', $script); |
| 2411 | 2410 | if ($args) { |
| 2412 | - $url .= quote_amp('&' . $args); |
|
| 2411 | + $url .= quote_amp('&'.$args); |
|
| 2413 | 2412 | } |
| 2414 | 2413 | |
| 2415 | 2414 | if ($no_entities) { |
@@ -2443,9 +2442,9 @@ discard block |
||
| 2443 | 2442 | } |
| 2444 | 2443 | $url = |
| 2445 | 2444 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2446 | - . $script . '/' |
|
| 2445 | + . $script.'/' |
|
| 2447 | 2446 | . ($path ? trim($path, '/') : '') |
| 2448 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2447 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2449 | 2448 | |
| 2450 | 2449 | if ($no_entities) { |
| 2451 | 2450 | $url = str_replace('&', '&', $url); |
@@ -2494,17 +2493,17 @@ discard block |
||
| 2494 | 2493 | |
| 2495 | 2494 | // le nom du repertoire plugins/ activables/desactivables |
| 2496 | 2495 | if (!defined('_DIR_PLUGINS')) { |
| 2497 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2496 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2498 | 2497 | } |
| 2499 | 2498 | |
| 2500 | 2499 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2501 | 2500 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2502 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2501 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2503 | 2502 | } |
| 2504 | 2503 | |
| 2505 | 2504 | // le nom du repertoire des librairies |
| 2506 | 2505 | if (!defined('_DIR_LIB')) { |
| 2507 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2506 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2508 | 2507 | } |
| 2509 | 2508 | |
| 2510 | 2509 | if (!defined('_DIR_IMG')) { |
@@ -2514,29 +2513,29 @@ discard block |
||
| 2514 | 2513 | define('_DIR_LOGOS', $pa); |
| 2515 | 2514 | } |
| 2516 | 2515 | if (!defined('_DIR_IMG_ICONES')) { |
| 2517 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2516 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2518 | 2517 | } |
| 2519 | 2518 | |
| 2520 | 2519 | if (!defined('_DIR_DUMP')) { |
| 2521 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2520 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2522 | 2521 | } |
| 2523 | 2522 | if (!defined('_DIR_SESSIONS')) { |
| 2524 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2523 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2525 | 2524 | } |
| 2526 | 2525 | if (!defined('_DIR_TRANSFERT')) { |
| 2527 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2526 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2528 | 2527 | } |
| 2529 | 2528 | if (!defined('_DIR_CACHE')) { |
| 2530 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2529 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2531 | 2530 | } |
| 2532 | 2531 | if (!defined('_DIR_CACHE_XML')) { |
| 2533 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2532 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_SKELS')) { |
| 2536 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2535 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_AIDE')) { |
| 2539 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2538 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_DIR_TMP')) { |
| 2542 | 2541 | define('_DIR_TMP', $ti); |
@@ -2565,27 +2564,27 @@ discard block |
||
| 2565 | 2564 | // Declaration des fichiers |
| 2566 | 2565 | |
| 2567 | 2566 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2568 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2567 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2569 | 2568 | } |
| 2570 | 2569 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2571 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2570 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2572 | 2571 | } |
| 2573 | 2572 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2574 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2573 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2575 | 2574 | } |
| 2576 | 2575 | if (!defined('_CACHE_PIPELINES')) { |
| 2577 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2576 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2578 | 2577 | } |
| 2579 | 2578 | if (!defined('_CACHE_CHEMIN')) { |
| 2580 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2579 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2581 | 2580 | } |
| 2582 | 2581 | |
| 2583 | 2582 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2584 | 2583 | if (!defined('_FILE_META')) { |
| 2585 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2584 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | if (!defined('_DIR_LOG')) { |
| 2588 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2587 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2589 | 2588 | } |
| 2590 | 2589 | if (!defined('_FILE_LOG')) { |
| 2591 | 2590 | define('_FILE_LOG', 'spip'); |
@@ -2602,8 +2601,8 @@ discard block |
||
| 2602 | 2601 | if (!defined('_FILE_CONNECT')) { |
| 2603 | 2602 | define( |
| 2604 | 2603 | '_FILE_CONNECT', |
| 2605 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2606 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2604 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2605 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2607 | 2606 | : false)) |
| 2608 | 2607 | ); |
| 2609 | 2608 | } |
@@ -2615,7 +2614,7 @@ discard block |
||
| 2615 | 2614 | if (!defined('_FILE_CHMOD')) { |
| 2616 | 2615 | define( |
| 2617 | 2616 | '_FILE_CHMOD', |
| 2618 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2617 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2619 | 2618 | : false) |
| 2620 | 2619 | ); |
| 2621 | 2620 | } |
@@ -2628,10 +2627,10 @@ discard block |
||
| 2628 | 2627 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2629 | 2628 | } |
| 2630 | 2629 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2631 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2630 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2632 | 2631 | } |
| 2633 | 2632 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2634 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2633 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2635 | 2634 | } |
| 2636 | 2635 | |
| 2637 | 2636 | // Definition des droits d'acces en ecriture |
@@ -2649,13 +2648,13 @@ discard block |
||
| 2649 | 2648 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2650 | 2649 | } |
| 2651 | 2650 | if (!defined('_ROOT_PLUGINS')) { |
| 2652 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2651 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2653 | 2652 | } |
| 2654 | 2653 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2655 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2654 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2656 | 2655 | } |
| 2657 | 2656 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2658 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2657 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2659 | 2658 | } |
| 2660 | 2659 | |
| 2661 | 2660 | // La taille des Log |
@@ -2692,7 +2691,7 @@ discard block |
||
| 2692 | 2691 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2693 | 2692 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2694 | 2693 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2695 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2694 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2696 | 2695 | |
| 2697 | 2696 | // charger tout de suite le path et son cache |
| 2698 | 2697 | load_path_cache(); |
@@ -2740,7 +2739,7 @@ discard block |
||
| 2740 | 2739 | !empty($_SERVER['QUERY_STRING']) |
| 2741 | 2740 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2742 | 2741 | ) { |
| 2743 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2742 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2744 | 2743 | } |
| 2745 | 2744 | } |
| 2746 | 2745 | |
@@ -2776,7 +2775,7 @@ discard block |
||
| 2776 | 2775 | ) { |
| 2777 | 2776 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2778 | 2777 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2779 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2778 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2780 | 2779 | } else { |
| 2781 | 2780 | $uri_ref = ''; |
| 2782 | 2781 | } |
@@ -2870,7 +2869,7 @@ discard block |
||
| 2870 | 2869 | } |
| 2871 | 2870 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2872 | 2871 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2873 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2872 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2874 | 2873 | } |
| 2875 | 2874 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2876 | 2875 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3092,7 +3091,7 @@ discard block |
||
| 3092 | 3091 | } |
| 3093 | 3092 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3094 | 3093 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3095 | - . ' ' . _VAR_MODE); |
|
| 3094 | + . ' '._VAR_MODE); |
|
| 3096 | 3095 | } |
| 3097 | 3096 | } // pas autorise ? |
| 3098 | 3097 | else { |
@@ -3107,7 +3106,7 @@ discard block |
||
| 3107 | 3106 | if (strpos($self, 'page=login') === false) { |
| 3108 | 3107 | include_spip('inc/headers'); |
| 3109 | 3108 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3110 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3109 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3111 | 3110 | } |
| 3112 | 3111 | } |
| 3113 | 3112 | // sinon tant pis |
@@ -3149,10 +3148,10 @@ discard block |
||
| 3149 | 3148 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3150 | 3149 | // certaines constantes |
| 3151 | 3150 | @spip_initialisation_core( |
| 3152 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3153 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3154 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3155 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3151 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3152 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3153 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3154 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3156 | 3155 | ); |
| 3157 | 3156 | |
| 3158 | 3157 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3185,7 +3184,7 @@ discard block |
||
| 3185 | 3184 | } |
| 3186 | 3185 | |
| 3187 | 3186 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3188 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3187 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3189 | 3188 | $session = charger_fonction('session', 'inc'); |
| 3190 | 3189 | if ($session()) { |
| 3191 | 3190 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3265,7 +3264,7 @@ discard block |
||
| 3265 | 3264 | 'definir_session', |
| 3266 | 3265 | $GLOBALS['visiteur_session'] |
| 3267 | 3266 | ? serialize($GLOBALS['visiteur_session']) |
| 3268 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3267 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3269 | 3268 | : '' |
| 3270 | 3269 | ); |
| 3271 | 3270 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3421,11 +3420,11 @@ discard block |
||
| 3421 | 3420 | $GLOBALS['_INC_PUBLIC']++; |
| 3422 | 3421 | |
| 3423 | 3422 | // fix #4235 |
| 3424 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3423 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3425 | 3424 | |
| 3426 | 3425 | |
| 3427 | 3426 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3428 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3427 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3429 | 3428 | |
| 3430 | 3429 | $page = evaluer_fond($f, $contexte, $connect); |
| 3431 | 3430 | if ($page === '') { |
@@ -3510,7 +3509,7 @@ discard block |
||
| 3510 | 3509 | * @return array|string |
| 3511 | 3510 | */ |
| 3512 | 3511 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3513 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3512 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3514 | 3513 | if (!$pathinfo) { |
| 3515 | 3514 | return $f; |
| 3516 | 3515 | } |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | $cles = \Spip\Chiffrer\SpipCles::instance(); |
| 92 | 92 | $secret = $cles->getSecretAuth(); |
| 93 | 93 | |
| 94 | - $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 94 | + $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($login)); |
|
| 95 | 95 | if ($id_auteur !== null) { |
| 96 | 96 | // c'est un auteur connu : si on a pas de secret il faut absolument qu'il se reconnecte avec le meme mot de passe |
| 97 | 97 | // pour restaurer la copie des cles |
| 98 | 98 | if (!$secret and !auth_spip_initialiser_secret()) { |
| 99 | - $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 99 | + $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 100 | 100 | if (empty($row['backup_cles']) or !$cles->restore($row['backup_cles'], $pass, $row['pass'], $id_auteur)) { |
| 101 | 101 | $echec = _T('avis_connexion_erreur_fichier_cle_manquant_1'); |
| 102 | 102 | echouer_etape_3b($echec); |
| 103 | 103 | } |
| 104 | - spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 104 | + spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 105 | 105 | $cles->save(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | 'email' => $email, |
| 111 | 111 | 'login' => $login, |
| 112 | 112 | 'statut' => '0minirezo' |
| 113 | - ], 'id_auteur=' . intval($id_auteur)); |
|
| 113 | + ], 'id_auteur='.intval($id_auteur)); |
|
| 114 | 114 | // le passer webmestre separement du reste, au cas ou l'alter n'aurait pas fonctionne |
| 115 | 115 | @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
| 116 | 116 | if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | !$auteur = auth_identifier_login($login, $pass) |
| 153 | 153 | or !auth_loger($auteur) |
| 154 | 154 | ) { |
| 155 | - spip_log("login automatique impossible $auth_spip $session" . (is_countable($row) ? count($row) : 0)); |
|
| 155 | + spip_log("login automatique impossible $auth_spip $session".(is_countable($row) ? count($row) : 0)); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | function echouer_etape_3b($echec) { |
| 175 | 175 | echo minipres( |
| 176 | 176 | 'AUTO', |
| 177 | - info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 178 | - "<div class='error'><h3>$echec</h3>\n" . |
|
| 179 | - '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 177 | + info_progression_etape(3, 'etape_', 'install/', true). |
|
| 178 | + "<div class='error'><h3>$echec</h3>\n". |
|
| 179 | + '<p>'._T('avis_connexion_echec_2').'</p>'. |
|
| 180 | 180 | '</div>' |
| 181 | 181 | ); |
| 182 | 182 | exit; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $pass_poivre = hash_hmac('sha256', $password_clair, $key); |
| 38 | 38 | return password_verify($pass_poivre, $password_hash); |
| 39 | 39 | } |
| 40 | - spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 40 | + spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $pass_poivre = hash_hmac('sha256', $password_clair, $key); |
| 60 | 60 | return password_hash($pass_poivre, PASSWORD_DEFAULT); |
| 61 | 61 | } |
| 62 | - spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 62 | + spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 63 | 63 | return null; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | final class SpipCles { |
| 17 | 17 | private static array $instances = []; |
| 18 | 18 | |
| 19 | - private string $file = _DIR_ETC . 'cles.php'; |
|
| 19 | + private string $file = _DIR_ETC.'cles.php'; |
|
| 20 | 20 | private Cles $cles; |
| 21 | 21 | |
| 22 | 22 | public static function instance(string $file = ''): self { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // et par extension tous les passwords |
| 118 | 118 | if (!empty($cles_potentielles['secret_des_auth'])) { |
| 119 | 119 | if (!Password::verifier($password_clair, $password_hash, $cles_potentielles['secret_des_auth'])) { |
| 120 | - spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 120 | + spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 121 | 121 | unset($cles_potentielles['secret_des_auth']); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | foreach ($cles_potentielles as $name => $key) { |
| 128 | 128 | if (!$this->cles->has($name)) { |
| 129 | 129 | $this->cles->set($name, $key); |
| 130 | - spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 130 | + spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 131 | 131 | $restauration = true; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | private function getMetaKey(string $name, bool $autoInit = true): ?string { |
| 150 | 150 | if (!isset($GLOBALS['meta'][$name])) { |
| 151 | 151 | include_spip('base/abstract_sql'); |
| 152 | - $GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = ' . sql_quote($name, '', 'string')); |
|
| 152 | + $GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = '.sql_quote($name, '', 'string')); |
|
| 153 | 153 | } |
| 154 | 154 | $key = base64_decode($GLOBALS['meta'][$name] ?? ''); |
| 155 | 155 | if (strlen($key) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) { |