@@ -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,14 +98,14 @@ 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 | - _T('fichier_introuvable', ['fichier' => '<b>' . spip_htmlentities($d) . '</b>']), |
|
| 108 | - ['all_inline' => true,'status' => 404] |
|
| 107 | + _T('fichier_introuvable', ['fichier' => '<b>'.spip_htmlentities($d).'</b>']), |
|
| 108 | + ['all_inline' => true, 'status' => 404] |
|
| 109 | 109 | ); |
| 110 | 110 | exit; |
| 111 | 111 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * - string : chemin du fichier trouvé |
| 152 | 152 | **/ |
| 153 | 153 | function include_spip($f, $include = true) { |
| 154 | - return find_in_path($f . '.php', '', $include); |
|
| 154 | + return find_in_path($f.'.php', '', $include); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * - string : chemin du fichier trouvé |
| 172 | 172 | **/ |
| 173 | 173 | function require_spip($f) { |
| 174 | - return find_in_path($f . '.php', '', 'required'); |
|
| 174 | + return find_in_path($f.'.php', '', 'required'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // donc il faut l'inclure "en globals" |
| 189 | 189 | if ($f = find_in_path('mes_fonctions.php')) { |
| 190 | 190 | global $dossier_squelettes; |
| 191 | - include_once(_ROOT_CWD . $f); |
|
| 191 | + include_once(_ROOT_CWD.$f); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | // appliquer notre fonction si elle existe |
| 296 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 296 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 297 | 297 | if (function_exists($fonc)) { |
| 298 | 298 | $val = $fonc($val); |
| 299 | 299 | } // plantage ? |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | function spip_log($message = null, $name = null) { |
| 359 | 359 | static $pre = []; |
| 360 | 360 | static $log; |
| 361 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 361 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 362 | 362 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 363 | 363 | $logname = null; |
| 364 | 364 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | if (!is_string($message)) { |
| 387 | 387 | $message = print_r($message, true); |
| 388 | 388 | } |
| 389 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 389 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | $a = './'; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 590 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 591 | 591 | $ajouts = array_flip(explode('|', $c)); |
| 592 | 592 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 593 | 593 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 615 | 615 | // pour un tableau ce sera fait dans la prochaine boucle |
| 616 | 616 | elseif (substr($r[1], -2) != '[]') { |
| 617 | - $url[$n] = $r[1] . '=' . $u; |
|
| 617 | + $url[$n] = $r[1].'='.$u; |
|
| 618 | 618 | unset($ajouts[$r[1]]); |
| 619 | 619 | } |
| 620 | 620 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -635,11 +635,11 @@ discard block |
||
| 635 | 635 | } elseif ($testv) { |
| 636 | 636 | foreach ($ajouts as $k => $n) { |
| 637 | 637 | if (!is_array($v)) { |
| 638 | - $url[] = $k . '=' . $u; |
|
| 638 | + $url[] = $k.'='.$u; |
|
| 639 | 639 | } else { |
| 640 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 640 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 641 | 641 | foreach ($v as $w) { |
| 642 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 642 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 643 | 643 | } |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -650,10 +650,10 @@ discard block |
||
| 650 | 650 | |
| 651 | 651 | // recomposer l'adresse |
| 652 | 652 | if ($url) { |
| 653 | - $a .= '?' . join($sep, $url); |
|
| 653 | + $a .= '?'.join($sep, $url); |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | - return $a . $ancre; |
|
| 656 | + return $a.$ancre; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | /** |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | translitteration($ancre) |
| 686 | 686 | ); |
| 687 | 687 | } |
| 688 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 688 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | /** |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | * @return bool |
| 802 | 802 | */ |
| 803 | 803 | function test_plugin_actif($plugin) { |
| 804 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 804 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | /** |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | $value = interdire_scripts($value, -1); |
| 934 | 934 | } |
| 935 | 935 | if (!empty($options['class'])) { |
| 936 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 936 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 937 | 937 | } |
| 938 | 938 | $text = str_replace("@$name@", $value, $text); |
| 939 | 939 | unset($args[$name]); |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | // Si des variables n'ont pas ete inserees, le signaler |
| 943 | 943 | // (chaines de langues pas a jour) |
| 944 | 944 | if ($args) { |
| 945 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 945 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | function joli_repertoire($rep) { |
| 967 | 967 | $a = substr($rep, 0, 1); |
| 968 | 968 | if ($a <> '.' and $a <> '/') { |
| 969 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 969 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 970 | 970 | } |
| 971 | 971 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 972 | 972 | |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | $p -= ($x * 1000); |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1023 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1024 | 1024 | } |
| 1025 | 1025 | } |
| 1026 | 1026 | |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | if ($taches and count($taches) and !spip_connect()) { |
| 1088 | 1088 | return false; |
| 1089 | 1089 | } |
| 1090 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1090 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1091 | 1091 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1092 | 1092 | return $genie($taches); |
| 1093 | 1093 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | if ($queue_next_job_time == -1) { |
| 1193 | 1193 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1194 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1194 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | // utiliser un cache memoire si dispo |
| 1197 | 1197 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1260,8 +1260,8 @@ discard block |
||
| 1260 | 1260 | $src = ''; |
| 1261 | 1261 | } |
| 1262 | 1262 | if ($script) { |
| 1263 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1264 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1263 | + $script = ("/*<![CDATA[*/\n". |
|
| 1264 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1265 | 1265 | '/*]]>*/'); |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($noscript) { |
@@ -1347,13 +1347,13 @@ discard block |
||
| 1347 | 1347 | if ($path_base == null) { |
| 1348 | 1348 | // Chemin standard depuis l'espace public |
| 1349 | 1349 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1350 | - _DIR_RACINE . ':' . |
|
| 1351 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1352 | - _DIR_RACINE . 'prive/:' . |
|
| 1350 | + _DIR_RACINE.':'. |
|
| 1351 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1352 | + _DIR_RACINE.'prive/:'. |
|
| 1353 | 1353 | _DIR_RESTREINT; |
| 1354 | 1354 | // Ajouter squelettes/ |
| 1355 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1356 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1355 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1356 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1357 | 1357 | } |
| 1358 | 1358 | foreach (explode(':', $path) as $dir) { |
| 1359 | 1359 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | // Et le(s) dossier(s) des squelettes nommes |
| 1366 | 1366 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1367 | 1367 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1368 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1368 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | |
| 1377 | 1377 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1378 | 1378 | $tete = ''; |
| 1379 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1379 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1380 | 1380 | $tete = array_shift($path_base); |
| 1381 | 1381 | } |
| 1382 | 1382 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | // Et le(s) dossier(s) des squelettes nommes |
| 1398 | 1398 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1399 | 1399 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1400 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1400 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -1468,14 +1468,14 @@ discard block |
||
| 1468 | 1468 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1469 | 1469 | if ( |
| 1470 | 1470 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1471 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1471 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1472 | 1472 | and $f = find_in_theme("$file_svg_generique") |
| 1473 | 1473 | ) { |
| 1474 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1474 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1475 | 1475 | return $themefiles["$subdir$file"] = $fsize; |
| 1476 | 1476 | } |
| 1477 | 1477 | else { |
| 1478 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1478 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1479 | 1479 | } |
| 1480 | 1480 | } |
| 1481 | 1481 | |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | return $themefiles["$subdir$file"] = $f; |
| 1486 | 1486 | } |
| 1487 | 1487 | } |
| 1488 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1488 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1489 | 1489 | |
| 1490 | 1490 | return $themefiles["$subdir$file"] = ''; |
| 1491 | 1491 | } |
@@ -1593,8 +1593,8 @@ discard block |
||
| 1593 | 1593 | return false; |
| 1594 | 1594 | } |
| 1595 | 1595 | if ($include and !isset($inc[$dirname][$file])) { |
| 1596 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1596 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1607,14 +1607,14 @@ discard block |
||
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | foreach (creer_chemin() as $dir) { |
| 1610 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1611 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1610 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1611 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1612 | 1612 | } |
| 1613 | 1613 | if ($dirs[$a]) { |
| 1614 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1614 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1615 | 1615 | if ($include and !isset($inc[$dirname][$file])) { |
| 1616 | - include_once _ROOT_CWD . $a; |
|
| 1617 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1616 | + include_once _ROOT_CWD.$a; |
|
| 1617 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | if (!defined('_SAUVER_CHEMIN')) { |
| 1620 | 1620 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | define('_SAUVER_CHEMIN', true); |
| 1625 | 1625 | } |
| 1626 | 1626 | |
| 1627 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1627 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | } |
| 1630 | 1630 | } |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | define('_SAUVER_CHEMIN', true); |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1653 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | function clear_path_cache() { |
@@ -1720,12 +1720,12 @@ discard block |
||
| 1720 | 1720 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1721 | 1721 | // on a pas encore inclus flock.php |
| 1722 | 1722 | if (!function_exists('preg_files')) { |
| 1723 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1723 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | 1726 | // Parcourir le chemin |
| 1727 | 1727 | foreach (creer_chemin() as $d) { |
| 1728 | - $f = $d . $dir; |
|
| 1728 | + $f = $d.$dir; |
|
| 1729 | 1729 | if (@is_dir($f)) { |
| 1730 | 1730 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1731 | 1731 | foreach ($liste as $chemin) { |
@@ -1774,9 +1774,9 @@ discard block |
||
| 1774 | 1774 | function charger_fonction_url(string $quoi, string $type = '') { |
| 1775 | 1775 | if ($type === 'defaut') { |
| 1776 | 1776 | $objet = objet_type($quoi); |
| 1777 | - if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1777 | + if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1778 | 1778 | // deprecated |
| 1779 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1779 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1780 | 1780 | ) { |
| 1781 | 1781 | return $f; |
| 1782 | 1782 | } |
@@ -1896,7 +1896,7 @@ discard block |
||
| 1896 | 1896 | * @deprecated 4.1 |
| 1897 | 1897 | * @see generer_objet_url |
| 1898 | 1898 | */ |
| 1899 | -function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null){ |
|
| 1899 | +function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null) { |
|
| 1900 | 1900 | if ($public and is_string($public)) { |
| 1901 | 1901 | return generer_objet_url(intval($id), $entite, $args ?: '', $ancre ?: '', true, $type ?? '', $public); |
| 1902 | 1902 | } |
@@ -1930,7 +1930,7 @@ discard block |
||
| 1930 | 1930 | * @deprecated 4.1 |
| 1931 | 1931 | * @see generer_objet_url_ecrire_edit |
| 1932 | 1932 | */ |
| 1933 | -function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){ |
|
| 1933 | +function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') { |
|
| 1934 | 1934 | return generer_objet_url_ecrire_edit(intval($id), $entite, $args, $ancre); |
| 1935 | 1935 | } |
| 1936 | 1936 | |
@@ -1939,8 +1939,8 @@ discard block |
||
| 1939 | 1939 | include_spip('base/connect_sql'); |
| 1940 | 1940 | $id_type = id_table_objet($entite, $public); |
| 1941 | 1941 | |
| 1942 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1943 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1942 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1943 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1944 | 1944 | . (!$args ? '' : "&$args") |
| 1945 | 1945 | . (!$ancre ? '' : "#$ancre"); |
| 1946 | 1946 | } |
@@ -1993,7 +1993,7 @@ discard block |
||
| 1993 | 1993 | * @deprecated 4.1 |
| 1994 | 1994 | * @see generer_objet_url_absolue |
| 1995 | 1995 | */ |
| 1996 | -function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null){ |
|
| 1996 | +function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null) { |
|
| 1997 | 1997 | return generer_objet_url_absolue(intval($id), $entite, $args, $ancre, true, '', $connect); |
| 1998 | 1998 | } |
| 1999 | 1999 | |
@@ -2110,7 +2110,7 @@ discard block |
||
| 2110 | 2110 | !empty($_SERVER['QUERY_STRING']) |
| 2111 | 2111 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2112 | 2112 | ) { |
| 2113 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2113 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2114 | 2114 | } |
| 2115 | 2115 | } |
| 2116 | 2116 | } |
@@ -2145,9 +2145,9 @@ discard block |
||
| 2145 | 2145 | array_shift($myself); |
| 2146 | 2146 | $myself = implode('/', $myself); |
| 2147 | 2147 | } |
| 2148 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2148 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2149 | 2149 | |
| 2150 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2150 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2151 | 2151 | |
| 2152 | 2152 | return $url; |
| 2153 | 2153 | } |
@@ -2185,16 +2185,16 @@ discard block |
||
| 2185 | 2185 | **/ |
| 2186 | 2186 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2187 | 2187 | if (!$rel) { |
| 2188 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2188 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2189 | 2189 | } else { |
| 2190 | 2190 | if (!is_string($rel)) { |
| 2191 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2191 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2192 | 2192 | } |
| 2193 | 2193 | } |
| 2194 | 2194 | |
| 2195 | 2195 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2196 | 2196 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2197 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2197 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2198 | 2198 | } elseif ($args) { |
| 2199 | 2199 | $args = "?$args"; |
| 2200 | 2200 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | $args .= "#$ancre"; |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2205 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2206 | 2206 | } |
| 2207 | 2207 | |
| 2208 | 2208 | // |
@@ -2284,10 +2284,10 @@ discard block |
||
| 2284 | 2284 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2285 | 2285 | } |
| 2286 | 2286 | if ($args) { |
| 2287 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2287 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2288 | 2288 | } |
| 2289 | 2289 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2290 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2290 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2291 | 2291 | } |
| 2292 | 2292 | |
| 2293 | 2293 | if (!$no_entities) { |
@@ -2299,7 +2299,7 @@ discard block |
||
| 2299 | 2299 | |
| 2300 | 2300 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2301 | 2301 | |
| 2302 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2302 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | // Pour les formulaires en methode POST, |
@@ -2334,8 +2334,7 @@ discard block |
||
| 2334 | 2334 | . "><div>\n" |
| 2335 | 2335 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2336 | 2336 | . $corps |
| 2337 | - . (!$submit ? '' : |
|
| 2338 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2337 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2339 | 2338 | . "</div></form>\n"; |
| 2340 | 2339 | } |
| 2341 | 2340 | |
@@ -2360,14 +2359,14 @@ discard block |
||
| 2360 | 2359 | ? generer_url_ecrire(_request('exec')) |
| 2361 | 2360 | : generer_url_public(); |
| 2362 | 2361 | |
| 2363 | - return "\n<form action='" . |
|
| 2364 | - $h . |
|
| 2365 | - "'" . |
|
| 2366 | - $atts . |
|
| 2367 | - ">\n" . |
|
| 2368 | - '<div>' . |
|
| 2369 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2370 | - $corps . |
|
| 2362 | + return "\n<form action='". |
|
| 2363 | + $h. |
|
| 2364 | + "'". |
|
| 2365 | + $atts. |
|
| 2366 | + ">\n". |
|
| 2367 | + '<div>'. |
|
| 2368 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2369 | + $corps. |
|
| 2371 | 2370 | '</div></form>'; |
| 2372 | 2371 | } |
| 2373 | 2372 | |
@@ -2395,7 +2394,7 @@ discard block |
||
| 2395 | 2394 | : generer_url_public('', '', false, false); |
| 2396 | 2395 | $url = parametre_url($url, 'action', $script); |
| 2397 | 2396 | if ($args) { |
| 2398 | - $url .= quote_amp('&' . $args); |
|
| 2397 | + $url .= quote_amp('&'.$args); |
|
| 2399 | 2398 | } |
| 2400 | 2399 | |
| 2401 | 2400 | if ($no_entities) { |
@@ -2445,17 +2444,17 @@ discard block |
||
| 2445 | 2444 | |
| 2446 | 2445 | // le nom du repertoire plugins/ activables/desactivables |
| 2447 | 2446 | if (!defined('_DIR_PLUGINS')) { |
| 2448 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2447 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2449 | 2448 | } |
| 2450 | 2449 | |
| 2451 | 2450 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2452 | 2451 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2453 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2452 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2454 | 2453 | } |
| 2455 | 2454 | |
| 2456 | 2455 | // le nom du repertoire des librairies |
| 2457 | 2456 | if (!defined('_DIR_LIB')) { |
| 2458 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2457 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2459 | 2458 | } |
| 2460 | 2459 | |
| 2461 | 2460 | if (!defined('_DIR_IMG')) { |
@@ -2465,29 +2464,29 @@ discard block |
||
| 2465 | 2464 | define('_DIR_LOGOS', $pa); |
| 2466 | 2465 | } |
| 2467 | 2466 | if (!defined('_DIR_IMG_ICONES')) { |
| 2468 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2467 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2469 | 2468 | } |
| 2470 | 2469 | |
| 2471 | 2470 | if (!defined('_DIR_DUMP')) { |
| 2472 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2471 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2473 | 2472 | } |
| 2474 | 2473 | if (!defined('_DIR_SESSIONS')) { |
| 2475 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2474 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2476 | 2475 | } |
| 2477 | 2476 | if (!defined('_DIR_TRANSFERT')) { |
| 2478 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2477 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2479 | 2478 | } |
| 2480 | 2479 | if (!defined('_DIR_CACHE')) { |
| 2481 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2480 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2482 | 2481 | } |
| 2483 | 2482 | if (!defined('_DIR_CACHE_XML')) { |
| 2484 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2483 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2485 | 2484 | } |
| 2486 | 2485 | if (!defined('_DIR_SKELS')) { |
| 2487 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2486 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2488 | 2487 | } |
| 2489 | 2488 | if (!defined('_DIR_AIDE')) { |
| 2490 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2489 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2491 | 2490 | } |
| 2492 | 2491 | if (!defined('_DIR_TMP')) { |
| 2493 | 2492 | define('_DIR_TMP', $ti); |
@@ -2516,27 +2515,27 @@ discard block |
||
| 2516 | 2515 | // Declaration des fichiers |
| 2517 | 2516 | |
| 2518 | 2517 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2519 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2518 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2522 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2521 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2525 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2524 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_CACHE_PIPELINES')) { |
| 2528 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2527 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_CACHE_CHEMIN')) { |
| 2531 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2530 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | |
| 2534 | 2533 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2535 | 2534 | if (!defined('_FILE_META')) { |
| 2536 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2535 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_LOG')) { |
| 2539 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2538 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_FILE_LOG')) { |
| 2542 | 2541 | define('_FILE_LOG', 'spip'); |
@@ -2553,8 +2552,8 @@ discard block |
||
| 2553 | 2552 | if (!defined('_FILE_CONNECT')) { |
| 2554 | 2553 | define( |
| 2555 | 2554 | '_FILE_CONNECT', |
| 2556 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2557 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2555 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2556 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2558 | 2557 | : false)) |
| 2559 | 2558 | ); |
| 2560 | 2559 | } |
@@ -2566,7 +2565,7 @@ discard block |
||
| 2566 | 2565 | if (!defined('_FILE_CHMOD')) { |
| 2567 | 2566 | define( |
| 2568 | 2567 | '_FILE_CHMOD', |
| 2569 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2568 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2570 | 2569 | : false) |
| 2571 | 2570 | ); |
| 2572 | 2571 | } |
@@ -2579,10 +2578,10 @@ discard block |
||
| 2579 | 2578 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2580 | 2579 | } |
| 2581 | 2580 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2582 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2581 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2585 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2584 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | |
| 2588 | 2587 | // Definition des droits d'acces en ecriture |
@@ -2600,13 +2599,13 @@ discard block |
||
| 2600 | 2599 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2601 | 2600 | } |
| 2602 | 2601 | if (!defined('_ROOT_PLUGINS')) { |
| 2603 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2602 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2604 | 2603 | } |
| 2605 | 2604 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2606 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2605 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2607 | 2606 | } |
| 2608 | 2607 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2609 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2608 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2610 | 2609 | } |
| 2611 | 2610 | |
| 2612 | 2611 | // La taille des Log |
@@ -2643,7 +2642,7 @@ discard block |
||
| 2643 | 2642 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2644 | 2643 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2645 | 2644 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2646 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2645 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2647 | 2646 | |
| 2648 | 2647 | // charger tout de suite le path et son cache |
| 2649 | 2648 | load_path_cache(); |
@@ -2691,7 +2690,7 @@ discard block |
||
| 2691 | 2690 | !empty($_SERVER['QUERY_STRING']) |
| 2692 | 2691 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2693 | 2692 | ) { |
| 2694 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2693 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2695 | 2694 | } |
| 2696 | 2695 | } |
| 2697 | 2696 | |
@@ -2727,7 +2726,7 @@ discard block |
||
| 2727 | 2726 | ) { |
| 2728 | 2727 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2729 | 2728 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2730 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2729 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2731 | 2730 | } else { |
| 2732 | 2731 | $uri_ref = ''; |
| 2733 | 2732 | } |
@@ -2821,7 +2820,7 @@ discard block |
||
| 2821 | 2820 | } |
| 2822 | 2821 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2823 | 2822 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2824 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2823 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2825 | 2824 | } |
| 2826 | 2825 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2827 | 2826 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -2925,7 +2924,7 @@ discard block |
||
| 2925 | 2924 | $memory *= 1024; |
| 2926 | 2925 | } |
| 2927 | 2926 | if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) { |
| 2928 | - @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M'); |
|
| 2927 | + @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M'); |
|
| 2929 | 2928 | if (trim(ini_get('memory_limit')) != $m) { |
| 2930 | 2929 | if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) { |
| 2931 | 2930 | define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true); |
@@ -3076,7 +3075,7 @@ discard block |
||
| 3076 | 3075 | } |
| 3077 | 3076 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3078 | 3077 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3079 | - . ' ' . _VAR_MODE); |
|
| 3078 | + . ' '._VAR_MODE); |
|
| 3080 | 3079 | } |
| 3081 | 3080 | } // pas autorise ? |
| 3082 | 3081 | else { |
@@ -3091,7 +3090,7 @@ discard block |
||
| 3091 | 3090 | if (strpos($self, 'page=login') === false) { |
| 3092 | 3091 | include_spip('inc/headers'); |
| 3093 | 3092 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3094 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3093 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3095 | 3094 | } |
| 3096 | 3095 | } |
| 3097 | 3096 | // sinon tant pis |
@@ -3133,10 +3132,10 @@ discard block |
||
| 3133 | 3132 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3134 | 3133 | // certaines constantes |
| 3135 | 3134 | @spip_initialisation_core( |
| 3136 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3137 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3138 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3139 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3135 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3136 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3137 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3138 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3140 | 3139 | ); |
| 3141 | 3140 | |
| 3142 | 3141 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3169,7 +3168,7 @@ discard block |
||
| 3169 | 3168 | } |
| 3170 | 3169 | |
| 3171 | 3170 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3172 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3171 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3173 | 3172 | $session = charger_fonction('session', 'inc'); |
| 3174 | 3173 | if ($session()) { |
| 3175 | 3174 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3249,7 +3248,7 @@ discard block |
||
| 3249 | 3248 | 'definir_session', |
| 3250 | 3249 | $GLOBALS['visiteur_session'] |
| 3251 | 3250 | ? serialize($GLOBALS['visiteur_session']) |
| 3252 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3251 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3253 | 3252 | : '' |
| 3254 | 3253 | ); |
| 3255 | 3254 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3405,11 +3404,11 @@ discard block |
||
| 3405 | 3404 | $GLOBALS['_INC_PUBLIC']++; |
| 3406 | 3405 | |
| 3407 | 3406 | // fix #4235 |
| 3408 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3407 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3409 | 3408 | |
| 3410 | 3409 | |
| 3411 | 3410 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3412 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3411 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3413 | 3412 | |
| 3414 | 3413 | $page = evaluer_fond($f, $contexte, $connect); |
| 3415 | 3414 | if ($page === '') { |
@@ -3494,7 +3493,7 @@ discard block |
||
| 3494 | 3493 | * @return array|string |
| 3495 | 3494 | */ |
| 3496 | 3495 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3497 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3496 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3498 | 3497 | if (!$pathinfo) { |
| 3499 | 3498 | return $f; |
| 3500 | 3499 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ) { |
| 204 | 204 | $r = nettoyer_url_page($url, $contexte); |
| 205 | 205 | if ($r) { |
| 206 | - [$contexte, $type, , , $suite] = $r; |
|
| 206 | + [$contexte, $type,,, $suite] = $r; |
|
| 207 | 207 | $_id = id_table_objet($type); |
| 208 | 208 | $id_objet = $contexte[$_id]; |
| 209 | 209 | $url_propre = generer_objet_url($id_objet, $type); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function nettoyer_url_page($url, $contexte = []) { |
| 276 | 276 | $url_objets = urls_liste_objets(); |
| 277 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 277 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 280 | 280 | |
| 281 | 281 | if ( |
| 282 | 282 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | static $furls = []; |
| 314 | 314 | if (!isset($furls[$objet])) { |
| 315 | 315 | if ( |
| 316 | - function_exists($f = 'generer_' . $objet . '_url_ecrire') |
|
| 316 | + function_exists($f = 'generer_'.$objet.'_url_ecrire') |
|
| 317 | 317 | // ou definie par un plugin |
| 318 | 318 | or $f = charger_fonction($f, 'urls', true) |
| 319 | 319 | // deprecated |
| 320 | - or function_exists($f = 'generer_url_ecrire_' . $objet) or $f = charger_fonction($f, 'urls', true) |
|
| 320 | + or function_exists($f = 'generer_url_ecrire_'.$objet) or $f = charger_fonction($f, 'urls', true) |
|
| 321 | 321 | ) { |
| 322 | 322 | $furls[$objet] = $f; |
| 323 | 323 | } else { |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | if ($public or $connect) { |
| 336 | 336 | return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect); |
| 337 | 337 | } |
| 338 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 338 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 339 | 339 | if (!function_exists('objet_info')) { |
| 340 | 340 | include_spip('inc/filtres'); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 343 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /** |
@@ -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)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // affichage "GIT [master: abcdef]" |
| 224 | 224 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 225 | 225 | if ($desc['branch']) { |
| 226 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 226 | + $commit = $desc['branch'].': '.$commit; |
|
| 227 | 227 | } |
| 228 | 228 | return "{$desc['vcs']} [$commit]"; |
| 229 | 229 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // version installee par GIT |
| 245 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 246 | 246 | $currentHead = trim(substr($c, 4)); |
| 247 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 247 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 248 | 248 | return [ |
| 249 | 249 | 'vcs' => 'GIT', |
| 250 | 250 | 'branch' => basename($currentHead), |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | $dir = '.'; |
| 272 | 272 | } |
| 273 | 273 | // version installee par SVN |
| 274 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 274 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 276 | 276 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 277 | 277 | if ($result) { |
| 278 | 278 | $row = $result->fetchArray(); |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 292 | 292 | // et laisser passer les fonctions personnelles baptisees image_... |
| 293 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 294 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 295 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 296 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 297 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 298 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 293 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 294 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 295 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 296 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 297 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 298 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 299 | 299 | |
| 300 | 300 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 301 | 301 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | function filtre_debug($val, $key = null) { |
| 456 | 456 | $debug = ( |
| 457 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 458 | - ) . var_export($val, true); |
|
| 457 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 458 | + ).var_export($val, true); |
|
| 459 | 459 | |
| 460 | 460 | include_spip('inc/autoriser'); |
| 461 | 461 | if (autoriser('webmestre')) { |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $is_file = false; |
| 510 | 510 | } |
| 511 | 511 | if ($is_file) { |
| 512 | - $is_local_file = function ($path) { |
|
| 512 | + $is_local_file = function($path) { |
|
| 513 | 513 | if (strpos($path, '?') !== false) { |
| 514 | 514 | $path = supprimer_timestamp($path); |
| 515 | 515 | // remove ?24px added by find_in_theme on .svg files |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 562 | 562 | $srcover = $match[1]; |
| 563 | 563 | array_shift($args); |
| 564 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 564 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 565 | 565 | $srcover_filter = call_user_func_array($filtre, $args); |
| 566 | 566 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 567 | 567 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | // " -> " et tout ce genre de choses |
| 929 | 929 | $u = $GLOBALS['meta']['pcre_u']; |
| 930 | 930 | $texte = str_replace(' ', ' ', $texte); |
| 931 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 931 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 932 | 932 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 933 | 933 | $texte = entites_html($texte, false, false); |
| 934 | 934 | // mais bien echapper les double quotes ! |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | **/ |
| 989 | 989 | function supprimer_numero($texte) { |
| 990 | 990 | return preg_replace( |
| 991 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 991 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 992 | 992 | '', |
| 993 | 993 | $texte |
| 994 | 994 | ); |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | function recuperer_numero($texte) { |
| 1017 | 1017 | if ( |
| 1018 | 1018 | preg_match( |
| 1019 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1019 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1020 | 1020 | $texte, |
| 1021 | 1021 | $regs |
| 1022 | 1022 | ) |
@@ -1107,8 +1107,8 @@ discard block |
||
| 1107 | 1107 | **/ |
| 1108 | 1108 | function textebrut($texte) { |
| 1109 | 1109 | $u = $GLOBALS['meta']['pcre_u']; |
| 1110 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1111 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1110 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1111 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1112 | 1112 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1113 | 1113 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1114 | 1114 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | ) |
| 1143 | 1143 | ) { |
| 1144 | 1144 | foreach ($liens[0] as $a) { |
| 1145 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1145 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1146 | 1146 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1147 | 1147 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1148 | 1148 | $texte = str_replace($a, $ablank, $texte); |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | foreach ($regs[0] as $a) { |
| 1168 | 1168 | $rel = extraire_attribut($a, 'rel'); |
| 1169 | 1169 | if (strpos($rel, 'nofollow') === false) { |
| 1170 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1170 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1171 | 1171 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1172 | 1172 | $texte = str_replace($a, $anofollow, $texte); |
| 1173 | 1173 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | $u = $GLOBALS['meta']['pcre_u']; |
| 1197 | 1197 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1198 | 1198 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1199 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1199 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1200 | 1200 | |
| 1201 | 1201 | return $texte; |
| 1202 | 1202 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | return $texte; |
| 1228 | 1228 | } |
| 1229 | 1229 | include_spip('inc/texte'); |
| 1230 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1230 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1231 | 1231 | 'div' : 'span'; |
| 1232 | 1232 | |
| 1233 | 1233 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | } |
| 1340 | 1340 | $u = $GLOBALS['meta']['pcre_u']; |
| 1341 | 1341 | if ($textebrut) { |
| 1342 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1342 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1343 | 1343 | } |
| 1344 | 1344 | $texte = texte_backend($texte); |
| 1345 | 1345 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | # un message pour abs_url |
| 1375 | 1375 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1376 | 1376 | $url = trim($url); |
| 1377 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1377 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1378 | 1378 | |
| 1379 | 1379 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1380 | 1380 | } |
@@ -1578,14 +1578,14 @@ discard block |
||
| 1578 | 1578 | if (strpos($texte, '<') !== false) { |
| 1579 | 1579 | include_spip('inc/lien'); |
| 1580 | 1580 | if (defined('_PREG_MODELE')) { |
| 1581 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1581 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1582 | 1582 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1583 | 1583 | } |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | 1586 | $debut = ''; |
| 1587 | 1587 | $suite = $texte; |
| 1588 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1588 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1589 | 1589 | $debut .= substr($suite, 0, $t - 1); |
| 1590 | 1590 | $suite = substr($suite, $t); |
| 1591 | 1591 | $car = substr($suite, 0, 1); |
@@ -1603,11 +1603,11 @@ discard block |
||
| 1603 | 1603 | $suite = substr($suite, strlen($regs[0])); |
| 1604 | 1604 | } |
| 1605 | 1605 | } |
| 1606 | - $texte = $debut . $suite; |
|
| 1606 | + $texte = $debut.$suite; |
|
| 1607 | 1607 | |
| 1608 | 1608 | $texte = echappe_retour($texte); |
| 1609 | 1609 | |
| 1610 | - return $texte . $fin; |
|
| 1610 | + return $texte.$fin; |
|
| 1611 | 1611 | } |
| 1612 | 1612 | |
| 1613 | 1613 | |
@@ -1669,7 +1669,7 @@ discard block |
||
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | 1671 | foreach ($regs as $reg) { |
| 1672 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1672 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1673 | 1673 | $desc = $traduire($cle, $lang, true); |
| 1674 | 1674 | $l = $desc->langue; |
| 1675 | 1675 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1783,9 +1783,9 @@ discard block |
||
| 1783 | 1783 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1784 | 1784 | include_spip('inc/texte'); |
| 1785 | 1785 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1786 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1786 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1787 | 1787 | if ($mode === 'div') { |
| 1788 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1788 | + $trad = rtrim($trad)."\n\n"; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1791 | 1791 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -1981,7 +1981,7 @@ discard block |
||
| 1981 | 1981 | if (is_array($balise)) { |
| 1982 | 1982 | array_walk( |
| 1983 | 1983 | $balise, |
| 1984 | - function (&$a, $key, $t) { |
|
| 1984 | + function(&$a, $key, $t) { |
|
| 1985 | 1985 | $a = extraire_attribut($a, $t); |
| 1986 | 1986 | }, |
| 1987 | 1987 | $attribut |
@@ -2078,14 +2078,14 @@ discard block |
||
| 2078 | 2078 | |
| 2079 | 2079 | if ($old !== null) { |
| 2080 | 2080 | // Remplacer l'ancien attribut du meme nom |
| 2081 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2081 | + $balise = $r[1].$insert.$r[5]; |
|
| 2082 | 2082 | } else { |
| 2083 | 2083 | // preferer une balise " />" (comme <img />) |
| 2084 | 2084 | if (preg_match(',/>,', $balise)) { |
| 2085 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2085 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2086 | 2086 | } // sinon une balise <a ...> ... </a> |
| 2087 | 2087 | else { |
| 2088 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2088 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2089 | 2089 | } |
| 2090 | 2090 | } |
| 2091 | 2091 | |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | if ( |
| 2141 | 2141 | $class_courante |
| 2142 | 2142 | and strpos($class_courante, (string) $c) !== false |
| 2143 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2143 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2144 | 2144 | ) { |
| 2145 | 2145 | $is_class_presente = true; |
| 2146 | 2146 | } |
@@ -2148,12 +2148,12 @@ discard block |
||
| 2148 | 2148 | in_array($operation, ['ajouter', 'commuter']) |
| 2149 | 2149 | and !$is_class_presente |
| 2150 | 2150 | ) { |
| 2151 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2151 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2152 | 2152 | } elseif ( |
| 2153 | 2153 | in_array($operation, ['supprimer', 'commuter']) |
| 2154 | 2154 | and $is_class_presente |
| 2155 | 2155 | ) { |
| 2156 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2156 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2157 | 2157 | } |
| 2158 | 2158 | } |
| 2159 | 2159 | |
@@ -2216,7 +2216,7 @@ discard block |
||
| 2216 | 2216 | // Quelques fonctions de calcul arithmetique |
| 2217 | 2217 | // |
| 2218 | 2218 | function floatstr($a) { |
| 2219 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2219 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2220 | 2220 | } |
| 2221 | 2221 | function strize($f, $a, $b) { |
| 2222 | 2222 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2352,13 +2352,13 @@ discard block |
||
| 2352 | 2352 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2353 | 2353 | define('_TAGS_NOM_AUTEUR', ''); |
| 2354 | 2354 | } |
| 2355 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2355 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2356 | 2356 | foreach ($tags_acceptes as $tag) { |
| 2357 | 2357 | if (strlen($tag)) { |
| 2358 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2359 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2360 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2361 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2358 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2359 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2360 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2361 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2362 | 2362 | } |
| 2363 | 2363 | } |
| 2364 | 2364 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2412,7 +2412,7 @@ discard block |
||
| 2412 | 2412 | . http_img_pack( |
| 2413 | 2413 | 'attachment-16.png', |
| 2414 | 2414 | $t, |
| 2415 | - 'title="' . attribut_html($t) . '"' |
|
| 2415 | + 'title="'.attribut_html($t).'"' |
|
| 2416 | 2416 | ) |
| 2417 | 2417 | . '</a>', |
| 2418 | 2418 | $tag |
@@ -2476,10 +2476,10 @@ discard block |
||
| 2476 | 2476 | $fichier = basename($url); |
| 2477 | 2477 | |
| 2478 | 2478 | return '<a rel="enclosure"' |
| 2479 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2480 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2481 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2482 | - . '>' . $fichier . '</a>'; |
|
| 2479 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2480 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2481 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2482 | + . '>'.$fichier.'</a>'; |
|
| 2483 | 2483 | } |
| 2484 | 2484 | |
| 2485 | 2485 | /** |
@@ -2507,9 +2507,9 @@ discard block |
||
| 2507 | 2507 | } # vieux data |
| 2508 | 2508 | $fichier = basename($url); |
| 2509 | 2509 | $enclosures[] = '<enclosure' |
| 2510 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2511 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2512 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2510 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2511 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2512 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2513 | 2513 | . ' />'; |
| 2514 | 2514 | } |
| 2515 | 2515 | } |
@@ -2535,7 +2535,7 @@ discard block |
||
| 2535 | 2535 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2536 | 2536 | $subjects .= '<dc:subject>' |
| 2537 | 2537 | . texte_backend(textebrut($e)) |
| 2538 | - . '</dc:subject>' . "\n"; |
|
| 2538 | + . '</dc:subject>'."\n"; |
|
| 2539 | 2539 | } |
| 2540 | 2540 | } |
| 2541 | 2541 | |
@@ -2571,7 +2571,7 @@ discard block |
||
| 2571 | 2571 | if (is_array($texte)) { |
| 2572 | 2572 | array_walk( |
| 2573 | 2573 | $texte, |
| 2574 | - function (&$a, $key, $t) { |
|
| 2574 | + function(&$a, $key, $t) { |
|
| 2575 | 2575 | $a = extraire_balise($a, $t); |
| 2576 | 2576 | }, |
| 2577 | 2577 | $tag |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | if (is_array($texte)) { |
| 2620 | 2620 | array_walk( |
| 2621 | 2621 | $texte, |
| 2622 | - function (&$a, $key, $t) { |
|
| 2622 | + function(&$a, $key, $t) { |
|
| 2623 | 2623 | $a = extraire_balises($a, $t); |
| 2624 | 2624 | }, |
| 2625 | 2625 | $tag |
@@ -2751,7 +2751,7 @@ discard block |
||
| 2751 | 2751 | if ($fond != '404') { |
| 2752 | 2752 | $contexte = array_shift($p); |
| 2753 | 2753 | $contexte['page'] = $fond; |
| 2754 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2754 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2755 | 2755 | } |
| 2756 | 2756 | } |
| 2757 | 2757 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2806,9 +2806,9 @@ discard block |
||
| 2806 | 2806 | . '"' |
| 2807 | 2807 | . (is_null($val) |
| 2808 | 2808 | ? '' |
| 2809 | - : ' value="' . entites_html($val) . '"' |
|
| 2809 | + : ' value="'.entites_html($val).'"' |
|
| 2810 | 2810 | ) |
| 2811 | - . ' type="hidden"' . "\n/>"; |
|
| 2811 | + . ' type="hidden"'."\n/>"; |
|
| 2812 | 2812 | } |
| 2813 | 2813 | |
| 2814 | 2814 | return join('', $hidden); |
@@ -2918,7 +2918,7 @@ discard block |
||
| 2918 | 2918 | |
| 2919 | 2919 | return preg_replace_callback( |
| 2920 | 2920 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2921 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2921 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2922 | 2922 | $contenu |
| 2923 | 2923 | ); |
| 2924 | 2924 | } |
@@ -2979,14 +2979,14 @@ discard block |
||
| 2979 | 2979 | ) { |
| 2980 | 2980 | $distant = true; |
| 2981 | 2981 | $cssf = parse_url($css); |
| 2982 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2982 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2983 | 2983 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2984 | 2984 | } else { |
| 2985 | 2985 | $distant = false; |
| 2986 | 2986 | $cssf = $css; |
| 2987 | 2987 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2988 | 2988 | //propose (rien a faire dans ce cas) |
| 2989 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2989 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2990 | 2990 | if (@file_exists($f)) { |
| 2991 | 2991 | return $f; |
| 2992 | 2992 | } |
@@ -2996,7 +2996,7 @@ discard block |
||
| 2996 | 2996 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2997 | 2997 | $f = $dir_var |
| 2998 | 2998 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2999 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2999 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3000 | 3000 | |
| 3001 | 3001 | // la css peut etre distante (url absolue !) |
| 3002 | 3002 | if ($distant) { |
@@ -3042,8 +3042,8 @@ discard block |
||
| 3042 | 3042 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3043 | 3043 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3044 | 3044 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3045 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3046 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3045 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3046 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3047 | 3047 | } |
| 3048 | 3048 | $src[] = $regs[0][$k]; |
| 3049 | 3049 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3092,7 +3092,7 @@ discard block |
||
| 3092 | 3092 | |
| 3093 | 3093 | $f = basename($css, '.css'); |
| 3094 | 3094 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3095 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3095 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3096 | 3096 | . '.css'; |
| 3097 | 3097 | |
| 3098 | 3098 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3102,7 +3102,7 @@ discard block |
||
| 3102 | 3102 | if ($url_absolue_css == $css) { |
| 3103 | 3103 | if ( |
| 3104 | 3104 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3105 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3105 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3106 | 3106 | ) { |
| 3107 | 3107 | include_spip('inc/distant'); |
| 3108 | 3108 | $contenu = recuperer_url($css); |
@@ -3214,7 +3214,7 @@ discard block |
||
| 3214 | 3214 | $expression = str_replace('\/', '/', $expression); |
| 3215 | 3215 | $expression = str_replace('/', '\/', $expression); |
| 3216 | 3216 | |
| 3217 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3217 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3218 | 3218 | if (isset($r[$capte])) { |
| 3219 | 3219 | return $r[$capte]; |
| 3220 | 3220 | } else { |
@@ -3252,7 +3252,7 @@ discard block |
||
| 3252 | 3252 | $expression = str_replace('\/', '/', $expression); |
| 3253 | 3253 | $expression = str_replace('/', '\/', $expression); |
| 3254 | 3254 | |
| 3255 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3255 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3256 | 3256 | } |
| 3257 | 3257 | |
| 3258 | 3258 | |
@@ -3271,7 +3271,7 @@ discard block |
||
| 3271 | 3271 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3272 | 3272 | |
| 3273 | 3273 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3274 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3274 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3275 | 3275 | |
| 3276 | 3276 | if ( |
| 3277 | 3277 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3285,7 +3285,7 @@ discard block |
||
| 3285 | 3285 | if (!isset($doublons['documents'])) { |
| 3286 | 3286 | $doublons['documents'] = ''; |
| 3287 | 3287 | } |
| 3288 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3288 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3289 | 3289 | } |
| 3290 | 3290 | |
| 3291 | 3291 | return $letexte; |
@@ -3342,7 +3342,7 @@ discard block |
||
| 3342 | 3342 | if ($env) { |
| 3343 | 3343 | foreach ($env as $i => $j) { |
| 3344 | 3344 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3345 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3345 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3346 | 3346 | } |
| 3347 | 3347 | } |
| 3348 | 3348 | } |
@@ -3381,7 +3381,7 @@ discard block |
||
| 3381 | 3381 | if ($env) { |
| 3382 | 3382 | foreach ($env as $i => $j) { |
| 3383 | 3383 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3384 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3384 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3385 | 3385 | } |
| 3386 | 3386 | } |
| 3387 | 3387 | } |
@@ -3455,10 +3455,10 @@ discard block |
||
| 3455 | 3455 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3456 | 3456 | if ( |
| 3457 | 3457 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3458 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3458 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3459 | 3459 | and file_exists($variante_svg_generique) |
| 3460 | 3460 | ) { |
| 3461 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3461 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3462 | 3462 | $img_file = $variante_svg_size; |
| 3463 | 3463 | } |
| 3464 | 3464 | else { |
@@ -3516,7 +3516,7 @@ discard block |
||
| 3516 | 3516 | return ''; |
| 3517 | 3517 | } |
| 3518 | 3518 | } |
| 3519 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3519 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3520 | 3520 | } |
| 3521 | 3521 | |
| 3522 | 3522 | if (file_exists($img_file)) { |
@@ -3526,14 +3526,14 @@ discard block |
||
| 3526 | 3526 | $alt = ''; |
| 3527 | 3527 | } |
| 3528 | 3528 | elseif ($alt or $alt === '') { |
| 3529 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3529 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3530 | 3530 | } |
| 3531 | 3531 | else { |
| 3532 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3532 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3533 | 3533 | } |
| 3534 | 3534 | return "<img src='$img_file'$alt" |
| 3535 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3536 | - . ' ' . ltrim($atts) |
|
| 3535 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3536 | + . ' '.ltrim($atts) |
|
| 3537 | 3537 | . ' />'; |
| 3538 | 3538 | } |
| 3539 | 3539 | |
@@ -3547,10 +3547,10 @@ discard block |
||
| 3547 | 3547 | */ |
| 3548 | 3548 | function http_style_background($img, $att = '', $size = null) { |
| 3549 | 3549 | if ($size and is_numeric($size)) { |
| 3550 | - $size = trim($size) . 'px'; |
|
| 3550 | + $size = trim($size).'px'; |
|
| 3551 | 3551 | } |
| 3552 | - return " style='background" . |
|
| 3553 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3552 | + return " style='background". |
|
| 3553 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3554 | 3554 | . ($size ? "background-size:{$size};" : '') |
| 3555 | 3555 | . "'"; |
| 3556 | 3556 | } |
@@ -3665,7 +3665,7 @@ discard block |
||
| 3665 | 3665 | $img = http_img_pack( |
| 3666 | 3666 | $img, |
| 3667 | 3667 | $alt, |
| 3668 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3668 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3669 | 3669 | '', |
| 3670 | 3670 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3671 | 3671 | ); |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | $balise_svg_source = $balise_svg; |
| 3751 | 3751 | |
| 3752 | 3752 | // entete XML à supprimer |
| 3753 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3753 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3754 | 3754 | |
| 3755 | 3755 | // IE est toujours mon ami |
| 3756 | 3756 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3768,9 +3768,9 @@ discard block |
||
| 3768 | 3768 | // regler le alt |
| 3769 | 3769 | if ($alt) { |
| 3770 | 3770 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3771 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3771 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3772 | 3772 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3773 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3773 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3774 | 3774 | $balise_svg .= $title; |
| 3775 | 3775 | } |
| 3776 | 3776 | else { |
@@ -3818,7 +3818,7 @@ discard block |
||
| 3818 | 3818 | if (is_array($tableau)) { |
| 3819 | 3819 | foreach ($tableau as $k => $v) { |
| 3820 | 3820 | $res = recuperer_fond( |
| 3821 | - 'modeles/' . $modele, |
|
| 3821 | + 'modeles/'.$modele, |
|
| 3822 | 3822 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3823 | 3823 | ); |
| 3824 | 3824 | $texte .= $res; |
@@ -4003,7 +4003,7 @@ discard block |
||
| 4003 | 4003 | } |
| 4004 | 4004 | |
| 4005 | 4005 | $c = serialize($c); |
| 4006 | - $cle = calculer_cle_action($form . $c); |
|
| 4006 | + $cle = calculer_cle_action($form.$c); |
|
| 4007 | 4007 | $c = "$cle:$c"; |
| 4008 | 4008 | |
| 4009 | 4009 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4061,15 +4061,15 @@ discard block |
||
| 4061 | 4061 | } |
| 4062 | 4062 | // toujours encoder l'url source dans le bloc ajax |
| 4063 | 4063 | $r = self(); |
| 4064 | - $r = ' data-origin="' . $r . '"'; |
|
| 4064 | + $r = ' data-origin="'.$r.'"'; |
|
| 4065 | 4065 | $class = 'ajaxbloc'; |
| 4066 | 4066 | if ($ajaxid and is_string($ajaxid)) { |
| 4067 | 4067 | // ajaxid est normalement conforme a un nom de classe css |
| 4068 | 4068 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4069 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4069 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4070 | 4070 | } |
| 4071 | 4071 | |
| 4072 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4072 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4073 | 4073 | } |
| 4074 | 4074 | |
| 4075 | 4075 | /** |
@@ -4113,7 +4113,7 @@ discard block |
||
| 4113 | 4113 | $cle = substr($c, 0, $p); |
| 4114 | 4114 | $c = substr($c, $p + 1); |
| 4115 | 4115 | |
| 4116 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4116 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4117 | 4117 | $env = @unserialize($c); |
| 4118 | 4118 | return $env; |
| 4119 | 4119 | } |
@@ -4234,13 +4234,13 @@ discard block |
||
| 4234 | 4234 | } |
| 4235 | 4235 | } |
| 4236 | 4236 | } |
| 4237 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4237 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4238 | 4238 | } else { |
| 4239 | 4239 | $bal = 'a'; |
| 4240 | 4240 | $att = "href='$url'" |
| 4241 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4242 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4243 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4241 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4242 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4243 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4244 | 4244 | . $evt; |
| 4245 | 4245 | } |
| 4246 | 4246 | if ($libelle === null) { |
@@ -4379,7 +4379,7 @@ discard block |
||
| 4379 | 4379 | |
| 4380 | 4380 | // Icône |
| 4381 | 4381 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4382 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4382 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4383 | 4383 | |
| 4384 | 4384 | // Markup final |
| 4385 | 4385 | if ($type == 'lien') { |
@@ -4656,20 +4656,20 @@ discard block |
||
| 4656 | 4656 | $class_form = 'ajax'; |
| 4657 | 4657 | $class = str_replace('ajax', '', $class); |
| 4658 | 4658 | } |
| 4659 | - $class_btn = 'submit ' . trim($class); |
|
| 4659 | + $class_btn = 'submit '.trim($class); |
|
| 4660 | 4660 | |
| 4661 | 4661 | if ($confirm) { |
| 4662 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4662 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4663 | 4663 | if ($callback) { |
| 4664 | 4664 | $callback = "$confirm?($callback):false"; |
| 4665 | 4665 | } else { |
| 4666 | 4666 | $callback = $confirm; |
| 4667 | 4667 | } |
| 4668 | 4668 | } |
| 4669 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4669 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4670 | 4670 | $title = $title ? " title='$title'" : ''; |
| 4671 | 4671 | |
| 4672 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4672 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4673 | 4673 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4674 | 4674 | } |
| 4675 | 4675 | |
@@ -4734,14 +4734,14 @@ discard block |
||
| 4734 | 4734 | $champ_titre = ''; |
| 4735 | 4735 | if ($demande_titre) { |
| 4736 | 4736 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4737 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4737 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4738 | 4738 | } |
| 4739 | 4739 | include_spip('base/abstract_sql'); |
| 4740 | 4740 | include_spip('base/connect_sql'); |
| 4741 | 4741 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4742 | - '*' . $champ_titre, |
|
| 4742 | + '*'.$champ_titre, |
|
| 4743 | 4743 | $desc['table_sql'], |
| 4744 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4744 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4745 | 4745 | ); |
| 4746 | 4746 | |
| 4747 | 4747 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4834,8 +4834,7 @@ discard block |
||
| 4834 | 4834 | if (isset($ligne_sql['chapo'])) { |
| 4835 | 4835 | $chapo = $ligne_sql['chapo']; |
| 4836 | 4836 | $texte = strlen($descriptif) ? |
| 4837 | - '' : |
|
| 4838 | - "$chapo \n\n $texte"; |
|
| 4837 | + '' : "$chapo \n\n $texte"; |
|
| 4839 | 4838 | } |
| 4840 | 4839 | |
| 4841 | 4840 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4910,7 +4909,7 @@ discard block |
||
| 4910 | 4909 | return $texte; |
| 4911 | 4910 | } |
| 4912 | 4911 | |
| 4913 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4912 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4914 | 4913 | |
| 4915 | 4914 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4916 | 4915 | $Pile = [0 => $env]; |
@@ -4944,7 +4943,7 @@ discard block |
||
| 4944 | 4943 | } |
| 4945 | 4944 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4946 | 4945 | |
| 4947 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4946 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4948 | 4947 | } |
| 4949 | 4948 | |
| 4950 | 4949 | /** |
@@ -4970,10 +4969,10 @@ discard block |
||
| 4970 | 4969 | function wrap($texte, $wrap) { |
| 4971 | 4970 | $balises = extraire_balises($wrap); |
| 4972 | 4971 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4973 | - $texte = $wrap . $texte; |
|
| 4972 | + $texte = $wrap.$texte; |
|
| 4974 | 4973 | $regs = array_reverse($regs[1]); |
| 4975 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4976 | - $texte = $texte . $wrap; |
|
| 4974 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4975 | + $texte = $texte.$wrap; |
|
| 4977 | 4976 | } |
| 4978 | 4977 | |
| 4979 | 4978 | return $texte; |
@@ -5004,7 +5003,7 @@ discard block |
||
| 5004 | 5003 | |
| 5005 | 5004 | // caster $u en array si besoin |
| 5006 | 5005 | if (is_object($u)) { |
| 5007 | - $u = (array)$u; |
|
| 5006 | + $u = (array) $u; |
|
| 5008 | 5007 | } |
| 5009 | 5008 | |
| 5010 | 5009 | if (is_array($u)) { |
@@ -5026,7 +5025,7 @@ discard block |
||
| 5026 | 5025 | // sinon on passe a la ligne et on indente |
| 5027 | 5026 | $i_str = str_pad('', $indent, ' '); |
| 5028 | 5027 | foreach ($u as $k => $v) { |
| 5029 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5028 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5030 | 5029 | } |
| 5031 | 5030 | |
| 5032 | 5031 | return $out; |
@@ -5080,7 +5079,7 @@ discard block |
||
| 5080 | 5079 | * @return string |
| 5081 | 5080 | */ |
| 5082 | 5081 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5083 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5082 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5084 | 5083 | $icone = chemin_image($icone); |
| 5085 | 5084 | $balise_img = charger_filtre('balise_img'); |
| 5086 | 5085 | |
@@ -5106,7 +5105,7 @@ discard block |
||
| 5106 | 5105 | */ |
| 5107 | 5106 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5108 | 5107 | $chaine = explode(':', $chaine); |
| 5109 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5108 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5110 | 5109 | return $t; |
| 5111 | 5110 | } |
| 5112 | 5111 | $chaine = implode(':', $chaine); |
@@ -5172,7 +5171,7 @@ discard block |
||
| 5172 | 5171 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5173 | 5172 | |
| 5174 | 5173 | // calculer le nom de la css |
| 5175 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5174 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5176 | 5175 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5177 | 5176 | $contexte_implicite = calculer_contexte_implicite(); |
| 5178 | 5177 | |
@@ -5180,14 +5179,14 @@ discard block |
||
| 5180 | 5179 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5181 | 5180 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5182 | 5181 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5183 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5182 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5184 | 5183 | } |
| 5185 | 5184 | else { |
| 5186 | 5185 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5187 | 5186 | ksort($contexte); |
| 5188 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5187 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5189 | 5188 | } |
| 5190 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5189 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5191 | 5190 | |
| 5192 | 5191 | // mettre a jour le fichier si il n'existe pas |
| 5193 | 5192 | // ou trop ancien |
@@ -5195,8 +5194,8 @@ discard block |
||
| 5195 | 5194 | // et recopie sur le fichier cible uniquement si il change |
| 5196 | 5195 | if ( |
| 5197 | 5196 | !file_exists($filename) |
| 5198 | - or !file_exists($filename . '.last') |
|
| 5199 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5197 | + or !file_exists($filename.'.last') |
|
| 5198 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5200 | 5199 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5201 | 5200 | ) { |
| 5202 | 5201 | $contenu = $cache['texte']; |
@@ -5217,10 +5216,10 @@ discard block |
||
| 5217 | 5216 | } |
| 5218 | 5217 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5219 | 5218 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5220 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5219 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5221 | 5220 | } |
| 5222 | 5221 | // et ecrire le fichier si il change |
| 5223 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5222 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5224 | 5223 | } |
| 5225 | 5224 | |
| 5226 | 5225 | return timestamp($filename); |
@@ -5446,7 +5445,7 @@ discard block |
||
| 5446 | 5445 | if ($e > 0 and strlen($mid) > 8) { |
| 5447 | 5446 | $mid = '***...***'; |
| 5448 | 5447 | } |
| 5449 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5448 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5450 | 5449 | } |
| 5451 | 5450 | |
| 5452 | 5451 | |
@@ -5508,7 +5507,7 @@ discard block |
||
| 5508 | 5507 | case 'id': |
| 5509 | 5508 | case 'anchor': |
| 5510 | 5509 | if (preg_match(',^\d,', $texte)) { |
| 5511 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5510 | + $texte = substr($type, 0, 1).$texte; |
|
| 5512 | 5511 | } |
| 5513 | 5512 | } |
| 5514 | 5513 | |
@@ -5518,9 +5517,9 @@ discard block |
||
| 5518 | 5517 | |
| 5519 | 5518 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5520 | 5519 | if (preg_match(',^\d,', $texte)) { |
| 5521 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5520 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5522 | 5521 | } |
| 5523 | - $texte .= $separateur . md5($original); |
|
| 5522 | + $texte .= $separateur.md5($original); |
|
| 5524 | 5523 | $texte = substr($texte, 0, $longueur_mini); |
| 5525 | 5524 | } |
| 5526 | 5525 | |