@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $apl_constant = '_Z_AJAX_PARALLEL_LOAD'; |
| 54 | 54 | $page = _SPIP_PAGE; |
| 55 | 55 | $echafauder = charger_fonction('echafauder', 'public', true); |
| 56 | - define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim( |
|
| 56 | + define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim( |
|
| 57 | 57 | _DIR_PLUGIN_DIST, |
| 58 | 58 | '/' |
| 59 | 59 | ) : '')); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | and in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z |
| 78 | 78 | and defined($apl_constant) |
| 79 | 79 | and in_array($dir, explode(',', constant($apl_constant))) // et dans un demande en APL |
| 80 | - and $pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL |
|
| 80 | + and $pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL |
|
| 81 | 81 | ) { |
| 82 | 82 | $flux['data'] = $pipe; |
| 83 | 83 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $echafauder = ''; |
| 91 | 91 | } |
| 92 | 92 | if ($prepend) { |
| 93 | - $squelette = substr(find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext")); |
|
| 93 | + $squelette = substr(find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext")); |
|
| 94 | 94 | if ($squelette) { |
| 95 | 95 | $flux['data'] = $squelette; |
| 96 | 96 | } |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | // se brancher sur contenu/xx si il existe |
| 114 | 114 | // ou si c'est un objet spip, associe a une table, utiliser le fond homonyme |
| 115 | 115 | if (!isset($disponible[$fond])) { |
| 116 | - $disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 116 | + $disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if ($disponible[$fond]) { |
| 120 | - $flux['data'] = substr(find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext")); |
|
| 120 | + $flux['data'] = substr(find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext")); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $type = $flux['args']['contexte'][$page]; |
| 131 | 131 | } |
| 132 | 132 | if (!isset($disponible[$type])) { |
| 133 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 133 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 134 | 134 | } |
| 135 | 135 | if (is_string($disponible[$type])) { |
| 136 | 136 | $flux['data'] = $disponible[$type]; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext); |
| 146 | 146 | } else { |
| 147 | 147 | $flux['data'] = ($disponible['404'] = z_contenu_disponible( |
| 148 | - $prefix_path . $prepend, |
|
| 148 | + $prefix_path.$prepend, |
|
| 149 | 149 | $z_contenu, |
| 150 | 150 | '404', |
| 151 | 151 | $ext, |
@@ -169,10 +169,10 @@ discard block |
||
| 169 | 169 | $type = $flux['args']['contexte'][$page]; |
| 170 | 170 | } |
| 171 | 171 | if ($type !== 'page' and !isset($disponible[$type])) { |
| 172 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 172 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 173 | 173 | } |
| 174 | 174 | if ($type == 'page' or $disponible[$type]) { |
| 175 | - $flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext); |
|
| 175 | + $flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | isset($flux['args']['contexte']['type-page']) |
| 189 | 189 | and ( |
| 190 | 190 | (isset($flux['args']['contexte']['composition']) |
| 191 | - and file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext")) |
|
| 191 | + and file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext")) |
|
| 192 | 192 | or |
| 193 | - file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext") |
|
| 193 | + file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext") |
|
| 194 | 194 | ) |
| 195 | 195 | ) { |
| 196 | 196 | $flux['data'] = $f; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } elseif ( |
| 199 | 199 | $fond == 'structure' |
| 200 | 200 | and z_sanitize_var_zajax() |
| 201 | - and $f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext") |
|
| 201 | + and $f = find_in_path($prefix_path.$prepend.'ajax'.".$ext") |
|
| 202 | 202 | ) { |
| 203 | 203 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 204 | 204 | } // chercher le fond correspondant a la composition |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | and $dir = explode('/', $dir) |
| 210 | 210 | and $dir = reset($dir) |
| 211 | 211 | and in_array($dir, $z_blocs) |
| 212 | - and $f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext") |
|
| 212 | + and $f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext") |
|
| 213 | 213 | ) { |
| 214 | 214 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 215 | 215 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | function z_fond_valide($squelette) { |
| 272 | 272 | if ( |
| 273 | 273 | !_ZCORE_EXCLURE_PATH |
| 274 | - or !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette) |
|
| 274 | + or !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette) |
|
| 275 | 275 | ) { |
| 276 | 276 | return true; |
| 277 | 277 | } |
@@ -395,23 +395,23 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | $dir = z_blocs(test_espace_prive()); |
| 397 | 397 | $dir = reset($dir); |
| 398 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper($primary) . ',env}>'; |
|
| 398 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper($primary).',env}>'; |
|
| 399 | 399 | } // page objets |
| 400 | 400 | elseif ($type = $desc_exec and !str_contains($type, '/')) { |
| 401 | 401 | $dir = z_blocs(test_espace_prive()); |
| 402 | 402 | $dir = reset($dir); |
| 403 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />'; |
|
| 403 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />'; |
|
| 404 | 404 | } |
| 405 | 405 | // morceau d'objet : on fournit le fond de sibstitution dans $desc_exec |
| 406 | 406 | // et objet et tire de $table |
| 407 | 407 | elseif ($fond = $desc_exec) { |
| 408 | 408 | $dir = md5(dirname($fond)); |
| 409 | - $scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />'; |
|
| 409 | + $scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />'; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false); |
| 413 | 413 | $base_dir = sous_repertoire($base_dir, $dir, false); |
| 414 | - $f = $base_dir . "$exec"; |
|
| 414 | + $f = $base_dir."$exec"; |
|
| 415 | 415 | ecrire_fichier("$f.$ext", $scaffold); |
| 416 | 416 | |
| 417 | 417 | return $f; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * texte |
| 42 | 42 | */ |
| 43 | 43 | function sandbox_composer_texte($texte, &$p) { |
| 44 | - $code = "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], $texte) . "'"; |
|
| 44 | + $code = "'".str_replace(['\\', "'"], ['\\\\', "\\'"], $texte)."'"; |
|
| 45 | 45 | |
| 46 | 46 | return $code; |
| 47 | 47 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $min_f = $refl->getNumberOfRequiredParameters(); |
| 86 | 86 | if (($nb_args_f < $min_f)) { |
| 87 | 87 | $msg_args = ['filtre' => texte_script($fonc), 'nb' => $min_f - $nb_args_f]; |
| 88 | - erreur_squelette([ 'zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 88 | + erreur_squelette(['zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | // le filtre n'existe pas, |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | function sandbox_filtrer_squelette($skel, $corps, $filtres) { |
| 172 | 172 | $series_filtres = func_get_args(); |
| 173 | - array_shift($series_filtres);// skel |
|
| 174 | - array_shift($series_filtres);// corps |
|
| 173 | + array_shift($series_filtres); // skel |
|
| 174 | + array_shift($series_filtres); // corps |
|
| 175 | 175 | |
| 176 | 176 | // proteger les <INCLUDE> et tous les morceaux de php licites |
| 177 | 177 | if ($skel['process_ins'] == 'php') { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | if (is_array($r)) { |
| 220 | 220 | $dst[] = $r[0]; |
| 221 | 221 | |
| 222 | - return $src[] = '___' . md5($r[0]) . '___'; |
|
| 222 | + return $src[] = '___'.md5($r[0]).'___'; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | // si on recoit pas un tableau, on renvoit les couples de substitution |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * Pour plus de détails voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Initialisation de SPIP |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../'); |
| 55 | 55 | |
| 56 | 56 | /** chemin absolu vers la racine */ |
| 57 | -define('_ROOT_RACINE', dirname(__DIR__) . '/'); |
|
| 57 | +define('_ROOT_RACINE', dirname(__DIR__).'/'); |
|
| 58 | 58 | /** chemin absolu vers le repertoire de travail */ |
| 59 | -define('_ROOT_CWD', getcwd() . '/'); |
|
| 59 | +define('_ROOT_CWD', getcwd().'/'); |
|
| 60 | 60 | /** chemin absolu vers ecrire */ |
| 61 | -define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT); |
|
| 61 | +define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT); |
|
| 62 | 62 | |
| 63 | 63 | // Icones |
| 64 | 64 | if (!defined('_NOM_IMG_PACK')) { |
@@ -66,17 +66,17 @@ discard block |
||
| 66 | 66 | define('_NOM_IMG_PACK', 'images/'); |
| 67 | 67 | } |
| 68 | 68 | /** le chemin http (relatif) vers les images standard */ |
| 69 | -define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK)); |
|
| 69 | +define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK)); |
|
| 70 | 70 | |
| 71 | 71 | /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */ |
| 72 | -define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK); |
|
| 72 | +define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK); |
|
| 73 | 73 | |
| 74 | 74 | if (!defined('_JAVASCRIPT')) { |
| 75 | 75 | /** Nom du repertoire des bibliotheques JavaScript */ |
| 76 | 76 | define('_JAVASCRIPT', 'javascript/'); |
| 77 | 77 | } // utilisable avec #CHEMIN et find_in_path |
| 78 | 78 | /** le nom du repertoire des bibliotheques JavaScript du prive */ |
| 79 | -define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT)); |
|
| 79 | +define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT)); |
|
| 80 | 80 | |
| 81 | 81 | # Le nom des 4 repertoires modifiables par les scripts lances par httpd |
| 82 | 82 | # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas) |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // Son emplacement absolu si on le trouve |
| 109 | 109 | if ( |
| 110 | - @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php') |
|
| 111 | - or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php')) |
|
| 110 | + @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php') |
|
| 111 | + or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php')) |
|
| 112 | 112 | ) { |
| 113 | 113 | /** Emplacement absolu du fichier d'option */ |
| 114 | 114 | define('_FILE_OPTIONS', $f); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | // inclure l'ecran de securite |
| 133 | 133 | if ( |
| 134 | 134 | !defined('_ECRAN_SECURITE') |
| 135 | - and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php') |
|
| 135 | + and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php') |
|
| 136 | 136 | ) { |
| 137 | 137 | include $f; |
| 138 | 138 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | // UA plus cibles |
| 154 | 154 | . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' |
| 155 | 155 | . ',i', |
| 156 | - (string)$_SERVER['HTTP_USER_AGENT'] |
|
| 156 | + (string) $_SERVER['HTTP_USER_AGENT'] |
|
| 157 | 157 | ) |
| 158 | 158 | ); |
| 159 | 159 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | # la matrice standard (fichiers definissant les fonctions a inclure) |
| 396 | 396 | $spip_matrice = []; |
| 397 | 397 | # les plugins a activer |
| 398 | -$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 398 | +$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 399 | 399 | # les surcharges de include_spip() |
| 400 | 400 | $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php' |
| 401 | 401 | |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | // |
| 474 | 474 | // Charger les fonctions liees aux serveurs Http et Sql. |
| 475 | 475 | // |
| 476 | -require_once _ROOT_RESTREINT . 'inc/utils.php'; |
|
| 477 | -require_once _ROOT_RESTREINT . 'base/connect_sql.php'; |
|
| 476 | +require_once _ROOT_RESTREINT.'inc/utils.php'; |
|
| 477 | +require_once _ROOT_RESTREINT.'base/connect_sql.php'; |
|
| 478 | 478 | |
| 479 | 479 | // Definition personnelles eventuelles |
| 480 | 480 | |
@@ -497,10 +497,10 @@ discard block |
||
| 497 | 497 | // ===> on execute en neutralisant les messages d'erreur |
| 498 | 498 | |
| 499 | 499 | spip_initialisation_core( |
| 500 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 501 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 502 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 503 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 500 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 501 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 502 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 503 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 504 | 504 | ); |
| 505 | 505 | |
| 506 | 506 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | // Si on est dans le site public, dire que qq s'en occupe |
| 556 | 556 | include_spip('inc/minipres'); |
| 557 | 557 | utiliser_langue_visiteur(); |
| 558 | - echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]); |
|
| 558 | + echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]); |
|
| 559 | 559 | exit; |
| 560 | 560 | } |
| 561 | 561 | // autrement c'est une install ad hoc (spikini...), on sait pas faire |
@@ -594,12 +594,12 @@ discard block |
||
| 594 | 594 | } |
| 595 | 595 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 596 | 596 | include_spip('inc/filtres_mini'); |
| 597 | - header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt')); |
|
| 597 | + header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt')); |
|
| 598 | 598 | } else { |
| 599 | 599 | // header minimal |
| 600 | - header(_HEADER_COMPOSED_BY . ' @ www.spip.net'); |
|
| 600 | + header(_HEADER_COMPOSED_BY.' @ www.spip.net'); |
|
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : '')); |
| 605 | -spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG); |
|
| 605 | +spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG); |
|
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | function inc_sql_to_array_dist($data) { |
| 122 | 122 | # sortir le connecteur de $data |
| 123 | 123 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 124 | - $serveur = (string)$v[1]; |
|
| 124 | + $serveur = (string) $v[1]; |
|
| 125 | 125 | $req = trim($v[2]); |
| 126 | 126 | if ($s = sql_query($req, $serveur)) { |
| 127 | 127 | $r = []; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $json = json_decode($data, true, 512, JSON_THROW_ON_ERROR); |
| 147 | 147 | } catch (JsonException $e) { |
| 148 | 148 | $json = null; |
| 149 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO); |
|
| 149 | + spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO); |
|
| 150 | 150 | } |
| 151 | 151 | return is_array($json) ? (array) $json : []; |
| 152 | 152 | } |
@@ -166,13 +166,13 @@ discard block |
||
| 166 | 166 | $i = 1; |
| 167 | 167 | foreach ($entete as $k => $v) { |
| 168 | 168 | if (trim($v) == '') { |
| 169 | - $v = 'col' . $i; |
|
| 169 | + $v = 'col'.$i; |
|
| 170 | 170 | } // reperer des eventuelles cases vides |
| 171 | 171 | if (is_numeric($v) and $v < 0) { |
| 172 | - $v = '__' . $v; |
|
| 172 | + $v = '__'.$v; |
|
| 173 | 173 | } // ne pas risquer d'ecraser une cle numerique |
| 174 | 174 | if (is_numeric($v)) { |
| 175 | - $v = '_' . $v; |
|
| 175 | + $v = '_'.$v; |
|
| 176 | 176 | } // ne pas risquer d'ecraser une cle numerique |
| 177 | 177 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 178 | 178 | foreach ($csv as &$item) { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * @return array|bool |
| 259 | 259 | */ |
| 260 | 260 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 261 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 261 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 274 | 274 | $a = $glob_to_array($data); |
| 275 | 275 | foreach ($a as &$v) { |
| 276 | - $b = (array)@stat($v); |
|
| 276 | + $b = (array) @stat($v); |
|
| 277 | 277 | foreach ($b as $k => $ignore) { |
| 278 | 278 | if (is_numeric($k)) { |
| 279 | 279 | unset($b[$k]); |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | - $b['file'] = preg_replace('`/$`', '', $v) ; |
|
| 282 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 283 | 283 | $v = array_merge( |
| 284 | 284 | pathinfo($v), |
| 285 | 285 | $b |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $xml_array = []; |
| 300 | 300 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 301 | 301 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 302 | - $key .= '-' . uniqid(); |
|
| 302 | + $key .= '-'.uniqid(); |
|
| 303 | 303 | } |
| 304 | 304 | $vars = get_object_vars($object->current()); |
| 305 | 305 | if (isset($vars['@attributes'])) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $texte = $x . $texte; |
|
| 67 | + $texte = $x.$texte; |
|
| 68 | 68 | |
| 69 | 69 | return $texte; |
| 70 | 70 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | || ($pos = 0); |
| 179 | 179 | |
| 180 | 180 | if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 181 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 181 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 182 | 182 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | $texte = substr_replace($texte, $x, $pos, 0); |
| 212 | 212 | // pas de preview en fenetre enfant |
| 213 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes($GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 213 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 214 | 214 | if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) { |
| 215 | 215 | $pos = -1; |
| 216 | 216 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 283 | 283 | if (($p = strpos($texte, '</body>')) !== false) { |
| 284 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 284 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 285 | 285 | } else { |
| 286 | 286 | $texte .= $code; |
| 287 | 287 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 24 | 24 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 25 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 25 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if ($dir) { |
| 382 | 382 | $dir .= '/'; |
| 383 | 383 | } |
| 384 | - $dir .= 'procure:' . $procure['nom']; |
|
| 384 | + $dir .= 'procure:'.$procure['nom']; |
|
| 385 | 385 | |
| 386 | 386 | $procure['etat'] = '?'; |
| 387 | 387 | $procure['dir_type'] = $resume['dir_type']; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $plug = $resume['dir']; |
| 566 | 566 | $k = $infos[$dir_type][$plug]; |
| 567 | 567 | |
| 568 | - $plug = constant($dir_type) . $plug; |
|
| 568 | + $plug = constant($dir_type).$plug; |
|
| 569 | 569 | if (!isset($msg[$p])) { |
| 570 | 570 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 571 | 571 | $msg[$p] = [$resume['erreur']]; |
@@ -608,10 +608,10 @@ discard block |
||
| 608 | 608 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 609 | 609 | } elseif (!$raw) { |
| 610 | 610 | foreach ($list as $plug => $msg) { |
| 611 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 611 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 613 | 613 | } |
| 614 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 614 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 615 | 615 | } |
| 616 | 616 | if ($raz) { |
| 617 | 617 | effacer_meta('plugin_erreur_activation'); |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 726 | 726 | return _T("plugin_{$balise}_{$type}", [ |
| 727 | 727 | 'plugin' => $nom, |
| 728 | - 'version' => ' ≥ ' . $minimum |
|
| 728 | + 'version' => ' ≥ '.$minimum |
|
| 729 | 729 | ]); |
| 730 | 730 | } |
| 731 | 731 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 732 | 732 | return _T("plugin_{$balise}_{$type}", [ |
| 733 | 733 | 'plugin' => $nom, |
| 734 | - 'version' => ' > ' . $minimum |
|
| 734 | + 'version' => ' > '.$minimum |
|
| 735 | 735 | ]); |
| 736 | 736 | } |
| 737 | 737 | } |
@@ -740,13 +740,13 @@ discard block |
||
| 740 | 740 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 741 | 741 | return _T("plugin_{$balise}_{$type}", [ |
| 742 | 742 | 'plugin' => $nom, |
| 743 | - 'version' => ' ≤ ' . $maximum |
|
| 743 | + 'version' => ' ≤ '.$maximum |
|
| 744 | 744 | ]); |
| 745 | 745 | } |
| 746 | 746 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 747 | 747 | return _T("plugin_{$balise}_plugin", [ |
| 748 | 748 | 'plugin' => $nom, |
| 749 | - 'version' => ' < ' . $maximum |
|
| 749 | + 'version' => ' < '.$maximum |
|
| 750 | 750 | ]); |
| 751 | 751 | } |
| 752 | 752 | } |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | include_spip('inc/charger_plugin'); |
| 766 | 766 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 767 | 767 | }*/ |
| 768 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 768 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | foreach ($plugin_valides as $p => $resume) { |
| 866 | 866 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 867 | 867 | if (!str_starts_with($p, 'PHP:') and $p !== 'PHP') { |
| 868 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 868 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 869 | 869 | } |
| 870 | 870 | if ($resume['dir']) { |
| 871 | 871 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -890,11 +890,11 @@ discard block |
||
| 890 | 890 | $header = strtolower(implode(',', $header)); |
| 891 | 891 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 892 | 892 | ecrire_fichier( |
| 893 | - _DIR_VAR . 'config.txt', |
|
| 894 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 893 | + _DIR_VAR.'config.txt', |
|
| 894 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 895 | 895 | ); |
| 896 | 896 | } else { |
| 897 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 897 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 898 | 898 | } |
| 899 | 899 | // generer charger_plugins_chemin.php |
| 900 | 900 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | // definir le plugin, donc le path avant l'include du fichier options |
| 949 | 949 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 950 | 950 | |
| 951 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 951 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 952 | 952 | |
| 953 | 953 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 954 | 954 | if ( |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | if (!$info['chemin']) { |
| 960 | 960 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 961 | 961 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 962 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 962 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 963 | 963 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 964 | 964 | } |
| 965 | 965 | } |
@@ -980,13 +980,13 @@ discard block |
||
| 980 | 980 | $dir = ''; |
| 981 | 981 | } |
| 982 | 982 | if (strlen($dir)) { |
| 983 | - $dir = rtrim($dir, '/') . '/'; |
|
| 983 | + $dir = rtrim($dir, '/').'/'; |
|
| 984 | 984 | } |
| 985 | 985 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 986 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 986 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 987 | 987 | } |
| 988 | 988 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 989 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 989 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | } |
@@ -995,11 +995,11 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | } |
| 997 | 997 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 998 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 998 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 999 | 999 | ',', |
| 1000 | 1000 | array_reverse($chemins['public']) |
| 1001 | - ) . "]);\n" |
|
| 1002 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 1001 | + )."]);\n" |
|
| 1002 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | and !str_contains($dir, ':') // exclure le cas des procure: |
| 1049 | 1049 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1050 | 1050 | ) { |
| 1051 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1051 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1052 | 1052 | $info[$charge] = [$file]; |
| 1053 | 1053 | } |
| 1054 | 1054 | } |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | ) { |
| 1066 | 1066 | unset($info[$charge][$k]); |
| 1067 | 1067 | } else { |
| 1068 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1068 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1069 | 1069 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | } |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1078 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1079 | 1079 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1080 | 1080 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1081 | 1081 | |
@@ -1110,12 +1110,12 @@ discard block |
||
| 1110 | 1110 | define("_UPDATED_$nom", $val); |
| 1111 | 1111 | define("_UPDATED_md5_$nom", $md5); |
| 1112 | 1112 | } |
| 1113 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1113 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1114 | 1114 | |
| 1115 | 1115 | return |
| 1116 | 1116 | "if (!function_exists('$nom')) {\n" |
| 1117 | 1117 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1118 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1118 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1119 | 1119 | . "}\n"; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1139 | 1139 | include_once(_CACHE_PLUGINS_OPT); |
| 1140 | 1140 | } else { |
| 1141 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1141 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1176 | 1176 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1177 | 1177 | $plug = $plugin_valides[$p]['dir']; |
| 1178 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1178 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1179 | 1179 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1180 | 1180 | foreach ($info['pipeline'] as $pipe) { |
| 1181 | 1181 | $nom = $pipe['nom']; |
@@ -1209,7 +1209,7 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | if (isset($pipe['inclure'])) { |
| 1211 | 1211 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1212 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1212 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | $prepend_code['taches_generales_cron'] = ''; |
| 1220 | 1220 | } |
| 1221 | 1221 | foreach ($info['genie'] as $genie) { |
| 1222 | - $nom = $prefix . $genie['nom']; |
|
| 1222 | + $nom = $prefix.$genie['nom']; |
|
| 1223 | 1223 | $periode = max(60, intval($genie['periode'])); |
| 1224 | 1224 | if (charger_fonction($nom, 'genie', true)) { |
| 1225 | 1225 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1237,13 +1237,13 @@ discard block |
||
| 1237 | 1237 | } |
| 1238 | 1238 | foreach ($info['style'] as $style) { |
| 1239 | 1239 | if (isset($style['path']) and $style['path']) { |
| 1240 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1240 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1241 | 1241 | } else { |
| 1242 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1242 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1245 | 1245 | if (isset($style['media']) and strlen($style['media'])) { |
| 1246 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1246 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1247 | 1247 | } |
| 1248 | 1248 | $code .= "/>';\n"; |
| 1249 | 1249 | if ($style['type'] != 'prive') { |
@@ -1263,9 +1263,9 @@ discard block |
||
| 1263 | 1263 | if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) { |
| 1264 | 1264 | foreach ($info['script'] as $script) { |
| 1265 | 1265 | if (isset($script['path']) and $script['path']) { |
| 1266 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1266 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1267 | 1267 | } else { |
| 1268 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1268 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1269 | 1269 | } |
| 1270 | 1270 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1271 | 1271 | if ($script['type'] != 'prive') { |
@@ -1328,10 +1328,10 @@ discard block |
||
| 1328 | 1328 | unset($GLOBALS['spip_pipeline']['all']); |
| 1329 | 1329 | $all_pipes = trim(array_shift($a)); |
| 1330 | 1330 | if ($all_pipes) { |
| 1331 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1331 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | if (count($a)) { |
| 1334 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1334 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | } |
| 1337 | 1337 | $content = ''; |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1349 | 1349 | foreach ($pipe as $fonc) { |
| 1350 | 1350 | $fonc = trim($fonc); |
| 1351 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1351 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1352 | 1352 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1353 | 1353 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1354 | 1354 | $file = "'$file'"; |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | if (defined($root_dir)) { |
| 1360 | 1360 | $dir = $root_dir; |
| 1361 | 1361 | } |
| 1362 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1362 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1363 | 1363 | $file = str_replace("''.", '', $file); |
| 1364 | 1364 | $file = str_replace(constant($dir), '', $file); |
| 1365 | 1365 | } |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | $content .= "// Pipeline $action \n" |
| 1373 | 1373 | . "function execute_pipeline_$action(&\$val){\n" |
| 1374 | 1374 | . $s_inc |
| 1375 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1375 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1376 | 1376 | . $s_call |
| 1377 | 1377 | . "return \$val;\n}\n"; |
| 1378 | 1378 | } |
@@ -1428,9 +1428,9 @@ discard block |
||
| 1428 | 1428 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1429 | 1429 | if (_IS_CLI) { |
| 1430 | 1430 | include_spip('inc/filtres'); |
| 1431 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1432 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1433 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1431 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1432 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1433 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1434 | 1434 | $trace, |
| 1435 | 1435 | "\n"; |
| 1436 | 1436 | } |
@@ -1465,15 +1465,15 @@ discard block |
||
| 1465 | 1465 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1468 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1469 | 1469 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1470 | 1470 | // si pas de modif on ne touche pas au fichier initial |
| 1471 | 1471 | if (file_exists($nom)) { |
| 1472 | 1472 | if (substr($nom, -4) == '.php') { |
| 1473 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1473 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1474 | 1474 | } |
| 1475 | 1475 | else { |
| 1476 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1476 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1477 | 1477 | } |
| 1478 | 1478 | file_put_contents($fichier_tmp, $contenu); |
| 1479 | 1479 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | static $dirs = []; |
| 44 | 44 | $liste = []; |
| 45 | 45 | foreach (creer_chemin() as $dir) { |
| 46 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 46 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 47 | 47 | $dirs[$a] = (is_dir($a) || !$a); |
| 48 | 48 | } |
| 49 | 49 | if ($dirs[$a]) { |
@@ -69,21 +69,21 @@ discard block |
||
| 69 | 69 | **/ |
| 70 | 70 | function chercher_module_lang($module, $lang = '') { |
| 71 | 71 | if ($lang) { |
| 72 | - $lang = '_' . $lang; |
|
| 72 | + $lang = '_'.$lang; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 76 | 76 | if ( |
| 77 | 77 | $f = ($module == 'local' |
| 78 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 79 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 78 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 79 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 80 | 80 | ) { |
| 81 | 81 | return is_array($f) ? $f : [$f]; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 85 | 85 | return (($module == 'local') or strpos($module, '/')) |
| 86 | - ? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false) |
|
| 86 | + ? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false) |
|
| 87 | 87 | : false; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | **/ |
| 108 | 108 | function charger_langue($lang, $module = 'spip') { |
| 109 | 109 | static $langs = []; |
| 110 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 110 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 111 | 111 | if (!isset($langs[$lang])) { |
| 112 | 112 | $langs[$lang] = []; |
| 113 | 113 | if ($lang) { |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | foreach ($langs[$lang] as $l) { |
| 124 | 124 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 125 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 125 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 126 | 126 | $GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang)); |
| 127 | 127 | surcharger_langue($fichiers_lang); |
| 128 | 128 | if ($l !== $lang) { |
| 129 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 129 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 130 | 130 | } |
| 131 | - $GLOBALS['lang_' . $var] = $l; |
|
| 131 | + $GLOBALS['lang_'.$var] = $l; |
|
| 132 | 132 | #spip_log("module de langue : {$module}_$l.php", 'traduire'); |
| 133 | 133 | break; |
| 134 | 134 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | function lire_fichier_langue(string $fichier): array { |
| 148 | 148 | $idx_lang_before = $GLOBALS['idx_lang'] ?? null; |
| 149 | - $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire'; |
|
| 149 | + $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire'; |
|
| 150 | 150 | $GLOBALS['idx_lang'] = $idx_lang_tmp; |
| 151 | 151 | $idx_lang = include $fichier; |
| 152 | 152 | $GLOBALS['idx_lang'] = $idx_lang_before; |
@@ -257,27 +257,27 @@ discard block |
||
| 257 | 257 | } else { |
| 258 | 258 | $modules = ['spip', 'ecrire']; |
| 259 | 259 | $code = $ori; |
| 260 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 260 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $desc = new Description(); |
| 264 | 264 | |
| 265 | 265 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 266 | 266 | foreach ($modules as $module) { |
| 267 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 267 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 268 | 268 | |
| 269 | 269 | if (empty($GLOBALS[$var])) { |
| 270 | 270 | charger_langue($lang, $module); |
| 271 | 271 | // surcharges persos -- on cherche |
| 272 | 272 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 273 | - if (!isset($local['local_' . $lang])) { |
|
| 273 | + if (!isset($local['local_'.$lang])) { |
|
| 274 | 274 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 275 | 275 | $GLOBALS['idx_lang'] = $var; |
| 276 | 276 | // ... (lang/)local_xx.php |
| 277 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 277 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 278 | 278 | } |
| 279 | - if ($local['local_' . $lang]) { |
|
| 280 | - surcharger_langue($local['local_' . $lang]); |
|
| 279 | + if ($local['local_'.$lang]) { |
|
| 280 | + surcharger_langue($local['local_'.$lang]); |
|
| 281 | 281 | } |
| 282 | 282 | // ... puis (lang/)local.php |
| 283 | 283 | if (!isset($local['local'])) { |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if (isset($GLOBALS[$var][$code])) { |
| 292 | 292 | $desc->code = $code; |
| 293 | 293 | $desc->module = $module; |
| 294 | - $desc->langue = $GLOBALS['lang_' . $var] ?? $lang; |
|
| 294 | + $desc->langue = $GLOBALS['lang_'.$var] ?? $lang; |
|
| 295 | 295 | $desc->texte = $GLOBALS[$var][$code]; |
| 296 | 296 | break; |
| 297 | 297 | } |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | if (!$desc->mode and $desc->texte) { |
| 350 | 350 | // ne pas modifier 2 fois l'affichage |
| 351 | 351 | $desc->mode = 'traduction'; |
| 352 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 352 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 353 | 353 | $desc->texte = '<span ' |
| 354 | - . 'lang=' . $desc->langue |
|
| 355 | - . ' class=' . $classe |
|
| 356 | - . ' data-module=' . $desc->module |
|
| 357 | - . ' data-code=' . $desc->code |
|
| 358 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 354 | + . 'lang='.$desc->langue |
|
| 355 | + . ' class='.$classe |
|
| 356 | + . ' data-module='.$desc->module |
|
| 357 | + . ' data-code='.$desc->code |
|
| 358 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 359 | 359 | . $desc->texte |
| 360 | 360 | . '</span>'; |
| 361 | 361 | $desc->texte = str_replace( |
@@ -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; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // affichage "GIT [master: abcdef]" |
| 232 | 232 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 233 | 233 | if ($desc['branch']) { |
| 234 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 234 | + $commit = $desc['branch'].': '.$commit; |
|
| 235 | 235 | } |
| 236 | 236 | return "{$desc['vcs']} [$commit]"; |
| 237 | 237 | } |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // version installee par GIT |
| 253 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 253 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 254 | 254 | $currentHead = trim(substr($c, 4)); |
| 255 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 255 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 256 | 256 | return [ |
| 257 | 257 | 'vcs' => 'GIT', |
| 258 | 258 | 'branch' => basename($currentHead), |
@@ -267,12 +267,12 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 269 | 269 | // et laisser passer les fonctions personnelles baptisees image_... |
| 270 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 271 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 272 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 273 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 274 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 275 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 270 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 271 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 272 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 273 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 274 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 275 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 276 | 276 | |
| 277 | 277 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 278 | 278 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | function filtre_debug($val, $key = null) { |
| 433 | 433 | $debug = ( |
| 434 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 435 | - ) . var_export($val, true); |
|
| 434 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 435 | + ).var_export($val, true); |
|
| 436 | 436 | |
| 437 | 437 | include_spip('inc/autoriser'); |
| 438 | 438 | if (autoriser('webmestre')) { |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $is_file = false; |
| 489 | 489 | } |
| 490 | 490 | if ($is_file) { |
| 491 | - $is_local_file = function ($path) { |
|
| 491 | + $is_local_file = function($path) { |
|
| 492 | 492 | if (strpos($path, '?') !== false) { |
| 493 | 493 | $path = supprimer_timestamp($path); |
| 494 | 494 | // remove ?24px added by find_in_theme on .svg files |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 538 | 538 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 539 | 539 | $srcover = $match[1]; |
| 540 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 540 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 541 | 541 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 542 | 542 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 543 | 543 | } |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | // " -> " et tout ce genre de choses |
| 940 | 940 | $u = $GLOBALS['meta']['pcre_u']; |
| 941 | 941 | $texte = str_replace(' ', ' ', $texte); |
| 942 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 942 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 943 | 943 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 944 | 944 | $texte = entites_html($texte, false, false); |
| 945 | 945 | // mais bien echapper les double quotes ! |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | return ''; |
| 1002 | 1002 | } |
| 1003 | 1003 | return preg_replace( |
| 1004 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1004 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1005 | 1005 | '', |
| 1006 | 1006 | $texte |
| 1007 | 1007 | ); |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | if ( |
| 1031 | 1031 | $texte and |
| 1032 | 1032 | preg_match( |
| 1033 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1033 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1034 | 1034 | $texte, |
| 1035 | 1035 | $regs |
| 1036 | 1036 | ) |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | **/ |
| 1122 | 1122 | function textebrut($texte) { |
| 1123 | 1123 | $u = $GLOBALS['meta']['pcre_u']; |
| 1124 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1125 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1124 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1125 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1126 | 1126 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1127 | 1127 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1128 | 1128 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | ) |
| 1157 | 1157 | ) { |
| 1158 | 1158 | foreach ($liens[0] as $a) { |
| 1159 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1159 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1160 | 1160 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1161 | 1161 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1162 | 1162 | $texte = str_replace($a, $ablank, $texte); |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | foreach ($regs[0] as $a) { |
| 1182 | 1182 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1183 | 1183 | if (strpos($rel, 'nofollow') === false) { |
| 1184 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1184 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1185 | 1185 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1186 | 1186 | $texte = str_replace($a, $anofollow, $texte); |
| 1187 | 1187 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $u = $GLOBALS['meta']['pcre_u']; |
| 1211 | 1211 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1212 | 1212 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1213 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1213 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1214 | 1214 | |
| 1215 | 1215 | return $texte; |
| 1216 | 1216 | } |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | return $texte; |
| 1242 | 1242 | } |
| 1243 | 1243 | include_spip('inc/texte'); |
| 1244 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1244 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1245 | 1245 | 'div' : 'span'; |
| 1246 | 1246 | |
| 1247 | 1247 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | } |
| 1354 | 1354 | $u = $GLOBALS['meta']['pcre_u']; |
| 1355 | 1355 | if ($textebrut) { |
| 1356 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1356 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1357 | 1357 | } |
| 1358 | 1358 | $texte = texte_backend($texte); |
| 1359 | 1359 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | # un message pour abs_url |
| 1389 | 1389 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1390 | 1390 | $url = trim($url); |
| 1391 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1391 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1392 | 1392 | |
| 1393 | 1393 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1394 | 1394 | } |
@@ -1595,7 +1595,7 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | $debut = ''; |
| 1597 | 1597 | $suite = $texte; |
| 1598 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1598 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1599 | 1599 | $debut .= substr($suite, 0, $t - 1); |
| 1600 | 1600 | $suite = substr($suite, $t); |
| 1601 | 1601 | $car = substr($suite, 0, 1); |
@@ -1613,7 +1613,7 @@ discard block |
||
| 1613 | 1613 | $suite = substr($suite, strlen($regs[0])); |
| 1614 | 1614 | } |
| 1615 | 1615 | } |
| 1616 | - $texte = $debut . $suite; |
|
| 1616 | + $texte = $debut.$suite; |
|
| 1617 | 1617 | |
| 1618 | 1618 | if ($collecteurModeles) { |
| 1619 | 1619 | $texte = $collecteurModeles->retablir($texte); |
@@ -1621,7 +1621,7 @@ discard block |
||
| 1621 | 1621 | |
| 1622 | 1622 | $texte = echappe_retour($texte); |
| 1623 | 1623 | |
| 1624 | - return $texte . $fin; |
|
| 1624 | + return $texte.$fin; |
|
| 1625 | 1625 | } |
| 1626 | 1626 | |
| 1627 | 1627 | |
@@ -1897,7 +1897,7 @@ discard block |
||
| 1897 | 1897 | if (is_array($balise)) { |
| 1898 | 1898 | array_walk( |
| 1899 | 1899 | $balise, |
| 1900 | - function (&$a, $key, $t) { |
|
| 1900 | + function(&$a, $key, $t) { |
|
| 1901 | 1901 | $a = extraire_attribut($a, $t); |
| 1902 | 1902 | }, |
| 1903 | 1903 | $attribut |
@@ -1995,14 +1995,14 @@ discard block |
||
| 1995 | 1995 | |
| 1996 | 1996 | if ($old !== null) { |
| 1997 | 1997 | // Remplacer l'ancien attribut du meme nom |
| 1998 | - $balise = $r[1] . $insert . $r[5]; |
|
| 1998 | + $balise = $r[1].$insert.$r[5]; |
|
| 1999 | 1999 | } else { |
| 2000 | 2000 | // preferer une balise " />" (comme <img />) |
| 2001 | 2001 | if (preg_match(',/>,', $balise)) { |
| 2002 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2002 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2003 | 2003 | } // sinon une balise <a ...> ... </a> |
| 2004 | 2004 | else { |
| 2005 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2005 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2006 | 2006 | } |
| 2007 | 2007 | } |
| 2008 | 2008 | |
@@ -2057,7 +2057,7 @@ discard block |
||
| 2057 | 2057 | if ( |
| 2058 | 2058 | $class_courante |
| 2059 | 2059 | and str_contains($class_courante, (string) $c) |
| 2060 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2060 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2061 | 2061 | ) { |
| 2062 | 2062 | $is_class_presente = true; |
| 2063 | 2063 | } |
@@ -2065,12 +2065,12 @@ discard block |
||
| 2065 | 2065 | in_array($operation, ['ajouter', 'commuter']) |
| 2066 | 2066 | and !$is_class_presente |
| 2067 | 2067 | ) { |
| 2068 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2068 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2069 | 2069 | } elseif ( |
| 2070 | 2070 | in_array($operation, ['supprimer', 'commuter']) |
| 2071 | 2071 | and $is_class_presente |
| 2072 | 2072 | ) { |
| 2073 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2073 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2074 | 2074 | } |
| 2075 | 2075 | } |
| 2076 | 2076 | |
@@ -2133,7 +2133,7 @@ discard block |
||
| 2133 | 2133 | // Quelques fonctions de calcul arithmetique |
| 2134 | 2134 | // |
| 2135 | 2135 | function floatstr($a) { |
| 2136 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2136 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2137 | 2137 | } |
| 2138 | 2138 | function strize($f, $a, $b) { |
| 2139 | 2139 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2274,13 +2274,13 @@ discard block |
||
| 2274 | 2274 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2275 | 2275 | define('_TAGS_NOM_AUTEUR', ''); |
| 2276 | 2276 | } |
| 2277 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2277 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2278 | 2278 | foreach ($tags_acceptes as $tag) { |
| 2279 | 2279 | if (strlen($tag)) { |
| 2280 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2281 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2282 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2283 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2280 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2281 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2282 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2283 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2284 | 2284 | } |
| 2285 | 2285 | } |
| 2286 | 2286 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2400,10 +2400,10 @@ discard block |
||
| 2400 | 2400 | $fichier = basename($url); |
| 2401 | 2401 | |
| 2402 | 2402 | return '<a rel="enclosure"' |
| 2403 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2404 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2405 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2406 | - . '>' . $fichier . '</a>'; |
|
| 2403 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2404 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2405 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2406 | + . '>'.$fichier.'</a>'; |
|
| 2407 | 2407 | } |
| 2408 | 2408 | |
| 2409 | 2409 | /** |
@@ -2431,9 +2431,9 @@ discard block |
||
| 2431 | 2431 | } # vieux data |
| 2432 | 2432 | $fichier = basename($url); |
| 2433 | 2433 | $enclosures[] = '<enclosure' |
| 2434 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2435 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2436 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2434 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2435 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2436 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2437 | 2437 | . ' />'; |
| 2438 | 2438 | } |
| 2439 | 2439 | } |
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2460 | 2460 | $subjects .= '<dc:subject>' |
| 2461 | 2461 | . texte_backend(textebrut($e)) |
| 2462 | - . '</dc:subject>' . "\n"; |
|
| 2462 | + . '</dc:subject>'."\n"; |
|
| 2463 | 2463 | } |
| 2464 | 2464 | } |
| 2465 | 2465 | |
@@ -2495,7 +2495,7 @@ discard block |
||
| 2495 | 2495 | if (is_array($texte)) { |
| 2496 | 2496 | array_walk( |
| 2497 | 2497 | $texte, |
| 2498 | - function (&$a, $key, $t) { |
|
| 2498 | + function(&$a, $key, $t) { |
|
| 2499 | 2499 | $a = extraire_balise($a, $t); |
| 2500 | 2500 | }, |
| 2501 | 2501 | $tag |
@@ -2543,7 +2543,7 @@ discard block |
||
| 2543 | 2543 | if (is_array($texte)) { |
| 2544 | 2544 | array_walk( |
| 2545 | 2545 | $texte, |
| 2546 | - function (&$a, $key, $t) { |
|
| 2546 | + function(&$a, $key, $t) { |
|
| 2547 | 2547 | $a = extraire_balises($a, $t); |
| 2548 | 2548 | }, |
| 2549 | 2549 | $tag |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | if ($fond != '404') { |
| 2677 | 2677 | $contexte = array_shift($p); |
| 2678 | 2678 | $contexte['page'] = $fond; |
| 2679 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2679 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2680 | 2680 | } |
| 2681 | 2681 | } |
| 2682 | 2682 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2731,9 +2731,9 @@ discard block |
||
| 2731 | 2731 | . '"' |
| 2732 | 2732 | . (is_null($val) |
| 2733 | 2733 | ? '' |
| 2734 | - : ' value="' . entites_html($val) . '"' |
|
| 2734 | + : ' value="'.entites_html($val).'"' |
|
| 2735 | 2735 | ) |
| 2736 | - . ' type="hidden"' . "\n/>"; |
|
| 2736 | + . ' type="hidden"'."\n/>"; |
|
| 2737 | 2737 | } |
| 2738 | 2738 | |
| 2739 | 2739 | return join('', $hidden); |
@@ -2843,7 +2843,7 @@ discard block |
||
| 2843 | 2843 | |
| 2844 | 2844 | return preg_replace_callback( |
| 2845 | 2845 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2846 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2846 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2847 | 2847 | $contenu |
| 2848 | 2848 | ); |
| 2849 | 2849 | } |
@@ -2904,14 +2904,14 @@ discard block |
||
| 2904 | 2904 | ) { |
| 2905 | 2905 | $distant = true; |
| 2906 | 2906 | $cssf = parse_url($css); |
| 2907 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2907 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2908 | 2908 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2909 | 2909 | } else { |
| 2910 | 2910 | $distant = false; |
| 2911 | 2911 | $cssf = $css; |
| 2912 | 2912 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2913 | 2913 | //propose (rien a faire dans ce cas) |
| 2914 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2914 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2915 | 2915 | if (@file_exists($f)) { |
| 2916 | 2916 | return $f; |
| 2917 | 2917 | } |
@@ -2921,7 +2921,7 @@ discard block |
||
| 2921 | 2921 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2922 | 2922 | $f = $dir_var |
| 2923 | 2923 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2924 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2924 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2925 | 2925 | |
| 2926 | 2926 | // la css peut etre distante (url absolue !) |
| 2927 | 2927 | if ($distant) { |
@@ -2967,8 +2967,8 @@ discard block |
||
| 2967 | 2967 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2968 | 2968 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2969 | 2969 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2970 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 2971 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 2970 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 2971 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 2972 | 2972 | } |
| 2973 | 2973 | $src[] = $regs[0][$k]; |
| 2974 | 2974 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3017,7 +3017,7 @@ discard block |
||
| 3017 | 3017 | |
| 3018 | 3018 | $f = basename($css, '.css'); |
| 3019 | 3019 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3020 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3020 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3021 | 3021 | . '.css'; |
| 3022 | 3022 | |
| 3023 | 3023 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | if ($url_absolue_css == $css) { |
| 3028 | 3028 | if ( |
| 3029 | 3029 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3030 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3030 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3031 | 3031 | ) { |
| 3032 | 3032 | include_spip('inc/distant'); |
| 3033 | 3033 | $contenu = recuperer_url($css); |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | $expression = str_replace('\/', '/', $expression); |
| 3140 | 3140 | $expression = str_replace('/', '\/', $expression); |
| 3141 | 3141 | |
| 3142 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3142 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3143 | 3143 | if (isset($r[$capte])) { |
| 3144 | 3144 | return $r[$capte]; |
| 3145 | 3145 | } else { |
@@ -3177,7 +3177,7 @@ discard block |
||
| 3177 | 3177 | $expression = str_replace('\/', '/', $expression); |
| 3178 | 3178 | $expression = str_replace('/', '\/', $expression); |
| 3179 | 3179 | |
| 3180 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3180 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3181 | 3181 | } |
| 3182 | 3182 | |
| 3183 | 3183 | |
@@ -3196,7 +3196,7 @@ discard block |
||
| 3196 | 3196 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3197 | 3197 | |
| 3198 | 3198 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3199 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3199 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3200 | 3200 | |
| 3201 | 3201 | if ( |
| 3202 | 3202 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3210,7 +3210,7 @@ discard block |
||
| 3210 | 3210 | if (!isset($doublons['documents'])) { |
| 3211 | 3211 | $doublons['documents'] = ''; |
| 3212 | 3212 | } |
| 3213 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3213 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3214 | 3214 | } |
| 3215 | 3215 | |
| 3216 | 3216 | return $letexte; |
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | if ($env) { |
| 3268 | 3268 | foreach ($env as $i => $j) { |
| 3269 | 3269 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3270 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3270 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3271 | 3271 | } |
| 3272 | 3272 | } |
| 3273 | 3273 | } |
@@ -3306,7 +3306,7 @@ discard block |
||
| 3306 | 3306 | if ($env) { |
| 3307 | 3307 | foreach ($env as $i => $j) { |
| 3308 | 3308 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3309 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3309 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3310 | 3310 | } |
| 3311 | 3311 | } |
| 3312 | 3312 | } |
@@ -3380,10 +3380,10 @@ discard block |
||
| 3380 | 3380 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3381 | 3381 | if ( |
| 3382 | 3382 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3383 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3383 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3384 | 3384 | and file_exists($variante_svg_generique) |
| 3385 | 3385 | ) { |
| 3386 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3386 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3387 | 3387 | $img_file = $variante_svg_size; |
| 3388 | 3388 | } |
| 3389 | 3389 | else { |
@@ -3441,7 +3441,7 @@ discard block |
||
| 3441 | 3441 | return ''; |
| 3442 | 3442 | } |
| 3443 | 3443 | } |
| 3444 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3444 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3445 | 3445 | } |
| 3446 | 3446 | |
| 3447 | 3447 | if (file_exists($img_file)) { |
@@ -3451,14 +3451,14 @@ discard block |
||
| 3451 | 3451 | $alt = ''; |
| 3452 | 3452 | } |
| 3453 | 3453 | elseif ($alt or $alt === '') { |
| 3454 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3454 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3455 | 3455 | } |
| 3456 | 3456 | else { |
| 3457 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3457 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3458 | 3458 | } |
| 3459 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3460 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3461 | - . ' ' . ltrim($atts) |
|
| 3459 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3460 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3461 | + . ' '.ltrim($atts) |
|
| 3462 | 3462 | . ' />'; |
| 3463 | 3463 | } |
| 3464 | 3464 | |
@@ -3472,10 +3472,10 @@ discard block |
||
| 3472 | 3472 | */ |
| 3473 | 3473 | function http_style_background($img, $att = '', $size = null) { |
| 3474 | 3474 | if ($size and is_numeric($size)) { |
| 3475 | - $size = trim($size) . 'px'; |
|
| 3475 | + $size = trim($size).'px'; |
|
| 3476 | 3476 | } |
| 3477 | - return " style='background" . |
|
| 3478 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3477 | + return " style='background". |
|
| 3478 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3479 | 3479 | . ($size ? "background-size:{$size};" : '') |
| 3480 | 3480 | . "'"; |
| 3481 | 3481 | } |
@@ -3590,7 +3590,7 @@ discard block |
||
| 3590 | 3590 | $img = http_img_pack( |
| 3591 | 3591 | $img, |
| 3592 | 3592 | $alt, |
| 3593 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3593 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3594 | 3594 | '', |
| 3595 | 3595 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3596 | 3596 | ); |
@@ -3675,7 +3675,7 @@ discard block |
||
| 3675 | 3675 | $balise_svg_source = $balise_svg; |
| 3676 | 3676 | |
| 3677 | 3677 | // entete XML à supprimer |
| 3678 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3678 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3679 | 3679 | |
| 3680 | 3680 | // IE est toujours mon ami |
| 3681 | 3681 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3693,9 +3693,9 @@ discard block |
||
| 3693 | 3693 | // regler le alt |
| 3694 | 3694 | if ($alt) { |
| 3695 | 3695 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3696 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3696 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3697 | 3697 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3698 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3698 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3699 | 3699 | $balise_svg .= $title; |
| 3700 | 3700 | } |
| 3701 | 3701 | else { |
@@ -3743,7 +3743,7 @@ discard block |
||
| 3743 | 3743 | if (is_array($tableau)) { |
| 3744 | 3744 | foreach ($tableau as $k => $v) { |
| 3745 | 3745 | $res = recuperer_fond( |
| 3746 | - 'modeles/' . $modele, |
|
| 3746 | + 'modeles/'.$modele, |
|
| 3747 | 3747 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3748 | 3748 | ); |
| 3749 | 3749 | $texte .= $res; |
@@ -3928,7 +3928,7 @@ discard block |
||
| 3928 | 3928 | } |
| 3929 | 3929 | |
| 3930 | 3930 | $c = serialize($c); |
| 3931 | - $cle = calculer_cle_action($form . $c); |
|
| 3931 | + $cle = calculer_cle_action($form.$c); |
|
| 3932 | 3932 | $c = "$cle:$c"; |
| 3933 | 3933 | |
| 3934 | 3934 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3986,15 +3986,15 @@ discard block |
||
| 3986 | 3986 | } |
| 3987 | 3987 | // toujours encoder l'url source dans le bloc ajax |
| 3988 | 3988 | $r = self(); |
| 3989 | - $r = ' data-origin="' . $r . '"'; |
|
| 3989 | + $r = ' data-origin="'.$r.'"'; |
|
| 3990 | 3990 | $class = 'ajaxbloc'; |
| 3991 | 3991 | if ($ajaxid and is_string($ajaxid)) { |
| 3992 | 3992 | // ajaxid est normalement conforme a un nom de classe css |
| 3993 | 3993 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3994 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3994 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3995 | 3995 | } |
| 3996 | 3996 | |
| 3997 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3997 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3998 | 3998 | } |
| 3999 | 3999 | |
| 4000 | 4000 | /** |
@@ -4038,7 +4038,7 @@ discard block |
||
| 4038 | 4038 | $cle = substr($c, 0, $p); |
| 4039 | 4039 | $c = substr($c, $p + 1); |
| 4040 | 4040 | |
| 4041 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4041 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4042 | 4042 | $env = @unserialize($c); |
| 4043 | 4043 | return $env; |
| 4044 | 4044 | } |
@@ -4159,13 +4159,13 @@ discard block |
||
| 4159 | 4159 | } |
| 4160 | 4160 | } |
| 4161 | 4161 | } |
| 4162 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4162 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4163 | 4163 | } else { |
| 4164 | 4164 | $bal = 'a'; |
| 4165 | 4165 | $att = "href='$url'" |
| 4166 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4167 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4168 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4166 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4167 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4168 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4169 | 4169 | . $evt; |
| 4170 | 4170 | } |
| 4171 | 4171 | if ($libelle === null) { |
@@ -4304,7 +4304,7 @@ discard block |
||
| 4304 | 4304 | |
| 4305 | 4305 | // Icône |
| 4306 | 4306 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4307 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4307 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4308 | 4308 | |
| 4309 | 4309 | // Markup final |
| 4310 | 4310 | if ($type == 'lien') { |
@@ -4579,20 +4579,20 @@ discard block |
||
| 4579 | 4579 | $class_form = 'ajax'; |
| 4580 | 4580 | $class = str_replace('ajax', '', $class); |
| 4581 | 4581 | } |
| 4582 | - $class_btn = 'submit ' . trim($class); |
|
| 4582 | + $class_btn = 'submit '.trim($class); |
|
| 4583 | 4583 | |
| 4584 | 4584 | if ($confirm) { |
| 4585 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4585 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4586 | 4586 | if ($callback) { |
| 4587 | 4587 | $callback = "$confirm?($callback):false"; |
| 4588 | 4588 | } else { |
| 4589 | 4589 | $callback = $confirm; |
| 4590 | 4590 | } |
| 4591 | 4591 | } |
| 4592 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4592 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4593 | 4593 | $title = $title ? " title='$title'" : ''; |
| 4594 | 4594 | |
| 4595 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4595 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4596 | 4596 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4597 | 4597 | } |
| 4598 | 4598 | |
@@ -4657,14 +4657,14 @@ discard block |
||
| 4657 | 4657 | $champ_titre = ''; |
| 4658 | 4658 | if ($demande_titre) { |
| 4659 | 4659 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4660 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4660 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4661 | 4661 | } |
| 4662 | 4662 | include_spip('base/abstract_sql'); |
| 4663 | 4663 | include_spip('base/connect_sql'); |
| 4664 | 4664 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4665 | - '*' . $champ_titre, |
|
| 4665 | + '*'.$champ_titre, |
|
| 4666 | 4666 | $desc['table_sql'], |
| 4667 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4667 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4668 | 4668 | ); |
| 4669 | 4669 | |
| 4670 | 4670 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4757,8 +4757,7 @@ discard block |
||
| 4757 | 4757 | if (isset($ligne_sql['chapo'])) { |
| 4758 | 4758 | $chapo = $ligne_sql['chapo']; |
| 4759 | 4759 | $texte = strlen($descriptif) ? |
| 4760 | - '' : |
|
| 4761 | - "$chapo \n\n $texte"; |
|
| 4760 | + '' : "$chapo \n\n $texte"; |
|
| 4762 | 4761 | } |
| 4763 | 4762 | |
| 4764 | 4763 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4833,7 +4832,7 @@ discard block |
||
| 4833 | 4832 | return $texte; |
| 4834 | 4833 | } |
| 4835 | 4834 | |
| 4836 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4835 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4837 | 4836 | |
| 4838 | 4837 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4839 | 4838 | if (test_espace_prive()) { |
@@ -4872,7 +4871,7 @@ discard block |
||
| 4872 | 4871 | } |
| 4873 | 4872 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4874 | 4873 | |
| 4875 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4874 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4876 | 4875 | } |
| 4877 | 4876 | |
| 4878 | 4877 | /** |
@@ -4898,10 +4897,10 @@ discard block |
||
| 4898 | 4897 | function wrap($texte, $wrap) { |
| 4899 | 4898 | $balises = extraire_balises($wrap); |
| 4900 | 4899 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4901 | - $texte = $wrap . $texte; |
|
| 4900 | + $texte = $wrap.$texte; |
|
| 4902 | 4901 | $regs = array_reverse($regs[1]); |
| 4903 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4904 | - $texte = $texte . $wrap; |
|
| 4902 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4903 | + $texte = $texte.$wrap; |
|
| 4905 | 4904 | } |
| 4906 | 4905 | |
| 4907 | 4906 | return $texte; |
@@ -4932,7 +4931,7 @@ discard block |
||
| 4932 | 4931 | |
| 4933 | 4932 | // caster $u en array si besoin |
| 4934 | 4933 | if (is_object($u)) { |
| 4935 | - $u = (array)$u; |
|
| 4934 | + $u = (array) $u; |
|
| 4936 | 4935 | } |
| 4937 | 4936 | |
| 4938 | 4937 | if (is_array($u)) { |
@@ -4954,7 +4953,7 @@ discard block |
||
| 4954 | 4953 | // sinon on passe a la ligne et on indente |
| 4955 | 4954 | $i_str = str_pad('', $indent, ' '); |
| 4956 | 4955 | foreach ($u as $k => $v) { |
| 4957 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4956 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4958 | 4957 | } |
| 4959 | 4958 | |
| 4960 | 4959 | return $out; |
@@ -5008,7 +5007,7 @@ discard block |
||
| 5008 | 5007 | * @return string |
| 5009 | 5008 | */ |
| 5010 | 5009 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5011 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5010 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5012 | 5011 | $icone = chemin_image($icone); |
| 5013 | 5012 | $balise_img = charger_filtre('balise_img'); |
| 5014 | 5013 | |
@@ -5034,7 +5033,7 @@ discard block |
||
| 5034 | 5033 | */ |
| 5035 | 5034 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5036 | 5035 | $chaine = explode(':', $chaine); |
| 5037 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5036 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5038 | 5037 | return $t; |
| 5039 | 5038 | } |
| 5040 | 5039 | $chaine = implode(':', $chaine); |
@@ -5100,7 +5099,7 @@ discard block |
||
| 5100 | 5099 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5101 | 5100 | |
| 5102 | 5101 | // calculer le nom de la css |
| 5103 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5102 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5104 | 5103 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5105 | 5104 | $contexte_implicite = calculer_contexte_implicite(); |
| 5106 | 5105 | |
@@ -5108,14 +5107,14 @@ discard block |
||
| 5108 | 5107 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5109 | 5108 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5110 | 5109 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5111 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5110 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5112 | 5111 | } |
| 5113 | 5112 | else { |
| 5114 | 5113 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5115 | 5114 | ksort($contexte); |
| 5116 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5115 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5117 | 5116 | } |
| 5118 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5117 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5119 | 5118 | |
| 5120 | 5119 | // mettre a jour le fichier si il n'existe pas |
| 5121 | 5120 | // ou trop ancien |
@@ -5123,8 +5122,8 @@ discard block |
||
| 5123 | 5122 | // et recopie sur le fichier cible uniquement si il change |
| 5124 | 5123 | if ( |
| 5125 | 5124 | !file_exists($filename) |
| 5126 | - or !file_exists($filename . '.last') |
|
| 5127 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5125 | + or !file_exists($filename.'.last') |
|
| 5126 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5128 | 5127 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5129 | 5128 | ) { |
| 5130 | 5129 | $contenu = $cache['texte']; |
@@ -5148,10 +5147,10 @@ discard block |
||
| 5148 | 5147 | } |
| 5149 | 5148 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5150 | 5149 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5151 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5150 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5152 | 5151 | } |
| 5153 | 5152 | // et ecrire le fichier si il change |
| 5154 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5153 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5155 | 5154 | } |
| 5156 | 5155 | |
| 5157 | 5156 | return timestamp($filename); |
@@ -5384,7 +5383,7 @@ discard block |
||
| 5384 | 5383 | if ($e > 0 and strlen($mid) > 8) { |
| 5385 | 5384 | $mid = '***...***'; |
| 5386 | 5385 | } |
| 5387 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5386 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5388 | 5387 | } |
| 5389 | 5388 | |
| 5390 | 5389 | |
@@ -5446,7 +5445,7 @@ discard block |
||
| 5446 | 5445 | case 'id': |
| 5447 | 5446 | case 'anchor': |
| 5448 | 5447 | if (preg_match(',^\d,', $texte)) { |
| 5449 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5448 | + $texte = substr($type, 0, 1).$texte; |
|
| 5450 | 5449 | } |
| 5451 | 5450 | } |
| 5452 | 5451 | |
@@ -5456,9 +5455,9 @@ discard block |
||
| 5456 | 5455 | |
| 5457 | 5456 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5458 | 5457 | if (preg_match(',^\d,', $texte)) { |
| 5459 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5458 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5460 | 5459 | } |
| 5461 | - $texte .= $separateur . md5($original); |
|
| 5460 | + $texte .= $separateur.md5($original); |
|
| 5462 | 5461 | $texte = substr($texte, 0, $longueur_mini); |
| 5463 | 5462 | } |
| 5464 | 5463 | |
@@ -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 | /** |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | translitteration($ancre) |
| 694 | 694 | ); |
| 695 | 695 | } |
| 696 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 696 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | * @return bool |
| 810 | 810 | */ |
| 811 | 811 | function test_plugin_actif($plugin) { |
| 812 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 812 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | /** |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $value = interdire_scripts($value, -1); |
| 942 | 942 | } |
| 943 | 943 | if (!empty($options['class'])) { |
| 944 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 944 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 945 | 945 | } |
| 946 | 946 | $text = str_replace("@$name@", $value, $text); |
| 947 | 947 | unset($args[$name]); |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | // Si des variables n'ont pas ete inserees, le signaler |
| 951 | 951 | // (chaines de langues pas a jour) |
| 952 | 952 | if ($args) { |
| 953 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 953 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 954 | 954 | } |
| 955 | 955 | } |
| 956 | 956 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | function joli_repertoire($rep) { |
| 975 | 975 | $a = substr($rep, 0, 1); |
| 976 | 976 | if ($a <> '.' and $a <> '/') { |
| 977 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 977 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 978 | 978 | } |
| 979 | 979 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 980 | 980 | |
@@ -1028,7 +1028,7 @@ discard block |
||
| 1028 | 1028 | $p -= ($x * 1000); |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1031 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | if ($taches and count($taches) and !spip_connect()) { |
| 1096 | 1096 | return false; |
| 1097 | 1097 | } |
| 1098 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1098 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1099 | 1099 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1100 | 1100 | return $genie($taches); |
| 1101 | 1101 | } |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | |
| 1200 | 1200 | if ($queue_next_job_time == -1) { |
| 1201 | 1201 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1202 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1202 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1203 | 1203 | } |
| 1204 | 1204 | // utiliser un cache memoire si dispo |
| 1205 | 1205 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1268,8 +1268,8 @@ discard block |
||
| 1268 | 1268 | $src = ''; |
| 1269 | 1269 | } |
| 1270 | 1270 | if ($script) { |
| 1271 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1272 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1271 | + $script = ("/*<![CDATA[*/\n". |
|
| 1272 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1273 | 1273 | '/*]]>*/'); |
| 1274 | 1274 | } |
| 1275 | 1275 | if ($noscript) { |
@@ -1355,13 +1355,13 @@ discard block |
||
| 1355 | 1355 | if ($path_base == null) { |
| 1356 | 1356 | // Chemin standard depuis l'espace public |
| 1357 | 1357 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1358 | - _DIR_RACINE . ':' . |
|
| 1359 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1360 | - _DIR_RACINE . 'prive/:' . |
|
| 1358 | + _DIR_RACINE.':'. |
|
| 1359 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1360 | + _DIR_RACINE.'prive/:'. |
|
| 1361 | 1361 | _DIR_RESTREINT; |
| 1362 | 1362 | // Ajouter squelettes/ |
| 1363 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1364 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1363 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1364 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1365 | 1365 | } |
| 1366 | 1366 | foreach (explode(':', $path) as $dir) { |
| 1367 | 1367 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | // Et le(s) dossier(s) des squelettes nommes |
| 1374 | 1374 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1375 | 1375 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1376 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1376 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1377 | 1377 | } |
| 1378 | 1378 | } |
| 1379 | 1379 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | |
| 1385 | 1385 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1386 | 1386 | $tete = ''; |
| 1387 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1387 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1388 | 1388 | $tete = array_shift($path_base); |
| 1389 | 1389 | } |
| 1390 | 1390 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1405,7 +1405,7 @@ discard block |
||
| 1405 | 1405 | // Et le(s) dossier(s) des squelettes nommes |
| 1406 | 1406 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1407 | 1407 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1408 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1408 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1409 | 1409 | } |
| 1410 | 1410 | } |
| 1411 | 1411 | |
@@ -1476,14 +1476,14 @@ discard block |
||
| 1476 | 1476 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1477 | 1477 | if ( |
| 1478 | 1478 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1479 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1479 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1480 | 1480 | and $f = find_in_theme("$file_svg_generique") |
| 1481 | 1481 | ) { |
| 1482 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1482 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1483 | 1483 | return $themefiles["$subdir$file"] = $fsize; |
| 1484 | 1484 | } |
| 1485 | 1485 | else { |
| 1486 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1486 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1487 | 1487 | } |
| 1488 | 1488 | } |
| 1489 | 1489 | |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | return $themefiles["$subdir$file"] = $f; |
| 1494 | 1494 | } |
| 1495 | 1495 | } |
| 1496 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1496 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1497 | 1497 | |
| 1498 | 1498 | return $themefiles["$subdir$file"] = ''; |
| 1499 | 1499 | } |
@@ -1601,8 +1601,8 @@ discard block |
||
| 1601 | 1601 | return false; |
| 1602 | 1602 | } |
| 1603 | 1603 | if ($include and !isset($inc[$dirname][$file])) { |
| 1604 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1605 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1604 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1605 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 1608 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1615,14 +1615,14 @@ discard block |
||
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | foreach (creer_chemin() as $dir) { |
| 1618 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1619 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1618 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1619 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1620 | 1620 | } |
| 1621 | 1621 | if ($dirs[$a]) { |
| 1622 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1622 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1623 | 1623 | if ($include and !isset($inc[$dirname][$file])) { |
| 1624 | - include_once _ROOT_CWD . $a; |
|
| 1625 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1624 | + include_once _ROOT_CWD.$a; |
|
| 1625 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1626 | 1626 | } |
| 1627 | 1627 | if (!defined('_SAUVER_CHEMIN')) { |
| 1628 | 1628 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | define('_SAUVER_CHEMIN', true); |
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1635 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1636 | 1636 | } |
| 1637 | 1637 | } |
| 1638 | 1638 | } |
@@ -1658,7 +1658,7 @@ discard block |
||
| 1658 | 1658 | define('_SAUVER_CHEMIN', true); |
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1661 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1662 | 1662 | } |
| 1663 | 1663 | |
| 1664 | 1664 | function clear_path_cache() { |
@@ -1728,12 +1728,12 @@ discard block |
||
| 1728 | 1728 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1729 | 1729 | // on a pas encore inclus flock.php |
| 1730 | 1730 | if (!function_exists('preg_files')) { |
| 1731 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1731 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | 1734 | // Parcourir le chemin |
| 1735 | 1735 | foreach (creer_chemin() as $d) { |
| 1736 | - $f = $d . $dir; |
|
| 1736 | + $f = $d.$dir; |
|
| 1737 | 1737 | if (@is_dir($f)) { |
| 1738 | 1738 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1739 | 1739 | foreach ($liste as $chemin) { |
@@ -1783,9 +1783,9 @@ discard block |
||
| 1783 | 1783 | if ($type === 'defaut') { |
| 1784 | 1784 | $objet = objet_type($quoi); |
| 1785 | 1785 | if ( |
| 1786 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1786 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1787 | 1787 | // deprecated |
| 1788 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1788 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1789 | 1789 | ) { |
| 1790 | 1790 | return $f; |
| 1791 | 1791 | } |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | // inclure le module d'url |
| 1801 | - include_spip('urls/' . $url_type); |
|
| 1801 | + include_spip('urls/'.$url_type); |
|
| 1802 | 1802 | |
| 1803 | 1803 | switch ($quoi) { |
| 1804 | 1804 | 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 | } |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | !empty($_SERVER['QUERY_STRING']) |
| 2128 | 2128 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2129 | 2129 | ) { |
| 2130 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2130 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | } |
| 2133 | 2133 | } |
@@ -2165,9 +2165,9 @@ discard block |
||
| 2165 | 2165 | array_shift($myself); |
| 2166 | 2166 | $myself = implode('/', $myself); |
| 2167 | 2167 | } |
| 2168 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2168 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2169 | 2169 | |
| 2170 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2170 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2171 | 2171 | |
| 2172 | 2172 | return $url; |
| 2173 | 2173 | } |
@@ -2206,16 +2206,16 @@ discard block |
||
| 2206 | 2206 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2207 | 2207 | $script ??= ''; |
| 2208 | 2208 | if (!$rel) { |
| 2209 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2209 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2210 | 2210 | } else { |
| 2211 | 2211 | if (!is_string($rel)) { |
| 2212 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2212 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2213 | 2213 | } |
| 2214 | 2214 | } |
| 2215 | 2215 | |
| 2216 | 2216 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2217 | 2217 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2218 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2218 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2219 | 2219 | } elseif ($args) { |
| 2220 | 2220 | $args = "?$args"; |
| 2221 | 2221 | } |
@@ -2223,7 +2223,7 @@ discard block |
||
| 2223 | 2223 | $args .= "#$ancre"; |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2226 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | 2229 | // |
@@ -2305,10 +2305,10 @@ discard block |
||
| 2305 | 2305 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2306 | 2306 | } |
| 2307 | 2307 | if ($args) { |
| 2308 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2308 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2309 | 2309 | } |
| 2310 | 2310 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2311 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2311 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2312 | 2312 | } |
| 2313 | 2313 | |
| 2314 | 2314 | if (!$no_entities) { |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | |
| 2321 | 2321 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2322 | 2322 | |
| 2323 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2323 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2324 | 2324 | } |
| 2325 | 2325 | |
| 2326 | 2326 | // Pour les formulaires en methode POST, |
@@ -2355,8 +2355,7 @@ discard block |
||
| 2355 | 2355 | . "><div>\n" |
| 2356 | 2356 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2357 | 2357 | . $corps |
| 2358 | - . (!$submit ? '' : |
|
| 2359 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2358 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2360 | 2359 | . "</div></form>\n"; |
| 2361 | 2360 | } |
| 2362 | 2361 | |
@@ -2381,14 +2380,14 @@ discard block |
||
| 2381 | 2380 | ? generer_url_ecrire(_request('exec')) |
| 2382 | 2381 | : generer_url_public(); |
| 2383 | 2382 | |
| 2384 | - return "\n<form action='" . |
|
| 2385 | - $h . |
|
| 2386 | - "'" . |
|
| 2387 | - $atts . |
|
| 2388 | - ">\n" . |
|
| 2389 | - '<div>' . |
|
| 2390 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2391 | - $corps . |
|
| 2383 | + return "\n<form action='". |
|
| 2384 | + $h. |
|
| 2385 | + "'". |
|
| 2386 | + $atts. |
|
| 2387 | + ">\n". |
|
| 2388 | + '<div>'. |
|
| 2389 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2390 | + $corps. |
|
| 2392 | 2391 | '</div></form>'; |
| 2393 | 2392 | } |
| 2394 | 2393 | |
@@ -2416,7 +2415,7 @@ discard block |
||
| 2416 | 2415 | : generer_url_public('', '', false, false); |
| 2417 | 2416 | $url = parametre_url($url, 'action', $script); |
| 2418 | 2417 | if ($args) { |
| 2419 | - $url .= quote_amp('&' . $args); |
|
| 2418 | + $url .= quote_amp('&'.$args); |
|
| 2420 | 2419 | } |
| 2421 | 2420 | |
| 2422 | 2421 | if ($no_entities) { |
@@ -2450,9 +2449,9 @@ discard block |
||
| 2450 | 2449 | } |
| 2451 | 2450 | $url = |
| 2452 | 2451 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2453 | - . $script . '/' |
|
| 2452 | + . $script.'/' |
|
| 2454 | 2453 | . ($path ? trim($path, '/') : '') |
| 2455 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2454 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2456 | 2455 | |
| 2457 | 2456 | if ($no_entities) { |
| 2458 | 2457 | $url = str_replace('&', '&', $url); |
@@ -2501,22 +2500,22 @@ discard block |
||
| 2501 | 2500 | |
| 2502 | 2501 | // le nom du repertoire plugins/ activables/desactivables |
| 2503 | 2502 | if (!defined('_DIR_PLUGINS')) { |
| 2504 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2503 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2505 | 2504 | } |
| 2506 | 2505 | |
| 2507 | 2506 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2508 | 2507 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2509 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2508 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2510 | 2509 | } |
| 2511 | 2510 | |
| 2512 | 2511 | // le nom du repertoire des librairies |
| 2513 | 2512 | if (!defined('_DIR_LIB')) { |
| 2514 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2513 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2515 | 2514 | } |
| 2516 | 2515 | |
| 2517 | 2516 | // répertoire des libs via Composer |
| 2518 | 2517 | if (!defined('_DIR_VENDOR')) { |
| 2519 | - define('_DIR_VENDOR', _DIR_RACINE . 'vendor/'); |
|
| 2518 | + define('_DIR_VENDOR', _DIR_RACINE.'vendor/'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | |
| 2522 | 2521 | if (!defined('_DIR_IMG')) { |
@@ -2526,29 +2525,29 @@ discard block |
||
| 2526 | 2525 | define('_DIR_LOGOS', $pa); |
| 2527 | 2526 | } |
| 2528 | 2527 | if (!defined('_DIR_IMG_ICONES')) { |
| 2529 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2528 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2530 | 2529 | } |
| 2531 | 2530 | |
| 2532 | 2531 | if (!defined('_DIR_DUMP')) { |
| 2533 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2532 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_SESSIONS')) { |
| 2536 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2535 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_TRANSFERT')) { |
| 2539 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2538 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_DIR_CACHE')) { |
| 2542 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2541 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2543 | 2542 | } |
| 2544 | 2543 | if (!defined('_DIR_CACHE_XML')) { |
| 2545 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2544 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2546 | 2545 | } |
| 2547 | 2546 | if (!defined('_DIR_SKELS')) { |
| 2548 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2547 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2549 | 2548 | } |
| 2550 | 2549 | if (!defined('_DIR_AIDE')) { |
| 2551 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2550 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2552 | 2551 | } |
| 2553 | 2552 | if (!defined('_DIR_TMP')) { |
| 2554 | 2553 | define('_DIR_TMP', $ti); |
@@ -2577,27 +2576,27 @@ discard block |
||
| 2577 | 2576 | // Declaration des fichiers |
| 2578 | 2577 | |
| 2579 | 2578 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2580 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2579 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2581 | 2580 | } |
| 2582 | 2581 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2583 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2582 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2584 | 2583 | } |
| 2585 | 2584 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2586 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2585 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2587 | 2586 | } |
| 2588 | 2587 | if (!defined('_CACHE_PIPELINES')) { |
| 2589 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2588 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2590 | 2589 | } |
| 2591 | 2590 | if (!defined('_CACHE_CHEMIN')) { |
| 2592 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2591 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2593 | 2592 | } |
| 2594 | 2593 | |
| 2595 | 2594 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2596 | 2595 | if (!defined('_FILE_META')) { |
| 2597 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2596 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2598 | 2597 | } |
| 2599 | 2598 | if (!defined('_DIR_LOG')) { |
| 2600 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2599 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2601 | 2600 | } |
| 2602 | 2601 | if (!defined('_FILE_LOG')) { |
| 2603 | 2602 | define('_FILE_LOG', 'spip'); |
@@ -2614,8 +2613,8 @@ discard block |
||
| 2614 | 2613 | if (!defined('_FILE_CONNECT')) { |
| 2615 | 2614 | define( |
| 2616 | 2615 | '_FILE_CONNECT', |
| 2617 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2618 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2616 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2617 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2619 | 2618 | : false)) |
| 2620 | 2619 | ); |
| 2621 | 2620 | } |
@@ -2627,7 +2626,7 @@ discard block |
||
| 2627 | 2626 | if (!defined('_FILE_CHMOD')) { |
| 2628 | 2627 | define( |
| 2629 | 2628 | '_FILE_CHMOD', |
| 2630 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2629 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2631 | 2630 | : false) |
| 2632 | 2631 | ); |
| 2633 | 2632 | } |
@@ -2640,10 +2639,10 @@ discard block |
||
| 2640 | 2639 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2641 | 2640 | } |
| 2642 | 2641 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2643 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2642 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2644 | 2643 | } |
| 2645 | 2644 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2646 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2645 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2647 | 2646 | } |
| 2648 | 2647 | |
| 2649 | 2648 | // Definition des droits d'acces en ecriture |
@@ -2661,13 +2660,13 @@ discard block |
||
| 2661 | 2660 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2662 | 2661 | } |
| 2663 | 2662 | if (!defined('_ROOT_PLUGINS')) { |
| 2664 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2663 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2665 | 2664 | } |
| 2666 | 2665 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2667 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2666 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2668 | 2667 | } |
| 2669 | 2668 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2670 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2669 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2671 | 2670 | } |
| 2672 | 2671 | |
| 2673 | 2672 | // La taille des Log |
@@ -2704,7 +2703,7 @@ discard block |
||
| 2704 | 2703 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2705 | 2704 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2706 | 2705 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2707 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2706 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2708 | 2707 | |
| 2709 | 2708 | // charger tout de suite le path et son cache |
| 2710 | 2709 | 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 |
@@ -3157,10 +3156,10 @@ discard block |
||
| 3157 | 3156 | **/ |
| 3158 | 3157 | function verifier_visiteur() { |
| 3159 | 3158 | @spip_initialisation_core( |
| 3160 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3161 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3162 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3163 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3159 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3160 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3161 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3162 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3164 | 3163 | ); |
| 3165 | 3164 | |
| 3166 | 3165 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3193,7 +3192,7 @@ discard block |
||
| 3193 | 3192 | } |
| 3194 | 3193 | |
| 3195 | 3194 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3196 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3195 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3197 | 3196 | $session = charger_fonction('session', 'inc'); |
| 3198 | 3197 | if ($session()) { |
| 3199 | 3198 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3273,7 +3272,7 @@ discard block |
||
| 3273 | 3272 | 'definir_session', |
| 3274 | 3273 | $GLOBALS['visiteur_session'] |
| 3275 | 3274 | ? serialize($GLOBALS['visiteur_session']) |
| 3276 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3275 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3277 | 3276 | : '' |
| 3278 | 3277 | ); |
| 3279 | 3278 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3321,8 +3320,8 @@ discard block |
||
| 3321 | 3320 | foreach ($cookies_masques as $k) { |
| 3322 | 3321 | if (!empty($_COOKIE[$k])) { |
| 3323 | 3322 | $cookies_backup[$k] = $_COOKIE[$k]; |
| 3324 | - $_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3325 | - $_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3323 | + $_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3324 | + $_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3326 | 3325 | $_COOKIE[$k] = $mask; |
| 3327 | 3326 | } |
| 3328 | 3327 | } |
@@ -3440,11 +3439,11 @@ discard block |
||
| 3440 | 3439 | $GLOBALS['_INC_PUBLIC']++; |
| 3441 | 3440 | |
| 3442 | 3441 | // fix #4235 |
| 3443 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3442 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3444 | 3443 | |
| 3445 | 3444 | |
| 3446 | 3445 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3447 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3446 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3448 | 3447 | |
| 3449 | 3448 | $page = evaluer_fond($f, $contexte, $connect); |
| 3450 | 3449 | if ($page === '') { |
@@ -3529,7 +3528,7 @@ discard block |
||
| 3529 | 3528 | * @return array|string |
| 3530 | 3529 | */ |
| 3531 | 3530 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3532 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3531 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3533 | 3532 | if (!$pathinfo) { |
| 3534 | 3533 | return $f; |
| 3535 | 3534 | } |