@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1780,9 +1780,9 @@ discard block |
||
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | 1782 | if ( |
| 1783 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1783 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1784 | 1784 | // deprecated |
| 1785 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1785 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1786 | 1786 | ) { |
| 1787 | 1787 | return $f; |
| 1788 | 1788 | } |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | // inclure le module d'url |
| 1797 | - include_spip('urls/' . $type); |
|
| 1797 | + include_spip('urls/'.$type); |
|
| 1798 | 1798 | |
| 1799 | 1799 | switch ($quoi) { |
| 1800 | 1800 | case 'page': |
@@ -1950,8 +1950,8 @@ discard block |
||
| 1950 | 1950 | include_spip('base/connect_sql'); |
| 1951 | 1951 | $id_type = id_table_objet($entite, $public); |
| 1952 | 1952 | |
| 1953 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1954 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1953 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1954 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1955 | 1955 | . (!$args ? '' : "&$args") |
| 1956 | 1956 | . (!$ancre ? '' : "#$ancre"); |
| 1957 | 1957 | } |
@@ -2122,7 +2122,7 @@ discard block |
||
| 2122 | 2122 | !empty($_SERVER['QUERY_STRING']) |
| 2123 | 2123 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2124 | 2124 | ) { |
| 2125 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2125 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2126 | 2126 | } |
| 2127 | 2127 | } |
| 2128 | 2128 | } |
@@ -2157,9 +2157,9 @@ discard block |
||
| 2157 | 2157 | array_shift($myself); |
| 2158 | 2158 | $myself = implode('/', $myself); |
| 2159 | 2159 | } |
| 2160 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2160 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2161 | 2161 | |
| 2162 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2162 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2163 | 2163 | |
| 2164 | 2164 | return $url; |
| 2165 | 2165 | } |
@@ -2197,16 +2197,16 @@ discard block |
||
| 2197 | 2197 | **/ |
| 2198 | 2198 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2199 | 2199 | if (!$rel) { |
| 2200 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2200 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2201 | 2201 | } else { |
| 2202 | 2202 | if (!is_string($rel)) { |
| 2203 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2203 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2204 | 2204 | } |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | 2207 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2208 | 2208 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2209 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2209 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2210 | 2210 | } elseif ($args) { |
| 2211 | 2211 | $args = "?$args"; |
| 2212 | 2212 | } |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | $args .= "#$ancre"; |
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2217 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2218 | 2218 | } |
| 2219 | 2219 | |
| 2220 | 2220 | // |
@@ -2296,10 +2296,10 @@ discard block |
||
| 2296 | 2296 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2297 | 2297 | } |
| 2298 | 2298 | if ($args) { |
| 2299 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2299 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2300 | 2300 | } |
| 2301 | 2301 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2302 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2302 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | if (!$no_entities) { |
@@ -2311,7 +2311,7 @@ discard block |
||
| 2311 | 2311 | |
| 2312 | 2312 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2313 | 2313 | |
| 2314 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2314 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | // Pour les formulaires en methode POST, |
@@ -2346,8 +2346,7 @@ discard block |
||
| 2346 | 2346 | . "><div>\n" |
| 2347 | 2347 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2348 | 2348 | . $corps |
| 2349 | - . (!$submit ? '' : |
|
| 2350 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2349 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2351 | 2350 | . "</div></form>\n"; |
| 2352 | 2351 | } |
| 2353 | 2352 | |
@@ -2372,14 +2371,14 @@ discard block |
||
| 2372 | 2371 | ? generer_url_ecrire(_request('exec')) |
| 2373 | 2372 | : generer_url_public(); |
| 2374 | 2373 | |
| 2375 | - return "\n<form action='" . |
|
| 2376 | - $h . |
|
| 2377 | - "'" . |
|
| 2378 | - $atts . |
|
| 2379 | - ">\n" . |
|
| 2380 | - '<div>' . |
|
| 2381 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2382 | - $corps . |
|
| 2374 | + return "\n<form action='". |
|
| 2375 | + $h. |
|
| 2376 | + "'". |
|
| 2377 | + $atts. |
|
| 2378 | + ">\n". |
|
| 2379 | + '<div>'. |
|
| 2380 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2381 | + $corps. |
|
| 2383 | 2382 | '</div></form>'; |
| 2384 | 2383 | } |
| 2385 | 2384 | |
@@ -2407,7 +2406,7 @@ discard block |
||
| 2407 | 2406 | : generer_url_public('', '', false, false); |
| 2408 | 2407 | $url = parametre_url($url, 'action', $script); |
| 2409 | 2408 | if ($args) { |
| 2410 | - $url .= quote_amp('&' . $args); |
|
| 2409 | + $url .= quote_amp('&'.$args); |
|
| 2411 | 2410 | } |
| 2412 | 2411 | |
| 2413 | 2412 | if ($no_entities) { |
@@ -2441,9 +2440,9 @@ discard block |
||
| 2441 | 2440 | } |
| 2442 | 2441 | $url = |
| 2443 | 2442 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2444 | - . $script . '/' |
|
| 2443 | + . $script.'/' |
|
| 2445 | 2444 | . ($path ? trim($path, '/') : '') |
| 2446 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2445 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2447 | 2446 | |
| 2448 | 2447 | if ($no_entities) { |
| 2449 | 2448 | $url = str_replace('&', '&', $url); |
@@ -2492,17 +2491,17 @@ discard block |
||
| 2492 | 2491 | |
| 2493 | 2492 | // le nom du repertoire plugins/ activables/desactivables |
| 2494 | 2493 | if (!defined('_DIR_PLUGINS')) { |
| 2495 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2494 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2496 | 2495 | } |
| 2497 | 2496 | |
| 2498 | 2497 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2499 | 2498 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2500 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2499 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2501 | 2500 | } |
| 2502 | 2501 | |
| 2503 | 2502 | // le nom du repertoire des librairies |
| 2504 | 2503 | if (!defined('_DIR_LIB')) { |
| 2505 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2504 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2506 | 2505 | } |
| 2507 | 2506 | |
| 2508 | 2507 | if (!defined('_DIR_IMG')) { |
@@ -2512,29 +2511,29 @@ discard block |
||
| 2512 | 2511 | define('_DIR_LOGOS', $pa); |
| 2513 | 2512 | } |
| 2514 | 2513 | if (!defined('_DIR_IMG_ICONES')) { |
| 2515 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2514 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2516 | 2515 | } |
| 2517 | 2516 | |
| 2518 | 2517 | if (!defined('_DIR_DUMP')) { |
| 2519 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2518 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_DIR_SESSIONS')) { |
| 2522 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2521 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_DIR_TRANSFERT')) { |
| 2525 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2524 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_DIR_CACHE')) { |
| 2528 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2527 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_DIR_CACHE_XML')) { |
| 2531 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2530 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | if (!defined('_DIR_SKELS')) { |
| 2534 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2533 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2535 | 2534 | } |
| 2536 | 2535 | if (!defined('_DIR_AIDE')) { |
| 2537 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2536 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2538 | 2537 | } |
| 2539 | 2538 | if (!defined('_DIR_TMP')) { |
| 2540 | 2539 | define('_DIR_TMP', $ti); |
@@ -2563,27 +2562,27 @@ discard block |
||
| 2563 | 2562 | // Declaration des fichiers |
| 2564 | 2563 | |
| 2565 | 2564 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2566 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2565 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2567 | 2566 | } |
| 2568 | 2567 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2569 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2568 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2570 | 2569 | } |
| 2571 | 2570 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2572 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2571 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2573 | 2572 | } |
| 2574 | 2573 | if (!defined('_CACHE_PIPELINES')) { |
| 2575 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2574 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2576 | 2575 | } |
| 2577 | 2576 | if (!defined('_CACHE_CHEMIN')) { |
| 2578 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2577 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2579 | 2578 | } |
| 2580 | 2579 | |
| 2581 | 2580 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2582 | 2581 | if (!defined('_FILE_META')) { |
| 2583 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2582 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2584 | 2583 | } |
| 2585 | 2584 | if (!defined('_DIR_LOG')) { |
| 2586 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2585 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2587 | 2586 | } |
| 2588 | 2587 | if (!defined('_FILE_LOG')) { |
| 2589 | 2588 | define('_FILE_LOG', 'spip'); |
@@ -2600,8 +2599,8 @@ discard block |
||
| 2600 | 2599 | if (!defined('_FILE_CONNECT')) { |
| 2601 | 2600 | define( |
| 2602 | 2601 | '_FILE_CONNECT', |
| 2603 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2604 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2602 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2603 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2605 | 2604 | : false)) |
| 2606 | 2605 | ); |
| 2607 | 2606 | } |
@@ -2613,7 +2612,7 @@ discard block |
||
| 2613 | 2612 | if (!defined('_FILE_CHMOD')) { |
| 2614 | 2613 | define( |
| 2615 | 2614 | '_FILE_CHMOD', |
| 2616 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2615 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2617 | 2616 | : false) |
| 2618 | 2617 | ); |
| 2619 | 2618 | } |
@@ -2626,10 +2625,10 @@ discard block |
||
| 2626 | 2625 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2627 | 2626 | } |
| 2628 | 2627 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2629 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2628 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2630 | 2629 | } |
| 2631 | 2630 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2632 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2631 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2633 | 2632 | } |
| 2634 | 2633 | |
| 2635 | 2634 | // Definition des droits d'acces en ecriture |
@@ -2647,13 +2646,13 @@ discard block |
||
| 2647 | 2646 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2648 | 2647 | } |
| 2649 | 2648 | if (!defined('_ROOT_PLUGINS')) { |
| 2650 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2649 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2651 | 2650 | } |
| 2652 | 2651 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2653 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2652 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2654 | 2653 | } |
| 2655 | 2654 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2656 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2655 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2657 | 2656 | } |
| 2658 | 2657 | |
| 2659 | 2658 | // La taille des Log |
@@ -2690,7 +2689,7 @@ discard block |
||
| 2690 | 2689 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2691 | 2690 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2692 | 2691 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2693 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2692 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2694 | 2693 | |
| 2695 | 2694 | // charger tout de suite le path et son cache |
| 2696 | 2695 | 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 |
@@ -3147,10 +3146,10 @@ discard block |
||
| 3147 | 3146 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3148 | 3147 | // certaines constantes |
| 3149 | 3148 | @spip_initialisation_core( |
| 3150 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3151 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3152 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3153 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3149 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3150 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3151 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3152 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3154 | 3153 | ); |
| 3155 | 3154 | |
| 3156 | 3155 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3183,7 +3182,7 @@ discard block |
||
| 3183 | 3182 | } |
| 3184 | 3183 | |
| 3185 | 3184 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3186 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3185 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3187 | 3186 | $session = charger_fonction('session', 'inc'); |
| 3188 | 3187 | if ($session()) { |
| 3189 | 3188 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3263,7 +3262,7 @@ discard block |
||
| 3263 | 3262 | 'definir_session', |
| 3264 | 3263 | $GLOBALS['visiteur_session'] |
| 3265 | 3264 | ? serialize($GLOBALS['visiteur_session']) |
| 3266 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3265 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3267 | 3266 | : '' |
| 3268 | 3267 | ); |
| 3269 | 3268 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3419,11 +3418,11 @@ discard block |
||
| 3419 | 3418 | $GLOBALS['_INC_PUBLIC']++; |
| 3420 | 3419 | |
| 3421 | 3420 | // fix #4235 |
| 3422 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3421 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3423 | 3422 | |
| 3424 | 3423 | |
| 3425 | 3424 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3426 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3425 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3427 | 3426 | |
| 3428 | 3427 | $page = evaluer_fond($f, $contexte, $connect); |
| 3429 | 3428 | if ($page === '') { |
@@ -3508,7 +3507,7 @@ discard block |
||
| 3508 | 3507 | * @return array|string |
| 3509 | 3508 | */ |
| 3510 | 3509 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3511 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3510 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3512 | 3511 | if (!$pathinfo) { |
| 3513 | 3512 | return $f; |
| 3514 | 3513 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2_097_152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | else { |
| 121 | - spip_log("copie_locale : recuperation $source sur $localrac OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 121 | + spip_log("copie_locale : recuperation $source sur $localrac OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 122 | 122 | } |
| 123 | 123 | if (!$res or !$res['length']) { |
| 124 | 124 | // si $t c'est sans doute juste un not-modified-since |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if (!$is_known_host) { |
| 209 | 209 | $host = trim($parsed_url['host'], '.'); |
| 210 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 210 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 211 | 211 | $ip = gethostbyname($host); |
| 212 | 212 | if ($ip === $host) { |
| 213 | 213 | // Error condition for gethostbyname() |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | if ($ip) { |
| 231 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 231 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 232 | 232 | return false; |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | $port = $parsed_url['port']; |
| 242 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 242 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 243 | 243 | return $url; |
| 244 | 244 | } |
| 245 | 245 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | if ($taille > 500) { |
| 312 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 312 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -337,16 +337,16 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | } else { |
| 339 | 339 | // fabrique une chaine HTTP simple pour un POST |
| 340 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 340 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 341 | 341 | $chaine = []; |
| 342 | 342 | if (is_array($donnees)) { |
| 343 | 343 | foreach ($donnees as $cle => $valeur) { |
| 344 | 344 | if (is_array($valeur)) { |
| 345 | 345 | foreach ($valeur as $val2) { |
| 346 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 346 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 347 | 347 | } |
| 348 | 348 | } else { |
| 349 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 349 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $chaine = implode('&', $chaine); |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 454 | + spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 455 | 455 | |
| 456 | 456 | // Ajout des en-têtes spécifiques si besoin |
| 457 | 457 | $formatted_data = ''; |
| 458 | 458 | if (!empty($options['headers'])) { |
| 459 | 459 | foreach ($options['headers'] as $champ => $valeur) { |
| 460 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 460 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 466 | 466 | $head .= $formatted_data; |
| 467 | 467 | if (stripos($head, 'Content-Length:') === false) { |
| 468 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 468 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 469 | 469 | } |
| 470 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 470 | + $formatted_data = $head."\r\n".$postdata; |
|
| 471 | 471 | if ( |
| 472 | 472 | strlen($postdata) |
| 473 | 473 | and !$methode_demandee |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 482 | 482 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 483 | 483 | if (!tester_url_absolue($url)) { |
| 484 | - $url = 'http://' . $url; |
|
| 484 | + $url = 'http://'.$url; |
|
| 485 | 485 | } elseif (strncmp($url, '//', 2) == 0) { |
| 486 | - $url = 'http:' . $url; |
|
| 486 | + $url = 'http:'.$url; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $url = url_to_ascii($url); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $options['if_modified_since'] |
| 513 | 513 | ); |
| 514 | 514 | if (!$handle) { |
| 515 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 515 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 516 | 516 | |
| 517 | 517 | return false; |
| 518 | 518 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | 'status' => 200, |
| 543 | 543 | ]; |
| 544 | 544 | } else { |
| 545 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 545 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 546 | 546 | return false; |
| 547 | 547 | } |
| 548 | 548 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -558,11 +558,11 @@ discard block |
||
| 558 | 558 | $options['datas'] = ''; |
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | - spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 561 | + spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 562 | 562 | |
| 563 | 563 | return recuperer_url($url, $options); |
| 564 | 564 | } elseif ($res['status'] !== 200) { |
| 565 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 565 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 566 | 566 | } |
| 567 | 567 | $result['status'] = $res['status']; |
| 568 | 568 | if (isset($res['headers'])) { |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | // on ne veut que les entetes |
| 580 | 580 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 581 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 581 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 582 | 582 | return $result; |
| 583 | 583 | } |
| 584 | 584 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | |
| 589 | 589 | $gz = false; |
| 590 | 590 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 591 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 591 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $trace = json_decode(json_encode($result), true); |
| 626 | 626 | $trace['page'] = '...'; |
| 627 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 627 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 628 | 628 | |
| 629 | 629 | return $result; |
| 630 | 630 | } |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | $sig['url'] = $url; |
| 679 | 679 | |
| 680 | 680 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 681 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 681 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 682 | 682 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 683 | 683 | $cache = "$sub$cache"; |
| 684 | 684 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $fp = false; |
| 733 | 733 | if ($fichier) { |
| 734 | 734 | include_spip('inc/acces'); |
| 735 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 735 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 736 | 736 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 737 | 737 | if (!$fp and file_exists($fichier)) { |
| 738 | 738 | return filesize($fichier); |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | $result['status'] = intval($r[1]); |
| 793 | 793 | while ($s = trim(fgets($handle, 16384))) { |
| 794 | - $result['headers'][] = $s . "\n"; |
|
| 794 | + $result['headers'][] = $s."\n"; |
|
| 795 | 795 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 796 | 796 | [, $d, $v] = $r; |
| 797 | 797 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | |
| 841 | 841 | // on se place tout le temps comme si on etait a la racine |
| 842 | 842 | if (_DIR_RACINE) { |
| 843 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 843 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | $m = md5($source); |
| 847 | 847 | |
| 848 | 848 | return $d |
| 849 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 849 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 850 | 850 | . substr($m, 0, 4) |
| 851 | 851 | . ".$extension"; |
| 852 | 852 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | // Si c'est deja local pas de souci |
| 870 | 870 | if (!tester_url_absolue($source)) { |
| 871 | 871 | if (_DIR_RACINE) { |
| 872 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 872 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | return $source; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $ext |
| 888 | 888 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 889 | 889 | and $f = nom_fichier_copie_locale($source, $ext) |
| 890 | - and file_exists(_DIR_RACINE . $f) |
|
| 890 | + and file_exists(_DIR_RACINE.$f) |
|
| 891 | 891 | ) { |
| 892 | 892 | return $f; |
| 893 | 893 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | // Si c'est deja dans la table des documents, |
| 897 | 897 | // ramener le nom de sa copie potentielle |
| 898 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 898 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 899 | 899 | |
| 900 | 900 | if ($ext) { |
| 901 | 901 | return nom_fichier_copie_locale($source, $ext); |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 908 | 908 | |
| 909 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 909 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 910 | 910 | $f = nom_fichier_copie_locale($source, $ext); |
| 911 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 911 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 912 | 912 | return $f; |
| 913 | 913 | } |
| 914 | 914 | } |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | // Ping pour voir si son extension est connue et autorisee |
| 917 | 917 | // avec mise en cache du resultat du ping |
| 918 | 918 | |
| 919 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 919 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 920 | 920 | if ( |
| 921 | 921 | !@file_exists($cache) |
| 922 | 922 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -926,10 +926,10 @@ discard block |
||
| 926 | 926 | ecrire_fichier($cache, serialize($path_parts)); |
| 927 | 927 | } |
| 928 | 928 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 929 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 929 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 930 | 930 | return nom_fichier_copie_locale($source, $ext); |
| 931 | 931 | } |
| 932 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 932 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | } else { |
| 1014 | 1014 | if ($a['body']) { |
| 1015 | 1015 | $a['extension'] = $extension; |
| 1016 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1016 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1017 | 1017 | ecrire_fichier($a['fichier'], $a['body']); |
| 1018 | 1018 | $size_image = @spip_getimagesize($a['fichier']); |
| 1019 | 1019 | $a['largeur'] = intval($size_image[0]); |
@@ -1081,20 +1081,20 @@ discard block |
||
| 1081 | 1081 | !$t |
| 1082 | 1082 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1083 | 1083 | ) { |
| 1084 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1084 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1085 | 1085 | } |
| 1086 | 1086 | if ( |
| 1087 | 1087 | !$t |
| 1088 | 1088 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1089 | 1089 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1090 | 1090 | ) { |
| 1091 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1091 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1096 | 1096 | if (!$t) { |
| 1097 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1097 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1105,11 +1105,11 @@ discard block |
||
| 1105 | 1105 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1106 | 1106 | ) { |
| 1107 | 1107 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1108 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1108 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | if ($t) { |
| 1112 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1112 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1113 | 1113 | return $t['extension']; |
| 1114 | 1114 | } else { |
| 1115 | 1115 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | } |
| 1213 | 1213 | } else { |
| 1214 | 1214 | $scheme = $t['scheme']; |
| 1215 | - $noproxy = $scheme . '://'; |
|
| 1215 | + $noproxy = $scheme.'://'; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | if (isset($t['user'])) { |
| 1218 | 1218 | $user = [$t['user'], $t['pass']]; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | if (!empty($t['query'])) { |
| 1229 | - $path .= '?' . $t['query']; |
|
| 1229 | + $path .= '?'.$t['query']; |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1300,29 +1300,29 @@ discard block |
||
| 1300 | 1300 | $proxy_user = ''; |
| 1301 | 1301 | $http_proxy = need_proxy($host); |
| 1302 | 1302 | if ($user) { |
| 1303 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1303 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | $connect = ''; |
| 1307 | 1307 | if ($http_proxy) { |
| 1308 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1309 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1310 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1308 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1309 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1310 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1311 | 1311 | . "Host: $path_host\r\n" |
| 1312 | 1312 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1313 | 1313 | } else { |
| 1314 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1314 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1315 | 1315 | . (!$user ? '' : "$user@") |
| 1316 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1316 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1317 | 1317 | } |
| 1318 | 1318 | $t2 = @parse_url($http_proxy); |
| 1319 | 1319 | $first_host = $t2['host']; |
| 1320 | 1320 | $port = ($t2['port'] ?? null) ?: 80; |
| 1321 | 1321 | if ($t2['user'] ?? null) { |
| 1322 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1322 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | } else { |
| 1325 | - $first_host = $noproxy . $host; |
|
| 1325 | + $first_host = $noproxy.$host; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | if ($connect) { |
@@ -1344,7 +1344,7 @@ discard block |
||
| 1344 | 1344 | ); |
| 1345 | 1345 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1346 | 1346 | if (!$f) { |
| 1347 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1347 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1348 | 1348 | return $errno; |
| 1349 | 1349 | } |
| 1350 | 1350 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | or !count($res = explode(' ', $res)) |
| 1358 | 1358 | or $res[1] !== '200' |
| 1359 | 1359 | ) { |
| 1360 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1360 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1361 | 1361 | fclose($f); |
| 1362 | 1362 | |
| 1363 | 1363 | return false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1375 | 1375 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1376 | 1376 | if (!$f) { |
| 1377 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1377 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1378 | 1378 | |
| 1379 | 1379 | return $errno; |
| 1380 | 1380 | } |
@@ -1384,16 +1384,16 @@ discard block |
||
| 1384 | 1384 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1385 | 1385 | |
| 1386 | 1386 | $host_port = $host; |
| 1387 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1387 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1388 | 1388 | $host_port .= ":$port"; |
| 1389 | 1389 | } |
| 1390 | 1390 | $req = "$method $path $vers\r\n" |
| 1391 | 1391 | . "Host: $host_port\r\n" |
| 1392 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1393 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1392 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1393 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1394 | 1394 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1395 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1396 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1395 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1396 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1397 | 1397 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1398 | 1398 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1399 | 1399 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // affichage "GIT [master: abcdef]" |
| 240 | 240 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 241 | 241 | if ($desc['branch']) { |
| 242 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 242 | + $commit = $desc['branch'].': '.$commit; |
|
| 243 | 243 | } |
| 244 | 244 | return "{$desc['vcs']} [$commit]"; |
| 245 | 245 | } |
@@ -258,9 +258,9 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | // version installee par GIT |
| 261 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 261 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 262 | 262 | $currentHead = trim(substr($c, 4)); |
| 263 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 263 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 264 | 264 | return [ |
| 265 | 265 | 'vcs' => 'GIT', |
| 266 | 266 | 'branch' => basename($currentHead), |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | $dir = '.'; |
| 288 | 288 | } |
| 289 | 289 | // version installee par SVN |
| 290 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 290 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 292 | 292 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 293 | 293 | if ($result) { |
| 294 | 294 | $row = $result->fetchArray(); |
@@ -306,12 +306,12 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 308 | 308 | // et laisser passer les fonctions personnelles baptisees image_... |
| 309 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 310 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 311 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 312 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 313 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 314 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 311 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 312 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 313 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 314 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 315 | 315 | |
| 316 | 316 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 317 | 317 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | */ |
| 471 | 471 | function filtre_debug($val, $key = null) { |
| 472 | 472 | $debug = ( |
| 473 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 474 | - ) . var_export($val, true); |
|
| 473 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 474 | + ).var_export($val, true); |
|
| 475 | 475 | |
| 476 | 476 | include_spip('inc/autoriser'); |
| 477 | 477 | if (autoriser('webmestre')) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $is_file = false; |
| 526 | 526 | } |
| 527 | 527 | if ($is_file) { |
| 528 | - $is_local_file = function ($path) { |
|
| 528 | + $is_local_file = function($path) { |
|
| 529 | 529 | if (strpos($path, '?') !== false) { |
| 530 | 530 | $path = supprimer_timestamp($path); |
| 531 | 531 | // remove ?24px added by find_in_theme on .svg files |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 578 | 578 | $srcover = $match[1]; |
| 579 | 579 | array_shift($args); |
| 580 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 580 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 581 | 581 | $srcover_filter = $filtre(...$args); |
| 582 | 582 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 583 | 583 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | // " -> " et tout ce genre de choses |
| 981 | 981 | $u = $GLOBALS['meta']['pcre_u']; |
| 982 | 982 | $texte = str_replace(' ', ' ', $texte); |
| 983 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 983 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 984 | 984 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 985 | 985 | $texte = entites_html($texte, false, false); |
| 986 | 986 | // mais bien echapper les double quotes ! |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | **/ |
| 1041 | 1041 | function supprimer_numero($texte) { |
| 1042 | 1042 | return preg_replace( |
| 1043 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1043 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1044 | 1044 | '', |
| 1045 | 1045 | $texte |
| 1046 | 1046 | ); |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | function recuperer_numero($texte) { |
| 1069 | 1069 | if ( |
| 1070 | 1070 | preg_match( |
| 1071 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1071 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1072 | 1072 | $texte, |
| 1073 | 1073 | $regs |
| 1074 | 1074 | ) |
@@ -1159,8 +1159,8 @@ discard block |
||
| 1159 | 1159 | **/ |
| 1160 | 1160 | function textebrut($texte) { |
| 1161 | 1161 | $u = $GLOBALS['meta']['pcre_u']; |
| 1162 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1163 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1162 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1163 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1164 | 1164 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1165 | 1165 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1166 | 1166 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | ) |
| 1195 | 1195 | ) { |
| 1196 | 1196 | foreach ($liens[0] as $a) { |
| 1197 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1197 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1198 | 1198 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1199 | 1199 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1200 | 1200 | $texte = str_replace($a, $ablank, $texte); |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | foreach ($regs[0] as $a) { |
| 1220 | 1220 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1221 | 1221 | if (strpos($rel, 'nofollow') === false) { |
| 1222 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1222 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1223 | 1223 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1224 | 1224 | $texte = str_replace($a, $anofollow, $texte); |
| 1225 | 1225 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $u = $GLOBALS['meta']['pcre_u']; |
| 1249 | 1249 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1250 | 1250 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1251 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1251 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1252 | 1252 | |
| 1253 | 1253 | return $texte; |
| 1254 | 1254 | } |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | return $texte; |
| 1280 | 1280 | } |
| 1281 | 1281 | include_spip('inc/texte'); |
| 1282 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1282 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1283 | 1283 | 'div' : 'span'; |
| 1284 | 1284 | |
| 1285 | 1285 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | } |
| 1392 | 1392 | $u = $GLOBALS['meta']['pcre_u']; |
| 1393 | 1393 | if ($textebrut) { |
| 1394 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1394 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1395 | 1395 | } |
| 1396 | 1396 | $texte = texte_backend($texte); |
| 1397 | 1397 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | # un message pour abs_url |
| 1427 | 1427 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1428 | 1428 | $url = trim($url); |
| 1429 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1429 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1430 | 1430 | |
| 1431 | 1431 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1432 | 1432 | } |
@@ -1626,14 +1626,14 @@ discard block |
||
| 1626 | 1626 | if (strpos($texte, '<') !== false) { |
| 1627 | 1627 | include_spip('inc/lien'); |
| 1628 | 1628 | if (defined('_PREG_MODELE')) { |
| 1629 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1629 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1630 | 1630 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1631 | 1631 | } |
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | $debut = ''; |
| 1635 | 1635 | $suite = $texte; |
| 1636 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1636 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1637 | 1637 | $debut .= substr($suite, 0, $t - 1); |
| 1638 | 1638 | $suite = substr($suite, $t); |
| 1639 | 1639 | $car = substr($suite, 0, 1); |
@@ -1651,11 +1651,11 @@ discard block |
||
| 1651 | 1651 | $suite = substr($suite, strlen($regs[0])); |
| 1652 | 1652 | } |
| 1653 | 1653 | } |
| 1654 | - $texte = $debut . $suite; |
|
| 1654 | + $texte = $debut.$suite; |
|
| 1655 | 1655 | |
| 1656 | 1656 | $texte = echappe_retour($texte); |
| 1657 | 1657 | |
| 1658 | - return $texte . $fin; |
|
| 1658 | + return $texte.$fin; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | foreach ($regs as $reg) { |
| 1720 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1720 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1721 | 1721 | $desc = $traduire($cle, $lang, true); |
| 1722 | 1722 | $l = $desc->langue; |
| 1723 | 1723 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1831,9 +1831,9 @@ discard block |
||
| 1831 | 1831 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1832 | 1832 | include_spip('inc/texte'); |
| 1833 | 1833 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1834 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1834 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1835 | 1835 | if ($mode === 'div') { |
| 1836 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1836 | + $trad = rtrim($trad)."\n\n"; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1839 | 1839 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2033,7 +2033,7 @@ discard block |
||
| 2033 | 2033 | if (is_array($balise)) { |
| 2034 | 2034 | array_walk( |
| 2035 | 2035 | $balise, |
| 2036 | - function (&$a, $key, $t) { |
|
| 2036 | + function(&$a, $key, $t) { |
|
| 2037 | 2037 | $a = extraire_attribut($a, $t); |
| 2038 | 2038 | }, |
| 2039 | 2039 | $attribut |
@@ -2130,14 +2130,14 @@ discard block |
||
| 2130 | 2130 | |
| 2131 | 2131 | if ($old !== null) { |
| 2132 | 2132 | // Remplacer l'ancien attribut du meme nom |
| 2133 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2133 | + $balise = $r[1].$insert.$r[5]; |
|
| 2134 | 2134 | } else { |
| 2135 | 2135 | // preferer une balise " />" (comme <img />) |
| 2136 | 2136 | if (preg_match(',/>,', $balise)) { |
| 2137 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2137 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2138 | 2138 | } // sinon une balise <a ...> ... </a> |
| 2139 | 2139 | else { |
| 2140 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2140 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2141 | 2141 | } |
| 2142 | 2142 | } |
| 2143 | 2143 | |
@@ -2192,7 +2192,7 @@ discard block |
||
| 2192 | 2192 | if ( |
| 2193 | 2193 | $class_courante |
| 2194 | 2194 | and strpos($class_courante, (string) $c) !== false |
| 2195 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2195 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2196 | 2196 | ) { |
| 2197 | 2197 | $is_class_presente = true; |
| 2198 | 2198 | } |
@@ -2200,12 +2200,12 @@ discard block |
||
| 2200 | 2200 | in_array($operation, ['ajouter', 'commuter']) |
| 2201 | 2201 | and !$is_class_presente |
| 2202 | 2202 | ) { |
| 2203 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2203 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2204 | 2204 | } elseif ( |
| 2205 | 2205 | in_array($operation, ['supprimer', 'commuter']) |
| 2206 | 2206 | and $is_class_presente |
| 2207 | 2207 | ) { |
| 2208 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2208 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2209 | 2209 | } |
| 2210 | 2210 | } |
| 2211 | 2211 | |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | // Quelques fonctions de calcul arithmetique |
| 2269 | 2269 | // |
| 2270 | 2270 | function floatstr($a) { |
| 2271 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2271 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2272 | 2272 | } |
| 2273 | 2273 | function strize($f, $a, $b) { |
| 2274 | 2274 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2404,13 +2404,13 @@ discard block |
||
| 2404 | 2404 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2405 | 2405 | define('_TAGS_NOM_AUTEUR', ''); |
| 2406 | 2406 | } |
| 2407 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2407 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2408 | 2408 | foreach ($tags_acceptes as $tag) { |
| 2409 | 2409 | if (strlen($tag)) { |
| 2410 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2411 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2412 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2413 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2410 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2411 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2412 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2413 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2414 | 2414 | } |
| 2415 | 2415 | } |
| 2416 | 2416 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2464,7 +2464,7 @@ discard block |
||
| 2464 | 2464 | . http_img_pack( |
| 2465 | 2465 | 'attachment-16.png', |
| 2466 | 2466 | $t, |
| 2467 | - 'title="' . attribut_html($t) . '"' |
|
| 2467 | + 'title="'.attribut_html($t).'"' |
|
| 2468 | 2468 | ) |
| 2469 | 2469 | . '</a>', |
| 2470 | 2470 | $tag |
@@ -2528,10 +2528,10 @@ discard block |
||
| 2528 | 2528 | $fichier = basename($url); |
| 2529 | 2529 | |
| 2530 | 2530 | return '<a rel="enclosure"' |
| 2531 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2532 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2533 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2534 | - . '>' . $fichier . '</a>'; |
|
| 2531 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2532 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2533 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2534 | + . '>'.$fichier.'</a>'; |
|
| 2535 | 2535 | } |
| 2536 | 2536 | |
| 2537 | 2537 | /** |
@@ -2559,9 +2559,9 @@ discard block |
||
| 2559 | 2559 | } # vieux data |
| 2560 | 2560 | $fichier = basename($url); |
| 2561 | 2561 | $enclosures[] = '<enclosure' |
| 2562 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2563 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2564 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2562 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2563 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2564 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2565 | 2565 | . ' />'; |
| 2566 | 2566 | } |
| 2567 | 2567 | } |
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2588 | 2588 | $subjects .= '<dc:subject>' |
| 2589 | 2589 | . texte_backend(textebrut($e)) |
| 2590 | - . '</dc:subject>' . "\n"; |
|
| 2590 | + . '</dc:subject>'."\n"; |
|
| 2591 | 2591 | } |
| 2592 | 2592 | } |
| 2593 | 2593 | |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | if (is_array($texte)) { |
| 2624 | 2624 | array_walk( |
| 2625 | 2625 | $texte, |
| 2626 | - function (&$a, $key, $t) { |
|
| 2626 | + function(&$a, $key, $t) { |
|
| 2627 | 2627 | $a = extraire_balise($a, $t); |
| 2628 | 2628 | }, |
| 2629 | 2629 | $tag |
@@ -2671,7 +2671,7 @@ discard block |
||
| 2671 | 2671 | if (is_array($texte)) { |
| 2672 | 2672 | array_walk( |
| 2673 | 2673 | $texte, |
| 2674 | - function (&$a, $key, $t) { |
|
| 2674 | + function(&$a, $key, $t) { |
|
| 2675 | 2675 | $a = extraire_balises($a, $t); |
| 2676 | 2676 | }, |
| 2677 | 2677 | $tag |
@@ -2804,7 +2804,7 @@ discard block |
||
| 2804 | 2804 | if ($fond != '404') { |
| 2805 | 2805 | $contexte = array_shift($p); |
| 2806 | 2806 | $contexte['page'] = $fond; |
| 2807 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2807 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2808 | 2808 | } |
| 2809 | 2809 | } |
| 2810 | 2810 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2859,9 +2859,9 @@ discard block |
||
| 2859 | 2859 | . '"' |
| 2860 | 2860 | . (is_null($val) |
| 2861 | 2861 | ? '' |
| 2862 | - : ' value="' . entites_html($val) . '"' |
|
| 2862 | + : ' value="'.entites_html($val).'"' |
|
| 2863 | 2863 | ) |
| 2864 | - . ' type="hidden"' . "\n/>"; |
|
| 2864 | + . ' type="hidden"'."\n/>"; |
|
| 2865 | 2865 | } |
| 2866 | 2866 | |
| 2867 | 2867 | return join('', $hidden); |
@@ -2971,7 +2971,7 @@ discard block |
||
| 2971 | 2971 | |
| 2972 | 2972 | return preg_replace_callback( |
| 2973 | 2973 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2974 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2974 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2975 | 2975 | $contenu |
| 2976 | 2976 | ); |
| 2977 | 2977 | } |
@@ -3032,14 +3032,14 @@ discard block |
||
| 3032 | 3032 | ) { |
| 3033 | 3033 | $distant = true; |
| 3034 | 3034 | $cssf = parse_url($css); |
| 3035 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3035 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3036 | 3036 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3037 | 3037 | } else { |
| 3038 | 3038 | $distant = false; |
| 3039 | 3039 | $cssf = $css; |
| 3040 | 3040 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3041 | 3041 | //propose (rien a faire dans ce cas) |
| 3042 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3042 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3043 | 3043 | if (@file_exists($f)) { |
| 3044 | 3044 | return $f; |
| 3045 | 3045 | } |
@@ -3049,7 +3049,7 @@ discard block |
||
| 3049 | 3049 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3050 | 3050 | $f = $dir_var |
| 3051 | 3051 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3052 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3052 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3053 | 3053 | |
| 3054 | 3054 | // la css peut etre distante (url absolue !) |
| 3055 | 3055 | if ($distant) { |
@@ -3095,8 +3095,8 @@ discard block |
||
| 3095 | 3095 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3096 | 3096 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3097 | 3097 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3098 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3099 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3098 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3099 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | $src[] = $regs[0][$k]; |
| 3102 | 3102 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3145,7 +3145,7 @@ discard block |
||
| 3145 | 3145 | |
| 3146 | 3146 | $f = basename($css, '.css'); |
| 3147 | 3147 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3148 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3148 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3149 | 3149 | . '.css'; |
| 3150 | 3150 | |
| 3151 | 3151 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3155,7 +3155,7 @@ discard block |
||
| 3155 | 3155 | if ($url_absolue_css == $css) { |
| 3156 | 3156 | if ( |
| 3157 | 3157 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3158 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3158 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3159 | 3159 | ) { |
| 3160 | 3160 | include_spip('inc/distant'); |
| 3161 | 3161 | $contenu = recuperer_url($css); |
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | $expression = str_replace('\/', '/', $expression); |
| 3268 | 3268 | $expression = str_replace('/', '\/', $expression); |
| 3269 | 3269 | |
| 3270 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3270 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3271 | 3271 | if (isset($r[$capte])) { |
| 3272 | 3272 | return $r[$capte]; |
| 3273 | 3273 | } else { |
@@ -3305,7 +3305,7 @@ discard block |
||
| 3305 | 3305 | $expression = str_replace('\/', '/', $expression); |
| 3306 | 3306 | $expression = str_replace('/', '\/', $expression); |
| 3307 | 3307 | |
| 3308 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3308 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3309 | 3309 | } |
| 3310 | 3310 | |
| 3311 | 3311 | |
@@ -3324,7 +3324,7 @@ discard block |
||
| 3324 | 3324 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3325 | 3325 | |
| 3326 | 3326 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3327 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3327 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3328 | 3328 | |
| 3329 | 3329 | if ( |
| 3330 | 3330 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3338,7 +3338,7 @@ discard block |
||
| 3338 | 3338 | if (!isset($doublons['documents'])) { |
| 3339 | 3339 | $doublons['documents'] = ''; |
| 3340 | 3340 | } |
| 3341 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3341 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3342 | 3342 | } |
| 3343 | 3343 | |
| 3344 | 3344 | return $letexte; |
@@ -3395,7 +3395,7 @@ discard block |
||
| 3395 | 3395 | if ($env) { |
| 3396 | 3396 | foreach ($env as $i => $j) { |
| 3397 | 3397 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3398 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3398 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3399 | 3399 | } |
| 3400 | 3400 | } |
| 3401 | 3401 | } |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | if ($env) { |
| 3435 | 3435 | foreach ($env as $i => $j) { |
| 3436 | 3436 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3437 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3437 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3438 | 3438 | } |
| 3439 | 3439 | } |
| 3440 | 3440 | } |
@@ -3508,10 +3508,10 @@ discard block |
||
| 3508 | 3508 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3509 | 3509 | if ( |
| 3510 | 3510 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3511 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3511 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3512 | 3512 | and file_exists($variante_svg_generique) |
| 3513 | 3513 | ) { |
| 3514 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3514 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3515 | 3515 | $img_file = $variante_svg_size; |
| 3516 | 3516 | } |
| 3517 | 3517 | else { |
@@ -3569,7 +3569,7 @@ discard block |
||
| 3569 | 3569 | return ''; |
| 3570 | 3570 | } |
| 3571 | 3571 | } |
| 3572 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3572 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3573 | 3573 | } |
| 3574 | 3574 | |
| 3575 | 3575 | if (file_exists($img_file)) { |
@@ -3579,14 +3579,14 @@ discard block |
||
| 3579 | 3579 | $alt = ''; |
| 3580 | 3580 | } |
| 3581 | 3581 | elseif ($alt or $alt === '') { |
| 3582 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3582 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3583 | 3583 | } |
| 3584 | 3584 | else { |
| 3585 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3585 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3586 | 3586 | } |
| 3587 | 3587 | return "<img src='$img_file'$alt" |
| 3588 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3589 | - . ' ' . ltrim($atts) |
|
| 3588 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3589 | + . ' '.ltrim($atts) |
|
| 3590 | 3590 | . ' />'; |
| 3591 | 3591 | } |
| 3592 | 3592 | |
@@ -3600,10 +3600,10 @@ discard block |
||
| 3600 | 3600 | */ |
| 3601 | 3601 | function http_style_background($img, $att = '', $size = null) { |
| 3602 | 3602 | if ($size and is_numeric($size)) { |
| 3603 | - $size = trim($size) . 'px'; |
|
| 3603 | + $size = trim($size).'px'; |
|
| 3604 | 3604 | } |
| 3605 | - return " style='background" . |
|
| 3606 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3605 | + return " style='background". |
|
| 3606 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3607 | 3607 | . ($size ? "background-size:{$size};" : '') |
| 3608 | 3608 | . "'"; |
| 3609 | 3609 | } |
@@ -3718,7 +3718,7 @@ discard block |
||
| 3718 | 3718 | $img = http_img_pack( |
| 3719 | 3719 | $img, |
| 3720 | 3720 | $alt, |
| 3721 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3721 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3722 | 3722 | '', |
| 3723 | 3723 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3724 | 3724 | ); |
@@ -3803,7 +3803,7 @@ discard block |
||
| 3803 | 3803 | $balise_svg_source = $balise_svg; |
| 3804 | 3804 | |
| 3805 | 3805 | // entete XML à supprimer |
| 3806 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3806 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3807 | 3807 | |
| 3808 | 3808 | // IE est toujours mon ami |
| 3809 | 3809 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3821,9 +3821,9 @@ discard block |
||
| 3821 | 3821 | // regler le alt |
| 3822 | 3822 | if ($alt) { |
| 3823 | 3823 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3824 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3824 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3825 | 3825 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3826 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3826 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3827 | 3827 | $balise_svg .= $title; |
| 3828 | 3828 | } |
| 3829 | 3829 | else { |
@@ -3871,7 +3871,7 @@ discard block |
||
| 3871 | 3871 | if (is_array($tableau)) { |
| 3872 | 3872 | foreach ($tableau as $k => $v) { |
| 3873 | 3873 | $res = recuperer_fond( |
| 3874 | - 'modeles/' . $modele, |
|
| 3874 | + 'modeles/'.$modele, |
|
| 3875 | 3875 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3876 | 3876 | ); |
| 3877 | 3877 | $texte .= $res; |
@@ -4056,7 +4056,7 @@ discard block |
||
| 4056 | 4056 | } |
| 4057 | 4057 | |
| 4058 | 4058 | $c = serialize($c); |
| 4059 | - $cle = calculer_cle_action($form . $c); |
|
| 4059 | + $cle = calculer_cle_action($form.$c); |
|
| 4060 | 4060 | $c = "$cle:$c"; |
| 4061 | 4061 | |
| 4062 | 4062 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4114,15 +4114,15 @@ discard block |
||
| 4114 | 4114 | } |
| 4115 | 4115 | // toujours encoder l'url source dans le bloc ajax |
| 4116 | 4116 | $r = self(); |
| 4117 | - $r = ' data-origin="' . $r . '"'; |
|
| 4117 | + $r = ' data-origin="'.$r.'"'; |
|
| 4118 | 4118 | $class = 'ajaxbloc'; |
| 4119 | 4119 | if ($ajaxid and is_string($ajaxid)) { |
| 4120 | 4120 | // ajaxid est normalement conforme a un nom de classe css |
| 4121 | 4121 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4122 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4122 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4123 | 4123 | } |
| 4124 | 4124 | |
| 4125 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4125 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4126 | 4126 | } |
| 4127 | 4127 | |
| 4128 | 4128 | /** |
@@ -4166,7 +4166,7 @@ discard block |
||
| 4166 | 4166 | $cle = substr($c, 0, $p); |
| 4167 | 4167 | $c = substr($c, $p + 1); |
| 4168 | 4168 | |
| 4169 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4169 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4170 | 4170 | $env = @unserialize($c); |
| 4171 | 4171 | return $env; |
| 4172 | 4172 | } |
@@ -4287,13 +4287,13 @@ discard block |
||
| 4287 | 4287 | } |
| 4288 | 4288 | } |
| 4289 | 4289 | } |
| 4290 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4290 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4291 | 4291 | } else { |
| 4292 | 4292 | $bal = 'a'; |
| 4293 | 4293 | $att = "href='$url'" |
| 4294 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4295 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4296 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4294 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4295 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4296 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4297 | 4297 | . $evt; |
| 4298 | 4298 | } |
| 4299 | 4299 | if ($libelle === null) { |
@@ -4432,7 +4432,7 @@ discard block |
||
| 4432 | 4432 | |
| 4433 | 4433 | // Icône |
| 4434 | 4434 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4435 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4435 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4436 | 4436 | |
| 4437 | 4437 | // Markup final |
| 4438 | 4438 | if ($type == 'lien') { |
@@ -4709,20 +4709,20 @@ discard block |
||
| 4709 | 4709 | $class_form = 'ajax'; |
| 4710 | 4710 | $class = str_replace('ajax', '', $class); |
| 4711 | 4711 | } |
| 4712 | - $class_btn = 'submit ' . trim($class); |
|
| 4712 | + $class_btn = 'submit '.trim($class); |
|
| 4713 | 4713 | |
| 4714 | 4714 | if ($confirm) { |
| 4715 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4715 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4716 | 4716 | if ($callback) { |
| 4717 | 4717 | $callback = "$confirm?($callback):false"; |
| 4718 | 4718 | } else { |
| 4719 | 4719 | $callback = $confirm; |
| 4720 | 4720 | } |
| 4721 | 4721 | } |
| 4722 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4722 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4723 | 4723 | $title = $title ? " title='$title'" : ''; |
| 4724 | 4724 | |
| 4725 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4725 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4726 | 4726 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4727 | 4727 | } |
| 4728 | 4728 | |
@@ -4787,14 +4787,14 @@ discard block |
||
| 4787 | 4787 | $champ_titre = ''; |
| 4788 | 4788 | if ($demande_titre) { |
| 4789 | 4789 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4790 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4790 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4791 | 4791 | } |
| 4792 | 4792 | include_spip('base/abstract_sql'); |
| 4793 | 4793 | include_spip('base/connect_sql'); |
| 4794 | 4794 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4795 | - '*' . $champ_titre, |
|
| 4795 | + '*'.$champ_titre, |
|
| 4796 | 4796 | $desc['table_sql'], |
| 4797 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4797 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4798 | 4798 | ); |
| 4799 | 4799 | |
| 4800 | 4800 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4887,8 +4887,7 @@ discard block |
||
| 4887 | 4887 | if (isset($ligne_sql['chapo'])) { |
| 4888 | 4888 | $chapo = $ligne_sql['chapo']; |
| 4889 | 4889 | $texte = strlen($descriptif) ? |
| 4890 | - '' : |
|
| 4891 | - "$chapo \n\n $texte"; |
|
| 4890 | + '' : "$chapo \n\n $texte"; |
|
| 4892 | 4891 | } |
| 4893 | 4892 | |
| 4894 | 4893 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4963,7 +4962,7 @@ discard block |
||
| 4963 | 4962 | return $texte; |
| 4964 | 4963 | } |
| 4965 | 4964 | |
| 4966 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4965 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4967 | 4966 | |
| 4968 | 4967 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4969 | 4968 | $Pile = [0 => $env]; |
@@ -4997,7 +4996,7 @@ discard block |
||
| 4997 | 4996 | } |
| 4998 | 4997 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4999 | 4998 | |
| 5000 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4999 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 5001 | 5000 | } |
| 5002 | 5001 | |
| 5003 | 5002 | /** |
@@ -5023,10 +5022,10 @@ discard block |
||
| 5023 | 5022 | function wrap($texte, $wrap) { |
| 5024 | 5023 | $balises = extraire_balises($wrap); |
| 5025 | 5024 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5026 | - $texte = $wrap . $texte; |
|
| 5025 | + $texte = $wrap.$texte; |
|
| 5027 | 5026 | $regs = array_reverse($regs[1]); |
| 5028 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5029 | - $texte = $texte . $wrap; |
|
| 5027 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5028 | + $texte = $texte.$wrap; |
|
| 5030 | 5029 | } |
| 5031 | 5030 | |
| 5032 | 5031 | return $texte; |
@@ -5057,7 +5056,7 @@ discard block |
||
| 5057 | 5056 | |
| 5058 | 5057 | // caster $u en array si besoin |
| 5059 | 5058 | if (is_object($u)) { |
| 5060 | - $u = (array)$u; |
|
| 5059 | + $u = (array) $u; |
|
| 5061 | 5060 | } |
| 5062 | 5061 | |
| 5063 | 5062 | if (is_array($u)) { |
@@ -5079,7 +5078,7 @@ discard block |
||
| 5079 | 5078 | // sinon on passe a la ligne et on indente |
| 5080 | 5079 | $i_str = str_pad('', $indent, ' '); |
| 5081 | 5080 | foreach ($u as $k => $v) { |
| 5082 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5081 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5083 | 5082 | } |
| 5084 | 5083 | |
| 5085 | 5084 | return $out; |
@@ -5133,7 +5132,7 @@ discard block |
||
| 5133 | 5132 | * @return string |
| 5134 | 5133 | */ |
| 5135 | 5134 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5136 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5135 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5137 | 5136 | $icone = chemin_image($icone); |
| 5138 | 5137 | $balise_img = charger_filtre('balise_img'); |
| 5139 | 5138 | |
@@ -5159,7 +5158,7 @@ discard block |
||
| 5159 | 5158 | */ |
| 5160 | 5159 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5161 | 5160 | $chaine = explode(':', $chaine); |
| 5162 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5161 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5163 | 5162 | return $t; |
| 5164 | 5163 | } |
| 5165 | 5164 | $chaine = implode(':', $chaine); |
@@ -5225,7 +5224,7 @@ discard block |
||
| 5225 | 5224 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5226 | 5225 | |
| 5227 | 5226 | // calculer le nom de la css |
| 5228 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5227 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5229 | 5228 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5230 | 5229 | $contexte_implicite = calculer_contexte_implicite(); |
| 5231 | 5230 | |
@@ -5233,14 +5232,14 @@ discard block |
||
| 5233 | 5232 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5234 | 5233 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5235 | 5234 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5236 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5235 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5237 | 5236 | } |
| 5238 | 5237 | else { |
| 5239 | 5238 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5240 | 5239 | ksort($contexte); |
| 5241 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5240 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5242 | 5241 | } |
| 5243 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5242 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5244 | 5243 | |
| 5245 | 5244 | // mettre a jour le fichier si il n'existe pas |
| 5246 | 5245 | // ou trop ancien |
@@ -5248,8 +5247,8 @@ discard block |
||
| 5248 | 5247 | // et recopie sur le fichier cible uniquement si il change |
| 5249 | 5248 | if ( |
| 5250 | 5249 | !file_exists($filename) |
| 5251 | - or !file_exists($filename . '.last') |
|
| 5252 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5250 | + or !file_exists($filename.'.last') |
|
| 5251 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5253 | 5252 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5254 | 5253 | ) { |
| 5255 | 5254 | $contenu = $cache['texte']; |
@@ -5270,10 +5269,10 @@ discard block |
||
| 5270 | 5269 | } |
| 5271 | 5270 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5272 | 5271 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5273 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5272 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5274 | 5273 | } |
| 5275 | 5274 | // et ecrire le fichier si il change |
| 5276 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5275 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5277 | 5276 | } |
| 5278 | 5277 | |
| 5279 | 5278 | return timestamp($filename); |
@@ -5499,7 +5498,7 @@ discard block |
||
| 5499 | 5498 | if ($e > 0 and strlen($mid) > 8) { |
| 5500 | 5499 | $mid = '***...***'; |
| 5501 | 5500 | } |
| 5502 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5501 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5503 | 5502 | } |
| 5504 | 5503 | |
| 5505 | 5504 | |
@@ -5561,7 +5560,7 @@ discard block |
||
| 5561 | 5560 | case 'id': |
| 5562 | 5561 | case 'anchor': |
| 5563 | 5562 | if (preg_match(',^\d,', $texte)) { |
| 5564 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5563 | + $texte = substr($type, 0, 1).$texte; |
|
| 5565 | 5564 | } |
| 5566 | 5565 | } |
| 5567 | 5566 | |
@@ -5571,9 +5570,9 @@ discard block |
||
| 5571 | 5570 | |
| 5572 | 5571 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5573 | 5572 | if (preg_match(',^\d,', $texte)) { |
| 5574 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5573 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5575 | 5574 | } |
| 5576 | - $texte .= $separateur . md5($original); |
|
| 5575 | + $texte .= $separateur.md5($original); |
|
| 5577 | 5576 | $texte = substr($texte, 0, $longueur_mini); |
| 5578 | 5577 | } |
| 5579 | 5578 | |
@@ -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 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | function initialiser_sel() { |
| 328 | 328 | if (!isset($GLOBALS['htsalt'])) { |
| 329 | 329 | if (CRYPT_MD5) { |
| 330 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 330 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 331 | 331 | } else { |
| 332 | 332 | $GLOBALS['htsalt'] = ''; |
| 333 | 333 | } |
@@ -349,8 +349,8 @@ discard block |
||
| 349 | 349 | * - void sinon. |
| 350 | 350 | **/ |
| 351 | 351 | function ecrire_acces() { |
| 352 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 353 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 352 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 353 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 354 | 354 | |
| 355 | 355 | // Cette variable de configuration peut etre posee par un plugin |
| 356 | 356 | // par exemple acces_restreint ; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | and !@file_exists($htaccess) |
| 362 | 362 | ) { |
| 363 | 363 | spip_unlink($htpasswd); |
| 364 | - spip_unlink($htpasswd . '-admin'); |
|
| 364 | + spip_unlink($htpasswd.'-admin'); |
|
| 365 | 365 | return; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | $pwd_all = ''; // login:htpass pour tous |
| 391 | 391 | $pwd_admin = ''; // login:htpass pour les admins |
| 392 | 392 | |
| 393 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 393 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 394 | 394 | while ($row = sql_fetch($res)) { |
| 395 | 395 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 396 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 396 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 397 | 397 | $pwd_all .= $ligne; |
| 398 | 398 | if ($row['statut'] == '0minirezo') { |
| 399 | 399 | $pwd_admin .= $ligne; |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @return boolean |
| 439 | 439 | */ |
| 440 | 440 | function verifier_htaccess($rep, $force = false) { |
| 441 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 441 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 442 | 442 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 443 | 443 | return true; |
| 444 | 444 | } |
@@ -467,17 +467,17 @@ discard block |
||
| 467 | 467 | fputs($ht, $deny); |
| 468 | 468 | fclose($ht); |
| 469 | 469 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 470 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 470 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 471 | 471 | if ($ht = @fopen($t, 'w')) { |
| 472 | 472 | @fclose($ht); |
| 473 | 473 | include_spip('inc/distant'); |
| 474 | 474 | $t = substr($t, strlen(_DIR_RACINE)); |
| 475 | - $t = url_de_base() . $t; |
|
| 475 | + $t = url_de_base().$t; |
|
| 476 | 476 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 477 | 477 | $ht = ($ht['status'] ?? null) === 403; |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 480 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 481 | 481 | |
| 482 | 482 | return $ht; |
| 483 | 483 | } |
@@ -503,11 +503,11 @@ discard block |
||
| 503 | 503 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 504 | 504 | $dirs[] = ['extension' => 'distant']; |
| 505 | 505 | foreach ($dirs as $e) { |
| 506 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 506 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 507 | 507 | if ($f) { |
| 508 | 508 | verifier_htaccess($dir); |
| 509 | 509 | } else { |
| 510 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 510 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | -require_once _ROOT_RESTREINT . 'base/objets.php'; |
|
| 21 | +require_once _ROOT_RESTREINT.'base/objets.php'; |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $f = (!preg_match('/^[\w\.]*$/', $serveur)) |
| 60 | 60 | ? '' // nom de serveur mal ecrit |
| 61 | 61 | : ($serveur ? |
| 62 | - (_DIR_CONNECT . $serveur . '.php') // serveur externe |
|
| 62 | + (_DIR_CONNECT.$serveur.'.php') // serveur externe |
|
| 63 | 63 | : (_FILE_CONNECT ?: ($install ? _FILE_CONNECT_TMP // init du serveur principal |
| 64 | 64 | : ''))); // installation pas faite |
| 65 | 65 | |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | // chargement de la version du jeu de fonctions |
| 102 | 102 | // si pas dans le fichier par defaut |
| 103 | 103 | $type = $GLOBALS['db_ok']['type']; |
| 104 | - $jeu = 'spip_' . $type . '_functions_' . $version; |
|
| 104 | + $jeu = 'spip_'.$type.'_functions_'.$version; |
|
| 105 | 105 | if (!isset($GLOBALS[$jeu])) { |
| 106 | - if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) { |
|
| 106 | + if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) { |
|
| 107 | 107 | spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS); |
| 108 | 108 | |
| 109 | 109 | // ne plus reessayer |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | $connexion = spip_connect($serveur); |
| 166 | 166 | $e = sql_errno($serveur); |
| 167 | 167 | $t = ($connexion['type'] ?? 'sql'); |
| 168 | - $m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']); |
|
| 169 | - $f = $t . $serveur; |
|
| 170 | - spip_log($m, $f . '.' . _LOG_ERREUR); |
|
| 168 | + $m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']); |
|
| 169 | + $f = $t.$serveur; |
|
| 170 | + spip_log($m, $f.'.'._LOG_ERREUR); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | // si en cours d'installation ou si db=@test@ on ne pose rien |
| 254 | 254 | // car c'est un test de connexion |
| 255 | 255 | if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') { |
| 256 | - $f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out'; |
|
| 256 | + $f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out'; |
|
| 257 | 257 | } elseif ($db == '@test@') { |
| 258 | 258 | $db = ''; |
| 259 | 259 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // En cas d'indisponibilite du serveur, eviter de le bombarder |
| 293 | 293 | if ($f) { |
| 294 | 294 | @touch($f); |
| 295 | - spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS); |
|
| 295 | + spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS); |
|
| 296 | 296 | } |
| 297 | 297 | return null; |
| 298 | 298 | } |
@@ -390,11 +390,11 @@ discard block |
||
| 390 | 390 | } elseif (is_array($a)) { |
| 391 | 391 | return join(',', array_map('_q', $a)); |
| 392 | 392 | } elseif (is_scalar($a)) { |
| 393 | - return ("'" . addslashes($a) . "'"); |
|
| 393 | + return ("'".addslashes($a)."'"); |
|
| 394 | 394 | } elseif ($a === null) { |
| 395 | 395 | return "''"; |
| 396 | 396 | } |
| 397 | - throw new \RuntimeException('Can’t use _q with ' . gettype($a)); |
|
| 397 | + throw new \RuntimeException('Can’t use _q with '.gettype($a)); |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /** |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | $next = reset($textes); |
| 446 | 446 | if ( |
| 447 | 447 | strpos($next, "'") === 0 |
| 448 | - and strpos($query_echappees, $part . $next, $currentpos) === $nextpos |
|
| 448 | + and strpos($query_echappees, $part.$next, $currentpos) === $nextpos |
|
| 449 | 449 | ) { |
| 450 | 450 | $part .= array_shift($textes); |
| 451 | 451 | } |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $parts[$k] = [ |
| 458 | 458 | 'texte' => $part, |
| 459 | 459 | 'position' => $nextpos, |
| 460 | - 'placeholder' => '%' . $k . '$s', |
|
| 460 | + 'placeholder' => '%'.$k.'$s', |
|
| 461 | 461 | ]; |
| 462 | 462 | $currentpos = $nextpos + strlen($part); |
| 463 | 463 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | static $dirs = []; |
| 42 | 42 | $liste = []; |
| 43 | 43 | foreach (creer_chemin() as $dir) { |
| 44 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 44 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 45 | 45 | $dirs[$a] = (is_dir($a) || !$a); |
| 46 | 46 | } |
| 47 | 47 | if ($dirs[$a]) { |
@@ -67,21 +67,21 @@ discard block |
||
| 67 | 67 | **/ |
| 68 | 68 | function chercher_module_lang($module, $lang = '') { |
| 69 | 69 | if ($lang) { |
| 70 | - $lang = '_' . $lang; |
|
| 70 | + $lang = '_'.$lang; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 74 | 74 | if ( |
| 75 | 75 | $f = ($module == 'local' |
| 76 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 77 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 76 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 77 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 78 | 78 | ) { |
| 79 | 79 | return is_array($f) ? $f : [$f]; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 83 | 83 | return (($module == 'local') or strpos($module, '/')) |
| 84 | - ? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false) |
|
| 84 | + ? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false) |
|
| 85 | 85 | : false; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | **/ |
| 106 | 106 | function charger_langue($lang, $module = 'spip') { |
| 107 | 107 | static $langs = []; |
| 108 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 108 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 109 | 109 | if (!isset($langs[$lang])) { |
| 110 | 110 | $langs[$lang] = []; |
| 111 | 111 | if ($lang) { |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | foreach ($langs[$lang] as $l) { |
| 122 | 122 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 123 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 123 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 124 | 124 | $GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang)); |
| 125 | 125 | surcharger_langue($fichiers_lang); |
| 126 | 126 | if ($l !== $lang) { |
| 127 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 127 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 128 | 128 | } |
| 129 | - $GLOBALS['lang_' . $var] = $l; |
|
| 129 | + $GLOBALS['lang_'.$var] = $l; |
|
| 130 | 130 | #spip_log("module de langue : ${module}_$l.php", 'traduire'); |
| 131 | 131 | break; |
| 132 | 132 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | function lire_fichier_langue(string $fichier): array { |
| 146 | 146 | $idx_lang_before = $GLOBALS['idx_lang'] ?? null; |
| 147 | - $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire'; |
|
| 147 | + $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire'; |
|
| 148 | 148 | $GLOBALS['idx_lang'] = $idx_lang_tmp; |
| 149 | 149 | $idx_lang = include $fichier; |
| 150 | 150 | $GLOBALS['idx_lang'] = $idx_lang_before; |
@@ -273,27 +273,27 @@ discard block |
||
| 273 | 273 | } else { |
| 274 | 274 | $modules = ['spip', 'ecrire']; |
| 275 | 275 | $code = $ori; |
| 276 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 276 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | $desc = new SPIP_Traductions_Description(); |
| 280 | 280 | |
| 281 | 281 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 282 | 282 | foreach ($modules as $module) { |
| 283 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 283 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 284 | 284 | |
| 285 | 285 | if (empty($GLOBALS[$var])) { |
| 286 | 286 | charger_langue($lang, $module); |
| 287 | 287 | // surcharges persos -- on cherche |
| 288 | 288 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 289 | - if (!isset($local['local_' . $lang])) { |
|
| 289 | + if (!isset($local['local_'.$lang])) { |
|
| 290 | 290 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 291 | 291 | $GLOBALS['idx_lang'] = $var; |
| 292 | 292 | // ... (lang/)local_xx.php |
| 293 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 293 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 294 | 294 | } |
| 295 | - if ($local['local_' . $lang]) { |
|
| 296 | - surcharger_langue($local['local_' . $lang]); |
|
| 295 | + if ($local['local_'.$lang]) { |
|
| 296 | + surcharger_langue($local['local_'.$lang]); |
|
| 297 | 297 | } |
| 298 | 298 | // ... puis (lang/)local.php |
| 299 | 299 | if (!isset($local['local'])) { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | if (isset($GLOBALS[$var][$code])) { |
| 308 | 308 | $desc->code = $code; |
| 309 | 309 | $desc->module = $module; |
| 310 | - $desc->langue = $GLOBALS['lang_' . $var]; |
|
| 310 | + $desc->langue = $GLOBALS['lang_'.$var]; |
|
| 311 | 311 | $desc->texte = $GLOBALS[$var][$code]; |
| 312 | 312 | break; |
| 313 | 313 | } |
@@ -365,13 +365,13 @@ discard block |
||
| 365 | 365 | if (!$desc->mode and $desc->texte) { |
| 366 | 366 | // ne pas modifier 2 fois l'affichage |
| 367 | 367 | $desc->mode = 'traduction'; |
| 368 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 368 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 369 | 369 | $desc->texte = '<span ' |
| 370 | - . 'lang=' . $desc->langue |
|
| 371 | - . ' class=' . $classe |
|
| 372 | - . ' data-module=' . $desc->module |
|
| 373 | - . ' data-code=' . $desc->code |
|
| 374 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 370 | + . 'lang='.$desc->langue |
|
| 371 | + . ' class='.$classe |
|
| 372 | + . ' data-module='.$desc->module |
|
| 373 | + . ' data-code='.$desc->code |
|
| 374 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 375 | 375 | . $desc->texte |
| 376 | 376 | . '</span>'; |
| 377 | 377 | $desc->texte = str_replace( |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | ob_start(); |
| 48 | 48 | if (strpos($page['texte'], '?xml') !== false) { |
| 49 | - $page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']); |
|
| 49 | + $page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | try { |
| 53 | - $res = eval('?' . '>' . $page['texte']); |
|
| 53 | + $res = eval('?'.'>'.$page['texte']); |
|
| 54 | 54 | $page['texte'] = ob_get_contents(); |
| 55 | 55 | } catch (\Throwable $e) { |
| 56 | 56 | $code = $page['texte']; |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | if (!function_exists('numerote_ligne_php')) { |
| 59 | 59 | function numerote_ligne_php($match) { |
| 60 | 60 | $GLOBALS['numero_ligne_php']++; |
| 61 | - return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 61 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 64 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 65 | 65 | $code = trim(highlight_string($code, true)); |
| 66 | - erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]); |
|
| 66 | + erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]); |
|
| 67 | 67 | $page['texte'] = '<!-- Erreur -->'; |
| 68 | 68 | } |
| 69 | 69 | ob_end_clean(); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $page['process_ins'] = 'html'; |
| 72 | 72 | |
| 73 | 73 | if (strpos($page['texte'], '?xml') !== false) { |
| 74 | - $page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']); |
|
| 74 | + $page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | sql_updateq( |
| 136 | 136 | 'spip_rubriques', |
| 137 | 137 | ['statut' => 'publie', 'date' => date('Y-m-d H:i:s')], |
| 138 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 138 | + 'id_rubrique='.intval($id_rubrique) |
|
| 139 | 139 | ); |
| 140 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique)); |
|
| 140 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique)); |
|
| 141 | 141 | if (!$id_parent) { |
| 142 | 142 | break; |
| 143 | 143 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | return $id_pred != $id_rubrique; |
| 173 | 173 | } |
| 174 | 174 | // passer au parent si on a depublie |
| 175 | - $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred)); |
|
| 175 | + $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred)); |
|
| 176 | 176 | $id_pred = $r['id_parent']; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | $date = date('Y-m-d H:i:s'); |
| 198 | 198 | } |
| 199 | 199 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 200 | - ' AND date <= ' . sql_quote($date) : ''; |
|
| 200 | + ' AND date <= '.sql_quote($date) : ''; |
|
| 201 | 201 | |
| 202 | 202 | if (!$id_rubrique = intval($id_rubrique)) { |
| 203 | 203 | return false; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // verifier qu'elle existe et est bien publiee |
| 207 | - $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 207 | + $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 208 | 208 | if (!$r or $r['statut'] !== 'publie') { |
| 209 | 209 | return false; |
| 210 | 210 | } |
@@ -214,12 +214,12 @@ discard block |
||
| 214 | 214 | $compte = [ |
| 215 | 215 | 'articles' => sql_countsel( |
| 216 | 216 | 'spip_articles', |
| 217 | - 'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates" |
|
| 217 | + 'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates" |
|
| 218 | 218 | ), |
| 219 | - 'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"), |
|
| 219 | + 'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"), |
|
| 220 | 220 | 'documents' => sql_countsel( |
| 221 | 221 | 'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document', |
| 222 | - 'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 222 | + 'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 223 | 223 | ) |
| 224 | 224 | ]; |
| 225 | 225 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique)); |
|
| 247 | + sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique)); |
|
| 248 | 248 | |
| 249 | 249 | # spip_log("depublier_rubrique $id_pred"); |
| 250 | 250 | return true; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Afficher les articles post-dates ? |
| 309 | 309 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 310 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 310 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 311 | 311 | |
| 312 | 312 | $r = sql_select( |
| 313 | 313 | 'R.id_rubrique AS id, max(A.date) AS date_h', |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | sql_updateq( |
| 320 | 320 | 'spip_rubriques', |
| 321 | 321 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 322 | - 'id_rubrique=' . intval($row['id']) |
|
| 322 | + 'id_rubrique='.intval($row['id']) |
|
| 323 | 323 | ); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | sql_updateq( |
| 346 | 346 | 'spip_rubriques', |
| 347 | 347 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 348 | - 'id_rubrique=' . intval($row['id']) |
|
| 348 | + 'id_rubrique='.intval($row['id']) |
|
| 349 | 349 | ); |
| 350 | 350 | $continuer = true; |
| 351 | 351 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | and $rows = sql_allfetsel( |
| 399 | 399 | 'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur', |
| 400 | 400 | 'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique', |
| 401 | - 'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 401 | + 'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 402 | 402 | '', |
| 403 | 403 | 'R.id_secteur', |
| 404 | 404 | '0,100' |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | and $rows = sql_allfetsel( |
| 438 | 438 | 'id_rubrique as id', |
| 439 | 439 | 'spip_rubriques', |
| 440 | - 'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select( |
|
| 440 | + 'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select( |
|
| 441 | 441 | 'zzz.id_rubrique', |
| 442 | 442 | 'spip_rubriques AS zzz', |
| 443 | - 'zzz.profondeur=' . intval($prof) |
|
| 444 | - ) . ')', |
|
| 443 | + 'zzz.profondeur='.intval($prof) |
|
| 444 | + ).')', |
|
| 445 | 445 | '', |
| 446 | 446 | '', |
| 447 | 447 | '0,100' |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | // si pas de rubrique a profondeur $prof+1 pas la peine de continuer |
| 456 | 456 | // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse) |
| 457 | 457 | // on arrete les frais |
| 458 | - if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) { |
|
| 458 | + if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) { |
|
| 459 | 459 | $prof++; |
| 460 | 460 | $continuer = true; |
| 461 | 461 | } |
@@ -463,12 +463,12 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // loger si la table des rubriques semble foireuse |
| 465 | 465 | // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles |
| 466 | - if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) { |
|
| 466 | + if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) { |
|
| 467 | 467 | spip_log( |
| 468 | - 'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 468 | + 'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 469 | 469 | _LOG_CRITIQUE |
| 470 | 470 | ); |
| 471 | - sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1)); |
|
| 471 | + sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1)); |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | // reparer les articles |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | 481 | while ($row = sql_fetch($r)) { |
| 482 | - sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id'])); |
|
| 482 | + sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id'])); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // avertir les plugins qui peuvent faire leur mises a jour egalement |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $t = sql_updateq( |
| 511 | 511 | 'spip_rubriques', |
| 512 | 512 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 513 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 513 | + 'id_rubrique='.intval($id_rubrique) |
|
| 514 | 514 | ); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | sql_updateq( |
| 556 | 556 | 'spip_articles', |
| 557 | 557 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 558 | - 'id_article=' . intval($id_article) |
|
| 558 | + 'id_article='.intval($id_article) |
|
| 559 | 559 | ); |
| 560 | 560 | } |
| 561 | 561 | |
@@ -630,11 +630,11 @@ discard block |
||
| 630 | 630 | ]; |
| 631 | 631 | // generer un nom de fonction "anonyme" unique |
| 632 | 632 | do { |
| 633 | - $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax()); |
|
| 633 | + $functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax()); |
|
| 634 | 634 | } while (function_exists($functionname)); |
| 635 | 635 | $code = calculer_boucle('calculer_langues_utilisees', $boucles); |
| 636 | - $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code; |
|
| 637 | - $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();'; |
|
| 636 | + $code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code; |
|
| 637 | + $code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();'; |
|
| 638 | 638 | $res = ''; |
| 639 | 639 | eval($code); |
| 640 | 640 | $res = explode(',', $res); |
@@ -736,11 +736,11 @@ discard block |
||
| 736 | 736 | $maxiter-- and $filles = sql_allfetsel( |
| 737 | 737 | 'id_rubrique', |
| 738 | 738 | 'spip_rubriques', |
| 739 | - sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT') |
|
| 739 | + sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT') |
|
| 740 | 740 | ) |
| 741 | 741 | ) { |
| 742 | 742 | $r = join(',', array_column($filles, 'id_rubrique')); |
| 743 | - $branche .= ',' . $r; |
|
| 743 | + $branche .= ','.$r; |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | if (isset($b[$id])) { |
| 782 | 782 | // Notre branche commence par la rubrique de depart si $tout=true |
| 783 | - return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id]; |
|
| 783 | + return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id]; |
|
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | $hier = ''; |
@@ -793,11 +793,11 @@ discard block |
||
| 793 | 793 | $maxiter-- and $parents = sql_allfetsel( |
| 794 | 794 | 'id_parent', |
| 795 | 795 | 'spip_rubriques', |
| 796 | - sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT') |
|
| 796 | + sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT') |
|
| 797 | 797 | ) |
| 798 | 798 | ) { |
| 799 | 799 | $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent')); |
| 800 | - $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : ''); |
|
| 800 | + $hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : ''); |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | include_spip('base/abstract_sql'); |
| 830 | 830 | if ($check) { |
| 831 | 831 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 832 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 832 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 833 | 833 | |
| 834 | 834 | $r = sql_select( |
| 835 | 835 | 'DISTINCT A.id_rubrique AS id', |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $t = sql_fetsel( |
| 847 | 847 | 'date', |
| 848 | 848 | 'spip_articles', |
| 849 | - "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), |
|
| 849 | + "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), |
|
| 850 | 850 | '', |
| 851 | 851 | 'date', |
| 852 | 852 | '1' |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | $r = sql_getfetsel( |
| 903 | 903 | 'id_rubrique', |
| 904 | 904 | 'spip_rubriques', |
| 905 | - 'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent), |
|
| 905 | + 'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent), |
|
| 906 | 906 | $groupby = [], |
| 907 | 907 | $orderby = [], |
| 908 | 908 | $limit = '', |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | sql_updateq( |
| 939 | 939 | 'spip_rubriques', |
| 940 | 940 | ['id_secteur' => $id_secteur, 'lang' => $lang], |
| 941 | - 'id_rubrique=' . intval($id_rubrique), |
|
| 941 | + 'id_rubrique='.intval($id_rubrique), |
|
| 942 | 942 | [], |
| 943 | 943 | $serveur |
| 944 | 944 | ); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | // Appels incomplets (sans $c) |
| 115 | 115 | if (!is_array($c)) { |
| 116 | - spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c'); |
|
| 116 | + spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c'); |
|
| 117 | 117 | |
| 118 | 118 | return _T('erreur_technique_enregistrement_impossible'); |
| 119 | 119 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $champs = array_map('corriger_caracteres', $champs); |
| 147 | 147 | |
| 148 | 148 | // On récupère l'état avant toute modification |
| 149 | - $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet); |
|
| 149 | + $row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet); |
|
| 150 | 150 | |
| 151 | 151 | // Envoyer aux plugins |
| 152 | 152 | $champs = pipeline( |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $id_rubrique = 0; |
| 201 | 201 | if (isset($desc['field']['id_rubrique'])) { |
| 202 | 202 | $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique'; |
| 203 | - $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet)); |
|
| 203 | + $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet)); |
|
| 204 | 204 | } |
| 205 | 205 | $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action'); |
| 206 | 206 | $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur); |
@@ -222,13 +222,13 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | // allez on commit la modif |
| 225 | - sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), [], $serveur); |
|
| 225 | + sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), [], $serveur); |
|
| 226 | 226 | |
| 227 | 227 | // on verifie si elle est bien passee |
| 228 | 228 | $moof = sql_fetsel( |
| 229 | 229 | array_keys($champs), |
| 230 | 230 | $spip_table_objet, |
| 231 | - "$id_table_objet=" . intval($id_objet), |
|
| 231 | + "$id_table_objet=".intval($id_objet), |
|
| 232 | 232 | [], |
| 233 | 233 | [], |
| 234 | 234 | '', |
@@ -264,13 +264,13 @@ discard block |
||
| 264 | 264 | // c'est un cas exceptionnel |
| 265 | 265 | if (count($liste)) { |
| 266 | 266 | spip_log( |
| 267 | - "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true), |
|
| 268 | - 'modifier.' . _LOG_CRITIQUE |
|
| 267 | + "Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true), |
|
| 268 | + 'modifier.'._LOG_CRITIQUE |
|
| 269 | 269 | ); |
| 270 | 270 | |
| 271 | 271 | return _T( |
| 272 | 272 | 'erreur_technique_enregistrement_champs', |
| 273 | - ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"] |
|
| 273 | + ['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"] |
|
| 274 | 274 | ); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -312,18 +312,18 @@ discard block |
||
| 312 | 312 | include_spip('inc/filtres_mini'); |
| 313 | 313 | $qui = ''; |
| 314 | 314 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 315 | - $qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#'; |
|
| 315 | + $qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#'; |
|
| 316 | 316 | } |
| 317 | 317 | if (!empty($GLOBALS['visiteur_session']['nom'])) { |
| 318 | - $qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#'; |
|
| 318 | + $qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#'; |
|
| 319 | 319 | } |
| 320 | 320 | if ($qui == '') { |
| 321 | - $qui = '#ip:' . $GLOBALS['ip'] . '#'; |
|
| 321 | + $qui = '#ip:'.$GLOBALS['ip'].'#'; |
|
| 322 | 322 | } |
| 323 | - journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join( |
|
| 323 | + journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join( |
|
| 324 | 324 | '+', |
| 325 | 325 | array_diff(array_keys($champs), ['date_modif']) |
| 326 | - ) . ')'), [ |
|
| 326 | + ).')'), [ |
|
| 327 | 327 | 'faire' => 'modifier', |
| 328 | 328 | 'quoi' => $objet, |
| 329 | 329 | 'id' => $id_objet |