@@ -23,11 +23,11 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $GLOBALS['maj'][2021_02_18_00] = [ |
| 26 | - ['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL" ], |
|
| 27 | - ['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL" ], |
|
| 26 | + ['sql_alter', "TABLE spip_auteurs CHANGE imessage imessage VARCHAR(3) DEFAULT '' NOT NULL"], |
|
| 27 | + ['sql_updateq', 'spip_auteurs', ['imessage' => 'oui'], "imessage != 'non' OR imessage IS NULL"], |
|
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | 30 | $GLOBALS['maj'][2022_02_23_02] = [ |
| 31 | - ['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL" ], |
|
| 32 | - ['sql_delete', 'spip_meta', "nom='secret_du_site'" ], |
|
| 31 | + ['sql_alter', "TABLE spip_auteurs ADD backup_cles mediumtext DEFAULT '' NOT NULL"], |
|
| 32 | + ['sql_delete', 'spip_meta', "nom='secret_du_site'"], |
|
| 33 | 33 | ]; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | include_spip('base/abstract_sql'); |
| 64 | - $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email'])); |
|
| 64 | + $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email='.sql_quote($desc['email'])); |
|
| 65 | 65 | // erreur ? |
| 66 | 66 | if (!$res) { |
| 67 | 67 | return _T('titre_probleme_technique'); |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | $login = $login_base; |
| 219 | 219 | |
| 220 | - for ($i = 1;; $i++) { |
|
| 220 | + for ($i = 1; ; $i++) { |
|
| 221 | 221 | if (!sql_countsel('spip_auteurs', "login='$login'")) { |
| 222 | 222 | return $login; |
| 223 | 223 | } |
| 224 | - $login = $login_base . $i; |
|
| 224 | + $login = $login_base.$i; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
@@ -361,11 +361,11 @@ discard block |
||
| 361 | 361 | do { |
| 362 | 362 | // Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer |
| 363 | 363 | // tous les jetons connus pour vérifier le jeton d’un auteur. |
| 364 | - $public = substr(creer_uniqid(), 0, 7) . '.'; |
|
| 365 | - $jeton = $public . creer_uniqid(); |
|
| 366 | - $jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | - sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur)); |
|
| 368 | - } while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 364 | + $public = substr(creer_uniqid(), 0, 7).'.'; |
|
| 365 | + $jeton = $public.creer_uniqid(); |
|
| 366 | + $jeton_chiffre_prefixe = $public.Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | + sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur='.intval($id_auteur)); |
|
| 368 | + } while (sql_countsel('spip_auteurs', 'cookie_oubli='.sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 369 | 369 | |
| 370 | 370 | return $jeton; |
| 371 | 371 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | function auteur_lire_jeton(int $id_auteur, bool $autoInit = false): ?string { |
| 384 | 384 | include_spip('base/abstract_sql'); |
| 385 | - $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur); |
|
| 385 | + $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur='.$id_auteur); |
|
| 386 | 386 | if ($jeton_chiffre_prefixe) { |
| 387 | 387 | include_spip('inc/chiffrer'); |
| 388 | 388 | $jeton_chiffre = substr($jeton_chiffre_prefixe, 8); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $public = substr($jeton, 0, 8); |
| 415 | 415 | |
| 416 | 416 | // Les auteurs qui ont un jetons ressemblant |
| 417 | - $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%')); |
|
| 417 | + $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE '.sql_quote($public.'%')); |
|
| 418 | 418 | foreach ($auteurs as $auteur) { |
| 419 | 419 | $jeton_chiffre = substr($auteur['cookie_oubli'], 8); |
| 420 | 420 | $_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
@@ -433,5 +433,5 @@ discard block |
||
| 433 | 433 | */ |
| 434 | 434 | function auteur_effacer_jeton($id_auteur) { |
| 435 | 435 | include_spip('base/abstract_sql'); |
| 436 | - return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur)); |
|
| 436 | + return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur='.intval($id_auteur)); |
|
| 437 | 437 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1780,9 +1780,9 @@ discard block |
||
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | 1782 | if ( |
| 1783 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1783 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1784 | 1784 | // deprecated |
| 1785 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1785 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1786 | 1786 | ) { |
| 1787 | 1787 | return $f; |
| 1788 | 1788 | } |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | // inclure le module d'url |
| 1798 | - include_spip('urls/' . $url_type); |
|
| 1798 | + include_spip('urls/'.$url_type); |
|
| 1799 | 1799 | |
| 1800 | 1800 | switch ($quoi) { |
| 1801 | 1801 | case 'page': |
@@ -1951,8 +1951,8 @@ discard block |
||
| 1951 | 1951 | include_spip('base/connect_sql'); |
| 1952 | 1952 | $id_type = id_table_objet($entite, $public); |
| 1953 | 1953 | |
| 1954 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1955 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1954 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1955 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1956 | 1956 | . (!$args ? '' : "&$args") |
| 1957 | 1957 | . (!$ancre ? '' : "#$ancre"); |
| 1958 | 1958 | } |
@@ -2123,7 +2123,7 @@ discard block |
||
| 2123 | 2123 | !empty($_SERVER['QUERY_STRING']) |
| 2124 | 2124 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2125 | 2125 | ) { |
| 2126 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2126 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2127 | 2127 | } |
| 2128 | 2128 | } |
| 2129 | 2129 | } |
@@ -2158,9 +2158,9 @@ discard block |
||
| 2158 | 2158 | array_shift($myself); |
| 2159 | 2159 | $myself = implode('/', $myself); |
| 2160 | 2160 | } |
| 2161 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2161 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2162 | 2162 | |
| 2163 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2163 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2164 | 2164 | |
| 2165 | 2165 | return $url; |
| 2166 | 2166 | } |
@@ -2199,16 +2199,16 @@ discard block |
||
| 2199 | 2199 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2200 | 2200 | $script ??= ''; |
| 2201 | 2201 | if (!$rel) { |
| 2202 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2202 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2203 | 2203 | } else { |
| 2204 | 2204 | if (!is_string($rel)) { |
| 2205 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2205 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2206 | 2206 | } |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2210 | 2210 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2211 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2211 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2212 | 2212 | } elseif ($args) { |
| 2213 | 2213 | $args = "?$args"; |
| 2214 | 2214 | } |
@@ -2216,7 +2216,7 @@ discard block |
||
| 2216 | 2216 | $args .= "#$ancre"; |
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2219 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | // |
@@ -2298,10 +2298,10 @@ discard block |
||
| 2298 | 2298 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2299 | 2299 | } |
| 2300 | 2300 | if ($args) { |
| 2301 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2301 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2302 | 2302 | } |
| 2303 | 2303 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2304 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2304 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2305 | 2305 | } |
| 2306 | 2306 | |
| 2307 | 2307 | if (!$no_entities) { |
@@ -2313,7 +2313,7 @@ discard block |
||
| 2313 | 2313 | |
| 2314 | 2314 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2315 | 2315 | |
| 2316 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2316 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2317 | 2317 | } |
| 2318 | 2318 | |
| 2319 | 2319 | // Pour les formulaires en methode POST, |
@@ -2348,8 +2348,7 @@ discard block |
||
| 2348 | 2348 | . "><div>\n" |
| 2349 | 2349 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2350 | 2350 | . $corps |
| 2351 | - . (!$submit ? '' : |
|
| 2352 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2351 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2353 | 2352 | . "</div></form>\n"; |
| 2354 | 2353 | } |
| 2355 | 2354 | |
@@ -2374,14 +2373,14 @@ discard block |
||
| 2374 | 2373 | ? generer_url_ecrire(_request('exec')) |
| 2375 | 2374 | : generer_url_public(); |
| 2376 | 2375 | |
| 2377 | - return "\n<form action='" . |
|
| 2378 | - $h . |
|
| 2379 | - "'" . |
|
| 2380 | - $atts . |
|
| 2381 | - ">\n" . |
|
| 2382 | - '<div>' . |
|
| 2383 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2384 | - $corps . |
|
| 2376 | + return "\n<form action='". |
|
| 2377 | + $h. |
|
| 2378 | + "'". |
|
| 2379 | + $atts. |
|
| 2380 | + ">\n". |
|
| 2381 | + '<div>'. |
|
| 2382 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2383 | + $corps. |
|
| 2385 | 2384 | '</div></form>'; |
| 2386 | 2385 | } |
| 2387 | 2386 | |
@@ -2409,7 +2408,7 @@ discard block |
||
| 2409 | 2408 | : generer_url_public('', '', false, false); |
| 2410 | 2409 | $url = parametre_url($url, 'action', $script); |
| 2411 | 2410 | if ($args) { |
| 2412 | - $url .= quote_amp('&' . $args); |
|
| 2411 | + $url .= quote_amp('&'.$args); |
|
| 2413 | 2412 | } |
| 2414 | 2413 | |
| 2415 | 2414 | if ($no_entities) { |
@@ -2443,9 +2442,9 @@ discard block |
||
| 2443 | 2442 | } |
| 2444 | 2443 | $url = |
| 2445 | 2444 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2446 | - . $script . '/' |
|
| 2445 | + . $script.'/' |
|
| 2447 | 2446 | . ($path ? trim($path, '/') : '') |
| 2448 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2447 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2449 | 2448 | |
| 2450 | 2449 | if ($no_entities) { |
| 2451 | 2450 | $url = str_replace('&', '&', $url); |
@@ -2494,17 +2493,17 @@ discard block |
||
| 2494 | 2493 | |
| 2495 | 2494 | // le nom du repertoire plugins/ activables/desactivables |
| 2496 | 2495 | if (!defined('_DIR_PLUGINS')) { |
| 2497 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2496 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2498 | 2497 | } |
| 2499 | 2498 | |
| 2500 | 2499 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2501 | 2500 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2502 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2501 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2503 | 2502 | } |
| 2504 | 2503 | |
| 2505 | 2504 | // le nom du repertoire des librairies |
| 2506 | 2505 | if (!defined('_DIR_LIB')) { |
| 2507 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2506 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2508 | 2507 | } |
| 2509 | 2508 | |
| 2510 | 2509 | if (!defined('_DIR_IMG')) { |
@@ -2514,29 +2513,29 @@ discard block |
||
| 2514 | 2513 | define('_DIR_LOGOS', $pa); |
| 2515 | 2514 | } |
| 2516 | 2515 | if (!defined('_DIR_IMG_ICONES')) { |
| 2517 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2516 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2518 | 2517 | } |
| 2519 | 2518 | |
| 2520 | 2519 | if (!defined('_DIR_DUMP')) { |
| 2521 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2520 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2522 | 2521 | } |
| 2523 | 2522 | if (!defined('_DIR_SESSIONS')) { |
| 2524 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2523 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2525 | 2524 | } |
| 2526 | 2525 | if (!defined('_DIR_TRANSFERT')) { |
| 2527 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2526 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2528 | 2527 | } |
| 2529 | 2528 | if (!defined('_DIR_CACHE')) { |
| 2530 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2529 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2531 | 2530 | } |
| 2532 | 2531 | if (!defined('_DIR_CACHE_XML')) { |
| 2533 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2532 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_SKELS')) { |
| 2536 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2535 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_AIDE')) { |
| 2539 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2538 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_DIR_TMP')) { |
| 2542 | 2541 | define('_DIR_TMP', $ti); |
@@ -2565,27 +2564,27 @@ discard block |
||
| 2565 | 2564 | // Declaration des fichiers |
| 2566 | 2565 | |
| 2567 | 2566 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2568 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2567 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2569 | 2568 | } |
| 2570 | 2569 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2571 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2570 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2572 | 2571 | } |
| 2573 | 2572 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2574 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2573 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2575 | 2574 | } |
| 2576 | 2575 | if (!defined('_CACHE_PIPELINES')) { |
| 2577 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2576 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2578 | 2577 | } |
| 2579 | 2578 | if (!defined('_CACHE_CHEMIN')) { |
| 2580 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2579 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2581 | 2580 | } |
| 2582 | 2581 | |
| 2583 | 2582 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2584 | 2583 | if (!defined('_FILE_META')) { |
| 2585 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2584 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | if (!defined('_DIR_LOG')) { |
| 2588 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2587 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2589 | 2588 | } |
| 2590 | 2589 | if (!defined('_FILE_LOG')) { |
| 2591 | 2590 | define('_FILE_LOG', 'spip'); |
@@ -2602,8 +2601,8 @@ discard block |
||
| 2602 | 2601 | if (!defined('_FILE_CONNECT')) { |
| 2603 | 2602 | define( |
| 2604 | 2603 | '_FILE_CONNECT', |
| 2605 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2606 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2604 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2605 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2607 | 2606 | : false)) |
| 2608 | 2607 | ); |
| 2609 | 2608 | } |
@@ -2615,7 +2614,7 @@ discard block |
||
| 2615 | 2614 | if (!defined('_FILE_CHMOD')) { |
| 2616 | 2615 | define( |
| 2617 | 2616 | '_FILE_CHMOD', |
| 2618 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2617 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2619 | 2618 | : false) |
| 2620 | 2619 | ); |
| 2621 | 2620 | } |
@@ -2628,10 +2627,10 @@ discard block |
||
| 2628 | 2627 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2629 | 2628 | } |
| 2630 | 2629 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2631 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2630 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2632 | 2631 | } |
| 2633 | 2632 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2634 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2633 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2635 | 2634 | } |
| 2636 | 2635 | |
| 2637 | 2636 | // Definition des droits d'acces en ecriture |
@@ -2649,13 +2648,13 @@ discard block |
||
| 2649 | 2648 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2650 | 2649 | } |
| 2651 | 2650 | if (!defined('_ROOT_PLUGINS')) { |
| 2652 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2651 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2653 | 2652 | } |
| 2654 | 2653 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2655 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2654 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2656 | 2655 | } |
| 2657 | 2656 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2658 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2657 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2659 | 2658 | } |
| 2660 | 2659 | |
| 2661 | 2660 | // La taille des Log |
@@ -2692,7 +2691,7 @@ discard block |
||
| 2692 | 2691 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2693 | 2692 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2694 | 2693 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2695 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2694 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2696 | 2695 | |
| 2697 | 2696 | // charger tout de suite le path et son cache |
| 2698 | 2697 | load_path_cache(); |
@@ -2740,7 +2739,7 @@ discard block |
||
| 2740 | 2739 | !empty($_SERVER['QUERY_STRING']) |
| 2741 | 2740 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2742 | 2741 | ) { |
| 2743 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2742 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2744 | 2743 | } |
| 2745 | 2744 | } |
| 2746 | 2745 | |
@@ -2776,7 +2775,7 @@ discard block |
||
| 2776 | 2775 | ) { |
| 2777 | 2776 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2778 | 2777 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2779 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2778 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2780 | 2779 | } else { |
| 2781 | 2780 | $uri_ref = ''; |
| 2782 | 2781 | } |
@@ -2870,7 +2869,7 @@ discard block |
||
| 2870 | 2869 | } |
| 2871 | 2870 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2872 | 2871 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2873 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2872 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2874 | 2873 | } |
| 2875 | 2874 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2876 | 2875 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3092,7 +3091,7 @@ discard block |
||
| 3092 | 3091 | } |
| 3093 | 3092 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3094 | 3093 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3095 | - . ' ' . _VAR_MODE); |
|
| 3094 | + . ' '._VAR_MODE); |
|
| 3096 | 3095 | } |
| 3097 | 3096 | } // pas autorise ? |
| 3098 | 3097 | else { |
@@ -3107,7 +3106,7 @@ discard block |
||
| 3107 | 3106 | if (strpos($self, 'page=login') === false) { |
| 3108 | 3107 | include_spip('inc/headers'); |
| 3109 | 3108 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3110 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3109 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3111 | 3110 | } |
| 3112 | 3111 | } |
| 3113 | 3112 | // sinon tant pis |
@@ -3149,10 +3148,10 @@ discard block |
||
| 3149 | 3148 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3150 | 3149 | // certaines constantes |
| 3151 | 3150 | @spip_initialisation_core( |
| 3152 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3153 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3154 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3155 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3151 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3152 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3153 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3154 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3156 | 3155 | ); |
| 3157 | 3156 | |
| 3158 | 3157 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3185,7 +3184,7 @@ discard block |
||
| 3185 | 3184 | } |
| 3186 | 3185 | |
| 3187 | 3186 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3188 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3187 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3189 | 3188 | $session = charger_fonction('session', 'inc'); |
| 3190 | 3189 | if ($session()) { |
| 3191 | 3190 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3265,7 +3264,7 @@ discard block |
||
| 3265 | 3264 | 'definir_session', |
| 3266 | 3265 | $GLOBALS['visiteur_session'] |
| 3267 | 3266 | ? serialize($GLOBALS['visiteur_session']) |
| 3268 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3267 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3269 | 3268 | : '' |
| 3270 | 3269 | ); |
| 3271 | 3270 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3421,11 +3420,11 @@ discard block |
||
| 3421 | 3420 | $GLOBALS['_INC_PUBLIC']++; |
| 3422 | 3421 | |
| 3423 | 3422 | // fix #4235 |
| 3424 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3423 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3425 | 3424 | |
| 3426 | 3425 | |
| 3427 | 3426 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3428 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3427 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3429 | 3428 | |
| 3430 | 3429 | $page = evaluer_fond($f, $contexte, $connect); |
| 3431 | 3430 | if ($page === '') { |
@@ -3510,7 +3509,7 @@ discard block |
||
| 3510 | 3509 | * @return array|string |
| 3511 | 3510 | */ |
| 3512 | 3511 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3513 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3512 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3514 | 3513 | if (!$pathinfo) { |
| 3515 | 3514 | return $f; |
| 3516 | 3515 | } |
@@ -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))); |
@@ -2456,7 +2456,7 @@ discard block |
||
| 2456 | 2456 | . http_img_pack( |
| 2457 | 2457 | 'attachment-16.png', |
| 2458 | 2458 | $t, |
| 2459 | - 'title="' . attribut_html($t) . '"' |
|
| 2459 | + 'title="'.attribut_html($t).'"' |
|
| 2460 | 2460 | ) |
| 2461 | 2461 | . '</a>', |
| 2462 | 2462 | $tag |
@@ -2520,10 +2520,10 @@ discard block |
||
| 2520 | 2520 | $fichier = basename($url); |
| 2521 | 2521 | |
| 2522 | 2522 | return '<a rel="enclosure"' |
| 2523 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2524 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2525 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2526 | - . '>' . $fichier . '</a>'; |
|
| 2523 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2524 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2525 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2526 | + . '>'.$fichier.'</a>'; |
|
| 2527 | 2527 | } |
| 2528 | 2528 | |
| 2529 | 2529 | /** |
@@ -2551,9 +2551,9 @@ discard block |
||
| 2551 | 2551 | } # vieux data |
| 2552 | 2552 | $fichier = basename($url); |
| 2553 | 2553 | $enclosures[] = '<enclosure' |
| 2554 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2555 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2556 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2554 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2555 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2556 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2557 | 2557 | . ' />'; |
| 2558 | 2558 | } |
| 2559 | 2559 | } |
@@ -2579,7 +2579,7 @@ discard block |
||
| 2579 | 2579 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2580 | 2580 | $subjects .= '<dc:subject>' |
| 2581 | 2581 | . texte_backend(textebrut($e)) |
| 2582 | - . '</dc:subject>' . "\n"; |
|
| 2582 | + . '</dc:subject>'."\n"; |
|
| 2583 | 2583 | } |
| 2584 | 2584 | } |
| 2585 | 2585 | |
@@ -2615,7 +2615,7 @@ discard block |
||
| 2615 | 2615 | if (is_array($texte)) { |
| 2616 | 2616 | array_walk( |
| 2617 | 2617 | $texte, |
| 2618 | - function (&$a, $key, $t) { |
|
| 2618 | + function(&$a, $key, $t) { |
|
| 2619 | 2619 | $a = extraire_balise($a, $t); |
| 2620 | 2620 | }, |
| 2621 | 2621 | $tag |
@@ -2663,7 +2663,7 @@ discard block |
||
| 2663 | 2663 | if (is_array($texte)) { |
| 2664 | 2664 | array_walk( |
| 2665 | 2665 | $texte, |
| 2666 | - function (&$a, $key, $t) { |
|
| 2666 | + function(&$a, $key, $t) { |
|
| 2667 | 2667 | $a = extraire_balises($a, $t); |
| 2668 | 2668 | }, |
| 2669 | 2669 | $tag |
@@ -2796,7 +2796,7 @@ discard block |
||
| 2796 | 2796 | if ($fond != '404') { |
| 2797 | 2797 | $contexte = array_shift($p); |
| 2798 | 2798 | $contexte['page'] = $fond; |
| 2799 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2799 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2800 | 2800 | } |
| 2801 | 2801 | } |
| 2802 | 2802 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2851,9 +2851,9 @@ discard block |
||
| 2851 | 2851 | . '"' |
| 2852 | 2852 | . (is_null($val) |
| 2853 | 2853 | ? '' |
| 2854 | - : ' value="' . entites_html($val) . '"' |
|
| 2854 | + : ' value="'.entites_html($val).'"' |
|
| 2855 | 2855 | ) |
| 2856 | - . ' type="hidden"' . "\n/>"; |
|
| 2856 | + . ' type="hidden"'."\n/>"; |
|
| 2857 | 2857 | } |
| 2858 | 2858 | |
| 2859 | 2859 | return join('', $hidden); |
@@ -2963,7 +2963,7 @@ discard block |
||
| 2963 | 2963 | |
| 2964 | 2964 | return preg_replace_callback( |
| 2965 | 2965 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2966 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2966 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2967 | 2967 | $contenu |
| 2968 | 2968 | ); |
| 2969 | 2969 | } |
@@ -3024,14 +3024,14 @@ discard block |
||
| 3024 | 3024 | ) { |
| 3025 | 3025 | $distant = true; |
| 3026 | 3026 | $cssf = parse_url($css); |
| 3027 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3027 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3028 | 3028 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3029 | 3029 | } else { |
| 3030 | 3030 | $distant = false; |
| 3031 | 3031 | $cssf = $css; |
| 3032 | 3032 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3033 | 3033 | //propose (rien a faire dans ce cas) |
| 3034 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3034 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3035 | 3035 | if (@file_exists($f)) { |
| 3036 | 3036 | return $f; |
| 3037 | 3037 | } |
@@ -3041,7 +3041,7 @@ discard block |
||
| 3041 | 3041 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3042 | 3042 | $f = $dir_var |
| 3043 | 3043 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3044 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3044 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3045 | 3045 | |
| 3046 | 3046 | // la css peut etre distante (url absolue !) |
| 3047 | 3047 | if ($distant) { |
@@ -3087,8 +3087,8 @@ discard block |
||
| 3087 | 3087 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3088 | 3088 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3089 | 3089 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3090 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3091 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3090 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3091 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3092 | 3092 | } |
| 3093 | 3093 | $src[] = $regs[0][$k]; |
| 3094 | 3094 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3137,7 +3137,7 @@ discard block |
||
| 3137 | 3137 | |
| 3138 | 3138 | $f = basename($css, '.css'); |
| 3139 | 3139 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3140 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3140 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3141 | 3141 | . '.css'; |
| 3142 | 3142 | |
| 3143 | 3143 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3147,7 +3147,7 @@ discard block |
||
| 3147 | 3147 | if ($url_absolue_css == $css) { |
| 3148 | 3148 | if ( |
| 3149 | 3149 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3150 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3150 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3151 | 3151 | ) { |
| 3152 | 3152 | include_spip('inc/distant'); |
| 3153 | 3153 | $contenu = recuperer_url($css); |
@@ -3259,7 +3259,7 @@ discard block |
||
| 3259 | 3259 | $expression = str_replace('\/', '/', $expression); |
| 3260 | 3260 | $expression = str_replace('/', '\/', $expression); |
| 3261 | 3261 | |
| 3262 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3262 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3263 | 3263 | if (isset($r[$capte])) { |
| 3264 | 3264 | return $r[$capte]; |
| 3265 | 3265 | } else { |
@@ -3297,7 +3297,7 @@ discard block |
||
| 3297 | 3297 | $expression = str_replace('\/', '/', $expression); |
| 3298 | 3298 | $expression = str_replace('/', '\/', $expression); |
| 3299 | 3299 | |
| 3300 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3300 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3301 | 3301 | } |
| 3302 | 3302 | |
| 3303 | 3303 | |
@@ -3316,7 +3316,7 @@ discard block |
||
| 3316 | 3316 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3317 | 3317 | |
| 3318 | 3318 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3319 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3319 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3320 | 3320 | |
| 3321 | 3321 | if ( |
| 3322 | 3322 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3330,7 +3330,7 @@ discard block |
||
| 3330 | 3330 | if (!isset($doublons['documents'])) { |
| 3331 | 3331 | $doublons['documents'] = ''; |
| 3332 | 3332 | } |
| 3333 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3333 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3334 | 3334 | } |
| 3335 | 3335 | |
| 3336 | 3336 | return $letexte; |
@@ -3387,7 +3387,7 @@ discard block |
||
| 3387 | 3387 | if ($env) { |
| 3388 | 3388 | foreach ($env as $i => $j) { |
| 3389 | 3389 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3390 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3390 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3391 | 3391 | } |
| 3392 | 3392 | } |
| 3393 | 3393 | } |
@@ -3426,7 +3426,7 @@ discard block |
||
| 3426 | 3426 | if ($env) { |
| 3427 | 3427 | foreach ($env as $i => $j) { |
| 3428 | 3428 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3429 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3429 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3430 | 3430 | } |
| 3431 | 3431 | } |
| 3432 | 3432 | } |
@@ -3500,10 +3500,10 @@ discard block |
||
| 3500 | 3500 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3501 | 3501 | if ( |
| 3502 | 3502 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3503 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3503 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3504 | 3504 | and file_exists($variante_svg_generique) |
| 3505 | 3505 | ) { |
| 3506 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3506 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3507 | 3507 | $img_file = $variante_svg_size; |
| 3508 | 3508 | } |
| 3509 | 3509 | else { |
@@ -3562,7 +3562,7 @@ discard block |
||
| 3562 | 3562 | return ''; |
| 3563 | 3563 | } |
| 3564 | 3564 | } |
| 3565 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3565 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3566 | 3566 | } |
| 3567 | 3567 | |
| 3568 | 3568 | if (file_exists($img_file)) { |
@@ -3575,14 +3575,14 @@ discard block |
||
| 3575 | 3575 | $alt = ''; |
| 3576 | 3576 | } |
| 3577 | 3577 | elseif ($alt or $alt === '') { |
| 3578 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3578 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3579 | 3579 | } |
| 3580 | 3580 | else { |
| 3581 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3581 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3582 | 3582 | } |
| 3583 | 3583 | return "<img src='$img_file'$alt" |
| 3584 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3585 | - . ' ' . ltrim($atts) |
|
| 3584 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3585 | + . ' '.ltrim($atts) |
|
| 3586 | 3586 | . ' />'; |
| 3587 | 3587 | } |
| 3588 | 3588 | |
@@ -3597,14 +3597,14 @@ discard block |
||
| 3597 | 3597 | */ |
| 3598 | 3598 | function http_style_background($img, $att = '', $size = null, $alternative = '') { |
| 3599 | 3599 | if ($size and is_numeric($size)) { |
| 3600 | - $size = trim($size) . 'px'; |
|
| 3600 | + $size = trim($size).'px'; |
|
| 3601 | 3601 | } |
| 3602 | 3602 | |
| 3603 | 3603 | if (!$img = chemin_image($img)) { |
| 3604 | 3604 | $img = chemin_image($alternative); |
| 3605 | 3605 | } |
| 3606 | - return " style='background" . |
|
| 3607 | - ($att ? '' : '-image') . ': url("' . $img . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3606 | + return " style='background". |
|
| 3607 | + ($att ? '' : '-image').': url("'.$img.'")'.($att ? (' '.$att) : '').';' |
|
| 3608 | 3608 | . ($size ? "background-size:{$size};" : '') |
| 3609 | 3609 | . "'"; |
| 3610 | 3610 | } |
@@ -3719,7 +3719,7 @@ discard block |
||
| 3719 | 3719 | $img = http_img_pack( |
| 3720 | 3720 | $img, |
| 3721 | 3721 | $alt, |
| 3722 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3722 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3723 | 3723 | '', |
| 3724 | 3724 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3725 | 3725 | ); |
@@ -3804,7 +3804,7 @@ discard block |
||
| 3804 | 3804 | $balise_svg_source = $balise_svg; |
| 3805 | 3805 | |
| 3806 | 3806 | // entete XML à supprimer |
| 3807 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3807 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3808 | 3808 | |
| 3809 | 3809 | // IE est toujours mon ami |
| 3810 | 3810 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3822,9 +3822,9 @@ discard block |
||
| 3822 | 3822 | // regler le alt |
| 3823 | 3823 | if ($alt) { |
| 3824 | 3824 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3825 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3825 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3826 | 3826 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3827 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3827 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3828 | 3828 | $balise_svg .= $title; |
| 3829 | 3829 | } |
| 3830 | 3830 | else { |
@@ -3872,7 +3872,7 @@ discard block |
||
| 3872 | 3872 | if (is_array($tableau)) { |
| 3873 | 3873 | foreach ($tableau as $k => $v) { |
| 3874 | 3874 | $res = recuperer_fond( |
| 3875 | - 'modeles/' . $modele, |
|
| 3875 | + 'modeles/'.$modele, |
|
| 3876 | 3876 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3877 | 3877 | ); |
| 3878 | 3878 | $texte .= $res; |
@@ -4057,7 +4057,7 @@ discard block |
||
| 4057 | 4057 | } |
| 4058 | 4058 | |
| 4059 | 4059 | $c = serialize($c); |
| 4060 | - $cle = calculer_cle_action($form . $c); |
|
| 4060 | + $cle = calculer_cle_action($form.$c); |
|
| 4061 | 4061 | $c = "$cle:$c"; |
| 4062 | 4062 | |
| 4063 | 4063 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4115,15 +4115,15 @@ discard block |
||
| 4115 | 4115 | } |
| 4116 | 4116 | // toujours encoder l'url source dans le bloc ajax |
| 4117 | 4117 | $r = self(); |
| 4118 | - $r = ' data-origin="' . $r . '"'; |
|
| 4118 | + $r = ' data-origin="'.$r.'"'; |
|
| 4119 | 4119 | $class = 'ajaxbloc'; |
| 4120 | 4120 | if ($ajaxid and is_string($ajaxid)) { |
| 4121 | 4121 | // ajaxid est normalement conforme a un nom de classe css |
| 4122 | 4122 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4123 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4123 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4124 | 4124 | } |
| 4125 | 4125 | |
| 4126 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4126 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4127 | 4127 | } |
| 4128 | 4128 | |
| 4129 | 4129 | /** |
@@ -4167,7 +4167,7 @@ discard block |
||
| 4167 | 4167 | $cle = substr($c, 0, $p); |
| 4168 | 4168 | $c = substr($c, $p + 1); |
| 4169 | 4169 | |
| 4170 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4170 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4171 | 4171 | $env = @unserialize($c); |
| 4172 | 4172 | return $env; |
| 4173 | 4173 | } |
@@ -4288,13 +4288,13 @@ discard block |
||
| 4288 | 4288 | } |
| 4289 | 4289 | } |
| 4290 | 4290 | } |
| 4291 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4291 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4292 | 4292 | } else { |
| 4293 | 4293 | $bal = 'a'; |
| 4294 | 4294 | $att = "href='$url'" |
| 4295 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4296 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4297 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4295 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4296 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4297 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4298 | 4298 | . $evt; |
| 4299 | 4299 | } |
| 4300 | 4300 | if ($libelle === null) { |
@@ -4433,7 +4433,7 @@ discard block |
||
| 4433 | 4433 | |
| 4434 | 4434 | // Icône |
| 4435 | 4435 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'", '', ['alternative' => "objet-generique-$size.png"]); |
| 4436 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4436 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4437 | 4437 | |
| 4438 | 4438 | // Markup final |
| 4439 | 4439 | if ($type == 'lien') { |
@@ -4708,20 +4708,20 @@ discard block |
||
| 4708 | 4708 | $class_form = 'ajax'; |
| 4709 | 4709 | $class = str_replace('ajax', '', $class); |
| 4710 | 4710 | } |
| 4711 | - $class_btn = 'submit ' . trim($class); |
|
| 4711 | + $class_btn = 'submit '.trim($class); |
|
| 4712 | 4712 | |
| 4713 | 4713 | if ($confirm) { |
| 4714 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4714 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4715 | 4715 | if ($callback) { |
| 4716 | 4716 | $callback = "$confirm?($callback):false"; |
| 4717 | 4717 | } else { |
| 4718 | 4718 | $callback = $confirm; |
| 4719 | 4719 | } |
| 4720 | 4720 | } |
| 4721 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4721 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4722 | 4722 | $title = $title ? " title='$title'" : ''; |
| 4723 | 4723 | |
| 4724 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4724 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4725 | 4725 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4726 | 4726 | } |
| 4727 | 4727 | |
@@ -4786,14 +4786,14 @@ discard block |
||
| 4786 | 4786 | $champ_titre = ''; |
| 4787 | 4787 | if ($demande_titre) { |
| 4788 | 4788 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4789 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4789 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4790 | 4790 | } |
| 4791 | 4791 | include_spip('base/abstract_sql'); |
| 4792 | 4792 | include_spip('base/connect_sql'); |
| 4793 | 4793 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4794 | - '*' . $champ_titre, |
|
| 4794 | + '*'.$champ_titre, |
|
| 4795 | 4795 | $desc['table_sql'], |
| 4796 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4796 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4797 | 4797 | ); |
| 4798 | 4798 | |
| 4799 | 4799 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4886,8 +4886,7 @@ discard block |
||
| 4886 | 4886 | if (isset($ligne_sql['chapo'])) { |
| 4887 | 4887 | $chapo = $ligne_sql['chapo']; |
| 4888 | 4888 | $texte = strlen($descriptif) ? |
| 4889 | - '' : |
|
| 4890 | - "$chapo \n\n $texte"; |
|
| 4889 | + '' : "$chapo \n\n $texte"; |
|
| 4891 | 4890 | } |
| 4892 | 4891 | |
| 4893 | 4892 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4962,7 +4961,7 @@ discard block |
||
| 4962 | 4961 | return $texte; |
| 4963 | 4962 | } |
| 4964 | 4963 | |
| 4965 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4964 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4966 | 4965 | |
| 4967 | 4966 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4968 | 4967 | $Pile = [0 => $env]; |
@@ -4996,7 +4995,7 @@ discard block |
||
| 4996 | 4995 | } |
| 4997 | 4996 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4998 | 4997 | |
| 4999 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4998 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 5000 | 4999 | } |
| 5001 | 5000 | |
| 5002 | 5001 | /** |
@@ -5022,10 +5021,10 @@ discard block |
||
| 5022 | 5021 | function wrap($texte, $wrap) { |
| 5023 | 5022 | $balises = extraire_balises($wrap); |
| 5024 | 5023 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5025 | - $texte = $wrap . $texte; |
|
| 5024 | + $texte = $wrap.$texte; |
|
| 5026 | 5025 | $regs = array_reverse($regs[1]); |
| 5027 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5028 | - $texte = $texte . $wrap; |
|
| 5026 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5027 | + $texte = $texte.$wrap; |
|
| 5029 | 5028 | } |
| 5030 | 5029 | |
| 5031 | 5030 | return $texte; |
@@ -5056,7 +5055,7 @@ discard block |
||
| 5056 | 5055 | |
| 5057 | 5056 | // caster $u en array si besoin |
| 5058 | 5057 | if (is_object($u)) { |
| 5059 | - $u = (array)$u; |
|
| 5058 | + $u = (array) $u; |
|
| 5060 | 5059 | } |
| 5061 | 5060 | |
| 5062 | 5061 | if (is_array($u)) { |
@@ -5078,7 +5077,7 @@ discard block |
||
| 5078 | 5077 | // sinon on passe a la ligne et on indente |
| 5079 | 5078 | $i_str = str_pad('', $indent, ' '); |
| 5080 | 5079 | foreach ($u as $k => $v) { |
| 5081 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5080 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5082 | 5081 | } |
| 5083 | 5082 | |
| 5084 | 5083 | return $out; |
@@ -5132,7 +5131,7 @@ discard block |
||
| 5132 | 5131 | * @return string |
| 5133 | 5132 | */ |
| 5134 | 5133 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5135 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5134 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5136 | 5135 | $icone = chemin_image($icone); |
| 5137 | 5136 | $balise_img = charger_filtre('balise_img'); |
| 5138 | 5137 | |
@@ -5158,7 +5157,7 @@ discard block |
||
| 5158 | 5157 | */ |
| 5159 | 5158 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5160 | 5159 | $chaine = explode(':', $chaine); |
| 5161 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5160 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5162 | 5161 | return $t; |
| 5163 | 5162 | } |
| 5164 | 5163 | $chaine = implode(':', $chaine); |
@@ -5224,7 +5223,7 @@ discard block |
||
| 5224 | 5223 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5225 | 5224 | |
| 5226 | 5225 | // calculer le nom de la css |
| 5227 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5226 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5228 | 5227 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5229 | 5228 | $contexte_implicite = calculer_contexte_implicite(); |
| 5230 | 5229 | |
@@ -5232,14 +5231,14 @@ discard block |
||
| 5232 | 5231 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5233 | 5232 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5234 | 5233 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5235 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5234 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5236 | 5235 | } |
| 5237 | 5236 | else { |
| 5238 | 5237 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5239 | 5238 | ksort($contexte); |
| 5240 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5239 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5241 | 5240 | } |
| 5242 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5241 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5243 | 5242 | |
| 5244 | 5243 | // mettre a jour le fichier si il n'existe pas |
| 5245 | 5244 | // ou trop ancien |
@@ -5247,8 +5246,8 @@ discard block |
||
| 5247 | 5246 | // et recopie sur le fichier cible uniquement si il change |
| 5248 | 5247 | if ( |
| 5249 | 5248 | !file_exists($filename) |
| 5250 | - or !file_exists($filename . '.last') |
|
| 5251 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5249 | + or !file_exists($filename.'.last') |
|
| 5250 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5252 | 5251 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5253 | 5252 | ) { |
| 5254 | 5253 | $contenu = $cache['texte']; |
@@ -5269,10 +5268,10 @@ discard block |
||
| 5269 | 5268 | } |
| 5270 | 5269 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5271 | 5270 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5272 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5271 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5273 | 5272 | } |
| 5274 | 5273 | // et ecrire le fichier si il change |
| 5275 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5274 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5276 | 5275 | } |
| 5277 | 5276 | |
| 5278 | 5277 | return timestamp($filename); |
@@ -5498,7 +5497,7 @@ discard block |
||
| 5498 | 5497 | if ($e > 0 and strlen($mid) > 8) { |
| 5499 | 5498 | $mid = '***...***'; |
| 5500 | 5499 | } |
| 5501 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5500 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5502 | 5501 | } |
| 5503 | 5502 | |
| 5504 | 5503 | |
@@ -5560,7 +5559,7 @@ discard block |
||
| 5560 | 5559 | case 'id': |
| 5561 | 5560 | case 'anchor': |
| 5562 | 5561 | if (preg_match(',^\d,', $texte)) { |
| 5563 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5562 | + $texte = substr($type, 0, 1).$texte; |
|
| 5564 | 5563 | } |
| 5565 | 5564 | } |
| 5566 | 5565 | |
@@ -5570,9 +5569,9 @@ discard block |
||
| 5570 | 5569 | |
| 5571 | 5570 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5572 | 5571 | if (preg_match(',^\d,', $texte)) { |
| 5573 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5572 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5574 | 5573 | } |
| 5575 | - $texte .= $separateur . md5($original); |
|
| 5574 | + $texte .= $separateur.md5($original); |
|
| 5576 | 5575 | $texte = substr($texte, 0, $longueur_mini); |
| 5577 | 5576 | } |
| 5578 | 5577 | |