@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | function extraire_date($texte): string { |
| 40 | 40 | // format = 2001-08 |
| 41 | 41 | if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) { |
| 42 | - return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01'; |
|
| 42 | + return $regs[1].'-'.sprintf('%02d', $regs[2]).'-01'; |
|
| 43 | 43 | } |
| 44 | 44 | return ''; |
| 45 | 45 | } |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) { |
| 72 | 72 | $regs = array_pad($regs, 4, null); // eviter notice php |
| 73 | - $date = $regs[1] . '-00-00' . $regs[3]; |
|
| 73 | + $date = $regs[1].'-00-00'.$regs[3]; |
|
| 74 | 74 | } else { |
| 75 | 75 | if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) { |
| 76 | 76 | $regs = array_pad($regs, 4, null); // eviter notice php |
| 77 | - $date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3]; |
|
| 77 | + $date = preg_replace('@/@', '-', $regs[1]).'-00'.$regs[3]; |
|
| 78 | 78 | } else { |
| 79 | 79 | $date = date('Y-m-d H:i:s', strtotime($date)); |
| 80 | 80 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $letexte ??= ''; |
| 102 | 102 | if ( |
| 103 | 103 | !$verif_format_date |
| 104 | - or (in_array(strlen($letexte), [10,19]) and |
|
| 104 | + or (in_array(strlen($letexte), [10, 19]) and |
|
| 105 | 105 | preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte)) |
| 106 | 106 | ) { |
| 107 | 107 | if (strncmp('0000-00-00', $letexte, 10) == 0) { |
@@ -388,17 +388,17 @@ discard block |
||
| 388 | 388 | if ($decal > 3600 * 24 * 30) { |
| 389 | 389 | $mois = floor($decal / (3600 * 24 * 30)); |
| 390 | 390 | if ($mois < 2) { |
| 391 | - $delai = "$mois " . _T('date_un_mois'); |
|
| 391 | + $delai = "$mois "._T('date_un_mois'); |
|
| 392 | 392 | } else { |
| 393 | - $delai = "$mois " . _T('date_mois'); |
|
| 393 | + $delai = "$mois "._T('date_mois'); |
|
| 394 | 394 | } |
| 395 | 395 | } else { |
| 396 | 396 | if ($decal > 3600 * 24 * 7) { |
| 397 | 397 | $semaines = floor($decal / (3600 * 24 * 7)); |
| 398 | 398 | if ($semaines < 2) { |
| 399 | - $delai = "$semaines " . _T('date_une_semaine'); |
|
| 399 | + $delai = "$semaines "._T('date_une_semaine'); |
|
| 400 | 400 | } else { |
| 401 | - $delai = "$semaines " . _T('date_semaines'); |
|
| 401 | + $delai = "$semaines "._T('date_semaines'); |
|
| 402 | 402 | } |
| 403 | 403 | } else { |
| 404 | 404 | if ($decal > 3600 * 24) { |
@@ -406,30 +406,30 @@ discard block |
||
| 406 | 406 | if ($jours < 2) { |
| 407 | 407 | return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier'); |
| 408 | 408 | } else { |
| 409 | - $delai = "$jours " . _T('date_jours'); |
|
| 409 | + $delai = "$jours "._T('date_jours'); |
|
| 410 | 410 | } |
| 411 | 411 | } else { |
| 412 | 412 | if ($decal >= 3600) { |
| 413 | 413 | $heures = floor($decal / 3600); |
| 414 | 414 | if ($heures < 2) { |
| 415 | - $delai = "$heures " . _T('date_une_heure'); |
|
| 415 | + $delai = "$heures "._T('date_une_heure'); |
|
| 416 | 416 | } else { |
| 417 | - $delai = "$heures " . _T('date_heures'); |
|
| 417 | + $delai = "$heures "._T('date_heures'); |
|
| 418 | 418 | } |
| 419 | 419 | } else { |
| 420 | 420 | if ($decal >= 60) { |
| 421 | 421 | $minutes = floor($decal / 60); |
| 422 | 422 | if ($minutes < 2) { |
| 423 | - $delai = "$minutes " . _T('date_une_minute'); |
|
| 423 | + $delai = "$minutes "._T('date_une_minute'); |
|
| 424 | 424 | } else { |
| 425 | - $delai = "$minutes " . _T('date_minutes'); |
|
| 425 | + $delai = "$minutes "._T('date_minutes'); |
|
| 426 | 426 | } |
| 427 | 427 | } else { |
| 428 | 428 | $secondes = ceil($decal); |
| 429 | 429 | if ($secondes < 2) { |
| 430 | - $delai = "$secondes " . _T('date_une_seconde'); |
|
| 430 | + $delai = "$secondes "._T('date_une_seconde'); |
|
| 431 | 431 | } else { |
| 432 | - $delai = "$secondes " . _T('date_secondes'); |
|
| 432 | + $delai = "$secondes "._T('date_secondes'); |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | } |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $njour = 0; |
| 523 | 523 | } else { |
| 524 | 524 | $njour = intval($jour); |
| 525 | - if ($jourth = _T('date_jnum' . $jour)) { |
|
| 525 | + if ($jourth = _T('date_jnum'.$jour)) { |
|
| 526 | 526 | $jour = $jourth; |
| 527 | 527 | } |
| 528 | 528 | } |
@@ -530,10 +530,10 @@ discard block |
||
| 530 | 530 | $mois = intval($mois); |
| 531 | 531 | if ($mois > 0 and $mois < 13) { |
| 532 | 532 | /* Traiter le cas "abbr" pour les noms de mois */ |
| 533 | - $param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : ''); |
|
| 534 | - $nommois = _T('date_mois_' . $mois . $param); |
|
| 533 | + $param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_'.$options['param'] : ''); |
|
| 534 | + $nommois = _T('date_mois_'.$mois.$param); |
|
| 535 | 535 | if ($jour) { |
| 536 | - $jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]); |
|
| 536 | + $jourmois = _T('date_de_mois_'.$mois, ['j' => $jour, 'nommois' => $nommois]); |
|
| 537 | 537 | } else { |
| 538 | 538 | $jourmois = $nommois; |
| 539 | 539 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | if ($annee < 0) { |
| 546 | - $annee = -$annee . ' ' . _T('date_avant_jc'); |
|
| 546 | + $annee = -$annee.' '._T('date_avant_jc'); |
|
| 547 | 547 | $avjc = true; |
| 548 | 548 | } else { |
| 549 | 549 | $avjc = false; |
@@ -569,11 +569,11 @@ discard block |
||
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | if ($vue == 'saison') { |
| 572 | - return $saison ? _T('date_saison_' . $saison) : ''; |
|
| 572 | + return $saison ? _T('date_saison_'.$saison) : ''; |
|
| 573 | 573 | } else { |
| 574 | 574 | return $saison ? trim(_T( |
| 575 | 575 | 'date_fmt_saison_annee', |
| 576 | - ['saison' => _T('date_saison_' . $saison), 'annee' => $annee] |
|
| 576 | + ['saison' => _T('date_saison_'.$saison), 'annee' => $annee] |
|
| 577 | 577 | )) : ''; |
| 578 | 578 | } |
| 579 | 579 | |
@@ -650,9 +650,9 @@ discard block |
||
| 650 | 650 | } |
| 651 | 651 | $nom = mktime(1, 1, 1, $mois, $njour, $annee); |
| 652 | 652 | $nom = 1 + (int) date('w', $nom); |
| 653 | - $param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : ''); |
|
| 653 | + $param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : ''); |
|
| 654 | 654 | |
| 655 | - return _T('date_jour_' . $nom . $param); |
|
| 655 | + return _T('date_jour_'.$nom.$param); |
|
| 656 | 656 | |
| 657 | 657 | case 'mois_annee': |
| 658 | 658 | if ($avjc) { |
@@ -1047,8 +1047,8 @@ discard block |
||
| 1047 | 1047 | |
| 1048 | 1048 | $dtstart = $dtend = $dtabbr = ''; |
| 1049 | 1049 | if (strpos($forme, 'hcal') !== false) { |
| 1050 | - $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; |
|
| 1051 | - $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; |
|
| 1050 | + $dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>"; |
|
| 1051 | + $dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>"; |
|
| 1052 | 1052 | $dtabbr = '</abbr>'; |
| 1053 | 1053 | } |
| 1054 | 1054 | |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | } |
| 1097 | 1097 | } else { |
| 1098 | 1098 | if ($dtabbr && $dtstart) { |
| 1099 | - $s = $dtstart . spip_ucfirst($s) . $dtabbr; |
|
| 1099 | + $s = $dtstart.spip_ucfirst($s).$dtabbr; |
|
| 1100 | 1100 | } else { |
| 1101 | 1101 | $s = spip_ucfirst($s); |
| 1102 | 1102 | } |
@@ -1119,8 +1119,8 @@ discard block |
||
| 1119 | 1119 | $date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]); |
| 1120 | 1120 | $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]); |
| 1121 | 1121 | } |
| 1122 | - $date_debut = $dtstart . $date_debut . $dtabbr; |
|
| 1123 | - $date_fin = $dtend . $date_fin . $dtabbr; |
|
| 1122 | + $date_debut = $dtstart.$date_debut.$dtabbr; |
|
| 1123 | + $date_fin = $dtend.$date_fin.$dtabbr; |
|
| 1124 | 1124 | |
| 1125 | 1125 | $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]); |
| 1126 | 1126 | } else { |
@@ -1137,8 +1137,8 @@ discard block |
||
| 1137 | 1137 | $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]); |
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | - $date_debut = $dtstart . $date_debut . $dtabbr; |
|
| 1141 | - $date_fin = $dtend . $date_fin . $dtabbr; |
|
| 1140 | + $date_debut = $dtstart.$date_debut.$dtabbr; |
|
| 1141 | + $date_fin = $dtend.$date_fin.$dtabbr; |
|
| 1142 | 1142 | $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]); |
| 1143 | 1143 | } |
| 1144 | 1144 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | $d = date('Y-m-d'); |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | - return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2); |
|
| 1245 | + return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2); |
|
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | 1248 | /** |
@@ -1262,7 +1262,7 @@ discard block |
||
| 1262 | 1262 | $d = date('Y-m-d'); |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | - return substr($d, 0, 4) . substr($d, 5, 2); |
|
| 1265 | + return substr($d, 0, 4).substr($d, 5, 2); |
|
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Mot de passe |
| 32 | 32 | **/ |
| 33 | 33 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 34 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 34 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 35 | 35 | |
| 36 | 36 | mt_srand($seed); |
| 37 | 37 | $s = ''; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | if (!$s) { |
| 43 | 43 | $s = random_int(0, mt_getrandmax()); |
| 44 | 44 | } |
| 45 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 45 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 46 | 46 | } |
| 47 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 47 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 48 | 48 | $x = $r['r'] & 63; |
| 49 | 49 | if ($x < 10) { |
| 50 | 50 | $x = chr($x + 48); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | static $seeded; |
| 83 | 83 | |
| 84 | 84 | if (!$seeded) { |
| 85 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 85 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 86 | 86 | mt_srand($seed); |
| 87 | 87 | $seeded = true; |
| 88 | 88 | } |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); |
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | - $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur)); |
|
| 171 | + $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur)); |
|
| 172 | 172 | if (!$low_sec) { |
| 173 | 173 | $low_sec = creer_pass_aleatoire(); |
| 174 | - sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur)); |
|
| 174 | + sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur)); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) { |
| 230 | 230 | $id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0; |
| 231 | 231 | $cle = afficher_low_sec($id_auteur, "$script/$format $fond $args"); |
| 232 | - $path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : ''); |
|
| 232 | + $path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : ''); |
|
| 233 | 233 | |
| 234 | 234 | return generer_url_api($script, $path, $args, $no_entities = false, $public); |
| 235 | 235 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | foreach ($args as $val => $var) { |
| 254 | 254 | if ($var) { |
| 255 | 255 | if ($val <> 'statut') { |
| 256 | - $a .= ':' . $val . '-' . $var; |
|
| 256 | + $a .= ':'.$val.'-'.$var; |
|
| 257 | 257 | } |
| 258 | - $b .= $val . '=' . $var . '&'; |
|
| 258 | + $b .= $val.'='.$var.'&'; |
|
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | $a = substr($a, 1); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * Clé |
| 286 | 286 | **/ |
| 287 | 287 | function afficher_low_sec($id_auteur, $action = '') { |
| 288 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 288 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if (!$id_auteur = intval($id_auteur)) { |
| 317 | 317 | return; |
| 318 | 318 | } // jamais trop prudent ;) |
| 319 | - sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur)); |
|
| 319 | + sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur)); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
@@ -334,8 +334,8 @@ discard block |
||
| 334 | 334 | * - void sinon. |
| 335 | 335 | **/ |
| 336 | 336 | function ecrire_acces() { |
| 337 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 338 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 337 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 338 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 339 | 339 | |
| 340 | 340 | // Cette variable de configuration peut etre posee par un plugin |
| 341 | 341 | // par exemple acces_restreint ; |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | and !@file_exists($htaccess) |
| 347 | 347 | ) { |
| 348 | 348 | spip_unlink($htpasswd); |
| 349 | - spip_unlink($htpasswd . '-admin'); |
|
| 349 | + spip_unlink($htpasswd.'-admin'); |
|
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | 352 | |
@@ -374,10 +374,10 @@ discard block |
||
| 374 | 374 | $pwd_all = ''; // login:htpass pour tous |
| 375 | 375 | $pwd_admin = ''; // login:htpass pour les admins |
| 376 | 376 | |
| 377 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 377 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 378 | 378 | while ($row = sql_fetch($res)) { |
| 379 | 379 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 380 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 380 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 381 | 381 | $pwd_all .= $ligne; |
| 382 | 382 | if ($row['statut'] == '0minirezo') { |
| 383 | 383 | $pwd_admin .= $ligne; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | * @return boolean |
| 421 | 421 | */ |
| 422 | 422 | function verifier_htaccess($rep, $force = false) { |
| 423 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 423 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 424 | 424 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 425 | 425 | return true; |
| 426 | 426 | } |
@@ -449,17 +449,17 @@ discard block |
||
| 449 | 449 | fputs($ht, $deny); |
| 450 | 450 | fclose($ht); |
| 451 | 451 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 452 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 452 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 453 | 453 | if ($ht = @fopen($t, 'w')) { |
| 454 | 454 | @fclose($ht); |
| 455 | 455 | include_spip('inc/distant'); |
| 456 | 456 | $t = substr($t, strlen(_DIR_RACINE)); |
| 457 | - $t = url_de_base() . $t; |
|
| 457 | + $t = url_de_base().$t; |
|
| 458 | 458 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 459 | 459 | $ht = ($ht['status'] ?? null) === 403; |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 462 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 463 | 463 | |
| 464 | 464 | return $ht; |
| 465 | 465 | } |
@@ -485,11 +485,11 @@ discard block |
||
| 485 | 485 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 486 | 486 | $dirs[] = ['extension' => 'distant']; |
| 487 | 487 | foreach ($dirs as $e) { |
| 488 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 488 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 489 | 489 | if ($f) { |
| 490 | 490 | verifier_htaccess($dir); |
| 491 | 491 | } else { |
| 492 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 492 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | 495 | } |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | $link = @mysqli_connect($host, $login, $pass); |
| 63 | 63 | } |
| 64 | 64 | } catch (\mysqli_sql_exception $e) { |
| 65 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 65 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 66 | 66 | $link = false; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (!$link) { |
| 70 | - spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS); |
|
| 70 | + spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS); |
|
| 71 | 71 | |
| 72 | 72 | return false; |
| 73 | 73 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | spip_log( |
| 89 | - "Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'), |
|
| 89 | + "Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? 'operationnelle' : 'impossible'), |
|
| 90 | 90 | _LOG_DEBUG |
| 91 | 91 | ); |
| 92 | 92 | |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) { |
| 179 | 179 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 180 | - spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG); |
|
| 180 | + spip_log('changement de charset sql : '.'SET NAMES '._q($charset), _LOG_DEBUG); |
|
| 181 | 181 | |
| 182 | - return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset)); |
|
| 182 | + return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES '._q($charset)); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) { |
| 195 | 195 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 196 | 196 | $connexion['last'] = $c = 'SHOW CHARACTER SET' |
| 197 | - . (!$charset ? '' : (' LIKE ' . _q($charset['charset']))); |
|
| 197 | + . (!$charset ? '' : (' LIKE '._q($charset['charset']))); |
|
| 198 | 198 | |
| 199 | 199 | return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur); |
| 200 | 200 | } |
@@ -238,21 +238,21 @@ discard block |
||
| 238 | 238 | $debug = ''; |
| 239 | 239 | if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) { |
| 240 | 240 | if (isset($GLOBALS['debug']['aucasou'])) { |
| 241 | - [, $id, , $infos] = $GLOBALS['debug']['aucasou']; |
|
| 242 | - $debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | '; |
|
| 241 | + [, $id,, $infos] = $GLOBALS['debug']['aucasou']; |
|
| 242 | + $debug .= "BOUCLE$id @ ".($infos[0] ?? '').' | '; |
|
| 243 | 243 | } |
| 244 | 244 | if (isset($_SERVER['REQUEST_URI'])) { |
| 245 | 245 | $debug .= $_SERVER['REQUEST_URI']; |
| 246 | 246 | } |
| 247 | 247 | if (!empty($GLOBALS['ip'])) { |
| 248 | - $debug .= ' + ' . $GLOBALS['ip']; |
|
| 248 | + $debug .= ' + '.$GLOBALS['ip']; |
|
| 249 | 249 | } |
| 250 | - $debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */'; |
|
| 250 | + $debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */'; |
|
| 251 | 251 | } |
| 252 | 252 | try { |
| 253 | - $r = mysqli_query($link, $query . $debug); |
|
| 253 | + $r = mysqli_query($link, $query.$debug); |
|
| 254 | 254 | } catch (\mysqli_sql_exception $e) { |
| 255 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 255 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 256 | 256 | $r = false; |
| 257 | 257 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 258 | 258 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | $link = $connexion['link']; |
| 271 | 271 | //On retente au cas où |
| 272 | 272 | try { |
| 273 | - $r = mysqli_query($link, $query . $debug); |
|
| 273 | + $r = mysqli_query($link, $query.$debug); |
|
| 274 | 274 | } catch (\mysqli_sql_exception $e) { |
| 275 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 275 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 276 | 276 | $r = false; |
| 277 | 277 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 278 | 278 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | // d'utiliser ceux-ci, copie-colle de phpmyadmin |
| 306 | 306 | $query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query); |
| 307 | 307 | |
| 308 | - return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 308 | + return spip_mysql_query('ALTER '.$query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @return bool Toujours true |
| 319 | 319 | */ |
| 320 | 320 | function spip_mysql_optimize($table, $serveur = '', $requeter = true) { |
| 321 | - spip_mysql_query('OPTIMIZE TABLE ' . $table); |
|
| 321 | + spip_mysql_query('OPTIMIZE TABLE '.$table); |
|
| 322 | 322 | |
| 323 | 323 | return true; |
| 324 | 324 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | $link = $connexion['link']; |
| 342 | 342 | $db = $connexion['db']; |
| 343 | 343 | |
| 344 | - $query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe); |
|
| 344 | + $query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe); |
|
| 345 | 345 | $r = mysqli_query($link, $query); |
| 346 | 346 | |
| 347 | 347 | return spip_mysql_fetch($r, null, $serveur); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | . calculer_mysql_expression('WHERE', $where) |
| 393 | 393 | . calculer_mysql_expression('GROUP BY', $groupby, ',') |
| 394 | 394 | . calculer_mysql_expression('HAVING', $having) |
| 395 | - . ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '') |
|
| 395 | + . ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '') |
|
| 396 | 396 | . ($limit ? "\nLIMIT $limit" : ''); |
| 397 | 397 | |
| 398 | 398 | // renvoyer la requete inerte si demandee |
@@ -482,12 +482,12 @@ discard block |
||
| 482 | 482 | $exp = "\n$expression "; |
| 483 | 483 | |
| 484 | 484 | if (!is_array($v)) { |
| 485 | - return $exp . $v; |
|
| 485 | + return $exp.$v; |
|
| 486 | 486 | } else { |
| 487 | 487 | if (strtoupper($join) === 'AND') { |
| 488 | - return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 488 | + return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 489 | 489 | } else { |
| 490 | - return $exp . join($join, $v); |
|
| 490 | + return $exp.join($join, $v); |
|
| 491 | 491 | } |
| 492 | 492 | } |
| 493 | 493 | } |
@@ -505,17 +505,17 @@ discard block |
||
| 505 | 505 | if (substr($k, -1) == '@') { |
| 506 | 506 | // c'est une jointure qui se refere au from precedent |
| 507 | 507 | // pas de virgule |
| 508 | - $res .= ' ' . $v; |
|
| 508 | + $res .= ' '.$v; |
|
| 509 | 509 | } else { |
| 510 | 510 | if (!is_numeric($k)) { |
| 511 | 511 | $p = strpos($v, ' '); |
| 512 | 512 | if ($p) { |
| 513 | - $v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p); |
|
| 513 | + $v = substr($v, 0, $p)." AS `$k`".substr($v, $p); |
|
| 514 | 514 | } else { |
| 515 | 515 | $v .= " AS `$k`"; |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | - $res .= ', ' . $v; |
|
| 518 | + $res .= ', '.$v; |
|
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | |
@@ -545,13 +545,13 @@ discard block |
||
| 545 | 545 | function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) { |
| 546 | 546 | |
| 547 | 547 | if ($GLOBALS['mysql_rappel_nom_base'] and $db) { |
| 548 | - $pref = '`' . $db . '`.'; |
|
| 548 | + $pref = '`'.$db.'`.'; |
|
| 549 | 549 | } else { |
| 550 | 550 | $pref = ''; |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if ($prefixe) { |
| 554 | - $pref .= $prefixe . '_'; |
|
| 554 | + $pref .= $prefixe.'_'; |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) { |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $suite_echap = $suite; |
| 571 | 571 | } |
| 572 | 572 | if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) { |
| 573 | - $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 573 | + $suite_echap = $r[1]._mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 574 | 574 | if ($echappe_textes) { |
| 575 | 575 | $suite = query_reinjecte_textes($suite_echap, $textes); |
| 576 | 576 | } |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | } |
| 583 | - $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite; |
|
| 583 | + $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite; |
|
| 584 | 584 | |
| 585 | 585 | // en option, remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
| 586 | 586 | // remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | $link = _mysql_link($serveur); |
| 617 | 617 | $ok = mysqli_select_db($link, $db); |
| 618 | 618 | if (!$ok) { |
| 619 | - spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE); |
|
| 619 | + spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | return $ok; |
@@ -706,10 +706,10 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | $character_set = ''; |
| 708 | 708 | if (@$GLOBALS['meta']['charset_sql_base']) { |
| 709 | - $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base']; |
|
| 709 | + $character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base']; |
|
| 710 | 710 | } |
| 711 | 711 | if (@$GLOBALS['meta']['charset_collation_sql_base']) { |
| 712 | - $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base']; |
|
| 712 | + $character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base']; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | foreach ($champs as $k => $v) { |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | preg_match(',(char|text),i', $defs[1]) |
| 720 | 720 | and !preg_match(',(binary|CHARACTER|COLLATE),i', $v) |
| 721 | 721 | ) { |
| 722 | - $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1])); |
|
| 722 | + $v = $defs[1].$character_set.' '.substr($v, strlen($defs[1])); |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
@@ -731,8 +731,8 @@ discard block |
||
| 731 | 731 | $s = ','; |
| 732 | 732 | } |
| 733 | 733 | $temporary = $temporary ? 'TEMPORARY' : ''; |
| 734 | - $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')' |
|
| 735 | - . ' ENGINE=' . _MYSQL_ENGINE |
|
| 734 | + $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')' |
|
| 735 | + . ' ENGINE='._MYSQL_ENGINE |
|
| 736 | 736 | . ($character_set ? " DEFAULT $character_set" : '') |
| 737 | 737 | . "\n"; |
| 738 | 738 | |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | return false; |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 814 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 815 | 815 | |
| 816 | 816 | return spip_mysql_query($query, $serveur, $requeter); |
| 817 | 817 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | * Ressource à utiliser avec sql_fetch() |
| 870 | 870 | **/ |
| 871 | 871 | function spip_mysql_showbase($match, $serveur = '', $requeter = true) { |
| 872 | - return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter); |
|
| 872 | + return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | /** |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | * - true si la requête a réussie, false sinon |
| 886 | 886 | */ |
| 887 | 887 | function spip_mysql_repair($table, $serveur = '', $requeter = true) { |
| 888 | - $table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true)); |
|
| 888 | + $table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = '._q($table), $serveur, true)); |
|
| 889 | 889 | $engine = $table_status['Engine']; |
| 890 | 890 | if ($engine == 'InnoDB') { |
| 891 | 891 | if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) { |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | } elseif ($engine == 'MyISAM') { |
| 895 | 895 | return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter); |
| 896 | 896 | } else { |
| 897 | - spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG); |
|
| 897 | + spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.'._LOG_DEBUG); |
|
| 898 | 898 | } |
| 899 | 899 | } |
| 900 | 900 | |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | * - string : requete sql, si $requeter = true |
| 914 | 914 | **/ |
| 915 | 915 | function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) { |
| 916 | - $r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter); |
|
| 916 | + $r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter); |
|
| 917 | 917 | if (!$requeter) { |
| 918 | 918 | return $r; |
| 919 | 919 | } |
@@ -995,22 +995,22 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | if ($val['Default'] === '0' || $val['Default']) { |
| 997 | 997 | if (preg_match('/[A-Z_]/', $val['Default'])) { |
| 998 | - $nfields[$val['Field']] .= ' DEFAULT ' . $val['Default']; |
|
| 998 | + $nfields[$val['Field']] .= ' DEFAULT '.$val['Default']; |
|
| 999 | 999 | } else { |
| 1000 | - $nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'"; |
|
| 1000 | + $nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'"; |
|
| 1001 | 1001 | } |
| 1002 | 1002 | } |
| 1003 | 1003 | if ($val['Extra']) { |
| 1004 | - $nfields[$val['Field']] .= ' ' . $val['Extra']; |
|
| 1004 | + $nfields[$val['Field']] .= ' '.$val['Extra']; |
|
| 1005 | 1005 | } |
| 1006 | 1006 | if ($val['Key'] == 'PRI') { |
| 1007 | 1007 | $nkeys['PRIMARY KEY'] = $val['Field']; |
| 1008 | 1008 | } else { |
| 1009 | 1009 | if ($val['Key'] == 'MUL') { |
| 1010 | - $nkeys['KEY ' . $val['Field']] = $val['Field']; |
|
| 1010 | + $nkeys['KEY '.$val['Field']] = $val['Field']; |
|
| 1011 | 1011 | } else { |
| 1012 | 1012 | if ($val['Key'] == 'UNI') { |
| 1013 | - $nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field']; |
|
| 1013 | + $nkeys['UNIQUE KEY '.$val['Field']] = $val['Field']; |
|
| 1014 | 1014 | } |
| 1015 | 1015 | } |
| 1016 | 1016 | } |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | $serveur = '', |
| 1082 | 1082 | $requeter = true |
| 1083 | 1083 | ) { |
| 1084 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1084 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1085 | 1085 | |
| 1086 | 1086 | $r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter); |
| 1087 | 1087 | if (!$requeter) { |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | if ($s) { |
| 1122 | 1122 | $trace = debug_backtrace(); |
| 1123 | 1123 | if ($trace[0]['function'] != 'spip_mysql_error') { |
| 1124 | - spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR); |
|
| 1124 | + spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR); |
|
| 1125 | 1125 | } |
| 1126 | 1126 | } |
| 1127 | 1127 | |
@@ -1247,7 +1247,7 @@ discard block |
||
| 1247 | 1247 | try { |
| 1248 | 1248 | $insert = mysqli_query($link, $query); |
| 1249 | 1249 | } catch (\mysqli_sql_exception $e) { |
| 1250 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 1250 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 1251 | 1251 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 1252 | 1252 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
| 1253 | 1253 | } |
@@ -1302,8 +1302,8 @@ discard block |
||
| 1302 | 1302 | |
| 1303 | 1303 | return spip_mysql_insert( |
| 1304 | 1304 | $table, |
| 1305 | - '(' . join(',', array_keys($couples)) . ')', |
|
| 1306 | - '(' . join(',', $couples) . ')', |
|
| 1305 | + '('.join(',', array_keys($couples)).')', |
|
| 1306 | + '('.join(',', $couples).')', |
|
| 1307 | 1307 | $desc, |
| 1308 | 1308 | $serveur, |
| 1309 | 1309 | $requeter |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | } |
| 1341 | 1341 | $fields = $desc['field'] ?? []; |
| 1342 | 1342 | |
| 1343 | - $cles = '(' . join(',', array_keys(reset($tab_couples))) . ')'; |
|
| 1343 | + $cles = '('.join(',', array_keys(reset($tab_couples))).')'; |
|
| 1344 | 1344 | $valeurs = []; |
| 1345 | 1345 | $r = false; |
| 1346 | 1346 | |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | foreach ($couples as $champ => $val) { |
| 1350 | 1350 | $couples[$champ] = spip_mysql_cite($val, $fields[$champ]); |
| 1351 | 1351 | } |
| 1352 | - $valeurs[] = '(' . join(',', $couples) . ')'; |
|
| 1352 | + $valeurs[] = '('.join(',', $couples).')'; |
|
| 1353 | 1353 | if (count($valeurs) >= 100) { |
| 1354 | 1354 | $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter); |
| 1355 | 1355 | $valeurs = []; |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) { |
| 1387 | 1387 | $set = []; |
| 1388 | 1388 | foreach ($champs as $champ => $val) { |
| 1389 | - $set[] = $champ . "=$val"; |
|
| 1389 | + $set[] = $champ."=$val"; |
|
| 1390 | 1390 | } |
| 1391 | 1391 | if (!empty($set)) { |
| 1392 | 1392 | return spip_mysql_query( |
@@ -1442,7 +1442,7 @@ discard block |
||
| 1442 | 1442 | } |
| 1443 | 1443 | $set = []; |
| 1444 | 1444 | foreach ($champs as $champ => $val) { |
| 1445 | - $set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]); |
|
| 1445 | + $set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]); |
|
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | return spip_mysql_query( |
@@ -1511,10 +1511,10 @@ discard block |
||
| 1511 | 1511 | * - False en cas d'erreur. |
| 1512 | 1512 | **/ |
| 1513 | 1513 | function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) { |
| 1514 | - return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join( |
|
| 1514 | + return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join( |
|
| 1515 | 1515 | ',', |
| 1516 | 1516 | array_map('_q', $couples) |
| 1517 | - ) . ')', $serveur, $requeter); |
|
| 1517 | + ).')', $serveur, $requeter); |
|
| 1518 | 1518 | } |
| 1519 | 1519 | |
| 1520 | 1520 | |
@@ -1543,10 +1543,10 @@ discard block |
||
| 1543 | 1543 | * - False en cas d'erreur. |
| 1544 | 1544 | **/ |
| 1545 | 1545 | function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) { |
| 1546 | - $cles = '(' . join(',', array_keys($tab_couples[0])) . ')'; |
|
| 1546 | + $cles = '('.join(',', array_keys($tab_couples[0])).')'; |
|
| 1547 | 1547 | $valeurs = []; |
| 1548 | 1548 | foreach ($tab_couples as $couples) { |
| 1549 | - $valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')'; |
|
| 1549 | + $valeurs[] = '('.join(',', array_map('_q', $couples)).')'; |
|
| 1550 | 1550 | } |
| 1551 | 1551 | $valeurs = implode(', ', $valeurs); |
| 1552 | 1552 | |
@@ -1566,28 +1566,28 @@ discard block |
||
| 1566 | 1566 | */ |
| 1567 | 1567 | function spip_mysql_multi($objet, $lang) { |
| 1568 | 1568 | $lengthlang = strlen("[$lang]"); |
| 1569 | - $posmulti = 'INSTR(' . $objet . ", '<multi>')"; |
|
| 1570 | - $posfinmulti = 'INSTR(' . $objet . ", '</multi>')"; |
|
| 1571 | - $debutchaine = 'LEFT(' . $objet . ", $posmulti-1)"; |
|
| 1572 | - $finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))"; |
|
| 1573 | - $chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1574 | - $poslang = "INSTR($chainemulti,'[" . $lang . "]')"; |
|
| 1569 | + $posmulti = 'INSTR('.$objet.", '<multi>')"; |
|
| 1570 | + $posfinmulti = 'INSTR('.$objet.", '</multi>')"; |
|
| 1571 | + $debutchaine = 'LEFT('.$objet.", $posmulti-1)"; |
|
| 1572 | + $finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))"; |
|
| 1573 | + $chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1574 | + $poslang = "INSTR($chainemulti,'[".$lang."]')"; |
|
| 1575 | 1575 | $poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)"; |
| 1576 | - $chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1577 | - $posfinlang = 'INSTR(' . $chainelang . ", '[')"; |
|
| 1576 | + $chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1577 | + $posfinlang = 'INSTR('.$chainelang.", '[')"; |
|
| 1578 | 1578 | $chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)"; |
| 1579 | 1579 | //$chainelang = "LEFT($chainelang,$posfinlang-1)"; |
| 1580 | - $retour = "(TRIM(IF($posmulti = 0 , " . |
|
| 1581 | - ' TRIM(' . $objet . '), ' . |
|
| 1582 | - ' CONCAT( ' . |
|
| 1583 | - " $debutchaine, " . |
|
| 1584 | - ' IF( ' . |
|
| 1585 | - " $poslang = 0, " . |
|
| 1586 | - " $chainemulti, " . |
|
| 1587 | - " $chainelang" . |
|
| 1588 | - ' ), ' . |
|
| 1589 | - " $finchaine" . |
|
| 1590 | - ' ) ' . |
|
| 1580 | + $retour = "(TRIM(IF($posmulti = 0 , ". |
|
| 1581 | + ' TRIM('.$objet.'), '. |
|
| 1582 | + ' CONCAT( '. |
|
| 1583 | + " $debutchaine, ". |
|
| 1584 | + ' IF( '. |
|
| 1585 | + " $poslang = 0, ". |
|
| 1586 | + " $chainemulti, ". |
|
| 1587 | + " $chainelang". |
|
| 1588 | + ' ), '. |
|
| 1589 | + " $finchaine". |
|
| 1590 | + ' ) '. |
|
| 1591 | 1591 | '))) AS multi'; |
| 1592 | 1592 | |
| 1593 | 1593 | return $retour; |
@@ -1604,7 +1604,7 @@ discard block |
||
| 1604 | 1604 | * Valeur hexadécimale pour MySQL |
| 1605 | 1605 | **/ |
| 1606 | 1606 | function spip_mysql_hex($v) { |
| 1607 | - return '0x' . $v; |
|
| 1607 | + return '0x'.$v; |
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | /** |
@@ -1644,7 +1644,7 @@ discard block |
||
| 1644 | 1644 | * Expression SQL |
| 1645 | 1645 | **/ |
| 1646 | 1646 | function spip_mysql_date_proche($champ, $interval, $unite) { |
| 1647 | - $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false ); |
|
| 1647 | + $use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false); |
|
| 1648 | 1648 | return '(' |
| 1649 | 1649 | . $champ |
| 1650 | 1650 | . (($interval <= 0) ? '>' : '<') |
@@ -1699,7 +1699,7 @@ discard block |
||
| 1699 | 1699 | } elseif ($v === null) { |
| 1700 | 1700 | return "''"; |
| 1701 | 1701 | } |
| 1702 | - return "'" . addslashes($v) . "'"; |
|
| 1702 | + return "'".addslashes($v)."'"; |
|
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | if ($v === null) { |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | } |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | - return ("'" . addslashes($v) . "'"); |
|
| 1726 | + return ("'".addslashes($v)."'"); |
|
| 1727 | 1727 | } |
| 1728 | 1728 | |
| 1729 | 1729 | /** |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | } else { |
| 1758 | 1758 | $GLOBALS['mysql_rappel_nom_base'] = false; |
| 1759 | 1759 | |
| 1760 | - return "\$GLOBALS['mysql_rappel_nom_base'] = false; " . |
|
| 1760 | + return "\$GLOBALS['mysql_rappel_nom_base'] = false; ". |
|
| 1761 | 1761 | "/* echec de test_rappel_nom_base_mysql a l'installation. */\n"; |
| 1762 | 1762 | } |
| 1763 | 1763 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | and ( |
| 104 | 104 | $newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur']) |
| 105 | 105 | )); |
| 106 | - $res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . '</li>'; |
|
| 106 | + $res[] = "<li class='pagination-item'>".lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination').'</li>'; |
|
| 107 | 107 | } |
| 108 | 108 | if ($initiale) { |
| 109 | 109 | $memo = [ |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | if (!$initiale and !$url) { |
| 118 | 118 | if ((is_countable($res) ? count($res) : 0) > 1) { |
| 119 | - $out = "<ul class='pagination-items'>" . implode(' ', $res) . '</ul>'; |
|
| 119 | + $out = "<ul class='pagination-items'>".implode(' ', $res).'</ul>'; |
|
| 120 | 120 | } |
| 121 | 121 | $memo = null; |
| 122 | 122 | $res = []; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ) { |
| 158 | 158 | return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
| 159 | 159 | } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
| 160 | - return 'mailto:' . $email; |
|
| 160 | + return 'mailto:'.$email; |
|
| 161 | 161 | } else { |
| 162 | 162 | return ''; |
| 163 | 163 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | // message d'erreur au retour d'une operation |
| 122 | 122 | if ($erreur) { |
| 123 | - echo "<div class='error'>" . spip_htmlspecialchars($erreur) . '</div>'; |
|
| 123 | + echo "<div class='error'>".spip_htmlspecialchars($erreur).'</div>'; |
|
| 124 | 124 | } |
| 125 | 125 | if ($erreur_activation) { |
| 126 | 126 | echo "<div class='error'>$erreur_activation</div>"; |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | if ($quoi !== 'actifs') { |
| 148 | 148 | $lpf = liste_plugin_files(); |
| 149 | 149 | if ($lpf) { |
| 150 | - echo '<p>' . _T('texte_presente_plugin') . '</p>'; |
|
| 150 | + echo '<p>'._T('texte_presente_plugin').'</p>'; |
|
| 151 | 151 | } else { |
| 152 | 152 | if (!@is_dir(_DIR_PLUGINS)) { |
| 153 | - echo '<p>' . _T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)]) |
|
| 154 | - . ' — ' . _T('plugin_info_automatique_creer') . '</p>'; |
|
| 153 | + echo '<p>'._T('plugin_info_automatique_ftp', ['rep' => joli_repertoire(_DIR_PLUGINS)]) |
|
| 154 | + . ' — '._T('plugin_info_automatique_creer').'</p>'; |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | $lcpaffiche = $lpf; |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | if (defined('_DIR_PLUGINS_SUPPL')) { |
| 173 | 173 | $nb += is_countable($lcpas) ? count($lcpas) : 0; |
| 174 | 174 | } |
| 175 | - echo '<h3>' . sinon( |
|
| 175 | + echo '<h3>'.sinon( |
|
| 176 | 176 | singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
| 177 | 177 | _T('plugins_actif_aucun') |
| 178 | - ) . '</h3>'; |
|
| 178 | + ).'</h3>'; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | if (empty($format)) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | if ($corps) { |
| 194 | 194 | $corps .= "\n<div class='boutons' style='display:none;'>" |
| 195 | - . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') |
|
| 195 | + . "<input type='submit' class='submit save' value='"._T('bouton_enregistrer') |
|
| 196 | 196 | . "' />" |
| 197 | 197 | . '</div>'; |
| 198 | 198 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
| 267 | 267 | . '<p>' |
| 268 | 268 | . _T('plugin_info_plugins_dist_1', ['plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST)]) |
| 269 | - . '<br />' . _T('plugin_info_plugins_dist_2') |
|
| 269 | + . '<br />'._T('plugin_info_plugins_dist_2') |
|
| 270 | 270 | . '</p>' |
| 271 | 271 | . $liste |
| 272 | 272 | . fin_cadre_trait_couleur() |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees')); |
| 290 | 290 | $res .= '<dl>'; |
| 291 | 291 | foreach ($libs as $lib => $rep) { |
| 292 | - $res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n"; |
|
| 292 | + $res .= "<dt>$lib</dt><dd>".joli_repertoire($rep)."</dd>\n"; |
|
| 293 | 293 | } |
| 294 | 294 | $res .= '</dl>'; |
| 295 | 295 | $res .= fin_cadre_enfonce(); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $libs = []; |
| 309 | 309 | foreach (array_reverse(creer_chemin()) as $d) { |
| 310 | 310 | if ( |
| 311 | - is_dir($dir = $d . 'lib/') |
|
| 311 | + is_dir($dir = $d.'lib/') |
|
| 312 | 312 | and $t = opendir($dir) |
| 313 | 313 | ) { |
| 314 | 314 | while (($f = readdir($t)) !== false) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | if ($logo) { |
| 41 | 41 | # TODO : deprecated, a supprimer -> anciens logos IMG/artonxx.png pas en base |
| 42 | 42 | if ((is_countable($logo) ? count($logo) : 0) < 6) { |
| 43 | - spip_log('Supprimer ancien logo ' . json_encode($logo, JSON_THROW_ON_ERROR), 'logo'); |
|
| 43 | + spip_log('Supprimer ancien logo '.json_encode($logo, JSON_THROW_ON_ERROR), 'logo'); |
|
| 44 | 44 | spip_unlink($logo[0]); |
| 45 | 45 | } |
| 46 | 46 | elseif ( |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return $erreur; |
| 90 | 90 | } |
| 91 | 91 | // chercher dans la base |
| 92 | - $mode_document = 'logo' . $mode; |
|
| 92 | + $mode_document = 'logo'.$mode; |
|
| 93 | 93 | |
| 94 | 94 | include_spip('inc/documents'); |
| 95 | 95 | $erreur = ''; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $tmp_name = false; |
| 107 | 107 | if (file_exists($source)) { |
| 108 | 108 | $tmp_name = $source; |
| 109 | - } elseif (file_exists($f = determine_upload() . $source)) { |
|
| 109 | + } elseif (file_exists($f = determine_upload().$source)) { |
|
| 110 | 110 | $tmp_name = $f; |
| 111 | 111 | } |
| 112 | 112 | if (!$tmp_name) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if (!is_numeric($id_document)) { |
| 144 | 144 | $erreur = ($id_document ?: 'Erreur inconnue'); |
| 145 | - spip_log("Erreur ajout logo : $erreur pour source=" . json_encode($source, JSON_THROW_ON_ERROR), 'logo'); |
|
| 145 | + spip_log("Erreur ajout logo : $erreur pour source=".json_encode($source, JSON_THROW_ON_ERROR), 'logo'); |
|
| 146 | 146 | return $erreur; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -175,23 +175,23 @@ discard block |
||
| 175 | 175 | $GLOBALS['meta']['articles_modif'] = 'non'; |
| 176 | 176 | |
| 177 | 177 | foreach (['on', 'off'] as $mode) { |
| 178 | - $nom_base = $type . $mode; |
|
| 178 | + $nom_base = $type.$mode; |
|
| 179 | 179 | $dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG); |
| 180 | 180 | |
| 181 | - $files = glob($dir . $nom_base . '*'); |
|
| 181 | + $files = glob($dir.$nom_base.'*'); |
|
| 182 | 182 | // est-ce que c'est une nouvelle tentative de migration ? |
| 183 | 183 | // dans ce cas les logos sont deja dans IMG/logo/ |
| 184 | 184 | if (!(is_countable($files) ? count($files) : 0)) { |
| 185 | - $files = glob($dir_logos . $nom_base . '*'); |
|
| 185 | + $files = glob($dir_logos.$nom_base.'*'); |
|
| 186 | 186 | if (is_countable($files) ? count($files) : 0) { |
| 187 | 187 | // mais il faut verifier si ils ont pas deja ete migres pour tout ou partie |
| 188 | 188 | $filescheck = []; |
| 189 | 189 | foreach ($files as $file) { |
| 190 | - $short = basename(dirname($file)) . DIRECTORY_SEPARATOR . basename($file); |
|
| 190 | + $short = basename(dirname($file)).DIRECTORY_SEPARATOR.basename($file); |
|
| 191 | 191 | $filescheck[$short] = $file; |
| 192 | 192 | } |
| 193 | 193 | // trouver ceux deja migres |
| 194 | - $deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck)) . " AND mode LIKE 'logo%'"); |
|
| 194 | + $deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck))." AND mode LIKE 'logo%'"); |
|
| 195 | 195 | if (is_countable($deja) ? count($deja) : 0) { |
| 196 | 196 | $deja = array_column($deja, 'fichier'); |
| 197 | 197 | $restant = array_diff(array_keys($filescheck), $deja); |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $count = (is_countable($files) ? count($files) : 0); |
| 214 | - spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE); |
|
| 214 | + spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE); |
|
| 215 | 215 | |
| 216 | 216 | $deja = []; |
| 217 | 217 | foreach ($files as $file) { |
| 218 | - $logo = substr($file, strlen($dir . $nom_base)); |
|
| 218 | + $logo = substr($file, strlen($dir.$nom_base)); |
|
| 219 | 219 | $logo = explode('.', $logo); |
| 220 | 220 | if ( |
| 221 | 221 | is_numeric($logo[0]) |
@@ -226,16 +226,16 @@ discard block |
||
| 226 | 226 | // if no logo in base |
| 227 | 227 | if (!$logo or (is_countable($logo) ? count($logo) : 0) < 6) { |
| 228 | 228 | foreach ($formats_logos as $format) { |
| 229 | - if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) { |
|
| 229 | + if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) { |
|
| 230 | 230 | if (isset($desc['field']['date_modif'])) { |
| 231 | 231 | $date_modif = sql_getfetsel('date_modif', $table, "$_id_objet=$id_objet"); |
| 232 | 232 | } else { |
| 233 | 233 | $date_modif = null; |
| 234 | 234 | } |
| 235 | 235 | // logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre |
| 236 | - @rename($d, $dir_logos . $nom); |
|
| 236 | + @rename($d, $dir_logos.$nom); |
|
| 237 | 237 | // et on le declare comme nouveau logo |
| 238 | - logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom); |
|
| 238 | + logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom); |
|
| 239 | 239 | if ($date_modif) { |
| 240 | 240 | sql_updateq($table, ['date_modif' => $date_modif], "$_id_objet=$id_objet"); |
| 241 | 241 | } |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | // si le fichier est encore la on le move : rien a faire ici |
| 250 | 250 | // (sauf si c'est une re-migration : il est deja dans logo/ donc il bouge pas) |
| 251 | 251 | if ($dir !== $dir_logos and file_exists($file)) { |
| 252 | - @rename($file, $dir_logos_erreurs . basename($file)); |
|
| 252 | + @rename($file, $dir_logos_erreurs.basename($file)); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | $count--; |
| 256 | 256 | if ($count % 250 === 0) { |
| 257 | - spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE); |
|
| 257 | + spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ($time_limit and time() > $time_limit) { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // si spip_log() est appelé dans mes_options, toutes les constantes n'ont pas été définies |
| 41 | 41 | $logfile = |
| 42 | - ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 42 | + ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 43 | 43 | . $logname |
| 44 | 44 | . ($logsuf ?? (defined('_FILE_LOG_SUFFIX') ? _FILE_LOG_SUFFIX : '.log')); |
| 45 | 45 | |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | // Si le repertoire défini n'existe pas, poser dans tmp/ |
| 57 | 57 | if (!$test_repertoire[$d]) { |
| 58 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 58 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $rotate = 0; |
| 62 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 62 | + $pid = '(pid '.@getmypid().')'; |
|
| 63 | 63 | |
| 64 | 64 | // accepter spip_log( Array ) |
| 65 | 65 | if (!is_string($message)) { |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 75 | 75 | } |
| 76 | 76 | $fu = $debug[2]['function'] ?? ''; |
| 77 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 77 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' ' |
|
| 80 | + $m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' ' |
|
| 81 | 81 | //distinguer les logs prives et publics dans les grep |
| 82 | 82 | . $debugverb |
| 83 | 83 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $rotate-- > 0 |
| 103 | 103 | and function_exists('spip_unlink') |
| 104 | 104 | ) { |
| 105 | - spip_unlink($logfile . '.' . $rotate); |
|
| 105 | + spip_unlink($logfile.'.'.$rotate); |
|
| 106 | 106 | while ($rotate--) { |
| 107 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 107 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -303,9 +303,9 @@ |
||
| 303 | 303 | // et dans ce cas il faut verifier que l'ecriture en base a bien eu lieu a l'identique si il y a des planes dans la chaine |
| 304 | 304 | // car sinon ca casse le serialize PHP - par exemple si on est en mysql utf8 (non mb4) |
| 305 | 305 | if ($has_planes) { |
| 306 | - $check_store = sql_getfetsel('valeur', 'spip_' . $table, 'nom=' . sql_quote($casier)); |
|
| 306 | + $check_store = sql_getfetsel('valeur', 'spip_'.$table, 'nom='.sql_quote($casier)); |
|
| 307 | 307 | if ($check_store !== $serialized_store) { |
| 308 | - array_walk_recursive($store, function (&$value, $key) { |
|
| 308 | + array_walk_recursive($store, function(&$value, $key) { |
|
| 309 | 309 | if (is_string($value)) { |
| 310 | 310 | $value = utf8_noplanes($value); |
| 311 | 311 | } |
@@ -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 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | foreach ($regexp as $r => $e) { |
| 598 | 598 | $regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e)); |
| 599 | 599 | } |
| 600 | - $regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,'; |
|
| 600 | + $regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,'; |
|
| 601 | 601 | $ajouts = array_flip(explode('|', $c)); |
| 602 | 602 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 603 | 603 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 625 | 625 | // pour un tableau ce sera fait dans la prochaine boucle |
| 626 | 626 | elseif (substr($r[1], -2) != '[]') { |
| 627 | - $url[$n] = $r[1] . '=' . $u; |
|
| 627 | + $url[$n] = $r[1].'='.$u; |
|
| 628 | 628 | unset($ajouts[$r[1]]); |
| 629 | 629 | } |
| 630 | 630 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | } elseif ($testv) { |
| 646 | 646 | foreach ($ajouts as $k => $n) { |
| 647 | 647 | if (!is_array($v)) { |
| 648 | - $url[] = $k . '=' . $u; |
|
| 648 | + $url[] = $k.'='.$u; |
|
| 649 | 649 | } else { |
| 650 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 650 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 651 | 651 | foreach ($v as $w) { |
| 652 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 652 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | } |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // recomposer l'adresse |
| 662 | 662 | if ($url) { |
| 663 | - $a .= '?' . join($sep, $url); |
|
| 663 | + $a .= '?'.join($sep, $url); |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - return $a . $ancre; |
|
| 666 | + return $a.$ancre; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | translitteration($ancre) |
| 696 | 696 | ); |
| 697 | 697 | } |
| 698 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 698 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | * @return bool |
| 812 | 812 | */ |
| 813 | 813 | function test_plugin_actif($plugin) { |
| 814 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 814 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | /** |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | $value = interdire_scripts($value, -1); |
| 944 | 944 | } |
| 945 | 945 | if (!empty($options['class'])) { |
| 946 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 946 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 947 | 947 | } |
| 948 | 948 | $text = str_replace("@$name@", $value, $text); |
| 949 | 949 | unset($args[$name]); |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | // Si des variables n'ont pas ete inserees, le signaler |
| 953 | 953 | // (chaines de langues pas a jour) |
| 954 | 954 | if ($args) { |
| 955 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 955 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | 958 | |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | function joli_repertoire($rep) { |
| 977 | 977 | $a = substr($rep, 0, 1); |
| 978 | 978 | if ($a <> '.' and $a <> '/') { |
| 979 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 979 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 980 | 980 | } |
| 981 | 981 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 982 | 982 | |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $p -= ($x * 1000); |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1033 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | if ($taches and count($taches) and !spip_connect()) { |
| 1098 | 1098 | return false; |
| 1099 | 1099 | } |
| 1100 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1100 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1101 | 1101 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1102 | 1102 | return $genie($taches); |
| 1103 | 1103 | } |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | |
| 1202 | 1202 | if ($queue_next_job_time == -1) { |
| 1203 | 1203 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1204 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1204 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1205 | 1205 | } |
| 1206 | 1206 | // utiliser un cache memoire si dispo |
| 1207 | 1207 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1270,8 +1270,8 @@ discard block |
||
| 1270 | 1270 | $src = ''; |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($script) { |
| 1273 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1274 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1273 | + $script = ("/*<![CDATA[*/\n". |
|
| 1274 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1275 | 1275 | '/*]]>*/'); |
| 1276 | 1276 | } |
| 1277 | 1277 | if ($noscript) { |
@@ -1357,13 +1357,13 @@ discard block |
||
| 1357 | 1357 | if ($path_base == null) { |
| 1358 | 1358 | // Chemin standard depuis l'espace public |
| 1359 | 1359 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1360 | - _DIR_RACINE . ':' . |
|
| 1361 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1362 | - _DIR_RACINE . 'prive/:' . |
|
| 1360 | + _DIR_RACINE.':'. |
|
| 1361 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1362 | + _DIR_RACINE.'prive/:'. |
|
| 1363 | 1363 | _DIR_RESTREINT; |
| 1364 | 1364 | // Ajouter squelettes/ |
| 1365 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1366 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1365 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1366 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1367 | 1367 | } |
| 1368 | 1368 | foreach (explode(':', $path) as $dir) { |
| 1369 | 1369 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | // Et le(s) dossier(s) des squelettes nommes |
| 1376 | 1376 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1377 | 1377 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1378 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1378 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | } |
| 1381 | 1381 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | |
| 1387 | 1387 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1388 | 1388 | $tete = ''; |
| 1389 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1389 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1390 | 1390 | $tete = array_shift($path_base); |
| 1391 | 1391 | } |
| 1392 | 1392 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | // Et le(s) dossier(s) des squelettes nommes |
| 1408 | 1408 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1409 | 1409 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1410 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1410 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1411 | 1411 | } |
| 1412 | 1412 | } |
| 1413 | 1413 | |
@@ -1478,14 +1478,14 @@ discard block |
||
| 1478 | 1478 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1479 | 1479 | if ( |
| 1480 | 1480 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1481 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1481 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1482 | 1482 | and $f = find_in_theme("$file_svg_generique") |
| 1483 | 1483 | ) { |
| 1484 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1484 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1485 | 1485 | return $themefiles["$subdir$file"] = $fsize; |
| 1486 | 1486 | } |
| 1487 | 1487 | else { |
| 1488 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1488 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1489 | 1489 | } |
| 1490 | 1490 | } |
| 1491 | 1491 | |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | return $themefiles["$subdir$file"] = $f; |
| 1496 | 1496 | } |
| 1497 | 1497 | } |
| 1498 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1498 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1499 | 1499 | |
| 1500 | 1500 | return $themefiles["$subdir$file"] = ''; |
| 1501 | 1501 | } |
@@ -1603,8 +1603,8 @@ discard block |
||
| 1603 | 1603 | return false; |
| 1604 | 1604 | } |
| 1605 | 1605 | if ($include and !isset($inc[$dirname][$file])) { |
| 1606 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1607 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1606 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1607 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1617,14 +1617,14 @@ discard block |
||
| 1617 | 1617 | } |
| 1618 | 1618 | |
| 1619 | 1619 | foreach (creer_chemin() as $dir) { |
| 1620 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1621 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1620 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1621 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1622 | 1622 | } |
| 1623 | 1623 | if ($dirs[$a]) { |
| 1624 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1624 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1625 | 1625 | if ($include and !isset($inc[$dirname][$file])) { |
| 1626 | - include_once _ROOT_CWD . $a; |
|
| 1627 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1626 | + include_once _ROOT_CWD.$a; |
|
| 1627 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | if (!defined('_SAUVER_CHEMIN')) { |
| 1630 | 1630 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1634,7 +1634,7 @@ discard block |
||
| 1634 | 1634 | define('_SAUVER_CHEMIN', true); |
| 1635 | 1635 | } |
| 1636 | 1636 | |
| 1637 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1637 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | } |
| 1640 | 1640 | } |
@@ -1660,7 +1660,7 @@ discard block |
||
| 1660 | 1660 | define('_SAUVER_CHEMIN', true); |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1663 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | function clear_path_cache() { |
@@ -1730,12 +1730,12 @@ discard block |
||
| 1730 | 1730 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1731 | 1731 | // on a pas encore inclus flock.php |
| 1732 | 1732 | if (!function_exists('preg_files')) { |
| 1733 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1733 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 | // Parcourir le chemin |
| 1737 | 1737 | foreach (creer_chemin() as $d) { |
| 1738 | - $f = $d . $dir; |
|
| 1738 | + $f = $d.$dir; |
|
| 1739 | 1739 | if (@is_dir($f)) { |
| 1740 | 1740 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1741 | 1741 | foreach ($liste as $chemin) { |
@@ -1785,9 +1785,9 @@ discard block |
||
| 1785 | 1785 | if ($type === 'defaut') { |
| 1786 | 1786 | $objet = objet_type($quoi); |
| 1787 | 1787 | if ( |
| 1788 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1788 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1789 | 1789 | // deprecated |
| 1790 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1790 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1791 | 1791 | ) { |
| 1792 | 1792 | return $f; |
| 1793 | 1793 | } |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | 1802 | // inclure le module d'url |
| 1803 | - include_spip('urls/' . $url_type); |
|
| 1803 | + include_spip('urls/'.$url_type); |
|
| 1804 | 1804 | |
| 1805 | 1805 | switch ($quoi) { |
| 1806 | 1806 | case 'page': |
@@ -1954,8 +1954,8 @@ discard block |
||
| 1954 | 1954 | include_spip('base/connect_sql'); |
| 1955 | 1955 | $id_type = id_table_objet($entite, $public); |
| 1956 | 1956 | |
| 1957 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1958 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1957 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1958 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1959 | 1959 | . (!$args ? '' : "&$args") |
| 1960 | 1960 | . (!$ancre ? '' : "#$ancre"); |
| 1961 | 1961 | } |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | !empty($_SERVER['QUERY_STRING']) |
| 2131 | 2131 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2132 | 2132 | ) { |
| 2133 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2133 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2134 | 2134 | } |
| 2135 | 2135 | } |
| 2136 | 2136 | } |
@@ -2168,9 +2168,9 @@ discard block |
||
| 2168 | 2168 | array_shift($myself); |
| 2169 | 2169 | $myself = implode('/', $myself); |
| 2170 | 2170 | } |
| 2171 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2171 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2172 | 2172 | |
| 2173 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2173 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2174 | 2174 | |
| 2175 | 2175 | return $url; |
| 2176 | 2176 | } |
@@ -2209,16 +2209,16 @@ discard block |
||
| 2209 | 2209 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2210 | 2210 | $script ??= ''; |
| 2211 | 2211 | if (!$rel) { |
| 2212 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2212 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2213 | 2213 | } else { |
| 2214 | 2214 | if (!is_string($rel)) { |
| 2215 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2215 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2216 | 2216 | } |
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | 2219 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2220 | 2220 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2221 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2221 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2222 | 2222 | } elseif ($args) { |
| 2223 | 2223 | $args = "?$args"; |
| 2224 | 2224 | } |
@@ -2226,7 +2226,7 @@ discard block |
||
| 2226 | 2226 | $args .= "#$ancre"; |
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2229 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2230 | 2230 | } |
| 2231 | 2231 | |
| 2232 | 2232 | // |
@@ -2308,10 +2308,10 @@ discard block |
||
| 2308 | 2308 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2309 | 2309 | } |
| 2310 | 2310 | if ($args) { |
| 2311 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2311 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2312 | 2312 | } |
| 2313 | 2313 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2314 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2314 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | if (!$no_entities) { |
@@ -2323,7 +2323,7 @@ discard block |
||
| 2323 | 2323 | |
| 2324 | 2324 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2325 | 2325 | |
| 2326 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2326 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | 2329 | // Pour les formulaires en methode POST, |
@@ -2358,8 +2358,7 @@ discard block |
||
| 2358 | 2358 | . "><div>\n" |
| 2359 | 2359 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2360 | 2360 | . $corps |
| 2361 | - . (!$submit ? '' : |
|
| 2362 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2361 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2363 | 2362 | . "</div></form>\n"; |
| 2364 | 2363 | } |
| 2365 | 2364 | |
@@ -2384,14 +2383,14 @@ discard block |
||
| 2384 | 2383 | ? generer_url_ecrire(_request('exec')) |
| 2385 | 2384 | : generer_url_public(); |
| 2386 | 2385 | |
| 2387 | - return "\n<form action='" . |
|
| 2388 | - $h . |
|
| 2389 | - "'" . |
|
| 2390 | - $atts . |
|
| 2391 | - ">\n" . |
|
| 2392 | - '<div>' . |
|
| 2393 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2394 | - $corps . |
|
| 2386 | + return "\n<form action='". |
|
| 2387 | + $h. |
|
| 2388 | + "'". |
|
| 2389 | + $atts. |
|
| 2390 | + ">\n". |
|
| 2391 | + '<div>'. |
|
| 2392 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2393 | + $corps. |
|
| 2395 | 2394 | '</div></form>'; |
| 2396 | 2395 | } |
| 2397 | 2396 | |
@@ -2419,7 +2418,7 @@ discard block |
||
| 2419 | 2418 | : generer_url_public('', '', false, false); |
| 2420 | 2419 | $url = parametre_url($url, 'action', $script); |
| 2421 | 2420 | if ($args) { |
| 2422 | - $url .= quote_amp('&' . $args); |
|
| 2421 | + $url .= quote_amp('&'.$args); |
|
| 2423 | 2422 | } |
| 2424 | 2423 | |
| 2425 | 2424 | if ($no_entities) { |
@@ -2453,9 +2452,9 @@ discard block |
||
| 2453 | 2452 | } |
| 2454 | 2453 | $url = |
| 2455 | 2454 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2456 | - . $script . '/' |
|
| 2455 | + . $script.'/' |
|
| 2457 | 2456 | . ($path ? trim($path, '/') : '') |
| 2458 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2457 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2459 | 2458 | |
| 2460 | 2459 | if ($no_entities) { |
| 2461 | 2460 | $url = str_replace('&', '&', $url); |
@@ -2504,17 +2503,17 @@ discard block |
||
| 2504 | 2503 | |
| 2505 | 2504 | // le nom du repertoire plugins/ activables/desactivables |
| 2506 | 2505 | if (!defined('_DIR_PLUGINS')) { |
| 2507 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2506 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2508 | 2507 | } |
| 2509 | 2508 | |
| 2510 | 2509 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2511 | 2510 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2512 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2511 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2513 | 2512 | } |
| 2514 | 2513 | |
| 2515 | 2514 | // le nom du repertoire des librairies |
| 2516 | 2515 | if (!defined('_DIR_LIB')) { |
| 2517 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2516 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2518 | 2517 | } |
| 2519 | 2518 | |
| 2520 | 2519 | if (!defined('_DIR_IMG')) { |
@@ -2524,29 +2523,29 @@ discard block |
||
| 2524 | 2523 | define('_DIR_LOGOS', $pa); |
| 2525 | 2524 | } |
| 2526 | 2525 | if (!defined('_DIR_IMG_ICONES')) { |
| 2527 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2526 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2528 | 2527 | } |
| 2529 | 2528 | |
| 2530 | 2529 | if (!defined('_DIR_DUMP')) { |
| 2531 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2530 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | if (!defined('_DIR_SESSIONS')) { |
| 2534 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2533 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2535 | 2534 | } |
| 2536 | 2535 | if (!defined('_DIR_TRANSFERT')) { |
| 2537 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2536 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2538 | 2537 | } |
| 2539 | 2538 | if (!defined('_DIR_CACHE')) { |
| 2540 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2539 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2541 | 2540 | } |
| 2542 | 2541 | if (!defined('_DIR_CACHE_XML')) { |
| 2543 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2542 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2544 | 2543 | } |
| 2545 | 2544 | if (!defined('_DIR_SKELS')) { |
| 2546 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2545 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2547 | 2546 | } |
| 2548 | 2547 | if (!defined('_DIR_AIDE')) { |
| 2549 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2548 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2550 | 2549 | } |
| 2551 | 2550 | if (!defined('_DIR_TMP')) { |
| 2552 | 2551 | define('_DIR_TMP', $ti); |
@@ -2575,27 +2574,27 @@ discard block |
||
| 2575 | 2574 | // Declaration des fichiers |
| 2576 | 2575 | |
| 2577 | 2576 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2578 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2577 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2579 | 2578 | } |
| 2580 | 2579 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2581 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2580 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2582 | 2581 | } |
| 2583 | 2582 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2584 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2583 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2585 | 2584 | } |
| 2586 | 2585 | if (!defined('_CACHE_PIPELINES')) { |
| 2587 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2586 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2588 | 2587 | } |
| 2589 | 2588 | if (!defined('_CACHE_CHEMIN')) { |
| 2590 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2589 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2591 | 2590 | } |
| 2592 | 2591 | |
| 2593 | 2592 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2594 | 2593 | if (!defined('_FILE_META')) { |
| 2595 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2594 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2596 | 2595 | } |
| 2597 | 2596 | if (!defined('_DIR_LOG')) { |
| 2598 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2597 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2599 | 2598 | } |
| 2600 | 2599 | if (!defined('_FILE_LOG')) { |
| 2601 | 2600 | define('_FILE_LOG', 'spip'); |
@@ -2612,8 +2611,8 @@ discard block |
||
| 2612 | 2611 | if (!defined('_FILE_CONNECT')) { |
| 2613 | 2612 | define( |
| 2614 | 2613 | '_FILE_CONNECT', |
| 2615 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2616 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2614 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2615 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2617 | 2616 | : false)) |
| 2618 | 2617 | ); |
| 2619 | 2618 | } |
@@ -2625,7 +2624,7 @@ discard block |
||
| 2625 | 2624 | if (!defined('_FILE_CHMOD')) { |
| 2626 | 2625 | define( |
| 2627 | 2626 | '_FILE_CHMOD', |
| 2628 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2627 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2629 | 2628 | : false) |
| 2630 | 2629 | ); |
| 2631 | 2630 | } |
@@ -2638,10 +2637,10 @@ discard block |
||
| 2638 | 2637 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2639 | 2638 | } |
| 2640 | 2639 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2641 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2640 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2642 | 2641 | } |
| 2643 | 2642 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2644 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2643 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2645 | 2644 | } |
| 2646 | 2645 | |
| 2647 | 2646 | // Definition des droits d'acces en ecriture |
@@ -2659,13 +2658,13 @@ discard block |
||
| 2659 | 2658 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2660 | 2659 | } |
| 2661 | 2660 | if (!defined('_ROOT_PLUGINS')) { |
| 2662 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2661 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2663 | 2662 | } |
| 2664 | 2663 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2665 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2664 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2666 | 2665 | } |
| 2667 | 2666 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2668 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2667 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2669 | 2668 | } |
| 2670 | 2669 | |
| 2671 | 2670 | // La taille des Log |
@@ -2702,7 +2701,7 @@ discard block |
||
| 2702 | 2701 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2703 | 2702 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2704 | 2703 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2705 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2704 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2706 | 2705 | |
| 2707 | 2706 | // charger tout de suite le path et son cache |
| 2708 | 2707 | load_path_cache(); |
@@ -2738,7 +2737,7 @@ discard block |
||
| 2738 | 2737 | !empty($_SERVER['QUERY_STRING']) |
| 2739 | 2738 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2740 | 2739 | ) { |
| 2741 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2740 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2742 | 2741 | } |
| 2743 | 2742 | } |
| 2744 | 2743 | |
@@ -2774,7 +2773,7 @@ discard block |
||
| 2774 | 2773 | ) { |
| 2775 | 2774 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2776 | 2775 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2777 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2776 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2778 | 2777 | } else { |
| 2779 | 2778 | $uri_ref = ''; |
| 2780 | 2779 | } |
@@ -2868,7 +2867,7 @@ discard block |
||
| 2868 | 2867 | } |
| 2869 | 2868 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2870 | 2869 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2871 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2870 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2872 | 2871 | } |
| 2873 | 2872 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2874 | 2873 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3090,7 +3089,7 @@ discard block |
||
| 3090 | 3089 | } |
| 3091 | 3090 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3092 | 3091 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3093 | - . ' ' . _VAR_MODE); |
|
| 3092 | + . ' '._VAR_MODE); |
|
| 3094 | 3093 | } |
| 3095 | 3094 | } // pas autorise ? |
| 3096 | 3095 | else { |
@@ -3105,7 +3104,7 @@ discard block |
||
| 3105 | 3104 | if (strpos($self, 'page=login') === false) { |
| 3106 | 3105 | include_spip('inc/headers'); |
| 3107 | 3106 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3108 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3107 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3109 | 3108 | } |
| 3110 | 3109 | } |
| 3111 | 3110 | // sinon tant pis |
@@ -3155,10 +3154,10 @@ discard block |
||
| 3155 | 3154 | **/ |
| 3156 | 3155 | function verifier_visiteur() { |
| 3157 | 3156 | @spip_initialisation_core( |
| 3158 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3159 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3160 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3161 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3157 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3158 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3159 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3160 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3162 | 3161 | ); |
| 3163 | 3162 | |
| 3164 | 3163 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3191,7 +3190,7 @@ discard block |
||
| 3191 | 3190 | } |
| 3192 | 3191 | |
| 3193 | 3192 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3194 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3193 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3195 | 3194 | $session = charger_fonction('session', 'inc'); |
| 3196 | 3195 | if ($session()) { |
| 3197 | 3196 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3271,7 +3270,7 @@ discard block |
||
| 3271 | 3270 | 'definir_session', |
| 3272 | 3271 | $GLOBALS['visiteur_session'] |
| 3273 | 3272 | ? serialize($GLOBALS['visiteur_session']) |
| 3274 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3273 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3275 | 3274 | : '' |
| 3276 | 3275 | ); |
| 3277 | 3276 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3319,8 +3318,8 @@ discard block |
||
| 3319 | 3318 | foreach ($cookies_masques as $k) { |
| 3320 | 3319 | if (!empty($_COOKIE[$k])) { |
| 3321 | 3320 | $cookies_backup[$k] = $_COOKIE[$k]; |
| 3322 | - $_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3323 | - $_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3321 | + $_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3322 | + $_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3324 | 3323 | $_COOKIE[$k] = $mask; |
| 3325 | 3324 | } |
| 3326 | 3325 | } |
@@ -3438,11 +3437,11 @@ discard block |
||
| 3438 | 3437 | $GLOBALS['_INC_PUBLIC']++; |
| 3439 | 3438 | |
| 3440 | 3439 | // fix #4235 |
| 3441 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3440 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3442 | 3441 | |
| 3443 | 3442 | |
| 3444 | 3443 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3445 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3444 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3446 | 3445 | |
| 3447 | 3446 | $page = evaluer_fond($f, $contexte, $connect); |
| 3448 | 3447 | if ($page === '') { |
@@ -3527,7 +3526,7 @@ discard block |
||
| 3527 | 3526 | * @return array|string |
| 3528 | 3527 | */ |
| 3529 | 3528 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3530 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3529 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3531 | 3530 | if (!$pathinfo) { |
| 3532 | 3531 | return $f; |
| 3533 | 3532 | } |