@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | foreach ($regexp as $r => $e) { |
| 598 | 598 | $regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e)); |
| 599 | 599 | } |
| 600 | - $regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,'; |
|
| 600 | + $regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,'; |
|
| 601 | 601 | $ajouts = array_flip(explode('|', $c)); |
| 602 | 602 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 603 | 603 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 625 | 625 | // pour un tableau ce sera fait dans la prochaine boucle |
| 626 | 626 | elseif (substr($r[1], -2) != '[]') { |
| 627 | - $url[$n] = $r[1] . '=' . $u; |
|
| 627 | + $url[$n] = $r[1].'='.$u; |
|
| 628 | 628 | unset($ajouts[$r[1]]); |
| 629 | 629 | } |
| 630 | 630 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | } elseif ($testv) { |
| 646 | 646 | foreach ($ajouts as $k => $n) { |
| 647 | 647 | if (!is_array($v)) { |
| 648 | - $url[] = $k . '=' . $u; |
|
| 648 | + $url[] = $k.'='.$u; |
|
| 649 | 649 | } else { |
| 650 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 650 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 651 | 651 | foreach ($v as $w) { |
| 652 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 652 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | } |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // recomposer l'adresse |
| 662 | 662 | if ($url) { |
| 663 | - $a .= '?' . join($sep, $url); |
|
| 663 | + $a .= '?'.join($sep, $url); |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - return $a . $ancre; |
|
| 666 | + return $a.$ancre; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | translitteration($ancre) |
| 696 | 696 | ); |
| 697 | 697 | } |
| 698 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 698 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | * @return bool |
| 812 | 812 | */ |
| 813 | 813 | function test_plugin_actif($plugin) { |
| 814 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 814 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | /** |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | $value = interdire_scripts($value, -1); |
| 944 | 944 | } |
| 945 | 945 | if (!empty($options['class'])) { |
| 946 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 946 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 947 | 947 | } |
| 948 | 948 | $text = str_replace("@$name@", $value, $text); |
| 949 | 949 | unset($args[$name]); |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | // Si des variables n'ont pas ete inserees, le signaler |
| 953 | 953 | // (chaines de langues pas a jour) |
| 954 | 954 | if ($args) { |
| 955 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 955 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | 958 | |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | function joli_repertoire($rep) { |
| 977 | 977 | $a = substr($rep, 0, 1); |
| 978 | 978 | if ($a <> '.' and $a <> '/') { |
| 979 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 979 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 980 | 980 | } |
| 981 | 981 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 982 | 982 | |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $p -= ($x * 1000); |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1033 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | if ($taches and count($taches) and !spip_connect()) { |
| 1098 | 1098 | return false; |
| 1099 | 1099 | } |
| 1100 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1100 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1101 | 1101 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1102 | 1102 | return $genie($taches); |
| 1103 | 1103 | } |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | |
| 1202 | 1202 | if ($queue_next_job_time == -1) { |
| 1203 | 1203 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1204 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1204 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1205 | 1205 | } |
| 1206 | 1206 | // utiliser un cache memoire si dispo |
| 1207 | 1207 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1270,8 +1270,8 @@ discard block |
||
| 1270 | 1270 | $src = ''; |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($script) { |
| 1273 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1274 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1273 | + $script = ("/*<![CDATA[*/\n". |
|
| 1274 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1275 | 1275 | '/*]]>*/'); |
| 1276 | 1276 | } |
| 1277 | 1277 | if ($noscript) { |
@@ -1357,13 +1357,13 @@ discard block |
||
| 1357 | 1357 | if ($path_base == null) { |
| 1358 | 1358 | // Chemin standard depuis l'espace public |
| 1359 | 1359 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1360 | - _DIR_RACINE . ':' . |
|
| 1361 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1362 | - _DIR_RACINE . 'prive/:' . |
|
| 1360 | + _DIR_RACINE.':'. |
|
| 1361 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1362 | + _DIR_RACINE.'prive/:'. |
|
| 1363 | 1363 | _DIR_RESTREINT; |
| 1364 | 1364 | // Ajouter squelettes/ |
| 1365 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1366 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1365 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1366 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1367 | 1367 | } |
| 1368 | 1368 | foreach (explode(':', $path) as $dir) { |
| 1369 | 1369 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | // Et le(s) dossier(s) des squelettes nommes |
| 1376 | 1376 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1377 | 1377 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1378 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1378 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | } |
| 1381 | 1381 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | |
| 1387 | 1387 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1388 | 1388 | $tete = ''; |
| 1389 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1389 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1390 | 1390 | $tete = array_shift($path_base); |
| 1391 | 1391 | } |
| 1392 | 1392 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | // Et le(s) dossier(s) des squelettes nommes |
| 1408 | 1408 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1409 | 1409 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1410 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1410 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1411 | 1411 | } |
| 1412 | 1412 | } |
| 1413 | 1413 | |
@@ -1478,14 +1478,14 @@ discard block |
||
| 1478 | 1478 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1479 | 1479 | if ( |
| 1480 | 1480 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1481 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1481 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1482 | 1482 | and $f = find_in_theme("$file_svg_generique") |
| 1483 | 1483 | ) { |
| 1484 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1484 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1485 | 1485 | return $themefiles["$subdir$file"] = $fsize; |
| 1486 | 1486 | } |
| 1487 | 1487 | else { |
| 1488 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1488 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1489 | 1489 | } |
| 1490 | 1490 | } |
| 1491 | 1491 | |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | return $themefiles["$subdir$file"] = $f; |
| 1496 | 1496 | } |
| 1497 | 1497 | } |
| 1498 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1498 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1499 | 1499 | |
| 1500 | 1500 | return $themefiles["$subdir$file"] = ''; |
| 1501 | 1501 | } |
@@ -1603,8 +1603,8 @@ discard block |
||
| 1603 | 1603 | return false; |
| 1604 | 1604 | } |
| 1605 | 1605 | if ($include and !isset($inc[$dirname][$file])) { |
| 1606 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1607 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1606 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1607 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1617,14 +1617,14 @@ discard block |
||
| 1617 | 1617 | } |
| 1618 | 1618 | |
| 1619 | 1619 | foreach (creer_chemin() as $dir) { |
| 1620 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1621 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1620 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1621 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1622 | 1622 | } |
| 1623 | 1623 | if ($dirs[$a]) { |
| 1624 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1624 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1625 | 1625 | if ($include and !isset($inc[$dirname][$file])) { |
| 1626 | - include_once _ROOT_CWD . $a; |
|
| 1627 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1626 | + include_once _ROOT_CWD.$a; |
|
| 1627 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | if (!defined('_SAUVER_CHEMIN')) { |
| 1630 | 1630 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1634,7 +1634,7 @@ discard block |
||
| 1634 | 1634 | define('_SAUVER_CHEMIN', true); |
| 1635 | 1635 | } |
| 1636 | 1636 | |
| 1637 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1637 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | } |
| 1640 | 1640 | } |
@@ -1660,7 +1660,7 @@ discard block |
||
| 1660 | 1660 | define('_SAUVER_CHEMIN', true); |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1663 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | function clear_path_cache() { |
@@ -1730,12 +1730,12 @@ discard block |
||
| 1730 | 1730 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1731 | 1731 | // on a pas encore inclus flock.php |
| 1732 | 1732 | if (!function_exists('preg_files')) { |
| 1733 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1733 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 | // Parcourir le chemin |
| 1737 | 1737 | foreach (creer_chemin() as $d) { |
| 1738 | - $f = $d . $dir; |
|
| 1738 | + $f = $d.$dir; |
|
| 1739 | 1739 | if (@is_dir($f)) { |
| 1740 | 1740 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1741 | 1741 | foreach ($liste as $chemin) { |
@@ -1785,9 +1785,9 @@ discard block |
||
| 1785 | 1785 | if ($type === 'defaut') { |
| 1786 | 1786 | $objet = objet_type($quoi); |
| 1787 | 1787 | if ( |
| 1788 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1788 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1789 | 1789 | // deprecated |
| 1790 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1790 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1791 | 1791 | ) { |
| 1792 | 1792 | return $f; |
| 1793 | 1793 | } |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | 1802 | // inclure le module d'url |
| 1803 | - include_spip('urls/' . $url_type); |
|
| 1803 | + include_spip('urls/'.$url_type); |
|
| 1804 | 1804 | |
| 1805 | 1805 | switch ($quoi) { |
| 1806 | 1806 | case 'page': |
@@ -1956,8 +1956,8 @@ discard block |
||
| 1956 | 1956 | include_spip('base/connect_sql'); |
| 1957 | 1957 | $id_type = id_table_objet($entite, $public); |
| 1958 | 1958 | |
| 1959 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1960 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1959 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1960 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1961 | 1961 | . (!$args ? '' : "&$args") |
| 1962 | 1962 | . (!$ancre ? '' : "#$ancre"); |
| 1963 | 1963 | } |
@@ -2128,7 +2128,7 @@ discard block |
||
| 2128 | 2128 | !empty($_SERVER['QUERY_STRING']) |
| 2129 | 2129 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2130 | 2130 | ) { |
| 2131 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2131 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2132 | 2132 | } |
| 2133 | 2133 | } |
| 2134 | 2134 | } |
@@ -2163,9 +2163,9 @@ discard block |
||
| 2163 | 2163 | array_shift($myself); |
| 2164 | 2164 | $myself = implode('/', $myself); |
| 2165 | 2165 | } |
| 2166 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2166 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2167 | 2167 | |
| 2168 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2168 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2169 | 2169 | |
| 2170 | 2170 | return $url; |
| 2171 | 2171 | } |
@@ -2204,16 +2204,16 @@ discard block |
||
| 2204 | 2204 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2205 | 2205 | $script ??= ''; |
| 2206 | 2206 | if (!$rel) { |
| 2207 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2207 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2208 | 2208 | } else { |
| 2209 | 2209 | if (!is_string($rel)) { |
| 2210 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2210 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2211 | 2211 | } |
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2215 | 2215 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2216 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2216 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2217 | 2217 | } elseif ($args) { |
| 2218 | 2218 | $args = "?$args"; |
| 2219 | 2219 | } |
@@ -2221,7 +2221,7 @@ discard block |
||
| 2221 | 2221 | $args .= "#$ancre"; |
| 2222 | 2222 | } |
| 2223 | 2223 | |
| 2224 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2224 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | 2227 | // |
@@ -2303,10 +2303,10 @@ discard block |
||
| 2303 | 2303 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2304 | 2304 | } |
| 2305 | 2305 | if ($args) { |
| 2306 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2306 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2307 | 2307 | } |
| 2308 | 2308 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2309 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2309 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2310 | 2310 | } |
| 2311 | 2311 | |
| 2312 | 2312 | if (!$no_entities) { |
@@ -2318,7 +2318,7 @@ discard block |
||
| 2318 | 2318 | |
| 2319 | 2319 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2320 | 2320 | |
| 2321 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2321 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2322 | 2322 | } |
| 2323 | 2323 | |
| 2324 | 2324 | // Pour les formulaires en methode POST, |
@@ -2353,8 +2353,7 @@ discard block |
||
| 2353 | 2353 | . "><div>\n" |
| 2354 | 2354 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2355 | 2355 | . $corps |
| 2356 | - . (!$submit ? '' : |
|
| 2357 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2356 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2358 | 2357 | . "</div></form>\n"; |
| 2359 | 2358 | } |
| 2360 | 2359 | |
@@ -2379,14 +2378,14 @@ discard block |
||
| 2379 | 2378 | ? generer_url_ecrire(_request('exec')) |
| 2380 | 2379 | : generer_url_public(); |
| 2381 | 2380 | |
| 2382 | - return "\n<form action='" . |
|
| 2383 | - $h . |
|
| 2384 | - "'" . |
|
| 2385 | - $atts . |
|
| 2386 | - ">\n" . |
|
| 2387 | - '<div>' . |
|
| 2388 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2389 | - $corps . |
|
| 2381 | + return "\n<form action='". |
|
| 2382 | + $h. |
|
| 2383 | + "'". |
|
| 2384 | + $atts. |
|
| 2385 | + ">\n". |
|
| 2386 | + '<div>'. |
|
| 2387 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2388 | + $corps. |
|
| 2390 | 2389 | '</div></form>'; |
| 2391 | 2390 | } |
| 2392 | 2391 | |
@@ -2414,7 +2413,7 @@ discard block |
||
| 2414 | 2413 | : generer_url_public('', '', false, false); |
| 2415 | 2414 | $url = parametre_url($url, 'action', $script); |
| 2416 | 2415 | if ($args) { |
| 2417 | - $url .= quote_amp('&' . $args); |
|
| 2416 | + $url .= quote_amp('&'.$args); |
|
| 2418 | 2417 | } |
| 2419 | 2418 | |
| 2420 | 2419 | if ($no_entities) { |
@@ -2448,9 +2447,9 @@ discard block |
||
| 2448 | 2447 | } |
| 2449 | 2448 | $url = |
| 2450 | 2449 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2451 | - . $script . '/' |
|
| 2450 | + . $script.'/' |
|
| 2452 | 2451 | . ($path ? trim($path, '/') : '') |
| 2453 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2452 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2454 | 2453 | |
| 2455 | 2454 | if ($no_entities) { |
| 2456 | 2455 | $url = str_replace('&', '&', $url); |
@@ -2499,17 +2498,17 @@ discard block |
||
| 2499 | 2498 | |
| 2500 | 2499 | // le nom du repertoire plugins/ activables/desactivables |
| 2501 | 2500 | if (!defined('_DIR_PLUGINS')) { |
| 2502 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2501 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2503 | 2502 | } |
| 2504 | 2503 | |
| 2505 | 2504 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2506 | 2505 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2507 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2506 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2508 | 2507 | } |
| 2509 | 2508 | |
| 2510 | 2509 | // le nom du repertoire des librairies |
| 2511 | 2510 | if (!defined('_DIR_LIB')) { |
| 2512 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2511 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2513 | 2512 | } |
| 2514 | 2513 | |
| 2515 | 2514 | if (!defined('_DIR_IMG')) { |
@@ -2519,29 +2518,29 @@ discard block |
||
| 2519 | 2518 | define('_DIR_LOGOS', $pa); |
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_DIR_IMG_ICONES')) { |
| 2522 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2521 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | |
| 2525 | 2524 | if (!defined('_DIR_DUMP')) { |
| 2526 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2525 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2527 | 2526 | } |
| 2528 | 2527 | if (!defined('_DIR_SESSIONS')) { |
| 2529 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2528 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2530 | 2529 | } |
| 2531 | 2530 | if (!defined('_DIR_TRANSFERT')) { |
| 2532 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2531 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2533 | 2532 | } |
| 2534 | 2533 | if (!defined('_DIR_CACHE')) { |
| 2535 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2534 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2536 | 2535 | } |
| 2537 | 2536 | if (!defined('_DIR_CACHE_XML')) { |
| 2538 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2537 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2539 | 2538 | } |
| 2540 | 2539 | if (!defined('_DIR_SKELS')) { |
| 2541 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2540 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2542 | 2541 | } |
| 2543 | 2542 | if (!defined('_DIR_AIDE')) { |
| 2544 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2543 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2545 | 2544 | } |
| 2546 | 2545 | if (!defined('_DIR_TMP')) { |
| 2547 | 2546 | define('_DIR_TMP', $ti); |
@@ -2570,27 +2569,27 @@ discard block |
||
| 2570 | 2569 | // Declaration des fichiers |
| 2571 | 2570 | |
| 2572 | 2571 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2573 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2572 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2574 | 2573 | } |
| 2575 | 2574 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2576 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2575 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2577 | 2576 | } |
| 2578 | 2577 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2579 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2578 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2580 | 2579 | } |
| 2581 | 2580 | if (!defined('_CACHE_PIPELINES')) { |
| 2582 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2581 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | if (!defined('_CACHE_CHEMIN')) { |
| 2585 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2584 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | |
| 2588 | 2587 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2589 | 2588 | if (!defined('_FILE_META')) { |
| 2590 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2589 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2591 | 2590 | } |
| 2592 | 2591 | if (!defined('_DIR_LOG')) { |
| 2593 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2592 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2594 | 2593 | } |
| 2595 | 2594 | if (!defined('_FILE_LOG')) { |
| 2596 | 2595 | define('_FILE_LOG', 'spip'); |
@@ -2607,8 +2606,8 @@ discard block |
||
| 2607 | 2606 | if (!defined('_FILE_CONNECT')) { |
| 2608 | 2607 | define( |
| 2609 | 2608 | '_FILE_CONNECT', |
| 2610 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2611 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2609 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2610 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2612 | 2611 | : false)) |
| 2613 | 2612 | ); |
| 2614 | 2613 | } |
@@ -2620,7 +2619,7 @@ discard block |
||
| 2620 | 2619 | if (!defined('_FILE_CHMOD')) { |
| 2621 | 2620 | define( |
| 2622 | 2621 | '_FILE_CHMOD', |
| 2623 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2622 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2624 | 2623 | : false) |
| 2625 | 2624 | ); |
| 2626 | 2625 | } |
@@ -2633,10 +2632,10 @@ discard block |
||
| 2633 | 2632 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2634 | 2633 | } |
| 2635 | 2634 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2636 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2635 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2637 | 2636 | } |
| 2638 | 2637 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2639 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2638 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2640 | 2639 | } |
| 2641 | 2640 | |
| 2642 | 2641 | // Definition des droits d'acces en ecriture |
@@ -2654,13 +2653,13 @@ discard block |
||
| 2654 | 2653 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2655 | 2654 | } |
| 2656 | 2655 | if (!defined('_ROOT_PLUGINS')) { |
| 2657 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2656 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2658 | 2657 | } |
| 2659 | 2658 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2660 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2659 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2661 | 2660 | } |
| 2662 | 2661 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2663 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2662 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2664 | 2663 | } |
| 2665 | 2664 | |
| 2666 | 2665 | // La taille des Log |
@@ -2697,7 +2696,7 @@ discard block |
||
| 2697 | 2696 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2698 | 2697 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2699 | 2698 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2700 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2699 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2701 | 2700 | |
| 2702 | 2701 | // charger tout de suite le path et son cache |
| 2703 | 2702 | load_path_cache(); |
@@ -2733,7 +2732,7 @@ discard block |
||
| 2733 | 2732 | !empty($_SERVER['QUERY_STRING']) |
| 2734 | 2733 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2735 | 2734 | ) { |
| 2736 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2735 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2737 | 2736 | } |
| 2738 | 2737 | } |
| 2739 | 2738 | |
@@ -2769,7 +2768,7 @@ discard block |
||
| 2769 | 2768 | ) { |
| 2770 | 2769 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2771 | 2770 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2772 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2771 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2773 | 2772 | } else { |
| 2774 | 2773 | $uri_ref = ''; |
| 2775 | 2774 | } |
@@ -2863,7 +2862,7 @@ discard block |
||
| 2863 | 2862 | } |
| 2864 | 2863 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2865 | 2864 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2866 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2865 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2867 | 2866 | } |
| 2868 | 2867 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2869 | 2868 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3085,7 +3084,7 @@ discard block |
||
| 3085 | 3084 | } |
| 3086 | 3085 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3087 | 3086 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3088 | - . ' ' . _VAR_MODE); |
|
| 3087 | + . ' '._VAR_MODE); |
|
| 3089 | 3088 | } |
| 3090 | 3089 | } // pas autorise ? |
| 3091 | 3090 | else { |
@@ -3100,7 +3099,7 @@ discard block |
||
| 3100 | 3099 | if (strpos($self, 'page=login') === false) { |
| 3101 | 3100 | include_spip('inc/headers'); |
| 3102 | 3101 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3103 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3102 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3104 | 3103 | } |
| 3105 | 3104 | } |
| 3106 | 3105 | // sinon tant pis |
@@ -3150,10 +3149,10 @@ discard block |
||
| 3150 | 3149 | **/ |
| 3151 | 3150 | function verifier_visiteur() { |
| 3152 | 3151 | @spip_initialisation_core( |
| 3153 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3154 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3155 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3156 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3152 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3153 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3154 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3155 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3157 | 3156 | ); |
| 3158 | 3157 | |
| 3159 | 3158 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3186,7 +3185,7 @@ discard block |
||
| 3186 | 3185 | } |
| 3187 | 3186 | |
| 3188 | 3187 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3189 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3188 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3190 | 3189 | $session = charger_fonction('session', 'inc'); |
| 3191 | 3190 | if ($session()) { |
| 3192 | 3191 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3266,7 +3265,7 @@ discard block |
||
| 3266 | 3265 | 'definir_session', |
| 3267 | 3266 | $GLOBALS['visiteur_session'] |
| 3268 | 3267 | ? serialize($GLOBALS['visiteur_session']) |
| 3269 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3268 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3270 | 3269 | : '' |
| 3271 | 3270 | ); |
| 3272 | 3271 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3422,11 +3421,11 @@ discard block |
||
| 3422 | 3421 | $GLOBALS['_INC_PUBLIC']++; |
| 3423 | 3422 | |
| 3424 | 3423 | // fix #4235 |
| 3425 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3424 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3426 | 3425 | |
| 3427 | 3426 | |
| 3428 | 3427 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3429 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3428 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3430 | 3429 | |
| 3431 | 3430 | $page = evaluer_fond($f, $contexte, $connect); |
| 3432 | 3431 | if ($page === '') { |
@@ -3511,7 +3510,7 @@ discard block |
||
| 3511 | 3510 | * @return array|string |
| 3512 | 3511 | */ |
| 3513 | 3512 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3514 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3513 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3515 | 3514 | if (!$pathinfo) { |
| 3516 | 3515 | return $f; |
| 3517 | 3516 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // in fine renommer le prefixe si besoin |
| 107 | 107 | if (strpos($name, 'spip_') === 0) { |
| 108 | - $name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5); |
|
| 108 | + $name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | #spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies"); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | foreach ($_COOKIE as $name => $value) { |
| 165 | 165 | if (substr($name, 0, $prefix_long) == $cookie_prefix) { |
| 166 | - $spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name); |
|
| 166 | + $spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name); |
|
| 167 | 167 | $_COOKIE[$spipname] = $value; |
| 168 | 168 | $GLOBALS[$spipname] = $value; |
| 169 | 169 | } |
@@ -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?:', |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // si c'est la protection de soi-meme, retourner le path |
| 74 | 74 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 75 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 75 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 76 | 76 | |
| 77 | 77 | return @file_exists($source) ? $source : false; |
| 78 | 78 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $localrac = _DIR_RACINE . $local; |
|
| 95 | + $localrac = _DIR_RACINE.$local; |
|
| 96 | 96 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 97 | 97 | |
| 98 | 98 | // test d'existence du fichier |
@@ -112,18 +112,18 @@ discard block |
||
| 112 | 112 | if (!$taille_max) { |
| 113 | 113 | $taille_max = _COPIE_LOCALE_MAX_SIZE; |
| 114 | 114 | } |
| 115 | - $localrac_tmp = $localrac . '.tmp'; |
|
| 115 | + $localrac_tmp = $localrac.'.tmp'; |
|
| 116 | 116 | $res = recuperer_url( |
| 117 | 117 | $source, |
| 118 | 118 | ['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 122 | - spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 122 | + spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 123 | 123 | @unlink($localrac_tmp); |
| 124 | 124 | } |
| 125 | 125 | else { |
| 126 | - spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 126 | + spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 127 | 127 | } |
| 128 | 128 | if (!$res or !$res['length']) { |
| 129 | 129 | // si $t c'est sans doute juste un not-modified-since |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | if ($callback_valider_url |
| 135 | 135 | and is_callable($callback_valider_url) |
| 136 | 136 | and !$callback_valider_url($res['url'])) { |
| 137 | - spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 137 | + spip_log("copie_locale : url finale ".$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE); |
|
| 138 | 138 | @unlink($localrac_tmp); |
| 139 | 139 | return $t ? $local : false; |
| 140 | 140 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | if (!$is_known_host) { |
| 227 | 227 | $host = trim($parsed_url['host'], '.'); |
| 228 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 228 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 229 | 229 | $ip = gethostbyname($host); |
| 230 | 230 | if ($ip === $host) { |
| 231 | 231 | // Error condition for gethostbyname() |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | if ($ip) { |
| 249 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 249 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 250 | 250 | return false; |
| 251 | 251 | } |
| 252 | 252 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $port = $parsed_url['port']; |
| 260 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 260 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 261 | 261 | return $url; |
| 262 | 262 | } |
| 263 | 263 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | if ($taille > 500) { |
| 330 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 330 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | |
@@ -355,16 +355,16 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | } else { |
| 357 | 357 | // fabrique une chaine HTTP simple pour un POST |
| 358 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 358 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 359 | 359 | $chaine = []; |
| 360 | 360 | if (is_array($donnees)) { |
| 361 | 361 | foreach ($donnees as $cle => $valeur) { |
| 362 | 362 | if (is_array($valeur)) { |
| 363 | 363 | foreach ($valeur as $val2) { |
| 364 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 364 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 365 | 365 | } |
| 366 | 366 | } else { |
| 367 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 367 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | $chaine = implode('&', $chaine); |
@@ -469,13 +469,13 @@ discard block |
||
| 469 | 469 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | - spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 472 | + spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 473 | 473 | |
| 474 | 474 | // Ajout des en-têtes spécifiques si besoin |
| 475 | 475 | $formatted_data = ''; |
| 476 | 476 | if (!empty($options['headers'])) { |
| 477 | 477 | foreach ($options['headers'] as $champ => $valeur) { |
| 478 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 478 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | |
@@ -483,9 +483,9 @@ discard block |
||
| 483 | 483 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 484 | 484 | $head .= $formatted_data; |
| 485 | 485 | if (stripos($head, 'Content-Length:') === false) { |
| 486 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 486 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 487 | 487 | } |
| 488 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 488 | + $formatted_data = $head."\r\n".$postdata; |
|
| 489 | 489 | if ( |
| 490 | 490 | strlen($postdata) |
| 491 | 491 | and !$methode_demandee |
@@ -499,9 +499,9 @@ discard block |
||
| 499 | 499 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 500 | 500 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 501 | 501 | if (!tester_url_absolue($url)) { |
| 502 | - $url = 'http://' . $url; |
|
| 502 | + $url = 'http://'.$url; |
|
| 503 | 503 | } elseif (strncmp($url, '//', 2) == 0) { |
| 504 | - $url = 'http:' . $url; |
|
| 504 | + $url = 'http:'.$url; |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | $url = url_to_ascii($url); |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | $options['if_modified_since'] |
| 531 | 531 | ); |
| 532 | 532 | if (!$handle) { |
| 533 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 533 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 534 | 534 | |
| 535 | 535 | return false; |
| 536 | 536 | } |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | 'status' => 200, |
| 561 | 561 | ]; |
| 562 | 562 | } else { |
| 563 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 563 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 564 | 564 | return false; |
| 565 | 565 | } |
| 566 | 566 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -576,11 +576,11 @@ discard block |
||
| 576 | 576 | $options['datas'] = ''; |
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | - spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 579 | + spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 580 | 580 | |
| 581 | 581 | return recuperer_url($url, $options); |
| 582 | 582 | } elseif ($res['status'] !== 200) { |
| 583 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 583 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 584 | 584 | } |
| 585 | 585 | $result['status'] = $res['status']; |
| 586 | 586 | if (isset($res['headers'])) { |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | // on ne veut que les entetes |
| 598 | 598 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 599 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 599 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 600 | 600 | return $result; |
| 601 | 601 | } |
| 602 | 602 | |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | |
| 607 | 607 | $gz = false; |
| 608 | 608 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 609 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 609 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | |
| 643 | 643 | $trace = json_decode(json_encode($result), true); |
| 644 | 644 | $trace['page'] = '...'; |
| 645 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 645 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 646 | 646 | |
| 647 | 647 | return $result; |
| 648 | 648 | } |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | $sig['url'] = $url; |
| 697 | 697 | |
| 698 | 698 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 699 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 699 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 700 | 700 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 701 | 701 | $cache = "$sub$cache"; |
| 702 | 702 | |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | $fp = false; |
| 751 | 751 | if ($fichier) { |
| 752 | 752 | include_spip('inc/acces'); |
| 753 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 753 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 754 | 754 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 755 | 755 | if (!$fp and file_exists($fichier)) { |
| 756 | 756 | return filesize($fichier); |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | } |
| 810 | 810 | $result['status'] = intval($r[1]); |
| 811 | 811 | while ($s = trim(fgets($handle, 16384))) { |
| 812 | - $result['headers'][] = $s . "\n"; |
|
| 812 | + $result['headers'][] = $s."\n"; |
|
| 813 | 813 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 814 | 814 | [, $d, $v] = $r; |
| 815 | 815 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -858,13 +858,13 @@ discard block |
||
| 858 | 858 | |
| 859 | 859 | // on se place tout le temps comme si on etait a la racine |
| 860 | 860 | if (_DIR_RACINE) { |
| 861 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 861 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | $m = md5($source); |
| 865 | 865 | |
| 866 | 866 | return $d |
| 867 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 867 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 868 | 868 | . substr($m, 0, 4) |
| 869 | 869 | . ".$extension"; |
| 870 | 870 | } |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | // Si c'est deja local pas de souci |
| 888 | 888 | if (!tester_url_absolue($source)) { |
| 889 | 889 | if (_DIR_RACINE) { |
| 890 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 890 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | return $source; |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | $ext |
| 906 | 906 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 907 | 907 | and $f = nom_fichier_copie_locale($source, $ext) |
| 908 | - and file_exists(_DIR_RACINE . $f) |
|
| 908 | + and file_exists(_DIR_RACINE.$f) |
|
| 909 | 909 | ) { |
| 910 | 910 | return $f; |
| 911 | 911 | } |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | |
| 914 | 914 | // Si c'est deja dans la table des documents, |
| 915 | 915 | // ramener le nom de sa copie potentielle |
| 916 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 916 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 917 | 917 | |
| 918 | 918 | if ($ext) { |
| 919 | 919 | return nom_fichier_copie_locale($source, $ext); |
@@ -924,9 +924,9 @@ discard block |
||
| 924 | 924 | |
| 925 | 925 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 926 | 926 | |
| 927 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 927 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 928 | 928 | $f = nom_fichier_copie_locale($source, $ext); |
| 929 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 929 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 930 | 930 | return $f; |
| 931 | 931 | } |
| 932 | 932 | } |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | // Ping pour voir si son extension est connue et autorisee |
| 935 | 935 | // avec mise en cache du resultat du ping |
| 936 | 936 | |
| 937 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 937 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 938 | 938 | if ( |
| 939 | 939 | !@file_exists($cache) |
| 940 | 940 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -944,10 +944,10 @@ discard block |
||
| 944 | 944 | ecrire_fichier($cache, serialize($path_parts)); |
| 945 | 945 | } |
| 946 | 946 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 947 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 947 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 948 | 948 | return nom_fichier_copie_locale($source, $ext); |
| 949 | 949 | } |
| 950 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 950 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | } else { |
| 1044 | 1044 | if ($a['body']) { |
| 1045 | 1045 | $a['extension'] = $extension; |
| 1046 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1046 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1047 | 1047 | ecrire_fichier($a['fichier'], $a['body']); |
| 1048 | 1048 | $size_image = @spip_getimagesize($a['fichier']); |
| 1049 | 1049 | $a['largeur'] = intval($size_image[0]); |
@@ -1111,20 +1111,20 @@ discard block |
||
| 1111 | 1111 | !$t |
| 1112 | 1112 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1113 | 1113 | ) { |
| 1114 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1114 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1115 | 1115 | } |
| 1116 | 1116 | if ( |
| 1117 | 1117 | !$t |
| 1118 | 1118 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1119 | 1119 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1120 | 1120 | ) { |
| 1121 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1121 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1122 | 1122 | } |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1126 | 1126 | if (!$t) { |
| 1127 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1127 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1135,11 +1135,11 @@ discard block |
||
| 1135 | 1135 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1136 | 1136 | ) { |
| 1137 | 1137 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1138 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1138 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | 1141 | if ($t) { |
| 1142 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1142 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1143 | 1143 | return $t['extension']; |
| 1144 | 1144 | } else { |
| 1145 | 1145 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | } |
| 1243 | 1243 | } else { |
| 1244 | 1244 | $scheme = $t['scheme']; |
| 1245 | - $noproxy = $scheme . '://'; |
|
| 1245 | + $noproxy = $scheme.'://'; |
|
| 1246 | 1246 | } |
| 1247 | 1247 | if (isset($t['user'])) { |
| 1248 | 1248 | $user = [$t['user'], $t['pass']]; |
@@ -1256,7 +1256,7 @@ discard block |
||
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | 1258 | if (!empty($t['query'])) { |
| 1259 | - $path .= '?' . $t['query']; |
|
| 1259 | + $path .= '?'.$t['query']; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | 1262 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1330,29 +1330,29 @@ discard block |
||
| 1330 | 1330 | $proxy_user = ''; |
| 1331 | 1331 | $http_proxy = need_proxy($host); |
| 1332 | 1332 | if ($user) { |
| 1333 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1333 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1334 | 1334 | } |
| 1335 | 1335 | |
| 1336 | 1336 | $connect = ''; |
| 1337 | 1337 | if ($http_proxy) { |
| 1338 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1339 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1340 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1338 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1339 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1340 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1341 | 1341 | . "Host: $path_host\r\n" |
| 1342 | 1342 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1343 | 1343 | } else { |
| 1344 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1344 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1345 | 1345 | . (!$user ? '' : "$user@") |
| 1346 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1346 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1347 | 1347 | } |
| 1348 | 1348 | $t2 = @parse_url($http_proxy); |
| 1349 | 1349 | $first_host = $t2['host']; |
| 1350 | 1350 | $port = ($t2['port'] ?? null) ?: 80; |
| 1351 | 1351 | if ($t2['user'] ?? null) { |
| 1352 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1352 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1353 | 1353 | } |
| 1354 | 1354 | } else { |
| 1355 | - $first_host = $noproxy . $host; |
|
| 1355 | + $first_host = $noproxy.$host; |
|
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | 1358 | if ($connect) { |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | ); |
| 1375 | 1375 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 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 | return $errno; |
| 1379 | 1379 | } |
| 1380 | 1380 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | or !count($res = explode(' ', $res)) |
| 1388 | 1388 | or $res[1] !== '200' |
| 1389 | 1389 | ) { |
| 1390 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1390 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1391 | 1391 | fclose($f); |
| 1392 | 1392 | |
| 1393 | 1393 | return false; |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1405 | 1405 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1406 | 1406 | if (!$f) { |
| 1407 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1407 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1408 | 1408 | |
| 1409 | 1409 | return $errno; |
| 1410 | 1410 | } |
@@ -1414,16 +1414,16 @@ discard block |
||
| 1414 | 1414 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1415 | 1415 | |
| 1416 | 1416 | $host_port = $host; |
| 1417 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1417 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1418 | 1418 | $host_port .= ":$port"; |
| 1419 | 1419 | } |
| 1420 | 1420 | $req = "$method $path $vers\r\n" |
| 1421 | 1421 | . "Host: $host_port\r\n" |
| 1422 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1423 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1422 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1423 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1424 | 1424 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1425 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1426 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1425 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1426 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1427 | 1427 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1428 | 1428 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1429 | 1429 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | // mais apres la fonction autoriser() |
| 121 | 121 | if ($f = find_in_path('mes_fonctions.php')) { |
| 122 | 122 | global $dossier_squelettes; |
| 123 | - include_once(_ROOT_CWD . $f); |
|
| 123 | + include_once(_ROOT_CWD.$f); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 163 | 163 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 164 | 164 | } elseif (is_numeric($qui)) { |
| 165 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 165 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | spip_log( |
| 175 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 176 | - 'autoriser' . _LOG_DEBUG |
|
| 175 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 176 | + 'autoriser'._LOG_DEBUG |
|
| 177 | 177 | ); |
| 178 | 178 | |
| 179 | 179 | // passer par objet_type pour avoir les alias |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 190 | 190 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 191 | 191 | ) { |
| 192 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 192 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 193 | 193 | return true; |
| 194 | 194 | } |
| 195 | 195 | |
@@ -198,18 +198,18 @@ discard block |
||
| 198 | 198 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 199 | 199 | $fonctions = $type |
| 200 | 200 | ? [ |
| 201 | - 'autoriser_' . $type . '_' . $faire, |
|
| 202 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 203 | - 'autoriser_' . $type, |
|
| 204 | - 'autoriser_' . $type . '_dist', |
|
| 205 | - 'autoriser_' . $faire, |
|
| 206 | - 'autoriser_' . $faire . '_dist', |
|
| 201 | + 'autoriser_'.$type.'_'.$faire, |
|
| 202 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 203 | + 'autoriser_'.$type, |
|
| 204 | + 'autoriser_'.$type.'_dist', |
|
| 205 | + 'autoriser_'.$faire, |
|
| 206 | + 'autoriser_'.$faire.'_dist', |
|
| 207 | 207 | 'autoriser_defaut', |
| 208 | 208 | 'autoriser_defaut_dist' |
| 209 | 209 | ] |
| 210 | 210 | : [ |
| 211 | - 'autoriser_' . $faire, |
|
| 212 | - 'autoriser_' . $faire . '_dist', |
|
| 211 | + 'autoriser_'.$faire, |
|
| 212 | + 'autoriser_'.$faire.'_dist', |
|
| 213 | 213 | 'autoriser_defaut', |
| 214 | 214 | 'autoriser_defaut_dist' |
| 215 | 215 | ]; |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | spip_log( |
| 225 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 226 | - 'autoriser' . _LOG_DEBUG |
|
| 225 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 226 | + 'autoriser'._LOG_DEBUG |
|
| 227 | 227 | ); |
| 228 | 228 | |
| 229 | 229 | return $a; |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 373 | 373 | |
| 374 | 374 | // Le visiteur a-t-il un statut prevu par la config ? |
| 375 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 375 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 376 | 376 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 377 | 377 | } |
| 378 | 378 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | } // pas de champ passe a la demande => NIET |
| 431 | 431 | $previsu = explode(',', $c['previsu']); |
| 432 | 432 | // regarder si ce statut est autorise pour l'auteur |
| 433 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 433 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 434 | 434 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 435 | 435 | // sinon l’auteur en session |
| 436 | 436 | include_spip('inc/securiser_action'); |
@@ -444,12 +444,12 @@ discard block |
||
| 444 | 444 | |
| 445 | 445 | if (!$id_auteur) { |
| 446 | 446 | return false; |
| 447 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 447 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 448 | 448 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 449 | 449 | } elseif ( |
| 450 | 450 | !sql_countsel( |
| 451 | 451 | 'spip_auteurs_liens', |
| 452 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 452 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 453 | 453 | ) |
| 454 | 454 | ) { |
| 455 | 455 | return false; |
@@ -494,16 +494,16 @@ discard block |
||
| 494 | 494 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 495 | 495 | $primary = id_table_objet($type); |
| 496 | 496 | if ($table != 'spip_rubriques') { |
| 497 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 497 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 498 | 498 | } else { |
| 499 | 499 | $id_rubrique = $id; |
| 500 | 500 | } |
| 501 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 501 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 502 | 502 | if (!$id_secteur > 0) { |
| 503 | 503 | $id_secteur = $id_rubrique; |
| 504 | 504 | } |
| 505 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 506 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 505 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 506 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 507 | 507 | if ($langue_secteur != $langue_objet) { |
| 508 | 508 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 509 | 509 | return true; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 512 | 512 | return false; |
| 513 | 513 | } else { |
| 514 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 514 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 515 | 515 | if ($id_parent != 0) { |
| 516 | 516 | // sous-rubriques : pas de choix de langue |
| 517 | 517 | return false; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | if (!isset($opt['statut'])) { |
| 565 | 565 | if (isset($desc['field']['statut'])) { |
| 566 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 566 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 567 | 567 | } else { |
| 568 | 568 | $statut = 'publie'; |
| 569 | 569 | } // pas de statut => publie |
@@ -737,11 +737,11 @@ discard block |
||
| 737 | 737 | return false; |
| 738 | 738 | } |
| 739 | 739 | |
| 740 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 740 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 741 | 741 | return false; |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 744 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 745 | 745 | return false; |
| 746 | 746 | } |
| 747 | 747 | |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | if (!$id) { |
| 779 | 779 | return false; |
| 780 | 780 | } |
| 781 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 781 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 782 | 782 | |
| 783 | 783 | return |
| 784 | 784 | $r |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | (!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true)) |
| 790 | 790 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 791 | 791 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 792 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 792 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 793 | 793 | ) |
| 794 | 794 | ); |
| 795 | 795 | } |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | if (!$id) { |
| 848 | 848 | return false; |
| 849 | 849 | } |
| 850 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 850 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | return |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | or |
| 859 | 859 | ($id |
| 860 | 860 | and $qui['id_auteur'] |
| 861 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 861 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | |
@@ -879,8 +879,8 @@ discard block |
||
| 879 | 879 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 880 | 880 | # securite, mais on aurait pas du arriver ici ! |
| 881 | 881 | if ( |
| 882 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 883 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 882 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 883 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 884 | 884 | ) { |
| 885 | 885 | return $f($faire, $type, $id, $qui, $opt); |
| 886 | 886 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | $n = sql_fetsel( |
| 1012 | 1012 | 'A.id_article', |
| 1013 | 1013 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1014 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1014 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1015 | 1015 | ); |
| 1016 | 1016 | |
| 1017 | 1017 | return $n ? true : false; |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | and $r = sql_allfetsel( |
| 1224 | 1224 | 'id_objet', |
| 1225 | 1225 | 'spip_auteurs_liens', |
| 1226 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1226 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1227 | 1227 | ) |
| 1228 | 1228 | and is_countable($r) ? count($r) : 0 |
| 1229 | 1229 | ) { |
@@ -1908,8 +1908,8 @@ discard block |
||
| 1908 | 1908 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1909 | 1909 | $objet = objet_type($objet); |
| 1910 | 1910 | $where = [ |
| 1911 | - 'objet=' . sql_quote($objet), |
|
| 1912 | - 'id_objet=' . intval($id_objet) |
|
| 1911 | + 'objet='.sql_quote($objet), |
|
| 1912 | + 'id_objet='.intval($id_objet) |
|
| 1913 | 1913 | ]; |
| 1914 | 1914 | if (!empty($cond)) { |
| 1915 | 1915 | if (is_array($cond)) { |
@@ -1944,7 +1944,7 @@ discard block |
||
| 1944 | 1944 | return sql_allfetsel( |
| 1945 | 1945 | 'id_auteur', |
| 1946 | 1946 | 'spip_auteurs_liens', |
| 1947 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1947 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1948 | 1948 | ); |
| 1949 | 1949 | } |
| 1950 | 1950 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | $options = array_merge($defaut, $options); |
| 45 | 45 | if (is_numeric($options['expires']) and $options['expires'] > 0) { |
| 46 | - $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 46 | + $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) { |
| 73 | 73 | // toujours envoyer un content type, meme vide ! |
| 74 | 74 | header('Accept-Ranges: bytes'); |
| 75 | - header('Content-Type: ' . $content_type); |
|
| 75 | + header('Content-Type: '.$content_type); |
|
| 76 | 76 | |
| 77 | 77 | if ($attachment) { |
| 78 | 78 | $f = basename($fichier); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | else { |
| 91 | 91 | $f = basename($fichier); |
| 92 | 92 | header("Content-Disposition: inline; filename=\"$f\";"); |
| 93 | - header('Expires: ' . $expires); // set expiration time |
|
| 93 | + header('Expires: '.$expires); // set expiration time |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -142,12 +142,12 @@ discard block |
||
| 142 | 142 | // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
| 143 | 143 | if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
| 144 | 144 | ### Offset signifies where we should begin to read the file |
| 145 | - $byteOffset = (int)$match[1]; |
|
| 145 | + $byteOffset = (int) $match[1]; |
|
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
| 149 | 149 | if (isset($match[2])) { |
| 150 | - $finishBytes = (int)$match[2]; |
|
| 150 | + $finishBytes = (int) $match[2]; |
|
| 151 | 151 | $byteLength = $finishBytes + 1; |
| 152 | 152 | } else { |
| 153 | 153 | $finishBytes = $fileSize - 1; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | // partial content |
| 170 | 170 | header('HTTP/1.1 206 Partial content'); |
| 171 | - header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 171 | + header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 172 | 172 | |
| 173 | 173 | |
| 174 | 174 | $byteRange = $byteLength - $byteOffset; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | and ( |
| 104 | 104 | $newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur']) |
| 105 | 105 | )); |
| 106 | - $res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . "</li>"; |
|
| 106 | + $res[] = "<li class='pagination-item'>".lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination')."</li>"; |
|
| 107 | 107 | } |
| 108 | 108 | if ($initiale) { |
| 109 | 109 | $memo = [ |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | if (!$initiale and !$url) { |
| 118 | 118 | if ((is_countable($res) ? count($res) : 0) > 1) { |
| 119 | - $out = "<ul class='pagination-items'>" . implode(' ', $res) . "</ul>"; |
|
| 119 | + $out = "<ul class='pagination-items'>".implode(' ', $res)."</ul>"; |
|
| 120 | 120 | } |
| 121 | 121 | $memo = null; |
| 122 | 122 | $res = []; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ) { |
| 158 | 158 | return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
| 159 | 159 | } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
| 160 | - return 'mailto:' . $email; |
|
| 160 | + return 'mailto:'.$email; |
|
| 161 | 161 | } else { |
| 162 | 162 | return ''; |
| 163 | 163 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | if ($logo) { |
| 41 | 41 | # TODO : deprecated, a supprimer -> anciens logos IMG/artonxx.png pas en base |
| 42 | 42 | if ((is_countable($logo) ? count($logo) : 0) < 6) { |
| 43 | - spip_log("Supprimer ancien logo " . json_encode($logo, JSON_THROW_ON_ERROR), 'logo'); |
|
| 43 | + spip_log("Supprimer ancien logo ".json_encode($logo, JSON_THROW_ON_ERROR), 'logo'); |
|
| 44 | 44 | spip_unlink($logo[0]); |
| 45 | 45 | } |
| 46 | 46 | elseif ( |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return $erreur; |
| 90 | 90 | } |
| 91 | 91 | // chercher dans la base |
| 92 | - $mode_document = 'logo' . $mode; |
|
| 92 | + $mode_document = 'logo'.$mode; |
|
| 93 | 93 | |
| 94 | 94 | include_spip('inc/documents'); |
| 95 | 95 | $erreur = ''; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $tmp_name = false; |
| 107 | 107 | if (file_exists($source)) { |
| 108 | 108 | $tmp_name = $source; |
| 109 | - } elseif (file_exists($f = determine_upload() . $source)) { |
|
| 109 | + } elseif (file_exists($f = determine_upload().$source)) { |
|
| 110 | 110 | $tmp_name = $f; |
| 111 | 111 | } |
| 112 | 112 | if (!$tmp_name) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if (!is_numeric($id_document)) { |
| 144 | 144 | $erreur = ($id_document ?: 'Erreur inconnue'); |
| 145 | - spip_log("Erreur ajout logo : $erreur pour source=" . json_encode($source, JSON_THROW_ON_ERROR), 'logo'); |
|
| 145 | + spip_log("Erreur ajout logo : $erreur pour source=".json_encode($source, JSON_THROW_ON_ERROR), 'logo'); |
|
| 146 | 146 | return $erreur; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -175,23 +175,23 @@ discard block |
||
| 175 | 175 | $GLOBALS['meta']['articles_modif'] = 'non'; |
| 176 | 176 | |
| 177 | 177 | foreach (['on', 'off'] as $mode) { |
| 178 | - $nom_base = $type . $mode; |
|
| 178 | + $nom_base = $type.$mode; |
|
| 179 | 179 | $dir = (defined('_DIR_LOGOS') ? _DIR_LOGOS : _DIR_IMG); |
| 180 | 180 | |
| 181 | - $files = glob($dir . $nom_base . '*'); |
|
| 181 | + $files = glob($dir.$nom_base.'*'); |
|
| 182 | 182 | // est-ce que c'est une nouvelle tentative de migration ? |
| 183 | 183 | // dans ce cas les logos sont deja dans IMG/logo/ |
| 184 | 184 | if (!(is_countable($files) ? count($files) : 0)) { |
| 185 | - $files = glob($dir_logos . $nom_base . '*'); |
|
| 185 | + $files = glob($dir_logos.$nom_base.'*'); |
|
| 186 | 186 | if (is_countable($files) ? count($files) : 0) { |
| 187 | 187 | // mais il faut verifier si ils ont pas deja ete migres pour tout ou partie |
| 188 | 188 | $filescheck = []; |
| 189 | 189 | foreach ($files as $file) { |
| 190 | - $short = basename(dirname($file)) . DIRECTORY_SEPARATOR . basename($file); |
|
| 190 | + $short = basename(dirname($file)).DIRECTORY_SEPARATOR.basename($file); |
|
| 191 | 191 | $filescheck[$short] = $file; |
| 192 | 192 | } |
| 193 | 193 | // trouver ceux deja migres |
| 194 | - $deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck)) . " AND mode LIKE 'logo%'"); |
|
| 194 | + $deja = sql_allfetsel('fichier', 'spip_documents', sql_in('fichier', array_keys($filescheck))." AND mode LIKE 'logo%'"); |
|
| 195 | 195 | if (is_countable($deja) ? count($deja) : 0) { |
| 196 | 196 | $deja = array_column($deja, 'fichier'); |
| 197 | 197 | $restant = array_diff(array_keys($filescheck), $deja); |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $count = (is_countable($files) ? count($files) : 0); |
| 214 | - spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE); |
|
| 214 | + spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE); |
|
| 215 | 215 | |
| 216 | 216 | $deja = []; |
| 217 | 217 | foreach ($files as $file) { |
| 218 | - $logo = substr($file, strlen($dir . $nom_base)); |
|
| 218 | + $logo = substr($file, strlen($dir.$nom_base)); |
|
| 219 | 219 | $logo = explode('.', $logo); |
| 220 | 220 | if ( |
| 221 | 221 | is_numeric($logo[0]) |
@@ -226,16 +226,16 @@ discard block |
||
| 226 | 226 | // if no logo in base |
| 227 | 227 | if (!$logo or (is_countable($logo) ? count($logo) : 0) < 6) { |
| 228 | 228 | foreach ($formats_logos as $format) { |
| 229 | - if (@file_exists($d = ($dir . ($nom = $nom_base . intval($id_objet) . '.' . $format)))) { |
|
| 229 | + if (@file_exists($d = ($dir.($nom = $nom_base.intval($id_objet).'.'.$format)))) { |
|
| 230 | 230 | if (isset($desc['field']['date_modif'])) { |
| 231 | 231 | $date_modif = sql_getfetsel('date_modif', $table, "$_id_objet=$id_objet"); |
| 232 | 232 | } else { |
| 233 | 233 | $date_modif = null; |
| 234 | 234 | } |
| 235 | 235 | // logo_modifier commence par supprimer le logo existant, donc on le deplace pour pas le perdre |
| 236 | - @rename($d, $dir_logos . $nom); |
|
| 236 | + @rename($d, $dir_logos.$nom); |
|
| 237 | 237 | // et on le declare comme nouveau logo |
| 238 | - logo_modifier($objet, $id_objet, $mode, $dir_logos . $nom); |
|
| 238 | + logo_modifier($objet, $id_objet, $mode, $dir_logos.$nom); |
|
| 239 | 239 | if ($date_modif) { |
| 240 | 240 | sql_updateq($table, ['date_modif' => $date_modif], "$_id_objet=$id_objet"); |
| 241 | 241 | } |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | // si le fichier est encore la on le move : rien a faire ici |
| 250 | 250 | // (sauf si c'est une re-migration : il est deja dans logo/ donc il bouge pas) |
| 251 | 251 | if ($dir !== $dir_logos and file_exists($file)) { |
| 252 | - @rename($file, $dir_logos_erreurs . basename($file)); |
|
| 252 | + @rename($file, $dir_logos_erreurs.basename($file)); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | $count--; |
| 256 | 256 | if ($count % 250 === 0) { |
| 257 | - spip_log("logo_migrer_en_base $objet $mode : " . $count . ' logos restant', 'maj' . _LOG_INFO_IMPORTANTE); |
|
| 257 | + spip_log("logo_migrer_en_base $objet $mode : ".$count.' logos restant', 'maj'._LOG_INFO_IMPORTANTE); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ($time_limit and time() > $time_limit) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | **/ |
| 45 | 45 | function install_fichier_connexion($nom, $texte) { |
| 46 | - $texte = '<' . "?php\n" |
|
| 46 | + $texte = '<'."?php\n" |
|
| 47 | 47 | . "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n" |
| 48 | 48 | . $texte; |
| 49 | 49 | |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | return $regs; |
| 113 | 113 | } else { |
| 114 | 114 | $ar = '\s*\'([^\']*)\''; |
| 115 | - $r = '\s*,' . $ar; |
|
| 115 | + $r = '\s*,'.$ar; |
|
| 116 | 116 | $r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#"; |
| 117 | 117 | if (preg_match($r, $s, $regs)) { |
| 118 | - $regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';'); |
|
| 118 | + $regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';'); |
|
| 119 | 119 | array_shift($regs); |
| 120 | 120 | array_shift($regs); |
| 121 | 121 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | // Si on n'a pas la bonne version de PHP, c'est la fin |
| 181 | 181 | if ($err) { |
| 182 | 182 | die("<div class='error'>" |
| 183 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>" |
|
| 183 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>" |
|
| 184 | 184 | . "<li><strong>{$err[0]}</strong></li>\n</ul></div>"); |
| 185 | 185 | } |
| 186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | if ($err) { |
| 203 | 203 | echo "<div class='error'>" |
| 204 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"; |
|
| 204 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"; |
|
| 205 | 205 | foreach ($err as $e) { |
| 206 | 206 | echo "<li><strong>$e</strong></li>\n"; |
| 207 | 207 | } |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | function info_etape($titre, $complement = '') { |
| 237 | - return '<h2>' . $titre . "</h2>\n" . |
|
| 238 | - ($complement ? '' . $complement . "\n" : ''); |
|
| 237 | + return '<h2>'.$titre."</h2>\n". |
|
| 238 | + ($complement ? ''.$complement."\n" : ''); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -249,18 +249,18 @@ discard block |
||
| 249 | 249 | $code = _T('bouton_suivant'); |
| 250 | 250 | } |
| 251 | 251 | static $suivant = 0; |
| 252 | - $id = 'suivant' . (($suivant > 0) ? strval($suivant) : ''); |
|
| 252 | + $id = 'suivant'.(($suivant > 0) ? strval($suivant) : ''); |
|
| 253 | 253 | $suivant += 1; |
| 254 | 254 | |
| 255 | - return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" . |
|
| 256 | - $code . |
|
| 255 | + return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"". |
|
| 256 | + $code. |
|
| 257 | 257 | " >>\" /></p>\n"; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | function info_progression_etape($en_cours, $phase, $dir, $erreur = false) { |
| 261 | 261 | $intitule_etat = []; |
| 262 | 262 | //$en_cours = _request('etape')?_request('etape'):""; |
| 263 | - $liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$'); |
|
| 263 | + $liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$'); |
|
| 264 | 264 | $debut = 1; |
| 265 | 265 | $etat = 'ok'; |
| 266 | 266 | $last = count($liste); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | $aff_etapes .= "<li class='$class'><div class='fond'>"; |
| 301 | 301 | $aff_etapes .= ($debut == $en_cours) ? '<strong>' : ''; |
| 302 | - $aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 302 | + $aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 303 | 303 | $aff_etapes .= $intitule_etat["$phase"][$debut]; |
| 304 | 304 | $aff_etapes .= ($debut == $en_cours) ? '</strong>' : ''; |
| 305 | 305 | $aff_etapes .= '</div></li>'; |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | |
| 316 | 316 | function fieldset($legend, $champs = [], $apres = '', $avant = '') { |
| 317 | - return "<fieldset>\n" . |
|
| 318 | - $avant . |
|
| 319 | - ($legend ? '<legend>' . $legend . "</legend>\n" : '') . |
|
| 320 | - fieldset_champs($champs) . |
|
| 321 | - $apres . |
|
| 317 | + return "<fieldset>\n". |
|
| 318 | + $avant. |
|
| 319 | + ($legend ? '<legend>'.$legend."</legend>\n" : ''). |
|
| 320 | + fieldset_champs($champs). |
|
| 321 | + $apres. |
|
| 322 | 322 | "</fieldset>\n"; |
| 323 | 323 | } |
| 324 | 324 | |
@@ -328,18 +328,18 @@ discard block |
||
| 328 | 328 | $type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text'); |
| 329 | 329 | $class = isset($contenu['hidden']) ? '' : "class='formo' size='40' "; |
| 330 | 330 | if (isset($contenu['alternatives'])) { |
| 331 | - $fieldset .= $contenu['label'] . "\n"; |
|
| 331 | + $fieldset .= $contenu['label']."\n"; |
|
| 332 | 332 | foreach ($contenu['alternatives'] as $valeur => $label) { |
| 333 | - $fieldset .= "<input type='radio' name='" . $nom . |
|
| 333 | + $fieldset .= "<input type='radio' name='".$nom. |
|
| 334 | 334 | "' id='$nom-$valeur' value='$valeur'" |
| 335 | 335 | . (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '') |
| 336 | 336 | . "/>\n"; |
| 337 | - $fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n"; |
|
| 337 | + $fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n"; |
|
| 338 | 338 | } |
| 339 | 339 | $fieldset .= "<br />\n"; |
| 340 | 340 | } else { |
| 341 | - $fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n"; |
|
| 342 | - $fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'" |
|
| 341 | + $fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n"; |
|
| 342 | + $fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'" |
|
| 343 | 343 | . (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '') |
| 344 | 344 | . ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '') |
| 345 | 345 | . " />\n"; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | function install_select_serveur() { |
| 353 | 353 | $options = []; |
| 354 | - $dir = _DIR_RESTREINT . 'req/'; |
|
| 354 | + $dir = _DIR_RESTREINT.'req/'; |
|
| 355 | 355 | $d = opendir($dir); |
| 356 | 356 | if (!$d) { |
| 357 | 357 | return []; |
@@ -359,17 +359,17 @@ discard block |
||
| 359 | 359 | while (($f = readdir($d)) !== false) { |
| 360 | 360 | if ( |
| 361 | 361 | (preg_match('/^(.*)[.]php$/', $f, $s)) |
| 362 | - and is_readable($f = $dir . $f) |
|
| 362 | + and is_readable($f = $dir.$f) |
|
| 363 | 363 | ) { |
| 364 | 364 | require_once($f); |
| 365 | 365 | $s = $s[1]; |
| 366 | - $v = 'spip_versions_' . $s; |
|
| 366 | + $v = 'spip_versions_'.$s; |
|
| 367 | 367 | if (function_exists($v) and $v()) { |
| 368 | 368 | $titre = _T("install_select_type_$s"); |
| 369 | 369 | // proposer mysql par defaut si dispo |
| 370 | 370 | $checked = ($s == 'mysql' ? " checked='checked'" : ''); |
| 371 | 371 | $options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>" |
| 372 | - . "<label for='$s'>" . ($titre ?: $s) . '</label></li>'; |
|
| 372 | + . "<label for='$s'>".($titre ?: $s).'</label></li>'; |
|
| 373 | 373 | } else { |
| 374 | 374 | spip_log("$s: portage indisponible"); |
| 375 | 375 | } |
@@ -387,8 +387,8 @@ discard block |
||
| 387 | 387 | "\n<input type='hidden' name='etape' value='$etape' />" |
| 388 | 388 | . $hidden |
| 389 | 389 | . (_request('echec') ? |
| 390 | - ('<p><b>' . _T('avis_connexion_echec_1') . |
|
| 391 | - '</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>') |
|
| 390 | + ('<p><b>'._T('avis_connexion_echec_1'). |
|
| 391 | + '</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>') |
|
| 392 | 392 | : '') |
| 393 | 393 | |
| 394 | 394 | . ($jquery ? http_script('', 'jquery.js') : '') |
@@ -426,9 +426,9 @@ discard block |
||
| 426 | 426 | });') |
| 427 | 427 | |
| 428 | 428 | . ($server_db |
| 429 | - ? '<input type="hidden" name="server_db" value="' . $server_db . '" />' |
|
| 429 | + ? '<input type="hidden" name="server_db" value="'.$server_db.'" />' |
|
| 430 | 430 | . (($predef[0]) |
| 431 | - ? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>') |
|
| 431 | + ? ('<h3>'._T('install_serveur_hebergeur').'</h3>') |
|
| 432 | 432 | : '') |
| 433 | 433 | : ('<fieldset><legend>' |
| 434 | 434 | . _T('install_select_type_db') |
@@ -443,9 +443,9 @@ discard block |
||
| 443 | 443 | . "\n</ul>\n</div></fieldset>") |
| 444 | 444 | ) |
| 445 | 445 | . '<div id="install_adresse_base_hebergeur">' |
| 446 | - . '<p>' . _T('texte_connexion_mysql') . '</p>' |
|
| 446 | + . '<p>'._T('texte_connexion_mysql').'</p>' |
|
| 447 | 447 | . ($predef[1] |
| 448 | - ? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>' |
|
| 448 | + ? '<h3>'._T('install_adresse_base_hebergeur').'</h3>' |
|
| 449 | 449 | : fieldset( |
| 450 | 450 | _T('entree_base_donnee_1'), |
| 451 | 451 | [ |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | |
| 461 | 461 | . '<div id="install_login_base_hebergeur">' |
| 462 | 462 | . ($predef[2] |
| 463 | - ? '<h3>' . _T('install_login_base_hebergeur') . '</h3>' |
|
| 463 | + ? '<h3>'._T('install_login_base_hebergeur').'</h3>' |
|
| 464 | 464 | : fieldset( |
| 465 | 465 | _T('entree_login_connexion_1'), |
| 466 | 466 | [ |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | . '<div id="install_pass_base_hebergeur">' |
| 477 | 477 | . ($predef[3] |
| 478 | - ? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>' |
|
| 478 | + ? '<h3>'._T('install_pass_base_hebergeur').'</h3>' |
|
| 479 | 479 | : fieldset( |
| 480 | 480 | _T('entree_mot_passe_1'), |
| 481 | 481 | [ |
@@ -497,20 +497,20 @@ discard block |
||
| 497 | 497 | function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) { |
| 498 | 498 | return ((defined('_INSTALL_HOST_DB')) |
| 499 | 499 | ? '' |
| 500 | - : "\n<input type='hidden' name='adresse_db' value=\"" . spip_htmlspecialchars($adresse_db) . '" />' |
|
| 500 | + : "\n<input type='hidden' name='adresse_db' value=\"".spip_htmlspecialchars($adresse_db).'" />' |
|
| 501 | 501 | ) |
| 502 | 502 | . ((defined('_INSTALL_USER_DB')) |
| 503 | 503 | ? '' |
| 504 | - : "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />' |
|
| 504 | + : "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />' |
|
| 505 | 505 | ) |
| 506 | 506 | . ((defined('_INSTALL_PASS_DB')) |
| 507 | 507 | ? '' |
| 508 | - : "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />' |
|
| 508 | + : "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />' |
|
| 509 | 509 | ) |
| 510 | 510 | |
| 511 | 511 | . ((defined('_INSTALL_SERVER_DB')) |
| 512 | 512 | ? '' |
| 513 | - : "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />' |
|
| 513 | + : "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />' |
|
| 514 | 514 | ); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -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 | if (is_callable($f)) { |
| 102 | 102 | return $f; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // affichage "GIT [master: abcdef]" |
| 235 | 235 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 236 | 236 | if ($desc['branch']) { |
| 237 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 237 | + $commit = $desc['branch'].': '.$commit; |
|
| 238 | 238 | } |
| 239 | 239 | return "{$desc['vcs']} [$commit]"; |
| 240 | 240 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // version installee par GIT |
| 256 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 256 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 257 | 257 | $currentHead = trim(substr($c, 4)); |
| 258 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 258 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 259 | 259 | return [ |
| 260 | 260 | 'vcs' => 'GIT', |
| 261 | 261 | 'branch' => basename($currentHead), |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | $dir = '.'; |
| 283 | 283 | } |
| 284 | 284 | // version installee par SVN |
| 285 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 285 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 287 | 287 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 288 | 288 | if ($result) { |
| 289 | 289 | $row = $result->fetchArray(); |
@@ -301,12 +301,12 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 303 | 303 | // et laisser passer les fonctions personnelles baptisees image_... |
| 304 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 305 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 306 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 307 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 308 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 304 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 305 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 306 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 307 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 308 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | 310 | |
| 311 | 311 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 312 | 312 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function filtre_debug($val, $key = null) { |
| 467 | 467 | $debug = ( |
| 468 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 469 | - ) . var_export($val, true); |
|
| 468 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 469 | + ).var_export($val, true); |
|
| 470 | 470 | |
| 471 | 471 | include_spip('inc/autoriser'); |
| 472 | 472 | if (autoriser('webmestre')) { |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $is_file = false; |
| 523 | 523 | } |
| 524 | 524 | if ($is_file) { |
| 525 | - $is_local_file = function ($path) { |
|
| 525 | + $is_local_file = function($path) { |
|
| 526 | 526 | if (strpos($path, '?') !== false) { |
| 527 | 527 | $path = supprimer_timestamp($path); |
| 528 | 528 | // remove ?24px added by find_in_theme on .svg files |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 572 | 572 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 573 | 573 | $srcover = $match[1]; |
| 574 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 574 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 575 | 575 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 576 | 576 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 577 | 577 | } |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | // " -> " et tout ce genre de choses |
| 973 | 973 | $u = $GLOBALS['meta']['pcre_u']; |
| 974 | 974 | $texte = str_replace(' ', ' ', $texte); |
| 975 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 975 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 976 | 976 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 977 | 977 | $texte = entites_html($texte, false, false); |
| 978 | 978 | // mais bien echapper les double quotes ! |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | **/ |
| 1033 | 1033 | function supprimer_numero($texte) { |
| 1034 | 1034 | return preg_replace( |
| 1035 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1035 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1036 | 1036 | '', |
| 1037 | 1037 | $texte |
| 1038 | 1038 | ); |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | function recuperer_numero($texte) { |
| 1061 | 1061 | if ( |
| 1062 | 1062 | preg_match( |
| 1063 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1063 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1064 | 1064 | $texte, |
| 1065 | 1065 | $regs |
| 1066 | 1066 | ) |
@@ -1151,8 +1151,8 @@ discard block |
||
| 1151 | 1151 | **/ |
| 1152 | 1152 | function textebrut($texte) { |
| 1153 | 1153 | $u = $GLOBALS['meta']['pcre_u']; |
| 1154 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1155 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1154 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1155 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1156 | 1156 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1157 | 1157 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1158 | 1158 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1186,7 +1186,7 @@ discard block |
||
| 1186 | 1186 | ) |
| 1187 | 1187 | ) { |
| 1188 | 1188 | foreach ($liens[0] as $a) { |
| 1189 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1189 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1190 | 1190 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1191 | 1191 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1192 | 1192 | $texte = str_replace($a, $ablank, $texte); |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | foreach ($regs[0] as $a) { |
| 1212 | 1212 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1213 | 1213 | if (strpos($rel, 'nofollow') === false) { |
| 1214 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1214 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1215 | 1215 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1216 | 1216 | $texte = str_replace($a, $anofollow, $texte); |
| 1217 | 1217 | } |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | $u = $GLOBALS['meta']['pcre_u']; |
| 1241 | 1241 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1242 | 1242 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1243 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1243 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1244 | 1244 | |
| 1245 | 1245 | return $texte; |
| 1246 | 1246 | } |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | return $texte; |
| 1272 | 1272 | } |
| 1273 | 1273 | include_spip('inc/texte'); |
| 1274 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1274 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1275 | 1275 | 'div' : 'span'; |
| 1276 | 1276 | |
| 1277 | 1277 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1383,7 +1383,7 @@ discard block |
||
| 1383 | 1383 | } |
| 1384 | 1384 | $u = $GLOBALS['meta']['pcre_u']; |
| 1385 | 1385 | if ($textebrut) { |
| 1386 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1386 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1387 | 1387 | } |
| 1388 | 1388 | $texte = texte_backend($texte); |
| 1389 | 1389 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | # un message pour abs_url |
| 1419 | 1419 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1420 | 1420 | $url = trim($url); |
| 1421 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1421 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1422 | 1422 | |
| 1423 | 1423 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1424 | 1424 | } |
@@ -1618,14 +1618,14 @@ discard block |
||
| 1618 | 1618 | if (strpos($texte, '<') !== false) { |
| 1619 | 1619 | include_spip('inc/lien'); |
| 1620 | 1620 | if (defined('_PREG_MODELE')) { |
| 1621 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1621 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1622 | 1622 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1623 | 1623 | } |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | $debut = ''; |
| 1627 | 1627 | $suite = $texte; |
| 1628 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1628 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1629 | 1629 | $debut .= substr($suite, 0, $t - 1); |
| 1630 | 1630 | $suite = substr($suite, $t); |
| 1631 | 1631 | $car = substr($suite, 0, 1); |
@@ -1643,11 +1643,11 @@ discard block |
||
| 1643 | 1643 | $suite = substr($suite, strlen($regs[0])); |
| 1644 | 1644 | } |
| 1645 | 1645 | } |
| 1646 | - $texte = $debut . $suite; |
|
| 1646 | + $texte = $debut.$suite; |
|
| 1647 | 1647 | |
| 1648 | 1648 | $texte = echappe_retour($texte); |
| 1649 | 1649 | |
| 1650 | - return $texte . $fin; |
|
| 1650 | + return $texte.$fin; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | foreach ($regs as $reg) { |
| 1712 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1712 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1713 | 1713 | $desc = $traduire($cle, $lang, true); |
| 1714 | 1714 | $l = $desc->langue; |
| 1715 | 1715 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1823,9 +1823,9 @@ discard block |
||
| 1823 | 1823 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1824 | 1824 | include_spip('inc/texte'); |
| 1825 | 1825 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1826 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1826 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1827 | 1827 | if ($mode === 'div') { |
| 1828 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1828 | + $trad = rtrim($trad)."\n\n"; |
|
| 1829 | 1829 | } |
| 1830 | 1830 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1831 | 1831 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2025,7 +2025,7 @@ discard block |
||
| 2025 | 2025 | if (is_array($balise)) { |
| 2026 | 2026 | array_walk( |
| 2027 | 2027 | $balise, |
| 2028 | - function (&$a, $key, $t) { |
|
| 2028 | + function(&$a, $key, $t) { |
|
| 2029 | 2029 | $a = extraire_attribut($a, $t); |
| 2030 | 2030 | }, |
| 2031 | 2031 | $attribut |
@@ -2122,14 +2122,14 @@ discard block |
||
| 2122 | 2122 | |
| 2123 | 2123 | if ($old !== null) { |
| 2124 | 2124 | // Remplacer l'ancien attribut du meme nom |
| 2125 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2125 | + $balise = $r[1].$insert.$r[5]; |
|
| 2126 | 2126 | } else { |
| 2127 | 2127 | // preferer une balise " />" (comme <img />) |
| 2128 | 2128 | if (preg_match(',/>,', $balise)) { |
| 2129 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2129 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2130 | 2130 | } // sinon une balise <a ...> ... </a> |
| 2131 | 2131 | else { |
| 2132 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2132 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2133 | 2133 | } |
| 2134 | 2134 | } |
| 2135 | 2135 | |
@@ -2184,7 +2184,7 @@ discard block |
||
| 2184 | 2184 | if ( |
| 2185 | 2185 | $class_courante |
| 2186 | 2186 | and strpos($class_courante, (string) $c) !== false |
| 2187 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2187 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2188 | 2188 | ) { |
| 2189 | 2189 | $is_class_presente = true; |
| 2190 | 2190 | } |
@@ -2192,12 +2192,12 @@ discard block |
||
| 2192 | 2192 | in_array($operation, ['ajouter', 'commuter']) |
| 2193 | 2193 | and !$is_class_presente |
| 2194 | 2194 | ) { |
| 2195 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2195 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2196 | 2196 | } elseif ( |
| 2197 | 2197 | in_array($operation, ['supprimer', 'commuter']) |
| 2198 | 2198 | and $is_class_presente |
| 2199 | 2199 | ) { |
| 2200 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2200 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2201 | 2201 | } |
| 2202 | 2202 | } |
| 2203 | 2203 | |
@@ -2260,7 +2260,7 @@ discard block |
||
| 2260 | 2260 | // Quelques fonctions de calcul arithmetique |
| 2261 | 2261 | // |
| 2262 | 2262 | function floatstr($a) { |
| 2263 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2263 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2264 | 2264 | } |
| 2265 | 2265 | function strize($f, $a, $b) { |
| 2266 | 2266 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2396,13 +2396,13 @@ discard block |
||
| 2396 | 2396 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2397 | 2397 | define('_TAGS_NOM_AUTEUR', ''); |
| 2398 | 2398 | } |
| 2399 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2399 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2400 | 2400 | foreach ($tags_acceptes as $tag) { |
| 2401 | 2401 | if (strlen($tag)) { |
| 2402 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2403 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2404 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2405 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2402 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2403 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2404 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2405 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2406 | 2406 | } |
| 2407 | 2407 | } |
| 2408 | 2408 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2522,10 +2522,10 @@ discard block |
||
| 2522 | 2522 | $fichier = basename($url); |
| 2523 | 2523 | |
| 2524 | 2524 | return '<a rel="enclosure"' |
| 2525 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2526 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2527 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2528 | - . '>' . $fichier . '</a>'; |
|
| 2525 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2526 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2527 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2528 | + . '>'.$fichier.'</a>'; |
|
| 2529 | 2529 | } |
| 2530 | 2530 | |
| 2531 | 2531 | /** |
@@ -2553,9 +2553,9 @@ discard block |
||
| 2553 | 2553 | } # vieux data |
| 2554 | 2554 | $fichier = basename($url); |
| 2555 | 2555 | $enclosures[] = '<enclosure' |
| 2556 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2557 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2558 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2556 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2557 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2558 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2559 | 2559 | . ' />'; |
| 2560 | 2560 | } |
| 2561 | 2561 | } |
@@ -2581,7 +2581,7 @@ discard block |
||
| 2581 | 2581 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2582 | 2582 | $subjects .= '<dc:subject>' |
| 2583 | 2583 | . texte_backend(textebrut($e)) |
| 2584 | - . '</dc:subject>' . "\n"; |
|
| 2584 | + . '</dc:subject>'."\n"; |
|
| 2585 | 2585 | } |
| 2586 | 2586 | } |
| 2587 | 2587 | |
@@ -2617,7 +2617,7 @@ discard block |
||
| 2617 | 2617 | if (is_array($texte)) { |
| 2618 | 2618 | array_walk( |
| 2619 | 2619 | $texte, |
| 2620 | - function (&$a, $key, $t) { |
|
| 2620 | + function(&$a, $key, $t) { |
|
| 2621 | 2621 | $a = extraire_balise($a, $t); |
| 2622 | 2622 | }, |
| 2623 | 2623 | $tag |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | if (is_array($texte)) { |
| 2666 | 2666 | array_walk( |
| 2667 | 2667 | $texte, |
| 2668 | - function (&$a, $key, $t) { |
|
| 2668 | + function(&$a, $key, $t) { |
|
| 2669 | 2669 | $a = extraire_balises($a, $t); |
| 2670 | 2670 | }, |
| 2671 | 2671 | $tag |
@@ -2798,7 +2798,7 @@ discard block |
||
| 2798 | 2798 | if ($fond != '404') { |
| 2799 | 2799 | $contexte = array_shift($p); |
| 2800 | 2800 | $contexte['page'] = $fond; |
| 2801 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2801 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2802 | 2802 | } |
| 2803 | 2803 | } |
| 2804 | 2804 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2853,9 +2853,9 @@ discard block |
||
| 2853 | 2853 | . '"' |
| 2854 | 2854 | . (is_null($val) |
| 2855 | 2855 | ? '' |
| 2856 | - : ' value="' . entites_html($val) . '"' |
|
| 2856 | + : ' value="'.entites_html($val).'"' |
|
| 2857 | 2857 | ) |
| 2858 | - . ' type="hidden"' . "\n/>"; |
|
| 2858 | + . ' type="hidden"'."\n/>"; |
|
| 2859 | 2859 | } |
| 2860 | 2860 | |
| 2861 | 2861 | return join('', $hidden); |
@@ -2965,7 +2965,7 @@ discard block |
||
| 2965 | 2965 | |
| 2966 | 2966 | return preg_replace_callback( |
| 2967 | 2967 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2968 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2968 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2969 | 2969 | $contenu |
| 2970 | 2970 | ); |
| 2971 | 2971 | } |
@@ -3026,14 +3026,14 @@ discard block |
||
| 3026 | 3026 | ) { |
| 3027 | 3027 | $distant = true; |
| 3028 | 3028 | $cssf = parse_url($css); |
| 3029 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3029 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3030 | 3030 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3031 | 3031 | } else { |
| 3032 | 3032 | $distant = false; |
| 3033 | 3033 | $cssf = $css; |
| 3034 | 3034 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3035 | 3035 | //propose (rien a faire dans ce cas) |
| 3036 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3036 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3037 | 3037 | if (@file_exists($f)) { |
| 3038 | 3038 | return $f; |
| 3039 | 3039 | } |
@@ -3043,7 +3043,7 @@ discard block |
||
| 3043 | 3043 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3044 | 3044 | $f = $dir_var |
| 3045 | 3045 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3046 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3046 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3047 | 3047 | |
| 3048 | 3048 | // la css peut etre distante (url absolue !) |
| 3049 | 3049 | if ($distant) { |
@@ -3089,8 +3089,8 @@ discard block |
||
| 3089 | 3089 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3090 | 3090 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3091 | 3091 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3092 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3093 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3092 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3093 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3094 | 3094 | } |
| 3095 | 3095 | $src[] = $regs[0][$k]; |
| 3096 | 3096 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | |
| 3140 | 3140 | $f = basename($css, '.css'); |
| 3141 | 3141 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3142 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3142 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3143 | 3143 | . '.css'; |
| 3144 | 3144 | |
| 3145 | 3145 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3149,7 +3149,7 @@ discard block |
||
| 3149 | 3149 | if ($url_absolue_css == $css) { |
| 3150 | 3150 | if ( |
| 3151 | 3151 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3152 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3152 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3153 | 3153 | ) { |
| 3154 | 3154 | include_spip('inc/distant'); |
| 3155 | 3155 | $contenu = recuperer_url($css); |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | $expression = str_replace('\/', '/', $expression); |
| 3262 | 3262 | $expression = str_replace('/', '\/', $expression); |
| 3263 | 3263 | |
| 3264 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3264 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3265 | 3265 | if (isset($r[$capte])) { |
| 3266 | 3266 | return $r[$capte]; |
| 3267 | 3267 | } else { |
@@ -3299,7 +3299,7 @@ discard block |
||
| 3299 | 3299 | $expression = str_replace('\/', '/', $expression); |
| 3300 | 3300 | $expression = str_replace('/', '\/', $expression); |
| 3301 | 3301 | |
| 3302 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3302 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3303 | 3303 | } |
| 3304 | 3304 | |
| 3305 | 3305 | |
@@ -3318,7 +3318,7 @@ discard block |
||
| 3318 | 3318 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3319 | 3319 | |
| 3320 | 3320 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3321 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3321 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3322 | 3322 | |
| 3323 | 3323 | if ( |
| 3324 | 3324 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3332,7 +3332,7 @@ discard block |
||
| 3332 | 3332 | if (!isset($doublons['documents'])) { |
| 3333 | 3333 | $doublons['documents'] = ''; |
| 3334 | 3334 | } |
| 3335 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3335 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3336 | 3336 | } |
| 3337 | 3337 | |
| 3338 | 3338 | return $letexte; |
@@ -3389,7 +3389,7 @@ discard block |
||
| 3389 | 3389 | if ($env) { |
| 3390 | 3390 | foreach ($env as $i => $j) { |
| 3391 | 3391 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3392 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3392 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3393 | 3393 | } |
| 3394 | 3394 | } |
| 3395 | 3395 | } |
@@ -3428,7 +3428,7 @@ discard block |
||
| 3428 | 3428 | if ($env) { |
| 3429 | 3429 | foreach ($env as $i => $j) { |
| 3430 | 3430 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3431 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3431 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3432 | 3432 | } |
| 3433 | 3433 | } |
| 3434 | 3434 | } |
@@ -3502,10 +3502,10 @@ discard block |
||
| 3502 | 3502 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3503 | 3503 | if ( |
| 3504 | 3504 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3505 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3505 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3506 | 3506 | and file_exists($variante_svg_generique) |
| 3507 | 3507 | ) { |
| 3508 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3508 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3509 | 3509 | $img_file = $variante_svg_size; |
| 3510 | 3510 | } |
| 3511 | 3511 | else { |
@@ -3563,7 +3563,7 @@ discard block |
||
| 3563 | 3563 | return ''; |
| 3564 | 3564 | } |
| 3565 | 3565 | } |
| 3566 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3566 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3567 | 3567 | } |
| 3568 | 3568 | |
| 3569 | 3569 | if (file_exists($img_file)) { |
@@ -3573,14 +3573,14 @@ discard block |
||
| 3573 | 3573 | $alt = ''; |
| 3574 | 3574 | } |
| 3575 | 3575 | elseif ($alt or $alt === '') { |
| 3576 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3576 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3577 | 3577 | } |
| 3578 | 3578 | else { |
| 3579 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3579 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3580 | 3580 | } |
| 3581 | 3581 | return "<img src='$img_file'$alt" |
| 3582 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3583 | - . ' ' . ltrim($atts) |
|
| 3582 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3583 | + . ' '.ltrim($atts) |
|
| 3584 | 3584 | . ' />'; |
| 3585 | 3585 | } |
| 3586 | 3586 | |
@@ -3594,10 +3594,10 @@ discard block |
||
| 3594 | 3594 | */ |
| 3595 | 3595 | function http_style_background($img, $att = '', $size = null) { |
| 3596 | 3596 | if ($size and is_numeric($size)) { |
| 3597 | - $size = trim($size) . 'px'; |
|
| 3597 | + $size = trim($size).'px'; |
|
| 3598 | 3598 | } |
| 3599 | - return " style='background" . |
|
| 3600 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3599 | + return " style='background". |
|
| 3600 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3601 | 3601 | . ($size ? "background-size:{$size};" : '') |
| 3602 | 3602 | . "'"; |
| 3603 | 3603 | } |
@@ -3712,7 +3712,7 @@ discard block |
||
| 3712 | 3712 | $img = http_img_pack( |
| 3713 | 3713 | $img, |
| 3714 | 3714 | $alt, |
| 3715 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3715 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3716 | 3716 | '', |
| 3717 | 3717 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3718 | 3718 | ); |
@@ -3797,7 +3797,7 @@ discard block |
||
| 3797 | 3797 | $balise_svg_source = $balise_svg; |
| 3798 | 3798 | |
| 3799 | 3799 | // entete XML à supprimer |
| 3800 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3800 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3801 | 3801 | |
| 3802 | 3802 | // IE est toujours mon ami |
| 3803 | 3803 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3815,9 +3815,9 @@ discard block |
||
| 3815 | 3815 | // regler le alt |
| 3816 | 3816 | if ($alt) { |
| 3817 | 3817 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3818 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3818 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3819 | 3819 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3820 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3820 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3821 | 3821 | $balise_svg .= $title; |
| 3822 | 3822 | } |
| 3823 | 3823 | else { |
@@ -3865,7 +3865,7 @@ discard block |
||
| 3865 | 3865 | if (is_array($tableau)) { |
| 3866 | 3866 | foreach ($tableau as $k => $v) { |
| 3867 | 3867 | $res = recuperer_fond( |
| 3868 | - 'modeles/' . $modele, |
|
| 3868 | + 'modeles/'.$modele, |
|
| 3869 | 3869 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3870 | 3870 | ); |
| 3871 | 3871 | $texte .= $res; |
@@ -4050,7 +4050,7 @@ discard block |
||
| 4050 | 4050 | } |
| 4051 | 4051 | |
| 4052 | 4052 | $c = serialize($c); |
| 4053 | - $cle = calculer_cle_action($form . $c); |
|
| 4053 | + $cle = calculer_cle_action($form.$c); |
|
| 4054 | 4054 | $c = "$cle:$c"; |
| 4055 | 4055 | |
| 4056 | 4056 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4108,15 +4108,15 @@ discard block |
||
| 4108 | 4108 | } |
| 4109 | 4109 | // toujours encoder l'url source dans le bloc ajax |
| 4110 | 4110 | $r = self(); |
| 4111 | - $r = ' data-origin="' . $r . '"'; |
|
| 4111 | + $r = ' data-origin="'.$r.'"'; |
|
| 4112 | 4112 | $class = 'ajaxbloc'; |
| 4113 | 4113 | if ($ajaxid and is_string($ajaxid)) { |
| 4114 | 4114 | // ajaxid est normalement conforme a un nom de classe css |
| 4115 | 4115 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4116 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4116 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4117 | 4117 | } |
| 4118 | 4118 | |
| 4119 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4119 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4120 | 4120 | } |
| 4121 | 4121 | |
| 4122 | 4122 | /** |
@@ -4160,7 +4160,7 @@ discard block |
||
| 4160 | 4160 | $cle = substr($c, 0, $p); |
| 4161 | 4161 | $c = substr($c, $p + 1); |
| 4162 | 4162 | |
| 4163 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4163 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4164 | 4164 | $env = @unserialize($c); |
| 4165 | 4165 | return $env; |
| 4166 | 4166 | } |
@@ -4281,13 +4281,13 @@ discard block |
||
| 4281 | 4281 | } |
| 4282 | 4282 | } |
| 4283 | 4283 | } |
| 4284 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4284 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4285 | 4285 | } else { |
| 4286 | 4286 | $bal = 'a'; |
| 4287 | 4287 | $att = "href='$url'" |
| 4288 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4289 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4290 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4288 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4289 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4290 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4291 | 4291 | . $evt; |
| 4292 | 4292 | } |
| 4293 | 4293 | if ($libelle === null) { |
@@ -4426,7 +4426,7 @@ discard block |
||
| 4426 | 4426 | |
| 4427 | 4427 | // Icône |
| 4428 | 4428 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4429 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4429 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4430 | 4430 | |
| 4431 | 4431 | // Markup final |
| 4432 | 4432 | if ($type == 'lien') { |
@@ -4701,20 +4701,20 @@ discard block |
||
| 4701 | 4701 | $class_form = 'ajax'; |
| 4702 | 4702 | $class = str_replace('ajax', '', $class); |
| 4703 | 4703 | } |
| 4704 | - $class_btn = 'submit ' . trim($class); |
|
| 4704 | + $class_btn = 'submit '.trim($class); |
|
| 4705 | 4705 | |
| 4706 | 4706 | if ($confirm) { |
| 4707 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4707 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4708 | 4708 | if ($callback) { |
| 4709 | 4709 | $callback = "$confirm?($callback):false"; |
| 4710 | 4710 | } else { |
| 4711 | 4711 | $callback = $confirm; |
| 4712 | 4712 | } |
| 4713 | 4713 | } |
| 4714 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4714 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4715 | 4715 | $title = $title ? " title='$title'" : ''; |
| 4716 | 4716 | |
| 4717 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4717 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4718 | 4718 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4719 | 4719 | } |
| 4720 | 4720 | |
@@ -4779,14 +4779,14 @@ discard block |
||
| 4779 | 4779 | $champ_titre = ''; |
| 4780 | 4780 | if ($demande_titre) { |
| 4781 | 4781 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4782 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4782 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4783 | 4783 | } |
| 4784 | 4784 | include_spip('base/abstract_sql'); |
| 4785 | 4785 | include_spip('base/connect_sql'); |
| 4786 | 4786 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4787 | - '*' . $champ_titre, |
|
| 4787 | + '*'.$champ_titre, |
|
| 4788 | 4788 | $desc['table_sql'], |
| 4789 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4789 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4790 | 4790 | ); |
| 4791 | 4791 | |
| 4792 | 4792 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4879,8 +4879,7 @@ discard block |
||
| 4879 | 4879 | if (isset($ligne_sql['chapo'])) { |
| 4880 | 4880 | $chapo = $ligne_sql['chapo']; |
| 4881 | 4881 | $texte = strlen($descriptif) ? |
| 4882 | - '' : |
|
| 4883 | - "$chapo \n\n $texte"; |
|
| 4882 | + '' : "$chapo \n\n $texte"; |
|
| 4884 | 4883 | } |
| 4885 | 4884 | |
| 4886 | 4885 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4955,7 +4954,7 @@ discard block |
||
| 4955 | 4954 | return $texte; |
| 4956 | 4955 | } |
| 4957 | 4956 | |
| 4958 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4957 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4959 | 4958 | |
| 4960 | 4959 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4961 | 4960 | $Pile = [0 => $env]; |
@@ -4989,7 +4988,7 @@ discard block |
||
| 4989 | 4988 | } |
| 4990 | 4989 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4991 | 4990 | |
| 4992 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4991 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4993 | 4992 | } |
| 4994 | 4993 | |
| 4995 | 4994 | /** |
@@ -5015,10 +5014,10 @@ discard block |
||
| 5015 | 5014 | function wrap($texte, $wrap) { |
| 5016 | 5015 | $balises = extraire_balises($wrap); |
| 5017 | 5016 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5018 | - $texte = $wrap . $texte; |
|
| 5017 | + $texte = $wrap.$texte; |
|
| 5019 | 5018 | $regs = array_reverse($regs[1]); |
| 5020 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5021 | - $texte = $texte . $wrap; |
|
| 5019 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5020 | + $texte = $texte.$wrap; |
|
| 5022 | 5021 | } |
| 5023 | 5022 | |
| 5024 | 5023 | return $texte; |
@@ -5049,7 +5048,7 @@ discard block |
||
| 5049 | 5048 | |
| 5050 | 5049 | // caster $u en array si besoin |
| 5051 | 5050 | if (is_object($u)) { |
| 5052 | - $u = (array)$u; |
|
| 5051 | + $u = (array) $u; |
|
| 5053 | 5052 | } |
| 5054 | 5053 | |
| 5055 | 5054 | if (is_array($u)) { |
@@ -5071,7 +5070,7 @@ discard block |
||
| 5071 | 5070 | // sinon on passe a la ligne et on indente |
| 5072 | 5071 | $i_str = str_pad('', $indent, ' '); |
| 5073 | 5072 | foreach ($u as $k => $v) { |
| 5074 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5073 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5075 | 5074 | } |
| 5076 | 5075 | |
| 5077 | 5076 | return $out; |
@@ -5125,7 +5124,7 @@ discard block |
||
| 5125 | 5124 | * @return string |
| 5126 | 5125 | */ |
| 5127 | 5126 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5128 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5127 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5129 | 5128 | $icone = chemin_image($icone); |
| 5130 | 5129 | $balise_img = charger_filtre('balise_img'); |
| 5131 | 5130 | |
@@ -5151,7 +5150,7 @@ discard block |
||
| 5151 | 5150 | */ |
| 5152 | 5151 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5153 | 5152 | $chaine = explode(':', $chaine); |
| 5154 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5153 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5155 | 5154 | return $t; |
| 5156 | 5155 | } |
| 5157 | 5156 | $chaine = implode(':', $chaine); |
@@ -5217,7 +5216,7 @@ discard block |
||
| 5217 | 5216 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5218 | 5217 | |
| 5219 | 5218 | // calculer le nom de la css |
| 5220 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5219 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5221 | 5220 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5222 | 5221 | $contexte_implicite = calculer_contexte_implicite(); |
| 5223 | 5222 | |
@@ -5225,14 +5224,14 @@ discard block |
||
| 5225 | 5224 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5226 | 5225 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5227 | 5226 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5228 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5227 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5229 | 5228 | } |
| 5230 | 5229 | else { |
| 5231 | 5230 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5232 | 5231 | ksort($contexte); |
| 5233 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5232 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5234 | 5233 | } |
| 5235 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5234 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5236 | 5235 | |
| 5237 | 5236 | // mettre a jour le fichier si il n'existe pas |
| 5238 | 5237 | // ou trop ancien |
@@ -5240,8 +5239,8 @@ discard block |
||
| 5240 | 5239 | // et recopie sur le fichier cible uniquement si il change |
| 5241 | 5240 | if ( |
| 5242 | 5241 | !file_exists($filename) |
| 5243 | - or !file_exists($filename . '.last') |
|
| 5244 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5242 | + or !file_exists($filename.'.last') |
|
| 5243 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5245 | 5244 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5246 | 5245 | ) { |
| 5247 | 5246 | $contenu = $cache['texte']; |
@@ -5265,10 +5264,10 @@ discard block |
||
| 5265 | 5264 | } |
| 5266 | 5265 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5267 | 5266 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5268 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5267 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5269 | 5268 | } |
| 5270 | 5269 | // et ecrire le fichier si il change |
| 5271 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5270 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5272 | 5271 | } |
| 5273 | 5272 | |
| 5274 | 5273 | return timestamp($filename); |
@@ -5500,7 +5499,7 @@ discard block |
||
| 5500 | 5499 | if ($e > 0 and strlen($mid) > 8) { |
| 5501 | 5500 | $mid = '***...***'; |
| 5502 | 5501 | } |
| 5503 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5502 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5504 | 5503 | } |
| 5505 | 5504 | |
| 5506 | 5505 | |
@@ -5562,7 +5561,7 @@ discard block |
||
| 5562 | 5561 | case 'id': |
| 5563 | 5562 | case 'anchor': |
| 5564 | 5563 | if (preg_match(',^\d,', $texte)) { |
| 5565 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5564 | + $texte = substr($type, 0, 1).$texte; |
|
| 5566 | 5565 | } |
| 5567 | 5566 | } |
| 5568 | 5567 | |
@@ -5572,9 +5571,9 @@ discard block |
||
| 5572 | 5571 | |
| 5573 | 5572 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5574 | 5573 | if (preg_match(',^\d,', $texte)) { |
| 5575 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5574 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5576 | 5575 | } |
| 5577 | - $texte .= $separateur . md5($original); |
|
| 5576 | + $texte .= $separateur.md5($original); |
|
| 5578 | 5577 | $texte = substr($texte, 0, $longueur_mini); |
| 5579 | 5578 | } |
| 5580 | 5579 | |