@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | if (strlen($dossier) && !str_ends_with($dossier, '/')) { |
| 53 | 53 | $dossier .= '/'; |
| 54 | 54 | } |
| 55 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 55 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 56 | 56 | |
| 57 | 57 | if (function_exists($f)) { |
| 58 | 58 | return $f; |
| 59 | 59 | } |
| 60 | - if (function_exists($g = $f . '_dist')) { |
|
| 60 | + if (function_exists($g = $f.'_dist')) { |
|
| 61 | 61 | return $g; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | // passer en minuscules (cf les balises de formulaires) |
| 79 | 79 | // et inclure le fichier |
| 80 | 80 | if ( |
| 81 | - !($inc = include_spip($dossier . ($d = strtolower($nom)))) |
|
| 81 | + !($inc = include_spip($dossier.($d = strtolower($nom)))) |
|
| 82 | 82 | && strlen(dirname($dossier)) |
| 83 | 83 | && dirname($dossier) != '.' |
| 84 | 84 | ) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Echec : message d'erreur |
| 99 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 99 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 100 | 100 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 101 | 101 | |
| 102 | 102 | include_spip('inc/minipres'); |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | echo minipres( |
| 105 | 105 | _T('forum_titre_erreur'), |
| 106 | 106 | $inc ? |
| 107 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 107 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 108 | 108 | . '<br />' |
| 109 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 109 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 110 | 110 | : |
| 111 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 112 | - ['all_inline' => true,'status' => 404] |
|
| 111 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 112 | + ['all_inline' => true, 'status' => 404] |
|
| 113 | 113 | ); |
| 114 | 114 | exit; |
| 115 | 115 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * - string : chemin du fichier trouvé |
| 156 | 156 | **/ |
| 157 | 157 | function include_spip($f, $include = true) { |
| 158 | - return find_in_path($f . '.php', '', $include); |
|
| 158 | + return find_in_path($f.'.php', '', $include); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * - string : chemin du fichier trouvé |
| 176 | 176 | **/ |
| 177 | 177 | function require_spip($f) { |
| 178 | - return find_in_path($f . '.php', '', 'required'); |
|
| 178 | + return find_in_path($f.'.php', '', 'required'); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | // donc il faut l'inclure "en globals" |
| 193 | 193 | if ($f = find_in_path('mes_fonctions.php')) { |
| 194 | 194 | global $dossier_squelettes; |
| 195 | - include_once(_ROOT_CWD . $f); |
|
| 195 | + include_once(_ROOT_CWD.$f); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | // appliquer notre fonction si elle existe |
| 300 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 300 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 301 | 301 | if (function_exists($fonc)) { |
| 302 | 302 | $val = $fonc($val); |
| 303 | 303 | } // plantage ? |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | function spip_log($message = null, $name = null) { |
| 363 | 363 | static $pre = []; |
| 364 | 364 | static $log; |
| 365 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 365 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 366 | 366 | if (!isset($regs[1]) || !$logname = $regs[1]) { |
| 367 | 367 | $logname = null; |
| 368 | 368 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (!is_string($message)) { |
| 391 | 391 | $message = print_r($message, true); |
| 392 | 392 | } |
| 393 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 393 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -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 (!str_ends_with($r[1], '[]')) { |
| 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 = (str_ends_with($k, '[]')) ? $k : ($k . '[]'); |
|
| 650 | + $id = (str_ends_with($k, '[]')) ? $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 | /** |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | translitteration($ancre) |
| 694 | 694 | ); |
| 695 | 695 | } |
| 696 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 696 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | if (str_starts_with($var, '^')) { |
| 739 | 739 | $var = substr($var, 1); |
| 740 | 740 | } else { |
| 741 | - $var = '[^=&]*' . $var; |
|
| 741 | + $var = '[^=&]*'.$var; |
|
| 742 | 742 | } |
| 743 | 743 | if (str_ends_with($var, '$')) { |
| 744 | 744 | $var = substr($var, 0, -1); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $var .= '[^=&]*'; |
| 747 | 747 | } |
| 748 | 748 | } |
| 749 | - $preg_nettoyer = ',([?&])(' . implode('|', $preg_nettoyer_vars) . ')=[^&]*(&|$),i'; |
|
| 749 | + $preg_nettoyer = ',([?&])('.implode('|', $preg_nettoyer_vars).')=[^&]*(&|$),i'; |
|
| 750 | 750 | } |
| 751 | 751 | if (empty($request_uri)) { |
| 752 | 752 | return $request_uri; |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | * @return bool |
| 834 | 834 | */ |
| 835 | 835 | function test_plugin_actif($plugin) { |
| 836 | - return ($plugin && defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 836 | + return ($plugin && defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | /** |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | $value = interdire_scripts($value, -1); |
| 966 | 966 | } |
| 967 | 967 | if (!empty($options['class'])) { |
| 968 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 968 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 969 | 969 | } |
| 970 | 970 | $text = str_replace("@$name@", (string) $value, (string) $text); |
| 971 | 971 | unset($args[$name]); |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | // Si des variables n'ont pas ete inserees, le signaler |
| 975 | 975 | // (chaines de langues pas a jour) |
| 976 | 976 | if ($args) { |
| 977 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 977 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 978 | 978 | } |
| 979 | 979 | } |
| 980 | 980 | |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | function joli_repertoire($rep) { |
| 999 | 999 | $a = substr($rep, 0, 1); |
| 1000 | 1000 | if ($a <> '.' && $a <> '/') { |
| 1001 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 1001 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 1002 | 1002 | } |
| 1003 | 1003 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 1004 | 1004 | |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | $p -= ($x * 1000); |
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1055 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1056 | 1056 | } |
| 1057 | 1057 | } |
| 1058 | 1058 | |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | if ($taches && count($taches) && !spip_connect()) { |
| 1120 | 1120 | return false; |
| 1121 | 1121 | } |
| 1122 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1122 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1123 | 1123 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1124 | 1124 | return $genie($taches); |
| 1125 | 1125 | } |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | |
| 1223 | 1223 | if ($queue_next_job_time == -1) { |
| 1224 | 1224 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1225 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1225 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1226 | 1226 | } |
| 1227 | 1227 | // utiliser un cache memoire si dispo |
| 1228 | 1228 | if (function_exists('cache_get') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) { |
@@ -1292,8 +1292,8 @@ discard block |
||
| 1292 | 1292 | $src = ''; |
| 1293 | 1293 | } |
| 1294 | 1294 | if ($script) { |
| 1295 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1296 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1295 | + $script = ("/*<![CDATA[*/\n". |
|
| 1296 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1297 | 1297 | '/*]]>*/'); |
| 1298 | 1298 | } |
| 1299 | 1299 | if ($noscript) { |
@@ -1382,13 +1382,13 @@ discard block |
||
| 1382 | 1382 | if ($path_base == null) { |
| 1383 | 1383 | // Chemin standard depuis l'espace public |
| 1384 | 1384 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1385 | - _DIR_RACINE . ':' . |
|
| 1386 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1387 | - _DIR_RACINE . 'prive/:' . |
|
| 1385 | + _DIR_RACINE.':'. |
|
| 1386 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1387 | + _DIR_RACINE.'prive/:'. |
|
| 1388 | 1388 | _DIR_RESTREINT; |
| 1389 | 1389 | // Ajouter squelettes/ |
| 1390 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1391 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1390 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1391 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1392 | 1392 | } |
| 1393 | 1393 | foreach (explode(':', $path) as $dir) { |
| 1394 | 1394 | if (strlen($dir) && !str_ends_with($dir, '/')) { |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | // Et le(s) dossier(s) des squelettes nommes |
| 1401 | 1401 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1402 | 1402 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1403 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1403 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1404 | 1404 | } |
| 1405 | 1405 | } |
| 1406 | 1406 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | |
| 1412 | 1412 | if (is_array($dir_path) || strlen($dir_path)) { |
| 1413 | 1413 | $tete = ''; |
| 1414 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1414 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1415 | 1415 | $tete = array_shift($path_base); |
| 1416 | 1416 | } |
| 1417 | 1417 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1432,7 +1432,7 @@ discard block |
||
| 1432 | 1432 | // Et le(s) dossier(s) des squelettes nommes |
| 1433 | 1433 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1434 | 1434 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1435 | - array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1435 | + array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1436 | 1436 | } |
| 1437 | 1437 | } |
| 1438 | 1438 | |
@@ -1508,14 +1508,14 @@ discard block |
||
| 1508 | 1508 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1509 | 1509 | if ( |
| 1510 | 1510 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1511 | - && ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg') |
|
| 1511 | + && ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg') |
|
| 1512 | 1512 | && ($f = find_in_theme("$file_svg_generique")) |
| 1513 | 1513 | ) { |
| 1514 | - if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) { |
|
| 1514 | + if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) { |
|
| 1515 | 1515 | return $themefiles["$subdir$file"] = $fsize; |
| 1516 | 1516 | } |
| 1517 | 1517 | else { |
| 1518 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1518 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1519 | 1519 | } |
| 1520 | 1520 | } |
| 1521 | 1521 | |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | return $themefiles["$subdir$file"] = $f; |
| 1526 | 1526 | } |
| 1527 | 1527 | } |
| 1528 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1528 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1529 | 1529 | |
| 1530 | 1530 | return $themefiles["$subdir$file"] = ''; |
| 1531 | 1531 | } |
@@ -1633,8 +1633,8 @@ discard block |
||
| 1633 | 1633 | return false; |
| 1634 | 1634 | } |
| 1635 | 1635 | if ($include && !isset($inc[$dirname][$file])) { |
| 1636 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1637 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1636 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1637 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1647,14 +1647,14 @@ discard block |
||
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | foreach (creer_chemin() as $dir) { |
| 1650 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1651 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1650 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1651 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1652 | 1652 | } |
| 1653 | 1653 | if ($dirs[$a]) { |
| 1654 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1654 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1655 | 1655 | if ($include && !isset($inc[$dirname][$file])) { |
| 1656 | - include_once _ROOT_CWD . $a; |
|
| 1657 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1656 | + include_once _ROOT_CWD.$a; |
|
| 1657 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1658 | 1658 | } |
| 1659 | 1659 | if (!defined('_SAUVER_CHEMIN')) { |
| 1660 | 1660 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1664,7 +1664,7 @@ discard block |
||
| 1664 | 1664 | define('_SAUVER_CHEMIN', true); |
| 1665 | 1665 | } |
| 1666 | 1666 | |
| 1667 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1667 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1668 | 1668 | } |
| 1669 | 1669 | } |
| 1670 | 1670 | } |
@@ -1690,7 +1690,7 @@ discard block |
||
| 1690 | 1690 | define('_SAUVER_CHEMIN', true); |
| 1691 | 1691 | } |
| 1692 | 1692 | |
| 1693 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1693 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | 1696 | function clear_path_cache() { |
@@ -1760,12 +1760,12 @@ discard block |
||
| 1760 | 1760 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1761 | 1761 | // on a pas encore inclus flock.php |
| 1762 | 1762 | if (!function_exists('preg_files')) { |
| 1763 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1763 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1764 | 1764 | } |
| 1765 | 1765 | |
| 1766 | 1766 | // Parcourir le chemin |
| 1767 | 1767 | foreach (creer_chemin() as $d) { |
| 1768 | - $f = $d . $dir; |
|
| 1768 | + $f = $d.$dir; |
|
| 1769 | 1769 | if (@is_dir($f)) { |
| 1770 | 1770 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1771 | 1771 | foreach ($liste as $chemin) { |
@@ -1817,8 +1817,8 @@ discard block |
||
| 1817 | 1817 | if ($type === 'defaut') { |
| 1818 | 1818 | $objet = objet_type($quoi); |
| 1819 | 1819 | if ( |
| 1820 | - ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true)) |
|
| 1821 | - || ($f = charger_fonction('generer_url_' . $objet, 'urls', true)) // deprecated |
|
| 1820 | + ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true)) |
|
| 1821 | + || ($f = charger_fonction('generer_url_'.$objet, 'urls', true)) // deprecated |
|
| 1822 | 1822 | ) { |
| 1823 | 1823 | return $f; |
| 1824 | 1824 | } |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | } |
| 1832 | 1832 | |
| 1833 | 1833 | // inclure le module d'url |
| 1834 | - include_spip('urls/' . $url_type); |
|
| 1834 | + include_spip('urls/'.$url_type); |
|
| 1835 | 1835 | |
| 1836 | 1836 | switch ($quoi) { |
| 1837 | 1837 | case 'page': |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | } |
| 1932 | 1932 | |
| 1933 | 1933 | // On a ete gentil mais la .... |
| 1934 | - spip_log("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect", _LOG_ERREUR); |
|
| 1934 | + spip_log("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect", _LOG_ERREUR); |
|
| 1935 | 1935 | |
| 1936 | 1936 | return ''; |
| 1937 | 1937 | } |
@@ -1982,8 +1982,8 @@ discard block |
||
| 1982 | 1982 | include_spip('base/connect_sql'); |
| 1983 | 1983 | $id_type = id_table_objet($entite, $public); |
| 1984 | 1984 | |
| 1985 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1986 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1985 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1986 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1987 | 1987 | . (!$args ? '' : "&$args") |
| 1988 | 1988 | . (!$ancre ? '' : "#$ancre"); |
| 1989 | 1989 | } |
@@ -2152,7 +2152,7 @@ discard block |
||
| 2152 | 2152 | !empty($_SERVER['QUERY_STRING']) |
| 2153 | 2153 | && !str_contains($_SERVER['REQUEST_URI'], '?') |
| 2154 | 2154 | ) { |
| 2155 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2155 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2156 | 2156 | } |
| 2157 | 2157 | } |
| 2158 | 2158 | } |
@@ -2190,9 +2190,9 @@ discard block |
||
| 2190 | 2190 | array_shift($myself); |
| 2191 | 2191 | $myself = implode('/', $myself); |
| 2192 | 2192 | } |
| 2193 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2193 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2194 | 2194 | |
| 2195 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2195 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2196 | 2196 | |
| 2197 | 2197 | return $url; |
| 2198 | 2198 | } |
@@ -2231,16 +2231,16 @@ discard block |
||
| 2231 | 2231 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2232 | 2232 | $script ??= ''; |
| 2233 | 2233 | if (!$rel) { |
| 2234 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2234 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2235 | 2235 | } else { |
| 2236 | 2236 | if (!is_string($rel)) { |
| 2237 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2237 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2238 | 2238 | } |
| 2239 | 2239 | } |
| 2240 | 2240 | |
| 2241 | 2241 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2242 | 2242 | if ($script && ($script <> 'accueil' || $rel)) { |
| 2243 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2243 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2244 | 2244 | } elseif ($args) { |
| 2245 | 2245 | $args = "?$args"; |
| 2246 | 2246 | } |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | $args .= "#$ancre"; |
| 2249 | 2249 | } |
| 2250 | 2250 | |
| 2251 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2251 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2252 | 2252 | } |
| 2253 | 2253 | |
| 2254 | 2254 | // |
@@ -2330,10 +2330,10 @@ discard block |
||
| 2330 | 2330 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2331 | 2331 | } |
| 2332 | 2332 | if ($args) { |
| 2333 | - $action .= (str_contains($action, '?') ? '&' : '?') . $args; |
|
| 2333 | + $action .= (str_contains($action, '?') ? '&' : '?').$args; |
|
| 2334 | 2334 | } |
| 2335 | 2335 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2336 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2336 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2337 | 2337 | } |
| 2338 | 2338 | |
| 2339 | 2339 | if (!$no_entities) { |
@@ -2345,7 +2345,7 @@ discard block |
||
| 2345 | 2345 | |
| 2346 | 2346 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2347 | 2347 | |
| 2348 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2348 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2349 | 2349 | } |
| 2350 | 2350 | |
| 2351 | 2351 | // Pour les formulaires en methode POST, |
@@ -2380,8 +2380,7 @@ discard block |
||
| 2380 | 2380 | . "><div>\n" |
| 2381 | 2381 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2382 | 2382 | . $corps |
| 2383 | - . (!$submit ? '' : |
|
| 2384 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2383 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2385 | 2384 | . "</div></form>\n"; |
| 2386 | 2385 | } |
| 2387 | 2386 | |
@@ -2406,14 +2405,14 @@ discard block |
||
| 2406 | 2405 | ? generer_url_ecrire(_request('exec')) |
| 2407 | 2406 | : generer_url_public(); |
| 2408 | 2407 | |
| 2409 | - return "\n<form action='" . |
|
| 2410 | - $h . |
|
| 2411 | - "'" . |
|
| 2412 | - $atts . |
|
| 2413 | - ">\n" . |
|
| 2414 | - '<div>' . |
|
| 2415 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2416 | - $corps . |
|
| 2408 | + return "\n<form action='". |
|
| 2409 | + $h. |
|
| 2410 | + "'". |
|
| 2411 | + $atts. |
|
| 2412 | + ">\n". |
|
| 2413 | + '<div>'. |
|
| 2414 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2415 | + $corps. |
|
| 2417 | 2416 | '</div></form>'; |
| 2418 | 2417 | } |
| 2419 | 2418 | |
@@ -2441,7 +2440,7 @@ discard block |
||
| 2441 | 2440 | : generer_url_public('', '', false, false); |
| 2442 | 2441 | $url = parametre_url($url, 'action', $script); |
| 2443 | 2442 | if ($args) { |
| 2444 | - $url .= quote_amp('&' . $args); |
|
| 2443 | + $url .= quote_amp('&'.$args); |
|
| 2445 | 2444 | } |
| 2446 | 2445 | |
| 2447 | 2446 | if ($no_entities) { |
@@ -2475,9 +2474,9 @@ discard block |
||
| 2475 | 2474 | } |
| 2476 | 2475 | $url = |
| 2477 | 2476 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2478 | - . $script . '/' |
|
| 2477 | + . $script.'/' |
|
| 2479 | 2478 | . ($path ? trim($path, '/') : '') |
| 2480 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2479 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2481 | 2480 | |
| 2482 | 2481 | if ($no_entities) { |
| 2483 | 2482 | $url = str_replace('&', '&', $url); |
@@ -2526,22 +2525,22 @@ discard block |
||
| 2526 | 2525 | |
| 2527 | 2526 | // le nom du repertoire plugins/ activables/desactivables |
| 2528 | 2527 | if (!defined('_DIR_PLUGINS')) { |
| 2529 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2528 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2530 | 2529 | } |
| 2531 | 2530 | |
| 2532 | 2531 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2533 | 2532 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2534 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2533 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2535 | 2534 | } |
| 2536 | 2535 | |
| 2537 | 2536 | // le nom du repertoire des librairies |
| 2538 | 2537 | if (!defined('_DIR_LIB')) { |
| 2539 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2538 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | |
| 2542 | 2541 | // répertoire des libs via Composer |
| 2543 | 2542 | if (!defined('_DIR_VENDOR')) { |
| 2544 | - define('_DIR_VENDOR', _DIR_RACINE . 'vendor/'); |
|
| 2543 | + define('_DIR_VENDOR', _DIR_RACINE.'vendor/'); |
|
| 2545 | 2544 | } |
| 2546 | 2545 | |
| 2547 | 2546 | if (!defined('_DIR_IMG')) { |
@@ -2551,29 +2550,29 @@ discard block |
||
| 2551 | 2550 | define('_DIR_LOGOS', $pa); |
| 2552 | 2551 | } |
| 2553 | 2552 | if (!defined('_DIR_IMG_ICONES')) { |
| 2554 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2553 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2555 | 2554 | } |
| 2556 | 2555 | |
| 2557 | 2556 | if (!defined('_DIR_DUMP')) { |
| 2558 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2557 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2559 | 2558 | } |
| 2560 | 2559 | if (!defined('_DIR_SESSIONS')) { |
| 2561 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2560 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2562 | 2561 | } |
| 2563 | 2562 | if (!defined('_DIR_TRANSFERT')) { |
| 2564 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2563 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2565 | 2564 | } |
| 2566 | 2565 | if (!defined('_DIR_CACHE')) { |
| 2567 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2566 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2568 | 2567 | } |
| 2569 | 2568 | if (!defined('_DIR_CACHE_XML')) { |
| 2570 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2569 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2571 | 2570 | } |
| 2572 | 2571 | if (!defined('_DIR_SKELS')) { |
| 2573 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2572 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2574 | 2573 | } |
| 2575 | 2574 | if (!defined('_DIR_AIDE')) { |
| 2576 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2575 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2577 | 2576 | } |
| 2578 | 2577 | if (!defined('_DIR_TMP')) { |
| 2579 | 2578 | define('_DIR_TMP', $ti); |
@@ -2602,27 +2601,27 @@ discard block |
||
| 2602 | 2601 | // Declaration des fichiers |
| 2603 | 2602 | |
| 2604 | 2603 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2605 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2604 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2606 | 2605 | } |
| 2607 | 2606 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2608 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2607 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2609 | 2608 | } |
| 2610 | 2609 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2611 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2610 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2612 | 2611 | } |
| 2613 | 2612 | if (!defined('_CACHE_PIPELINES')) { |
| 2614 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2613 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2615 | 2614 | } |
| 2616 | 2615 | if (!defined('_CACHE_CHEMIN')) { |
| 2617 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2616 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2618 | 2617 | } |
| 2619 | 2618 | |
| 2620 | 2619 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2621 | 2620 | if (!defined('_FILE_META')) { |
| 2622 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2621 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2623 | 2622 | } |
| 2624 | 2623 | if (!defined('_DIR_LOG')) { |
| 2625 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2624 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2626 | 2625 | } |
| 2627 | 2626 | if (!defined('_FILE_LOG')) { |
| 2628 | 2627 | define('_FILE_LOG', 'spip'); |
@@ -2638,7 +2637,7 @@ discard block |
||
| 2638 | 2637 | if (!defined('_FILE_CONNECT')) { |
| 2639 | 2638 | define( |
| 2640 | 2639 | '_FILE_CONNECT', |
| 2641 | - @is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : false |
|
| 2640 | + @is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f : false |
|
| 2642 | 2641 | ); |
| 2643 | 2642 | } |
| 2644 | 2643 | |
@@ -2649,7 +2648,7 @@ discard block |
||
| 2649 | 2648 | if (!defined('_FILE_CHMOD')) { |
| 2650 | 2649 | define( |
| 2651 | 2650 | '_FILE_CHMOD', |
| 2652 | - @is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f : false |
|
| 2651 | + @is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f : false |
|
| 2653 | 2652 | ); |
| 2654 | 2653 | } |
| 2655 | 2654 | |
@@ -2661,10 +2660,10 @@ discard block |
||
| 2661 | 2660 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2662 | 2661 | } |
| 2663 | 2662 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2664 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2663 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2665 | 2664 | } |
| 2666 | 2665 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2667 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2666 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2668 | 2667 | } |
| 2669 | 2668 | |
| 2670 | 2669 | // Definition des droits d'acces en ecriture |
@@ -2682,13 +2681,13 @@ discard block |
||
| 2682 | 2681 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2683 | 2682 | } |
| 2684 | 2683 | if (!defined('_ROOT_PLUGINS')) { |
| 2685 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2684 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2686 | 2685 | } |
| 2687 | 2686 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2688 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2687 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2689 | 2688 | } |
| 2690 | 2689 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2691 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2690 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2692 | 2691 | } |
| 2693 | 2692 | |
| 2694 | 2693 | // La taille des Log |
@@ -2725,7 +2724,7 @@ discard block |
||
| 2725 | 2724 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2726 | 2725 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2727 | 2726 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2727 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2729 | 2728 | |
| 2730 | 2729 | // charger tout de suite le path et son cache |
| 2731 | 2730 | load_path_cache(); |
@@ -2761,7 +2760,7 @@ discard block |
||
| 2761 | 2760 | !empty($_SERVER['QUERY_STRING']) |
| 2762 | 2761 | && !strpos($_SERVER['REQUEST_URI'], '?') |
| 2763 | 2762 | ) { |
| 2764 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2763 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2765 | 2764 | } |
| 2766 | 2765 | } |
| 2767 | 2766 | |
@@ -2797,7 +2796,7 @@ discard block |
||
| 2797 | 2796 | ) { |
| 2798 | 2797 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2799 | 2798 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2800 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2799 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2801 | 2800 | } else { |
| 2802 | 2801 | $uri_ref = ''; |
| 2803 | 2802 | } |
@@ -2891,7 +2890,7 @@ discard block |
||
| 2891 | 2890 | } |
| 2892 | 2891 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2893 | 2892 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2894 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2893 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2895 | 2894 | } |
| 2896 | 2895 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2897 | 2896 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3114,7 +3113,7 @@ discard block |
||
| 3114 | 3113 | } |
| 3115 | 3114 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3116 | 3115 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3117 | - . ' ' . _VAR_MODE); |
|
| 3116 | + . ' '._VAR_MODE); |
|
| 3118 | 3117 | } |
| 3119 | 3118 | } // pas autorise ? |
| 3120 | 3119 | else { |
@@ -3129,7 +3128,7 @@ discard block |
||
| 3129 | 3128 | if (!str_contains($self, 'page=login')) { |
| 3130 | 3129 | include_spip('inc/headers'); |
| 3131 | 3130 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3132 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3131 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3133 | 3132 | } |
| 3134 | 3133 | } |
| 3135 | 3134 | // sinon tant pis |
@@ -3179,10 +3178,10 @@ discard block |
||
| 3179 | 3178 | **/ |
| 3180 | 3179 | function verifier_visiteur() { |
| 3181 | 3180 | @spip_initialisation_core( |
| 3182 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3183 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3184 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3185 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3181 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3182 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3183 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3184 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3186 | 3185 | ); |
| 3187 | 3186 | |
| 3188 | 3187 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3215,7 +3214,7 @@ discard block |
||
| 3215 | 3214 | } |
| 3216 | 3215 | |
| 3217 | 3216 | $h = (isset($_SERVER['PHP_AUTH_USER']) && !$GLOBALS['ignore_auth_http']); |
| 3218 | - if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3217 | + if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3219 | 3218 | $session = charger_fonction('session', 'inc'); |
| 3220 | 3219 | if ($session()) { |
| 3221 | 3220 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3295,7 +3294,7 @@ discard block |
||
| 3295 | 3294 | if (!empty($GLOBALS['visiteur_session'])) { |
| 3296 | 3295 | include_spip('inc/session'); |
| 3297 | 3296 | $cookie = lire_cookie_session(); |
| 3298 | - $s = serialize($GLOBALS['visiteur_session']) . '_' . ($cookie ?: ''); |
|
| 3297 | + $s = serialize($GLOBALS['visiteur_session']).'_'.($cookie ?: ''); |
|
| 3299 | 3298 | } |
| 3300 | 3299 | $s = pipeline('definir_session', $s); |
| 3301 | 3300 | $session = ($s ? substr(md5($s), 0, 8) : ''); |
@@ -3343,8 +3342,8 @@ discard block |
||
| 3343 | 3342 | foreach ($cookies_masques as $k) { |
| 3344 | 3343 | if (!empty($_COOKIE[$k])) { |
| 3345 | 3344 | $cookies_backup[$k] = $_COOKIE[$k]; |
| 3346 | - $_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3347 | - $_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3345 | + $_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3346 | + $_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3348 | 3347 | $_COOKIE[$k] = $mask; |
| 3349 | 3348 | } |
| 3350 | 3349 | } |
@@ -3462,11 +3461,11 @@ discard block |
||
| 3462 | 3461 | $GLOBALS['_INC_PUBLIC']++; |
| 3463 | 3462 | |
| 3464 | 3463 | // fix #4235 |
| 3465 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3464 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3466 | 3465 | |
| 3467 | 3466 | |
| 3468 | 3467 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3469 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3468 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3470 | 3469 | |
| 3471 | 3470 | $page = evaluer_fond($f, $contexte, $connect); |
| 3472 | 3471 | if ($page === '') { |
@@ -3551,7 +3550,7 @@ discard block |
||
| 3551 | 3550 | * @return array|string |
| 3552 | 3551 | */ |
| 3553 | 3552 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3554 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3553 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3555 | 3554 | if (!$pathinfo) { |
| 3556 | 3555 | return $f; |
| 3557 | 3556 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $GLOBALS['contexte'] = calculer_contexte(); |
| 35 | 35 | $page = ['contexte_implicite' => calculer_contexte_implicite()]; |
| 36 | - $page['contexte_implicite']['cache'] = $fond . preg_replace( |
|
| 36 | + $page['contexte_implicite']['cache'] = $fond.preg_replace( |
|
| 37 | 37 | ',\.[a-zA-Z0-9]*$,', |
| 38 | 38 | '', |
| 39 | 39 | preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI']) |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($page === '') { |
| 134 | 134 | $erreur = _T( |
| 135 | 135 | 'info_erreur_squelette2', |
| 136 | - ['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES] |
|
| 136 | + ['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES] |
|
| 137 | 137 | ); |
| 138 | 138 | erreur_squelette($erreur); |
| 139 | 139 | // eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4 |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | if ( |
| 175 | 175 | $lastmodified && !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !isset($page['entetes']['Last-Modified']) |
| 176 | 176 | ) { |
| 177 | - $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT'; |
|
| 177 | + $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT'; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // fermer la connexion apres les headers si requete HEAD |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (!defined('_CONTEXTE_IGNORE_LISTE_VARIABLES')) { |
| 207 | 207 | nettoyer_uri_var(''); |
| 208 | 208 | } |
| 209 | - $preg_ignore_variables = '/(' . implode('|',_CONTEXTE_IGNORE_LISTE_VARIABLES) . ')/'; |
|
| 209 | + $preg_ignore_variables = '/('.implode('|', _CONTEXTE_IGNORE_LISTE_VARIABLES).')/'; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $contexte = []; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | 'spip_version_code' => $GLOBALS['spip_version_code'], |
| 248 | 248 | ]; |
| 249 | 249 | if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { |
| 250 | - $contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 250 | + $contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return $contexte_implicite; |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | if (is_null($id)) { |
| 585 | - $msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 585 | + $msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 586 | 586 | erreur_squelette($msg); |
| 587 | 587 | // on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant |
| 588 | 588 | $id = 0; |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | if (preg_match(',^[a-z0-9_]+$,', $soustype)) { |
| 628 | - if (!trouve_modele($fond = ($type . '_' . $soustype))) { |
|
| 628 | + if (!trouve_modele($fond = ($type.'_'.$soustype))) { |
|
| 629 | 629 | $fond = ''; |
| 630 | 630 | $class = $soustype; |
| 631 | 631 | } |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $compteur--; |
| 641 | 641 | return false; |
| 642 | 642 | } |
| 643 | - $fond = 'modeles/' . $fond; |
|
| 643 | + $fond = 'modeles/'.$fond; |
|
| 644 | 644 | // Creer le contexte |
| 645 | 645 | $contexte = $env; |
| 646 | 646 | $contexte['dir_racine'] = _DIR_RACINE; # eviter de mixer un cache racine et un cache ecrire (meme si pour l'instant les modeles ne sont pas caches, le resultat etant different il faut que le contexte en tienne compte |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | // sinon, s'il y a un lien, on l'ajoute classiquement |
| 682 | 682 | if ( |
| 683 | 683 | strstr( |
| 684 | - ' ' . ($classes = extraire_attribut($retour, 'class')) . ' ', |
|
| 684 | + ' '.($classes = extraire_attribut($retour, 'class')).' ', |
|
| 685 | 685 | 'spip_lien_ok' |
| 686 | 686 | ) |
| 687 | 687 | ) { |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | ); |
| 693 | 693 | } else { |
| 694 | 694 | if ($lien) { |
| 695 | - $retour = '<a href="' . $lien['href'] . '" class="' . $lien['class'] . '">' . $retour . '</a>'; |
|
| 695 | + $retour = '<a href="'.$lien['href'].'" class="'.$lien['class'].'">'.$retour.'</a>'; |
|
| 696 | 696 | } |
| 697 | 697 | } |
| 698 | 698 | |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | return $page; |
| 716 | 716 | } |
| 717 | 717 | // eval $page et affecte $res |
| 718 | - include _ROOT_RESTREINT . 'public/evaluer_page.php'; |
|
| 718 | + include _ROOT_RESTREINT.'public/evaluer_page.php'; |
|
| 719 | 719 | |
| 720 | 720 | // Lever un drapeau (global) si le fond utilise #SESSION |
| 721 | 721 | // a destination de public/parametrer |
@@ -783,16 +783,16 @@ discard block |
||
| 783 | 783 | if (($pos = strpos($head, '<head>')) !== false) { |
| 784 | 784 | $head = substr_replace($head, $base, $pos + 6, 0); |
| 785 | 785 | } elseif (preg_match(',<head[^>]*>,i', $head, $r)) { |
| 786 | - $head = str_replace($r[0], $r[0] . $base, $head); |
|
| 786 | + $head = str_replace($r[0], $r[0].$base, $head); |
|
| 787 | 787 | } |
| 788 | - $texte = $head . substr($texte, $poshead); |
|
| 788 | + $texte = $head.substr($texte, $poshead); |
|
| 789 | 789 | } |
| 790 | 790 | if ($href_base) { |
| 791 | 791 | // gerer les ancres |
| 792 | 792 | $base = $_SERVER['REQUEST_URI']; |
| 793 | 793 | // pas de guillemets ni < dans l'URL qu'on insere dans le HTML |
| 794 | 794 | if (str_contains($base, "'") || str_contains($base, '"') || str_contains($base, '<')) { |
| 795 | - $base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base); |
|
| 795 | + $base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base); |
|
| 796 | 796 | } |
| 797 | 797 | if (str_contains($texte, "href='#")) { |
| 798 | 798 | $texte = str_replace("href='#", "href='$base#", $texte); |