@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | function balise_DOSSIER_SQUELETTE_dist($p) { |
| 359 | 359 | $code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE)); |
| 360 | - $p->code = "_DIR_RACINE . '$code'" . |
|
| 360 | + $p->code = "_DIR_RACINE . '$code'". |
|
| 361 | 361 | $p->interdire_scripts = false; |
| 362 | 362 | |
| 363 | 363 | return $p; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | function balise_SQUELETTE_dist($p) { |
| 378 | 378 | $code = addslashes($p->descr['sourcefile']); |
| 379 | - $p->code = "'$code'" . |
|
| 379 | + $p->code = "'$code'". |
|
| 380 | 380 | $p->interdire_scripts = false; |
| 381 | 381 | |
| 382 | 382 | return $p; |
@@ -428,9 +428,9 @@ discard block |
||
| 428 | 428 | **/ |
| 429 | 429 | function balise_NOM_SITE_dist($p) { |
| 430 | 430 | if (!$p->etoile) { |
| 431 | - $p->code = 'supprimer_numero(calculer_url(' . |
|
| 432 | - champ_sql('url_site', $p) . ',' . |
|
| 433 | - champ_sql('nom_site', $p) . |
|
| 431 | + $p->code = 'supprimer_numero(calculer_url('. |
|
| 432 | + champ_sql('url_site', $p).','. |
|
| 433 | + champ_sql('nom_site', $p). |
|
| 434 | 434 | ", 'titre', \$connect, false))"; |
| 435 | 435 | } else { |
| 436 | 436 | $p->code = champ_sql('nom_site', $p); |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | * Pile complétée par le code à générer |
| 583 | 583 | **/ |
| 584 | 584 | function balise_POPULARITE_ABSOLUE_dist($p) { |
| 585 | - $p->code = 'ceil(' . |
|
| 586 | - champ_sql('popularite', $p) . |
|
| 585 | + $p->code = 'ceil('. |
|
| 586 | + champ_sql('popularite', $p). |
|
| 587 | 587 | ')'; |
| 588 | 588 | $p->interdire_scripts = false; |
| 589 | 589 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); |
| 665 | 665 | ; |
| 666 | 666 | if (($v = interprete_argument_balise(1, $p)) !== null) { |
| 667 | - $p->code = 'table_valeur(' . $p->code . ', ' . $v . ')'; |
|
| 667 | + $p->code = 'table_valeur('.$p->code.', '.$v.')'; |
|
| 668 | 668 | } |
| 669 | 669 | $p->interdire_scripts = true; |
| 670 | 670 | |
@@ -804,16 +804,16 @@ discard block |
||
| 804 | 804 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 805 | 805 | if ($desc = $trouver_table(table_objet_sql($type_objet))) { |
| 806 | 806 | if (isset($desc['field']['descriptif'])) { |
| 807 | - $_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ','; |
|
| 807 | + $_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).','; |
|
| 808 | 808 | } |
| 809 | 809 | if (isset($desc['field']['texte'])) { |
| 810 | - $_ligne .= "'texte' => " . champ_sql('texte', $p) . ','; |
|
| 810 | + $_ligne .= "'texte' => ".champ_sql('texte', $p).','; |
|
| 811 | 811 | } |
| 812 | 812 | if (isset($desc['field']['chapo'])) { |
| 813 | - $_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ','; |
|
| 813 | + $_ligne .= "'chapo' => ".champ_sql('chapo', $p).','; |
|
| 814 | 814 | } |
| 815 | 815 | if (isset($desc['introduction_longueur'])) { |
| 816 | - $_introduction_longueur = "'" . $desc['introduction_longueur'] . "'"; |
|
| 816 | + $_introduction_longueur = "'".$desc['introduction_longueur']."'"; |
|
| 817 | 817 | } |
| 818 | 818 | } |
| 819 | 819 | $_ligne .= ')'; |
@@ -909,10 +909,10 @@ discard block |
||
| 909 | 909 | $p->code = sprintf( |
| 910 | 910 | CODE_RECUPERER_FOND, |
| 911 | 911 | "'modeles/lesauteurs'", |
| 912 | - "array('objet'=>'" . $objet . |
|
| 913 | - "','id_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 914 | - ",'$id_table_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 915 | - ($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) . |
|
| 912 | + "array('objet'=>'".$objet. |
|
| 913 | + "','id_objet' => ".champ_sql($id_table_objet, $p). |
|
| 914 | + ",'$id_table_objet' => ".champ_sql($id_table_objet, $p). |
|
| 915 | + ($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)). |
|
| 916 | 916 | ')', |
| 917 | 917 | "'trim'=>true, 'compil'=>array($c)", |
| 918 | 918 | _q($connect) |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $m = trim($m); |
| 982 | 982 | if ($m != "''") { |
| 983 | 983 | if (!preg_match(',\W,', $m)) { |
| 984 | - $m = $boucle->id_table . ".$m"; |
|
| 984 | + $m = $boucle->id_table.".$m"; |
|
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | $m .= ' AS titre_rang'; |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | $f_pagination = chercher_filtre('pagination'); |
| 1143 | 1143 | $type = $p->boucles[$b]->modificateur['debut_nom']; |
| 1144 | 1144 | $modif = ($type[0] !== "'") ? "'debut'.$type" |
| 1145 | - : ("'debut" . substr($type, 1)); |
|
| 1145 | + : ("'debut".substr($type, 1)); |
|
| 1146 | 1146 | |
| 1147 | 1147 | $p->code = sprintf( |
| 1148 | 1148 | CODE_PAGINATION, |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']]; |
| 1286 | 1286 | erreur_squelette($msg, $p); |
| 1287 | 1287 | } else { |
| 1288 | - $p->code = 'find_in_path((string)' . $arg . ')'; |
|
| 1288 | + $p->code = 'find_in_path((string)'.$arg.')'; |
|
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | $p->interdire_scripts = false; |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']]; |
| 1321 | 1321 | erreur_squelette($msg, $p); |
| 1322 | 1322 | } else { |
| 1323 | - $p->code = 'chemin_image((string)' . $arg . ')'; |
|
| 1323 | + $p->code = 'chemin_image((string)'.$arg.')'; |
|
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | 1326 | $p->interdire_scripts = false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | // cas de #ENV sans argument : on retourne le serialize() du tableau |
| 1375 | 1375 | // une belle fonction [(#ENV|affiche_env)] serait pratique |
| 1376 | 1376 | if ($src) { |
| 1377 | - $p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")'; |
|
| 1377 | + $p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")'; |
|
| 1378 | 1378 | } else { |
| 1379 | 1379 | $p->code = 'serialize($Pile[0]??[])'; |
| 1380 | 1380 | } |
@@ -1427,8 +1427,8 @@ discard block |
||
| 1427 | 1427 | $_sinon = interprete_argument_balise(2, $p); |
| 1428 | 1428 | $_unserialize = sinon(interprete_argument_balise(3, $p), 'false'); |
| 1429 | 1429 | |
| 1430 | - $p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' . |
|
| 1431 | - ($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')"; |
|
| 1430 | + $p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','. |
|
| 1431 | + ($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')"; |
|
| 1432 | 1432 | |
| 1433 | 1433 | return $p; |
| 1434 | 1434 | } |
@@ -1521,7 +1521,7 @@ discard block |
||
| 1521 | 1521 | $err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']]; |
| 1522 | 1522 | erreur_squelette($err_b_s_a, $p); |
| 1523 | 1523 | } else { |
| 1524 | - $p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))'; |
|
| 1524 | + $p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))'; |
|
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | $p->interdire_scripts = false; |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | ) |
| 1570 | 1570 | ) { |
| 1571 | 1571 | $p->code = /* $r[1]. */ |
| 1572 | - '(' . $r[2] . ')'; |
|
| 1572 | + '('.$r[2].')'; |
|
| 1573 | 1573 | } else { |
| 1574 | 1574 | $p->code = "eval('return '.$php.';')"; |
| 1575 | 1575 | } |
@@ -1815,9 +1815,9 @@ discard block |
||
| 1815 | 1815 | |
| 1816 | 1816 | // noter la duree du cache dans un entete proprietaire |
| 1817 | 1817 | |
| 1818 | - $code = "'<'.'" . '?php header("X-Spip-Cache: ' |
|
| 1818 | + $code = "'<'.'".'?php header("X-Spip-Cache: ' |
|
| 1819 | 1819 | . $duree |
| 1820 | - . '"); ?' . "'.'>'"; |
|
| 1820 | + . '"); ?'."'.'>'"; |
|
| 1821 | 1821 | |
| 1822 | 1822 | // Remplir le header Cache-Control |
| 1823 | 1823 | // cas #CACHE{0} |
@@ -1838,9 +1838,9 @@ discard block |
||
| 1838 | 1838 | $pa == 'cache-client' |
| 1839 | 1839 | && $duree > 0 |
| 1840 | 1840 | ) { |
| 1841 | - $code .= ".'<'.'" . '?php header("Cache-Control: max-age=' |
|
| 1841 | + $code .= ".'<'.'".'?php header("Cache-Control: max-age=' |
|
| 1842 | 1842 | . $duree |
| 1843 | - . '"); ?' . "'.'>'"; |
|
| 1843 | + . '"); ?'."'.'>'"; |
|
| 1844 | 1844 | // il semble logique, si on cache-client, de ne pas invalider |
| 1845 | 1845 | $pa = 'statique'; |
| 1846 | 1846 | } |
@@ -1849,7 +1849,7 @@ discard block |
||
| 1849 | 1849 | $pa == 'statique' |
| 1850 | 1850 | && $duree > 0 |
| 1851 | 1851 | ) { |
| 1852 | - $code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'"; |
|
| 1852 | + $code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'"; |
|
| 1853 | 1853 | } |
| 1854 | 1854 | } |
| 1855 | 1855 | } else { |
@@ -2013,9 +2013,9 @@ discard block |
||
| 2013 | 2013 | if ($p->etoile) { |
| 2014 | 2014 | $_options[] = "'etoile'=>true"; |
| 2015 | 2015 | } |
| 2016 | - $_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')'; |
|
| 2016 | + $_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')'; |
|
| 2017 | 2017 | |
| 2018 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2018 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2019 | 2019 | if ($flag_env) { |
| 2020 | 2020 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2021 | 2021 | } |
@@ -2025,7 +2025,7 @@ discard block |
||
| 2025 | 2025 | $msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']]; |
| 2026 | 2026 | erreur_squelette($msg, $p); |
| 2027 | 2027 | } else { |
| 2028 | - $p->code = 'charge_scripts(' . $_contexte[1] . ',false)'; |
|
| 2028 | + $p->code = 'charge_scripts('.$_contexte[1].',false)'; |
|
| 2029 | 2029 | } |
| 2030 | 2030 | |
| 2031 | 2031 | $p->interdire_scripts = false; // la securite est assuree par recuperer_fond |
@@ -2073,7 +2073,7 @@ discard block |
||
| 2073 | 2073 | unset($_contexte[1]); |
| 2074 | 2074 | |
| 2075 | 2075 | if (preg_match("/^\s*'[^']*'/s", $nom)) { |
| 2076 | - $nom = "'modeles/" . substr($nom, 1); |
|
| 2076 | + $nom = "'modeles/".substr($nom, 1); |
|
| 2077 | 2077 | } else { |
| 2078 | 2078 | $nom = "'modeles/' . $nom"; |
| 2079 | 2079 | } |
@@ -2090,8 +2090,8 @@ discard block |
||
| 2090 | 2090 | $primary = $p->boucles[$p->id_boucle]->primary; |
| 2091 | 2091 | if (!strpos($primary, ',')) { |
| 2092 | 2092 | $id = champ_sql($primary, $p); |
| 2093 | - $_contexte[] = "'$primary'=>" . $id; |
|
| 2094 | - $_contexte[] = "'id'=>" . $id; |
|
| 2093 | + $_contexte[] = "'$primary'=>".$id; |
|
| 2094 | + $_contexte[] = "'id'=>".$id; |
|
| 2095 | 2095 | } |
| 2096 | 2096 | } |
| 2097 | 2097 | $_contexte[] = "'recurs'=>(++\$recurs)"; |
@@ -2103,11 +2103,11 @@ discard block |
||
| 2103 | 2103 | $_options = memoriser_contexte_compil($p); |
| 2104 | 2104 | $_options = "'compil'=>array($_options), 'trim'=>true"; |
| 2105 | 2105 | if (isset($_contexte['ajax'])) { |
| 2106 | - $_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2106 | + $_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2107 | 2107 | unset($_contexte['ajax']); |
| 2108 | 2108 | } |
| 2109 | 2109 | |
| 2110 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2110 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2111 | 2111 | if ($flag_env) { |
| 2112 | 2112 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2113 | 2113 | } |
@@ -2217,12 +2217,12 @@ discard block |
||
| 2217 | 2217 | function balise_DOUBLONS_dist($p) { |
| 2218 | 2218 | if ($type = interprete_argument_balise(1, $p)) { |
| 2219 | 2219 | if ($famille = interprete_argument_balise(2, $p)) { |
| 2220 | - $type .= '.' . $famille; |
|
| 2220 | + $type .= '.'.$famille; |
|
| 2221 | 2221 | } |
| 2222 | - $p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")'; |
|
| 2222 | + $p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")'; |
|
| 2223 | 2223 | if (!$p->etoile) { |
| 2224 | 2224 | $p->code = 'array_filter(array_map("intval",explode(",",' |
| 2225 | - . $p->code . ')))'; |
|
| 2225 | + . $p->code.')))'; |
|
| 2226 | 2226 | } |
| 2227 | 2227 | } else { |
| 2228 | 2228 | $p->code = '$doublons'; |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | $_code[] = "$_key => $_val"; |
| 2352 | 2352 | } |
| 2353 | 2353 | } while ($_key && $_val); |
| 2354 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2354 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2355 | 2355 | $p->interdire_scripts = false; |
| 2356 | 2356 | |
| 2357 | 2357 | return $p; |
@@ -2378,7 +2378,7 @@ discard block |
||
| 2378 | 2378 | while ($_val = interprete_argument_balise($n++, $p)) { |
| 2379 | 2379 | $_code[] = $_val; |
| 2380 | 2380 | } |
| 2381 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2381 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2382 | 2382 | $p->interdire_scripts = false; |
| 2383 | 2383 | |
| 2384 | 2384 | return $p; |
@@ -2423,10 +2423,10 @@ discard block |
||
| 2423 | 2423 | $_code[] = $_v; |
| 2424 | 2424 | } |
| 2425 | 2425 | |
| 2426 | - $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join( |
|
| 2426 | + $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join( |
|
| 2427 | 2427 | ', ', |
| 2428 | 2428 | $_code |
| 2429 | - ) . ')?" ":"")'; |
|
| 2429 | + ).')?" ":"")'; |
|
| 2430 | 2430 | $p->interdire_scripts = false; |
| 2431 | 2431 | |
| 2432 | 2432 | return $p; |
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | $type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"'; |
| 2460 | 2460 | |
| 2461 | 2461 | $f = chercher_filtre('info_plugin'); |
| 2462 | - $p->code = $f . '(' . $plugin . ', ' . $type_info . ')'; |
|
| 2462 | + $p->code = $f.'('.$plugin.', '.$type_info.')'; |
|
| 2463 | 2463 | |
| 2464 | 2464 | return $p; |
| 2465 | 2465 | } |
@@ -2691,7 +2691,7 @@ discard block |
||
| 2691 | 2691 | } |
| 2692 | 2692 | |
| 2693 | 2693 | // Différentes infos relatives au tri présentes dans les modificateurs |
| 2694 | - $_tri_nom = $boucle->modificateur['tri_nom'] ; // nom du paramètre définissant le tri |
|
| 2694 | + $_tri_nom = $boucle->modificateur['tri_nom']; // nom du paramètre définissant le tri |
|
| 2695 | 2695 | $_tri_champ = $boucle->modificateur['tri_champ']; // champ actuel utilisé le tri |
| 2696 | 2696 | $_tri_sens = $boucle->modificateur['tri_sens']; // sens de tri actuel |
| 2697 | 2697 | $_tri_liste_sens_defaut = $boucle->modificateur['tri_liste_sens_defaut']; // sens par défaut pour chaque champ |
@@ -2788,7 +2788,7 @@ discard block |
||
| 2788 | 2788 | $connect = $p->boucles[$p->id_boucle]->sql_serveur; |
| 2789 | 2789 | } |
| 2790 | 2790 | |
| 2791 | - $p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')"; |
|
| 2791 | + $p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')"; |
|
| 2792 | 2792 | $p->interdire_scripts = false; |
| 2793 | 2793 | |
| 2794 | 2794 | return $p; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $apl_constant = '_Z_AJAX_PARALLEL_LOAD'; |
| 53 | 53 | $page = _SPIP_PAGE; |
| 54 | 54 | $echafauder = charger_fonction('echafauder', 'public', true); |
| 55 | - define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim( |
|
| 55 | + define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim( |
|
| 56 | 56 | (string) _DIR_PLUGIN_DIST, |
| 57 | 57 | '/' |
| 58 | 58 | ) : '')); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | && in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z |
| 77 | 77 | && defined($apl_constant) |
| 78 | 78 | && in_array($dir, explode(',', (string) constant($apl_constant))) // et dans un demande en APL |
| 79 | - && ($pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 79 | + && ($pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 80 | 80 | ) { |
| 81 | 81 | $flux['data'] = $pipe; |
| 82 | 82 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $echafauder = ''; |
| 90 | 90 | } |
| 91 | 91 | if ($prepend) { |
| 92 | - $squelette = substr((string) find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext")); |
|
| 92 | + $squelette = substr((string) find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext")); |
|
| 93 | 93 | if ($squelette) { |
| 94 | 94 | $flux['data'] = $squelette; |
| 95 | 95 | } |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | // se brancher sur contenu/xx si il existe |
| 110 | 110 | // ou si c'est un objet spip, associe a une table, utiliser le fond homonyme |
| 111 | 111 | if (!isset($disponible[$fond])) { |
| 112 | - $disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, (bool) $echafauder); |
|
| 112 | + $disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, (bool) $echafauder); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if ($disponible[$fond]) { |
| 116 | - $flux['data'] = substr((string) find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext")); |
|
| 116 | + $flux['data'] = substr((string) find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext")); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $type = $flux['args']['contexte'][$page]; |
| 127 | 127 | } |
| 128 | 128 | if (!isset($disponible[$type])) { |
| 129 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, (bool) $echafauder); |
|
| 129 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, (bool) $echafauder); |
|
| 130 | 130 | } |
| 131 | 131 | if (is_string($disponible[$type])) { |
| 132 | 132 | $flux['data'] = $disponible[$type]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext); |
| 142 | 142 | } else { |
| 143 | 143 | $flux['data'] = ($disponible['404'] = z_contenu_disponible( |
| 144 | - $prefix_path . $prepend, |
|
| 144 | + $prefix_path.$prepend, |
|
| 145 | 145 | $z_contenu, |
| 146 | 146 | '404', |
| 147 | 147 | $ext, |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | $type = $flux['args']['contexte'][$page]; |
| 166 | 166 | } |
| 167 | 167 | if ($type !== 'page' && !isset($disponible[$type])) { |
| 168 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, (bool) $echafauder); |
|
| 168 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, (bool) $echafauder); |
|
| 169 | 169 | } |
| 170 | 170 | if ($type == 'page' || $disponible[$type]) { |
| 171 | - $flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext); |
|
| 171 | + $flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | if ( |
| 186 | 186 | isset($flux['args']['contexte']['type-page']) |
| 187 | 187 | && ( |
| 188 | - isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext") |
|
| 189 | - || file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext") |
|
| 188 | + isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext") |
|
| 189 | + || file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext") |
|
| 190 | 190 | ) |
| 191 | 191 | ) { |
| 192 | 192 | $flux['data'] = $f; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } elseif ( |
| 195 | 195 | $fond == 'structure' |
| 196 | 196 | && z_sanitize_var_zajax() |
| 197 | - && ($f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext")) |
|
| 197 | + && ($f = find_in_path($prefix_path.$prepend.'ajax'.".$ext")) |
|
| 198 | 198 | ) { |
| 199 | 199 | $flux['data'] = substr((string) $f, 0, -strlen(".$ext")); |
| 200 | 200 | } elseif ( |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | && ($dir = explode('/', $dir)) |
| 206 | 206 | && ($dir = reset($dir)) |
| 207 | 207 | && in_array($dir, $z_blocs) |
| 208 | - && ($f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext")) |
|
| 208 | + && ($f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext")) |
|
| 209 | 209 | ) { |
| 210 | 210 | $flux['data'] = substr((string) $f, 0, -strlen(".$ext")); |
| 211 | 211 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * `true` si on peut l'utiliser, `false` sinon. |
| 266 | 266 | **/ |
| 267 | 267 | function z_fond_valide($squelette) { |
| 268 | - return !_ZCORE_EXCLURE_PATH || !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette); |
|
| 268 | + return !_ZCORE_EXCLURE_PATH || !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -380,23 +380,23 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | $dir = z_blocs(test_espace_prive()); |
| 382 | 382 | $dir = reset($dir); |
| 383 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper((string) $primary) . ',env}>'; |
|
| 383 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper((string) $primary).',env}>'; |
|
| 384 | 384 | } // page objets |
| 385 | 385 | elseif (($type = $desc_exec) && !str_contains($type, '/')) { |
| 386 | 386 | $dir = z_blocs(test_espace_prive()); |
| 387 | 387 | $dir = reset($dir); |
| 388 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />'; |
|
| 388 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />'; |
|
| 389 | 389 | } |
| 390 | 390 | // morceau d'objet : on fournit le fond de sibstitution dans $desc_exec |
| 391 | 391 | // et objet et tire de $table |
| 392 | 392 | elseif ($fond = $desc_exec) { |
| 393 | 393 | $dir = md5(dirname($fond)); |
| 394 | - $scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />'; |
|
| 394 | + $scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />'; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | $base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false); |
| 398 | 398 | $base_dir = sous_repertoire($base_dir, $dir, false); |
| 399 | - $f = $base_dir . "$exec"; |
|
| 399 | + $f = $base_dir."$exec"; |
|
| 400 | 400 | ecrire_fichier("$f.$ext", $scaffold); |
| 401 | 401 | |
| 402 | 402 | return $f; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $type .= ($struct->type_requete ?: $struct->type_table_optionnelle); |
| 31 | 31 | |
| 32 | 32 | if ($struct->jointures_explicites) { |
| 33 | - $type .= ' ' . $struct->jointures_explicites; |
|
| 33 | + $type .= ' '.$struct->jointures_explicites; |
|
| 34 | 34 | } |
| 35 | 35 | if ($struct->table_optionnelle) { |
| 36 | 36 | $type .= '?'; |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $crit = $struct->param; |
| 41 | 41 | if ($crit && !is_array($crit[0])) { |
| 42 | - $type = strtolower($type) . array_shift($crit); |
|
| 42 | + $type = strtolower($type).array_shift($crit); |
|
| 43 | 43 | } |
| 44 | 44 | $crit = decompiler_criteres($struct, $fmt, $prof); |
| 45 | 45 | |
| 46 | - $f = 'format_boucle_' . $fmt; |
|
| 46 | + $f = 'format_boucle_'.$fmt; |
|
| 47 | 47 | |
| 48 | 48 | return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof); |
| 49 | 49 | } |
@@ -56,21 +56,20 @@ discard block |
||
| 56 | 56 | $res[] = decompiler_($v, $fmt, $prof); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | - $file = is_string($struct->texte) ? $struct->texte : |
|
| 60 | - decompiler_($struct->texte, $fmt, $prof); |
|
| 61 | - $f = 'format_inclure_' . $fmt; |
|
| 59 | + $file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof); |
|
| 60 | + $f = 'format_inclure_'.$fmt; |
|
| 62 | 61 | |
| 63 | 62 | return $f($file, $res, $prof); |
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | function decompiler_texte($struct, $fmt = '', $prof = 0) { |
| 67 | - $f = 'format_texte_' . $fmt; |
|
| 66 | + $f = 'format_texte_'.$fmt; |
|
| 68 | 67 | |
| 69 | 68 | return strlen((string) $struct->texte) ? $f($struct->texte, $prof) : ''; |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 | function decompiler_polyglotte($struct, $fmt = '', $prof = 0) { |
| 73 | - $f = 'format_polyglotte_' . $fmt; |
|
| 72 | + $f = 'format_polyglotte_'.$fmt; |
|
| 74 | 73 | |
| 75 | 74 | return $f($struct->traductions, $prof); |
| 76 | 75 | } |
@@ -83,7 +82,7 @@ discard block |
||
| 83 | 82 | |
| 84 | 83 | $filtres = decompiler_liste($struct->param, $fmt, $prof); |
| 85 | 84 | |
| 86 | - $f = 'format_idiome_' . $fmt; |
|
| 85 | + $f = 'format_idiome_'.$fmt; |
|
| 87 | 86 | |
| 88 | 87 | return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof); |
| 89 | 88 | } |
@@ -98,7 +97,7 @@ discard block |
||
| 98 | 97 | } |
| 99 | 98 | $filtres = decompiler_liste($p, $fmt, $prof); |
| 100 | 99 | } |
| 101 | - $f = 'format_champ_' . $fmt; |
|
| 100 | + $f = 'format_champ_'.$fmt; |
|
| 102 | 101 | |
| 103 | 102 | return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof); |
| 104 | 103 | } |
@@ -107,7 +106,7 @@ discard block |
||
| 107 | 106 | if (!is_array($sources)) { |
| 108 | 107 | return ''; |
| 109 | 108 | } |
| 110 | - $f = 'format_liste_' . $fmt; |
|
| 109 | + $f = 'format_liste_'.$fmt; |
|
| 111 | 110 | $res = ''; |
| 112 | 111 | foreach ($sources as $arg) { |
| 113 | 112 | if (!is_array($arg)) { |
@@ -124,7 +123,7 @@ discard block |
||
| 124 | 123 | && strlen((string) $v[0]->apres) == 1 |
| 125 | 124 | && $v[0]->apres == $v[0]->avant |
| 126 | 125 | ) { |
| 127 | - $args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres; |
|
| 126 | + $args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres; |
|
| 128 | 127 | } else { |
| 129 | 128 | $args[] = decompiler_($v, $fmt, 0 - $prof); |
| 130 | 129 | } |
@@ -147,7 +146,7 @@ discard block |
||
| 147 | 146 | return ''; |
| 148 | 147 | } |
| 149 | 148 | $res = ''; |
| 150 | - $f = 'format_critere_' . $fmt; |
|
| 149 | + $f = 'format_critere_'.$fmt; |
|
| 151 | 150 | foreach ($sources as $crit) { |
| 152 | 151 | if (!is_array($crit)) { |
| 153 | 152 | continue; |
@@ -160,13 +159,13 @@ discard block |
||
| 160 | 159 | && $v[0]->type == 'texte' |
| 161 | 160 | && $v[0]->apres |
| 162 | 161 | ) { |
| 163 | - $args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]]; |
|
| 162 | + $args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]]; |
|
| 164 | 163 | } else { |
| 165 | 164 | $res2 = []; |
| 166 | 165 | foreach ($v as $k => $p) { |
| 167 | 166 | if ( |
| 168 | 167 | isset($p->type) |
| 169 | - && function_exists($d = 'decompiler_' . $p->type) |
|
| 168 | + && function_exists($d = 'decompiler_'.$p->type) |
|
| 170 | 169 | ) { |
| 171 | 170 | $r = $d($p, $fmt, (0 - $prof)); |
| 172 | 171 | $res2[] = [$p->type, $r]; |
@@ -194,7 +193,7 @@ discard block |
||
| 194 | 193 | if (!isset($p->type)) { |
| 195 | 194 | continue; |
| 196 | 195 | } #?????? |
| 197 | - $d = 'decompiler_' . $p->type; |
|
| 196 | + $d = 'decompiler_'.$p->type; |
|
| 198 | 197 | $next = $liste[$k + 1] ?? false; |
| 199 | 198 | // Forcer le champ etendu si son source (pas les reecritures) |
| 200 | 199 | // contenait des args et s'il est suivi d'espaces, |
@@ -219,16 +218,16 @@ discard block |
||
| 219 | 218 | } |
| 220 | 219 | $contenu[] = [$d($p, $fmt, $prof2), $p->type]; |
| 221 | 220 | } |
| 222 | - $f = 'format_suite_' . $fmt; |
|
| 221 | + $f = 'format_suite_'.$fmt; |
|
| 223 | 222 | |
| 224 | 223 | return $f($contenu); |
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') { |
| 228 | - if (!include_spip('public/format_' . $fmt)) { |
|
| 227 | + if (!include_spip('public/format_'.$fmt)) { |
|
| 229 | 228 | return "'$fmt'?"; |
| 230 | 229 | } |
| 231 | - $f = 'decompiler_' . $quoi; |
|
| 230 | + $f = 'decompiler_'.$quoi; |
|
| 232 | 231 | |
| 233 | 232 | return $f($liste, $fmt, $prof); |
| 234 | 233 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 124 | 124 | if ($var !== 1) { |
| 125 | 125 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 126 | - . $val . ($echap ? ") . '" : ' '); |
|
| 126 | + . $val.($echap ? ") . '" : ' '); |
|
| 127 | 127 | } else { |
| 128 | 128 | $val = $echap ? "'.$val.'" : $val; |
| 129 | 129 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (!$lang) { |
| 145 | 145 | $lang = '$GLOBALS["spip_lang"]'; |
| 146 | 146 | } |
| 147 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 147 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 148 | 148 | |
| 149 | 149 | return $l; |
| 150 | 150 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 175 | 175 | if (is_string($p->texte)) { |
| 176 | 176 | $fichier = $p->texte; |
| 177 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 177 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 178 | 178 | } else { |
| 179 | 179 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 180 | 180 | if ($code && preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | return false; |
| 224 | 224 | } // j'aurais voulu toucher le fond ... |
| 225 | 225 | |
| 226 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 226 | + $contexte = 'array('.$_contexte.')'; |
|
| 227 | 227 | |
| 228 | 228 | if ($env) { |
| 229 | 229 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -238,16 +238,16 @@ discard block |
||
| 238 | 238 | $_options[] = $ajax; |
| 239 | 239 | } |
| 240 | 240 | $code = " ' . argumenter_squelette($code) . '"; |
| 241 | - $code = 'echo ' . sprintf( |
|
| 241 | + $code = 'echo '.sprintf( |
|
| 242 | 242 | CODE_RECUPERER_FOND, |
| 243 | 243 | $code, |
| 244 | 244 | $contexte, |
| 245 | 245 | implode(',', $_options), |
| 246 | 246 | "_request(\\'connect\\') ?? \\'\\'" |
| 247 | - ) . ';'; |
|
| 247 | + ).';'; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 250 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $id = $id_table; |
| 328 | 328 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 329 | 329 | } |
| 330 | - $mstatut = $id . '.' . $statut; |
|
| 330 | + $mstatut = $id.'.'.$statut; |
|
| 331 | 331 | |
| 332 | 332 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 333 | 333 | include_spip('public/quete'); |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | && $s['post_date'] |
| 337 | 337 | && $GLOBALS['meta']['post_dates'] == 'non' |
| 338 | 338 | ) { |
| 339 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 339 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 340 | 340 | array_unshift( |
| 341 | 341 | $boucle->where, |
| 342 | 342 | $echapper ? |
| 343 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 343 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 344 | 344 | : |
| 345 | 345 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 346 | 346 | ); |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | $boucle->where, |
| 350 | 350 | $echapper ? |
| 351 | 351 | "\nquete_condition_statut('$mstatut'," |
| 352 | - . _q($s['previsu']) . ',' |
|
| 353 | - . _q($s['publie']) . ',' |
|
| 354 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 352 | + . _q($s['previsu']).',' |
|
| 353 | + . _q($s['publie']).',' |
|
| 354 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 355 | 355 | : |
| 356 | 356 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 357 | 357 | ); |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | if (_request('var_mode_affiche') != 'resultat') { |
| 386 | 386 | $trace = ''; |
| 387 | 387 | } else { |
| 388 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 388 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 389 | 389 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 390 | 390 | $trace = " |
| 391 | 391 | if (empty($_trace)) { |
| 392 | 392 | $_trace = []; |
| 393 | 393 | } |
| 394 | 394 | if (count($_trace) < 3) { |
| 395 | - $_trace" . '[] = $t0; |
|
| 395 | + $_trace".'[] = $t0; |
|
| 396 | 396 | }'; |
| 397 | 397 | } |
| 398 | 398 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | return |
| 427 | 427 | // Numrows[$nom] peut ne pas être encore defini |
| 428 | 428 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 429 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 429 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 430 | 430 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 431 | 431 | . $trace |
| 432 | 432 | . "\n\treturn \$t0;"; |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 495 | 495 | // et puis faire un [] plutot qu'un "','." |
| 496 | 496 | if ($boucle->doublons) { |
| 497 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 497 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 498 | 498 | index_pile($id_boucle, $primary, $boucles) |
| 499 | 499 | . "; // doublons\n"; |
| 500 | 500 | } |
@@ -522,13 +522,13 @@ discard block |
||
| 522 | 522 | $corps .= |
| 523 | 523 | "\n\t\tlang_select_public(" |
| 524 | 524 | . index_pile($id_boucle, 'lang', $boucles) |
| 525 | - . ", '" . $boucle->lang_select . "'" |
|
| 525 | + . ", '".$boucle->lang_select."'" |
|
| 526 | 526 | . (in_array($type_boucle, [ |
| 527 | 527 | 'articles', |
| 528 | 528 | 'rubriques', |
| 529 | 529 | 'hierarchie', |
| 530 | 530 | 'breves' |
| 531 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 531 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 532 | 532 | . ');'; |
| 533 | 533 | } else { |
| 534 | 534 | $init_lang = ''; |
@@ -550,20 +550,16 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // gestion optimale des separateurs et des boucles constantes |
| 552 | 552 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 553 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 553 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | $corps .= |
| 557 | 557 | ((!$boucle->separateur) ? |
| 558 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 559 | - (($return === "''") ? '' : |
|
| 560 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 561 | - ("\n\t\t\$t1 " . |
|
| 558 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 562 | 559 | ((str_starts_with($return, '$t1.')) ? |
| 563 | - ('.=' . substr($return, 4)) : |
|
| 564 | - ('= ' . $return)) . |
|
| 565 | - ";\n\t\t" . |
|
| 566 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 560 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 561 | + ";\n\t\t". |
|
| 562 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 567 | 563 | |
| 568 | 564 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 569 | 565 | // souhaite invalider ces elements |
@@ -645,7 +641,7 @@ discard block |
||
| 645 | 641 | $corps, |
| 646 | 642 | $fin_lang, |
| 647 | 643 | $trace, |
| 648 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 644 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 649 | 645 | ); |
| 650 | 646 | |
| 651 | 647 | return $a; |
@@ -665,25 +661,24 @@ discard block |
||
| 665 | 661 | **/ |
| 666 | 662 | function calculer_requete_sql($boucle) { |
| 667 | 663 | $init = []; |
| 668 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 669 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 664 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 665 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 670 | 666 | # En absence de champ c'est un decompte : |
| 671 | 667 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 672 | 668 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 673 | 669 | $init[] = calculer_dec( |
| 674 | 670 | 'groupby', |
| 675 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 671 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 676 | 672 | ); |
| 677 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 678 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 673 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 674 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 679 | 675 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 680 | 676 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 681 | 677 | $init[] = calculer_dec( |
| 682 | 678 | 'limit', |
| 683 | 679 | ( |
| 684 | 680 | !str_contains($boucle->limit, 'intval') ? |
| 685 | - "'" . ($boucle->limit) . "'" : |
|
| 686 | - $boucle->limit |
|
| 681 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 687 | 682 | ) |
| 688 | 683 | ); |
| 689 | 684 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -692,17 +687,17 @@ discard block |
||
| 692 | 687 | // ou recalculée à chaque passage (vide) |
| 693 | 688 | foreach ($init as $i) { |
| 694 | 689 | if (reset($i)) { |
| 695 | - $s .= "\n\t\t" . end($i); |
|
| 690 | + $s .= "\n\t\t".end($i); |
|
| 696 | 691 | } # statique |
| 697 | 692 | else { |
| 698 | - $d .= "\n\t" . end($i); |
|
| 693 | + $d .= "\n\t".end($i); |
|
| 699 | 694 | } # dynamique |
| 700 | 695 | } |
| 701 | 696 | |
| 702 | 697 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 703 | 698 | . $boucle->in |
| 704 | 699 | . $boucle->hash |
| 705 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 700 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 706 | 701 | . $s |
| 707 | 702 | . "\n\t}" |
| 708 | 703 | . $d; |
@@ -757,7 +752,7 @@ discard block |
||
| 757 | 752 | ]; |
| 758 | 753 | |
| 759 | 754 | $p->id_boucle = $context_compil[2] ?? ''; |
| 760 | - $p->ligne = (int)($context_compil[3] ?? 0); |
|
| 755 | + $p->ligne = (int) ($context_compil[3] ?? 0); |
|
| 761 | 756 | $p->lang = $context_compil[4] ?? ''; |
| 762 | 757 | |
| 763 | 758 | return $p; |
@@ -786,7 +781,7 @@ discard block |
||
| 786 | 781 | * - index 1 : Code de l'affectation |
| 787 | 782 | **/ |
| 788 | 783 | function calculer_dec($nom, $val) { |
| 789 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 784 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 790 | 785 | // si une variable apparait dans le calcul de la clause |
| 791 | 786 | // il faut la re-evaluer a chaque passage |
| 792 | 787 | if ( |
@@ -803,7 +798,7 @@ discard block |
||
| 803 | 798 | $static = ''; |
| 804 | 799 | } |
| 805 | 800 | |
| 806 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 801 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 807 | 802 | } |
| 808 | 803 | |
| 809 | 804 | /** |
@@ -828,27 +823,27 @@ discard block |
||
| 828 | 823 | } |
| 829 | 824 | $res = ''; |
| 830 | 825 | if ($a && $a[0] == "'?'") { |
| 831 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 832 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 833 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 826 | + return ('('.calculer_dump_array($a[1]). |
|
| 827 | + ' ? '.calculer_dump_array($a[2]). |
|
| 828 | + ' : '.calculer_dump_array($a[3]). |
|
| 834 | 829 | ')'); |
| 835 | 830 | } else { |
| 836 | 831 | foreach ($a as $k => $v) { |
| 837 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 838 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 832 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 833 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 839 | 834 | } |
| 840 | 835 | |
| 841 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 836 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 842 | 837 | } |
| 843 | 838 | } |
| 844 | 839 | |
| 845 | 840 | function calculer_dump_join($a) { |
| 846 | 841 | $res = ''; |
| 847 | 842 | foreach ($a as $k => $v) { |
| 848 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 843 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 849 | 844 | } |
| 850 | 845 | |
| 851 | - return 'array(' . substr($res, 2) . ')'; |
|
| 846 | + return 'array('.substr($res, 2).')'; |
|
| 852 | 847 | } |
| 853 | 848 | |
| 854 | 849 | /** |
@@ -865,7 +860,7 @@ discard block |
||
| 865 | 860 | $res .= ",'$k' => '$v'"; |
| 866 | 861 | } |
| 867 | 862 | |
| 868 | - return 'array(' . substr($res, 1) . ')'; |
|
| 863 | + return 'array('.substr($res, 1).')'; |
|
| 869 | 864 | } |
| 870 | 865 | |
| 871 | 866 | /** |
@@ -883,7 +878,7 @@ discard block |
||
| 883 | 878 | $res .= ",'$k' => '$v'"; |
| 884 | 879 | } |
| 885 | 880 | |
| 886 | - return 'array(' . substr($res, 1) . ')'; |
|
| 881 | + return 'array('.substr($res, 1).')'; |
|
| 887 | 882 | } |
| 888 | 883 | |
| 889 | 884 | function calculer_order(&$boucle) { |
@@ -952,19 +947,19 @@ discard block |
||
| 952 | 947 | ) { |
| 953 | 948 | $res .= " .\n$tab$code"; |
| 954 | 949 | } else { |
| 955 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 950 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 956 | 951 | } |
| 957 | 952 | } |
| 958 | 953 | |
| 959 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 954 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 960 | 955 | } |
| 961 | 956 | } else { |
| 962 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 957 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 963 | 958 | |
| 964 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 959 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 965 | 960 | " ,\n$tab", |
| 966 | 961 | $codes |
| 967 | - ) . ')))'; |
|
| 962 | + ).')))'; |
|
| 968 | 963 | } |
| 969 | 964 | } |
| 970 | 965 | |
@@ -1000,7 +995,7 @@ discard block |
||
| 1000 | 995 | // texte seul |
| 1001 | 996 | case 'texte': |
| 1002 | 997 | $code = sandbox_composer_texte($p->texte, $p); |
| 1003 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 998 | + $commentaire = strlen($p->texte).' signes'; |
|
| 1004 | 999 | $avant = ''; |
| 1005 | 1000 | $apres = ''; |
| 1006 | 1001 | $altern = "''"; |
@@ -1009,14 +1004,14 @@ discard block |
||
| 1009 | 1004 | case 'polyglotte': |
| 1010 | 1005 | $code = ''; |
| 1011 | 1006 | foreach ($p->traductions as $k => $v) { |
| 1012 | - $code .= ",'" . |
|
| 1013 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1014 | - "' => '" . |
|
| 1015 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 1007 | + $code .= ",'". |
|
| 1008 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 1009 | + "' => '". |
|
| 1010 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1016 | 1011 | "'"; |
| 1017 | 1012 | } |
| 1018 | - $code = 'choisir_traduction(array(' . |
|
| 1019 | - substr($code, 1) . |
|
| 1013 | + $code = 'choisir_traduction(array('. |
|
| 1014 | + substr($code, 1). |
|
| 1020 | 1015 | '))'; |
| 1021 | 1016 | $commentaire = '&'; |
| 1022 | 1017 | $avant = ''; |
@@ -1032,7 +1027,7 @@ discard block |
||
| 1032 | 1027 | $err_e_c = true; |
| 1033 | 1028 | $code = "''"; |
| 1034 | 1029 | } else { |
| 1035 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1030 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1036 | 1031 | $avant = ''; |
| 1037 | 1032 | $apres = ''; |
| 1038 | 1033 | $altern = "''"; |
@@ -1061,8 +1056,8 @@ discard block |
||
| 1061 | 1056 | $err_e_c = true; |
| 1062 | 1057 | $code = "''"; |
| 1063 | 1058 | } else { |
| 1064 | - $code = 'BOUCLE' . |
|
| 1065 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1059 | + $code = 'BOUCLE'. |
|
| 1060 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1066 | 1061 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1067 | 1062 | $commentaire = "?$nom"; |
| 1068 | 1063 | if ( |
@@ -1104,24 +1099,22 @@ discard block |
||
| 1104 | 1099 | foreach ($p->arg as $k => $v) { |
| 1105 | 1100 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1106 | 1101 | if ($k) { |
| 1107 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1102 | + $l[] = _q($k).' => '.$_v; |
|
| 1108 | 1103 | } else { |
| 1109 | 1104 | $code = $_v; |
| 1110 | 1105 | } |
| 1111 | 1106 | } |
| 1112 | 1107 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1113 | 1108 | if ($p->module) { |
| 1114 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1109 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1115 | 1110 | } elseif ($p->nom_champ) { |
| 1116 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1111 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1117 | 1112 | } else { |
| 1118 | 1113 | $m = ''; |
| 1119 | 1114 | } |
| 1120 | 1115 | |
| 1121 | - $code = (!$code ? "'$m'" : |
|
| 1122 | - ($m ? "'$m' . $code" : |
|
| 1123 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1124 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1116 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1117 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1125 | 1118 | $code = "_T($code)"; |
| 1126 | 1119 | if ($p->param) { |
| 1127 | 1120 | $p->id_boucle = $id_boucle; |
@@ -1143,7 +1136,7 @@ discard block |
||
| 1143 | 1136 | $p->type_requete = $type; |
| 1144 | 1137 | |
| 1145 | 1138 | $code = calculer_champ($p); |
| 1146 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1139 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1147 | 1140 | $avant = calculer_liste( |
| 1148 | 1141 | $p->avant, |
| 1149 | 1142 | $descr, |
@@ -1182,10 +1175,9 @@ discard block |
||
| 1182 | 1175 | if ($code != "''") { |
| 1183 | 1176 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1184 | 1177 | $codes[] = (($mode == 'validation') ? |
| 1185 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1178 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1186 | 1179 | : (($mode == 'code') ? |
| 1187 | - "\n// $commentaire\n$code" : |
|
| 1188 | - $code)); |
|
| 1180 | + "\n// $commentaire\n$code" : $code)); |
|
| 1189 | 1181 | } |
| 1190 | 1182 | } // foreach |
| 1191 | 1183 | |
@@ -1241,19 +1233,19 @@ discard block |
||
| 1241 | 1233 | $cond = ''; |
| 1242 | 1234 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1243 | 1235 | $t = $r[2]; |
| 1244 | - $cond = '!' . $r[1]; |
|
| 1236 | + $cond = '!'.$r[1]; |
|
| 1245 | 1237 | } else { |
| 1246 | 1238 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1247 | 1239 | $t = $r[2]; |
| 1248 | 1240 | $cond = $r[1]; |
| 1249 | 1241 | } else { |
| 1250 | - $t = '$t' . $n; |
|
| 1242 | + $t = '$t'.$n; |
|
| 1251 | 1243 | $cond = "($t = $code)!==''"; |
| 1252 | 1244 | } |
| 1253 | 1245 | } |
| 1254 | 1246 | |
| 1255 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1256 | - $t . |
|
| 1247 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1248 | + $t. |
|
| 1257 | 1249 | (!$apres ? '' : " . $apres"); |
| 1258 | 1250 | |
| 1259 | 1251 | if ($res !== $t) { |
@@ -1304,12 +1296,12 @@ discard block |
||
| 1304 | 1296 | |
| 1305 | 1297 | // rendre inertes les echappements de #[](){}<> |
| 1306 | 1298 | $i = 0; |
| 1307 | - while (str_contains($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1299 | + while (str_contains($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1308 | 1300 | $i++; |
| 1309 | 1301 | } |
| 1310 | 1302 | $squelette = preg_replace_callback( |
| 1311 | 1303 | ',\\\\([#[()\]{}<>]),', |
| 1312 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1304 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1313 | 1305 | $squelette, |
| 1314 | 1306 | -1, |
| 1315 | 1307 | $esc |
@@ -1325,7 +1317,7 @@ discard block |
||
| 1325 | 1317 | // Phraser le squelette, selon sa grammaire |
| 1326 | 1318 | |
| 1327 | 1319 | $boucles = []; |
| 1328 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1320 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1329 | 1321 | |
| 1330 | 1322 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1331 | 1323 | |
@@ -1341,7 +1333,7 @@ discard block |
||
| 1341 | 1333 | ); |
| 1342 | 1334 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1343 | 1335 | ",$inerte-(\d+)-,", |
| 1344 | - fn ($a) => '\\\\' . chr($a[1]), |
|
| 1336 | + fn ($a) => '\\\\'.chr($a[1]), |
|
| 1345 | 1337 | $boucle->descr['squelette'] |
| 1346 | 1338 | ); |
| 1347 | 1339 | } |
@@ -1352,19 +1344,19 @@ discard block |
||
| 1352 | 1344 | include_spip('public/decompiler'); |
| 1353 | 1345 | foreach ($boucles as $id => $boucle) { |
| 1354 | 1346 | if ($id) { |
| 1355 | - $decomp = "\n/* BOUCLE " . |
|
| 1356 | - $boucle->type_requete . |
|
| 1357 | - ' ' . |
|
| 1358 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1359 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1347 | + $decomp = "\n/* BOUCLE ". |
|
| 1348 | + $boucle->type_requete. |
|
| 1349 | + ' '. |
|
| 1350 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1351 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1360 | 1352 | " */\n"; |
| 1361 | 1353 | } else { |
| 1362 | - $decomp = ("\n/*\n" . |
|
| 1354 | + $decomp = ("\n/*\n". |
|
| 1363 | 1355 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1364 | 1356 | . "\n*/"); |
| 1365 | 1357 | } |
| 1366 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1367 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1358 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1359 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1368 | 1360 | } |
| 1369 | 1361 | } |
| 1370 | 1362 | |
@@ -1387,7 +1379,7 @@ discard block |
||
| 1387 | 1379 | } |
| 1388 | 1380 | } |
| 1389 | 1381 | foreach ($boucles as $id => $boucle) { |
| 1390 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1382 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1391 | 1383 | } |
| 1392 | 1384 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1393 | 1385 | |
@@ -1480,8 +1472,7 @@ discard block |
||
| 1480 | 1472 | } else { |
| 1481 | 1473 | $boucles[$id]->type_requete = false; |
| 1482 | 1474 | $boucle = $boucles[$id]; |
| 1483 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1484 | - ($boucle->sql_serveur . ':')) . |
|
| 1475 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1485 | 1476 | $type; |
| 1486 | 1477 | $msg = [ |
| 1487 | 1478 | 'zbug_table_inconnue', |
@@ -1572,11 +1563,11 @@ discard block |
||
| 1572 | 1563 | // fonction de boucle avec serveur & table |
| 1573 | 1564 | ( |
| 1574 | 1565 | !$serveur |
| 1575 | - || !function_exists($f = 'boucle_' . $serveur . '_' . $table) && !function_exists($f = $f . '_dist') |
|
| 1566 | + || !function_exists($f = 'boucle_'.$serveur.'_'.$table) && !function_exists($f = $f.'_dist') |
|
| 1576 | 1567 | ) |
| 1577 | 1568 | // fonction de boucle avec table |
| 1578 | - && !function_exists($f = 'boucle_' . $table) |
|
| 1579 | - && !function_exists($f = $f . '_dist') |
|
| 1569 | + && !function_exists($f = 'boucle_'.$table) |
|
| 1570 | + && !function_exists($f = $f.'_dist') |
|
| 1580 | 1571 | ) { |
| 1581 | 1572 | // fonction de boucle standard |
| 1582 | 1573 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1584,20 +1575,20 @@ discard block |
||
| 1584 | 1575 | } |
| 1585 | 1576 | } |
| 1586 | 1577 | |
| 1587 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1588 | - "static \$connect;\n\t" . |
|
| 1589 | - "\$command['connect'] = \$connect = " . |
|
| 1590 | - _q($boucle->sql_serveur) . |
|
| 1591 | - ';' . |
|
| 1578 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1579 | + "static \$connect;\n\t". |
|
| 1580 | + "\$command['connect'] = \$connect = ". |
|
| 1581 | + _q($boucle->sql_serveur). |
|
| 1582 | + ';'. |
|
| 1592 | 1583 | $f($id, $boucles); |
| 1593 | 1584 | } else { |
| 1594 | 1585 | $req = ("\n\treturn '';"); |
| 1595 | 1586 | } |
| 1596 | 1587 | |
| 1597 | 1588 | $boucles[$id]->return = |
| 1598 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1599 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1600 | - $req . |
|
| 1589 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1590 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1591 | + $req. |
|
| 1601 | 1592 | "\n}\n"; |
| 1602 | 1593 | } |
| 1603 | 1594 | |
@@ -1607,7 +1598,7 @@ discard block |
||
| 1607 | 1598 | return false; |
| 1608 | 1599 | } |
| 1609 | 1600 | |
| 1610 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1601 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1611 | 1602 | ' |
| 1612 | 1603 | // reporter de maniere securisee les doublons inclus |
| 1613 | 1604 | . ' |
@@ -1615,15 +1606,15 @@ discard block |
||
| 1615 | 1606 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1616 | 1607 | |
| 1617 | 1608 | $connect = ' . |
| 1618 | - _q($connect) . '; |
|
| 1609 | + _q($connect).'; |
|
| 1619 | 1610 | $page = ' . |
| 1620 | 1611 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1621 | 1612 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1622 | 1613 | // avant de referencer $Cache |
| 1623 | - $corps . '; |
|
| 1614 | + $corps.'; |
|
| 1624 | 1615 | |
| 1625 | 1616 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1626 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1617 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1627 | 1618 | }'; |
| 1628 | 1619 | |
| 1629 | 1620 | $secondes = spip_timer('calcul_skel'); |
@@ -1637,10 +1628,10 @@ discard block |
||
| 1637 | 1628 | $code->return = ' |
| 1638 | 1629 | // |
| 1639 | 1630 | // Fonction principale du squelette ' . |
| 1640 | - $sourcefile . |
|
| 1641 | - ($connect ? " pour $connect" : '') . |
|
| 1642 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1643 | - "\n//\n" . |
|
| 1631 | + $sourcefile. |
|
| 1632 | + ($connect ? " pour $connect" : ''). |
|
| 1633 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1634 | + "\n//\n". |
|
| 1644 | 1635 | $principal; |
| 1645 | 1636 | |
| 1646 | 1637 | $boucles[''] = $code; |
@@ -1692,7 +1683,7 @@ discard block |
||
| 1692 | 1683 | **/ |
| 1693 | 1684 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1694 | 1685 | include_spip('iterateur/data'); |
| 1695 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1686 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1696 | 1687 | $g = charger_fonction('data', 'iterateur'); |
| 1697 | 1688 | $boucles[$id] = $g($boucle); |
| 1698 | 1689 | // from[0] stocke le type de data (rss, yql, ...) |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 58 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 59 | 59 | |
| 60 | 60 | // si squelette est deja compile et perenne, le charger |
| 61 | 61 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | #} |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 71 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 72 | 72 | include_once $lib; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | eval("return true; $f ;"); |
| 97 | 97 | } catch (\ParseError $e) { |
| 98 | 98 | // Code syntaxiquement faux (critere etc mal programme') |
| 99 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 99 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 100 | 100 | erreur_squelette($msg, $boucle); |
| 101 | 101 | // continuer pour trouver d'autres fautes eventuelles |
| 102 | 102 | // mais prevenir que c'est mort |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if (defined('_VAR_MODE') && _VAR_MODE == 'debug') { |
| 126 | 126 | // Tracer ce qui vient d'etre compile |
| 127 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 127 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 128 | 128 | |
| 129 | 129 | // si c'est ce que demande le debusqueur, lui passer la main |
| 130 | 130 | if ( |
@@ -148,13 +148,13 @@ discard block |
||
| 148 | 148 | $code = " |
| 149 | 149 | /* |
| 150 | 150 | * Squelette : $sourcefile |
| 151 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 152 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 153 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 151 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 152 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 153 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 154 | 154 | */ '; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n"; |
|
| 157 | + $code = '<'."?php\n".$code.join('', $boucles)."\n"; |
|
| 158 | 158 | if (!defined('_VAR_NOCACHE') || !_VAR_NOCACHE) { |
| 159 | 159 | ecrire_fichier($phpfile, $code); |
| 160 | 160 | } |
@@ -215,16 +215,16 @@ discard block |
||
| 215 | 215 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 216 | 216 | |
| 217 | 217 | if ($j == 'X-Spip-Filtre' && isset($headers[$j])) { |
| 218 | - $headers[$j] .= '|' . $r[3]; |
|
| 218 | + $headers[$j] .= '|'.$r[3]; |
|
| 219 | 219 | } else { |
| 220 | - $headers[$j] = str_replace(['\\\\',"\\'",'\\"'], ['\\',"'",'"'], $r[3]); |
|
| 220 | + $headers[$j] = str_replace(['\\\\', "\\'", '\\"'], ['\\', "'", '"'], $r[3]); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | // S'agit-il d'un resultat constant ou contenant du code php |
| 225 | 225 | $process_ins = ( |
| 226 | - !str_contains($corps, '<' . '?') |
|
| 227 | - || str_contains($corps, '<' . '?xml') && !str_contains(str_replace('<' . '?xml', '', $corps), '<' . '?') |
|
| 226 | + !str_contains($corps, '<'.'?') |
|
| 227 | + || str_contains($corps, '<'.'?xml') && !str_contains(str_replace('<'.'?xml', '', $corps), '<'.'?') |
|
| 228 | 228 | ) |
| 229 | 229 | ? 'html' |
| 230 | 230 | : 'php'; |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | if ($process_ins == 'html') { |
| 255 | 255 | $skel['process_ins'] = ( |
| 256 | - !str_contains($corps, '<' . '?') |
|
| 257 | - || str_contains($corps, '<' . '?xml') && !str_contains(str_replace('<' . '?xml', '', $corps), '<' . '?') |
|
| 256 | + !str_contains($corps, '<'.'?') |
|
| 257 | + || str_contains($corps, '<'.'?xml') && !str_contains(str_replace('<'.'?xml', '', $corps), '<'.'?') |
|
| 258 | 258 | ) |
| 259 | 259 | ? 'html' |
| 260 | 260 | : 'php'; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | // |
| 273 | 273 | |
| 274 | 274 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 275 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 275 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 276 | 276 | include_once("%s"); |
| 277 | 277 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 278 | 278 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | // pas de lien symbolique sous Windows |
| 304 | 304 | && !(stristr(PHP_OS, 'WIN') && str_contains($file, ':')) |
| 305 | 305 | ) { |
| 306 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 306 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $lang = $context_compil[4]; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | $args = array_map('argumenter_squelette', $args); |
| 315 | 315 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 316 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 316 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 317 | 317 | } |
| 318 | 318 | $args = join(', ', $args); |
| 319 | 319 | |
@@ -347,14 +347,14 @@ discard block |
||
| 347 | 347 | if (is_object($v)) { |
| 348 | 348 | return var_export($v, true); |
| 349 | 349 | } elseif (!is_array($v)) { |
| 350 | - return "'" . texte_script((string) $v) . "'"; |
|
| 350 | + return "'".texte_script((string) $v)."'"; |
|
| 351 | 351 | } else { |
| 352 | 352 | $out = []; |
| 353 | 353 | foreach ($v as $k => $val) { |
| 354 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 354 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - return 'array(' . join(', ', $out) . ')'; |
|
| 357 | + return 'array('.join(', ', $out).')'; |
|
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | } |
| 380 | 380 | else { |
| 381 | 381 | $str_args = base64_encode(serialize($args)); |
| 382 | - return '<?' . "php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?" . ">\n"; |
|
| 382 | + return '<?'."php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?".">\n"; |
|
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | // Y a-t-il une fonction de traitement des arguments ? |
| 460 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 460 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 461 | 461 | |
| 462 | 462 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 463 | 463 | |
@@ -467,18 +467,18 @@ discard block |
||
| 467 | 467 | |
| 468 | 468 | // verifier que la fonction dyn est la, |
| 469 | 469 | // sinon se replier sur la generique si elle existe |
| 470 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 470 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 471 | 471 | if ( |
| 472 | 472 | ($balise_generique = chercher_balise_generique($nom)) |
| 473 | 473 | && ($nom_balise_generique = $balise_generique['nom_generique']) |
| 474 | - && ($file = include_spip('balise/' . strtolower($nom_balise_generique))) |
|
| 475 | - && function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 474 | + && ($file = include_spip('balise/'.strtolower($nom_balise_generique))) |
|
| 475 | + && function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 476 | 476 | ) { |
| 477 | 477 | // et lui injecter en premier arg le nom de la balise |
| 478 | 478 | array_unshift($r, $nom); |
| 479 | 479 | $nom_balise = $nom_balise_generique; |
| 480 | 480 | if (!_DIR_RESTREINT) { |
| 481 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 481 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 482 | 482 | } |
| 483 | 483 | } else { |
| 484 | 484 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $n = ''; |
| 581 | 581 | foreach (explode(',', $liste) as $val) { |
| 582 | 582 | if (($a = intval($val)) && $val === strval($a)) { |
| 583 | - $n .= ',' . $val; |
|
| 583 | + $n .= ','.$val; |
|
| 584 | 584 | } |
| 585 | 585 | } |
| 586 | 586 | if (strlen($n)) { |
@@ -759,8 +759,8 @@ discard block |
||
| 759 | 759 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 760 | 760 | $i = 0; |
| 761 | 761 | do { |
| 762 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 763 | - [$sous[1] . ' AS id'], |
|
| 762 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 763 | + [$sous[1].' AS id'], |
|
| 764 | 764 | $from, |
| 765 | 765 | $from_type, |
| 766 | 766 | $wheresub, |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $id, |
| 774 | 774 | $serveur, |
| 775 | 775 | false |
| 776 | - ) . ')'); |
|
| 776 | + ).')'); |
|
| 777 | 777 | if (!$i) { |
| 778 | 778 | $i = 1; |
| 779 | 779 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | if ($sous[0] == 'SUBSELECT') { |
| 793 | 793 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 794 | 794 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 795 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 795 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 796 | 796 | $sous[1], # select |
| 797 | 797 | $sous[2], #from |
| 798 | 798 | [], #from_type |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | $id, |
| 808 | 808 | $serveur, |
| 809 | 809 | false |
| 810 | - ) . ')'); |
|
| 810 | + ).')'); |
|
| 811 | 811 | } |
| 812 | 812 | array_pop($where_simples); |
| 813 | 813 | } |
@@ -870,15 +870,15 @@ discard block |
||
| 870 | 870 | // sans recours a preg_match |
| 871 | 871 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 872 | 872 | $afrom[$t][$cle] = [ |
| 873 | - "\n" . |
|
| 874 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 873 | + "\n". |
|
| 874 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 875 | 875 | $from[$cle], |
| 876 | 876 | "AS $cle", |
| 877 | 877 | 'ON (', |
| 878 | 878 | "$cle.$c", |
| 879 | 879 | '=', |
| 880 | 880 | "$t.$carr", |
| 881 | - ($and ? 'AND ' . $and : '') . |
|
| 881 | + ($and ? 'AND '.$and : ''). |
|
| 882 | 882 | ')' |
| 883 | 883 | ]; |
| 884 | 884 | if (isset($afrom[$cle])) { |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | $t = key($from); |
| 917 | 917 | $c = current($from); |
| 918 | 918 | reset($from); |
| 919 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 919 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 920 | 920 | if ( |
| 921 | 921 | !( |
| 922 | 922 | strpos($t, ' ') |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | unset($afrom[$t][$nt]); |
| 937 | 937 | $afrom[$nt] = $afrom[$t]; |
| 938 | 938 | unset($afrom[$t]); |
| 939 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 939 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 940 | 940 | $t = $nfrom[4]; |
| 941 | 941 | $alias = ''; |
| 942 | 942 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -947,14 +947,14 @@ discard block |
||
| 947 | 947 | if ($newcle != $oldcle) { |
| 948 | 948 | // si l'ancienne cle etait deja dans le select avec un AS |
| 949 | 949 | // reprendre simplement ce AS |
| 950 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 950 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 951 | 951 | if (preg_match($as, implode(',', $select), $m)) { |
| 952 | 952 | $alias = ''; |
| 953 | 953 | } else { |
| 954 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 954 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 957 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 958 | 958 | $join = remplacer_jointnul($t, $join, $e); |
| 959 | 959 | $where = remplacer_jointnul($t, $where, $e); |
| 960 | 960 | $having = remplacer_jointnul($t, $having, $e); |
@@ -1004,9 +1004,9 @@ discard block |
||
| 1004 | 1004 | } else { |
| 1005 | 1005 | $exp = ''; |
| 1006 | 1006 | if (strtoupper($join) === 'AND') { |
| 1007 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1007 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1008 | 1008 | } else { |
| 1009 | - return $exp . join($join, $v); |
|
| 1009 | + return $exp.join($join, $v); |
|
| 1010 | 1010 | } |
| 1011 | 1011 | } |
| 1012 | 1012 | } |
@@ -1068,6 +1068,6 @@ discard block |
||
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 | return $mime_type |
| 1071 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1072 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1071 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1072 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1073 | 1073 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | try { |
| 52 | - $res = eval('?' . '>' . $page['texte']); |
|
| 52 | + $res = eval('?'.'>'.$page['texte']); |
|
| 53 | 53 | $page['texte'] = ob_get_contents(); |
| 54 | 54 | } catch (\Throwable $e) { |
| 55 | 55 | $code = $page['texte']; |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | if (!function_exists('numerote_ligne_php')) { |
| 58 | 58 | function numerote_ligne_php($match) { |
| 59 | 59 | $GLOBALS['numero_ligne_php']++; |
| 60 | - return "\n/*" . str_pad((string) $GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 60 | + return "\n/*".str_pad((string) $GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', (string) $code); |
|
| 63 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', (string) $code); |
|
| 64 | 64 | $code = trim(highlight_string($code, true)); |
| 65 | - erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]); |
|
| 65 | + erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]); |
|
| 66 | 66 | $page['texte'] = '<!-- Erreur -->'; |
| 67 | 67 | } |
| 68 | 68 | ob_end_clean(); |
@@ -55,19 +55,19 @@ discard block |
||
| 55 | 55 | * Nom d'une balise #TOTO |
| 56 | 56 | * |
| 57 | 57 | * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */ |
| 58 | -define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 58 | +define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 59 | 59 | /** Balise complète [...(#TOTO) ... ] */ |
| 60 | -define('CHAMP_ETENDU', '/\[([^\[]*?)\(' . NOM_DE_CHAMP . '([^)]*\)[^]]*)\]/S'); |
|
| 60 | +define('CHAMP_ETENDU', '/\[([^\[]*?)\('.NOM_DE_CHAMP.'([^)]*\)[^]]*)\]/S'); |
|
| 61 | 61 | |
| 62 | 62 | define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S'); |
| 63 | 63 | define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims'); |
| 64 | 64 | define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS'); |
| 65 | -define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 65 | +define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 66 | 66 | |
| 67 | 67 | /** Champ sql dans parenthèse ex: (id_article) */ |
| 68 | 68 | define('SQL_ARGS', '(\([^)]*\))'); |
| 69 | 69 | /** Fonction SQL sur un champ ex: SUM(visites) */ |
| 70 | -define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?'); |
|
| 70 | +define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?'); |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * Parser les <INCLURE> dans le texte |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | while ( |
| 267 | 267 | (($p = strpos($texte, '#')) !== false) |
| 268 | - && preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match, PREG_OFFSET_CAPTURE, $p) |
|
| 268 | + && preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match, PREG_OFFSET_CAPTURE, $p) |
|
| 269 | 269 | ) { |
| 270 | 270 | $poss = array_column($match, 1); |
| 271 | 271 | $match = array_column($match, 0); |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $collecte[] = $champ; |
| 420 | 420 | $args = ltrim($regs[count($regs) - 1]); |
| 421 | 421 | } else { |
| 422 | - if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) { |
|
| 422 | + if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) { |
|
| 423 | 423 | // 0 est un aveu d'impuissance. A completer |
| 424 | 424 | $arg = phraser_champs_exterieurs($arg, 0, $sep, $result); |
| 425 | 425 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | */ |
| 506 | 506 | function phraser_champs_exterieurs(string $texte, int $ligne, string $sep, array $nested_res): array { |
| 507 | 507 | $res = []; |
| 508 | - $preg = ',^%' . preg_quote($sep, ',') . '([0-9]+)(\n*)@,'; |
|
| 508 | + $preg = ',^%'.preg_quote($sep, ',').'([0-9]+)(\n*)@,'; |
|
| 509 | 509 | while (($p = strpos($texte, "%$sep")) !== false) { |
| 510 | 510 | $suite = substr($texte, $p); |
| 511 | 511 | if (!preg_match($preg, $suite, $m)) { |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $pos_apres = 0; |
| 581 | 581 | $champs_trouves = phraser_args($match[7], ')', $sep, $champs_trouves, $champ, $pos_apres); |
| 582 | 582 | phraser_vieux($champ); |
| 583 | - $champ->avant = phraser_champs_exterieurs($match[1], $nbl, $sep, $champs_trouves); |
|
| 583 | + $champ->avant = phraser_champs_exterieurs($match[1], $nbl, $sep, $champs_trouves); |
|
| 584 | 584 | $apres = substr($match[7], $pos_apres + 1); |
| 585 | 585 | |
| 586 | 586 | $nbl_debut_champ = 0; |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $j = count($champs_trouves) - 1; |
| 597 | 597 | // on remplace ce champ par un placeholder |
| 598 | 598 | // ajouter $nbl_champ retour ligne pour que la partie conserve le nombre de lignes lors des itérations suivantes |
| 599 | - $parties[] = ($t = "%{$sep}{$j}" . str_repeat("\n", $nbl_champ) . '@'); |
|
| 599 | + $parties[] = ($t = "%{$sep}{$j}".str_repeat("\n", $nbl_champ).'@'); |
|
| 600 | 600 | $nbl += $nbl_champ; |
| 601 | 601 | |
| 602 | 602 | $texte = substr($texte, $poss[0] + strlen($match[0])); |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | // si on a trouvé des morceaux, il faut recommencer |
| 607 | 607 | if (count($parties)) { |
| 608 | 608 | // reprenons tous les morceaux qu'on a mis de côté car ne matchant pas (encore) |
| 609 | - $texte = implode('', $parties) . $texte; |
|
| 609 | + $texte = implode('', $parties).$texte; |
|
| 610 | 610 | } |
| 611 | 611 | } while (count($parties)); |
| 612 | 612 | |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | // une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"} |
| 693 | 693 | if (preg_match(',^(["\'])(.*)\1$,', $m[4])) { |
| 694 | 694 | $c = null; |
| 695 | - eval('$c = ' . $m[4] . ';'); |
|
| 695 | + eval('$c = '.$m[4].';'); |
|
| 696 | 696 | if (isset($c)) { |
| 697 | 697 | $m[4] = $c; |
| 698 | 698 | } |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', (string) $param, $m)) { |
| 773 | 773 | $crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', ''); |
| 774 | 774 | } elseif ( |
| 775 | - preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC . |
|
| 775 | + preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC. |
|
| 776 | 776 | ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', (string) $param, $m) |
| 777 | 777 | ) { |
| 778 | 778 | $a2 = trim($m[8]); |
@@ -789,8 +789,8 @@ discard block |
||
| 789 | 789 | ); |
| 790 | 790 | $crit->exclus = $m[1]; |
| 791 | 791 | } elseif ( |
| 792 | - preg_match('/^([!]?)\s*(' . |
|
| 793 | - CHAMP_SQL_PLUS_FONC . |
|
| 792 | + preg_match('/^([!]?)\s*('. |
|
| 793 | + CHAMP_SQL_PLUS_FONC. |
|
| 794 | 794 | ')\s*(\??)(.*)$/is', (string) $param, $m) |
| 795 | 795 | ) { |
| 796 | 796 | // contient aussi les comparaisons implicites ! |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | // trouver sa position de depart reelle : au <Bxx> ou au <BBxx> |
| 931 | - $precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>'; |
|
| 931 | + $precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>'; |
|
| 932 | 932 | $pos_precond = strpos((string) $texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 933 | 933 | if ( |
| 934 | 934 | $pos_precond !== false |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | $boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle); |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | - $preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>'; |
|
| 942 | + $preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>'; |
|
| 943 | 943 | $pos_preaff = strpos((string) $texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 944 | 944 | if ( |
| 945 | 945 | $pos_preaff !== false |
@@ -988,13 +988,13 @@ discard block |
||
| 988 | 988 | $pos_anonyme_next = null; |
| 989 | 989 | // si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme |
| 990 | 990 | if (!strlen((string) $id_boucle)) { |
| 991 | - $pos_anonyme_next = strpos((string) $texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 991 | + $pos_anonyme_next = strpos((string) $texte, BALISE_BOUCLE.'(', $pos_courante); |
|
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | // |
| 995 | 995 | // 1. Recuperer la partie conditionnelle apres |
| 996 | 996 | // |
| 997 | - $apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>'; |
|
| 997 | + $apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>'; |
|
| 998 | 998 | $pos_apres = strpos((string) $texte, $apres_boucle, $pos_courante); |
| 999 | 999 | if ( |
| 1000 | 1000 | $pos_apres !== false |
@@ -1003,13 +1003,13 @@ discard block |
||
| 1003 | 1003 | $boucle['pos_postcond'] = $pos_apres; |
| 1004 | 1004 | $pos_apres += strlen($apres_boucle); |
| 1005 | 1005 | $boucle['pos_postcond_inside'] = $pos_apres; |
| 1006 | - $pos_courante = $pos_apres ; |
|
| 1006 | + $pos_courante = $pos_apres; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | // |
| 1010 | 1010 | // 2. Récuperer la partie alternative apres |
| 1011 | 1011 | // |
| 1012 | - $altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>'; |
|
| 1012 | + $altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>'; |
|
| 1013 | 1013 | $pos_altern = strpos((string) $texte, $altern_boucle, $pos_courante); |
| 1014 | 1014 | if ( |
| 1015 | 1015 | $pos_altern !== false |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | // |
| 1025 | 1025 | // 3. Recuperer la partie footer non alternative |
| 1026 | 1026 | // |
| 1027 | - $postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>'; |
|
| 1027 | + $postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>'; |
|
| 1028 | 1028 | $pos_postaff = strpos((string) $texte, $postaff_boucle, $pos_courante); |
| 1029 | 1029 | if ( |
| 1030 | 1030 | $pos_postaff !== false |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | $boucle['pos_postaff'] = $pos_postaff; |
| 1034 | 1034 | $pos_postaff += strlen($postaff_boucle); |
| 1035 | 1035 | $boucle['pos_postaff_inside'] = $pos_postaff; |
| 1036 | - $pos_courante = $pos_postaff ; |
|
| 1036 | + $pos_courante = $pos_postaff; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | return $boucle; |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | * @return string |
| 1070 | 1070 | */ |
| 1071 | 1071 | function public_generer_boucle_placeholder(string $id_boucle, &$boucle, string $boucle_placeholder, int $nb_lignes): string { |
| 1072 | - $placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']'; |
|
| 1072 | + $placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']'; |
|
| 1073 | 1073 | //memoriser la boucle a reinjecter |
| 1074 | 1074 | $id_boucle = "$id_boucle"; |
| 1075 | 1075 | phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle); |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | // definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette |
| 1091 | 1091 | if (is_null($boucle_placeholder)) { |
| 1092 | 1092 | do { |
| 1093 | - $boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid())); |
|
| 1093 | + $boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid())); |
|
| 1094 | 1094 | } while (str_contains((string) $texte, $boucle_placeholder)); |
| 1095 | 1095 | } |
| 1096 | 1096 | |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | |
| 1111 | 1111 | // boucle anonyme ? |
| 1112 | 1112 | if (!strlen((string) $id_boucle)) { |
| 1113 | - $id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1113 | + $id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | $pos_debut_boucle = $pos_courante; |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | |
| 1124 | 1124 | $pos_avant = $boucle['pos_precond_inside']; |
| 1125 | 1125 | $result->avant = substr((string) $texte, $pos_avant, $pos_courante - $pos_avant); |
| 1126 | - $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1126 | + $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | // Regarder si on a une partie inconditionnelle avant <BB_xxx> |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | |
| 1133 | 1133 | $pos_preaff = $boucle['pos_preaff_inside']; |
| 1134 | 1134 | $result->preaff = substr((string) $texte, $pos_preaff, $end_preaff - $pos_preaff); |
| 1135 | - $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1135 | + $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | $result->id_boucle = $id_boucle; |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | } else { |
| 1191 | 1191 | $pos_milieu += 1; |
| 1192 | 1192 | |
| 1193 | - $fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>'; |
|
| 1193 | + $fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>'; |
|
| 1194 | 1194 | $pos_fin = strpos((string) $texte, $fin_boucle, $pos_milieu); |
| 1195 | 1195 | if ($pos_fin === false) { |
| 1196 | 1196 | $err_b = [ |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | else { |
| 1204 | 1204 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1205 | 1205 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1206 | - $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
|
| 1206 | + $search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'('; |
|
| 1207 | 1207 | $search_from = $pos_milieu; |
| 1208 | 1208 | $nb_open = 1; |
| 1209 | 1209 | $nb_close = 1; |
@@ -1243,7 +1243,7 @@ discard block |
||
| 1243 | 1243 | if ($boucle['pos_postcond']) { |
| 1244 | 1244 | $result->apres = substr((string) $texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante); |
| 1245 | 1245 | $ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']); |
| 1246 | - $pos_courante = $boucle['pos_postcond_inside'] ; |
|
| 1246 | + $pos_courante = $boucle['pos_postcond_inside']; |
|
| 1247 | 1247 | } |
| 1248 | 1248 | |
| 1249 | 1249 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ) { |
| 33 | 33 | // si l'url est une url du site, on la laisse passer sans rien faire |
| 34 | 34 | // c'est encore le plus simple |
| 35 | - $base = $GLOBALS['meta']['adresse_site'] . '/'; |
|
| 35 | + $base = $GLOBALS['meta']['adresse_site'].'/'; |
|
| 36 | 36 | if (strlen($base) && str_starts_with($redirect, $base)) { |
| 37 | 37 | return $redirect; |
| 38 | 38 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | if ($ancre = _request('var_ajax_ancre')) { |
| 154 | 154 | // pas n'importe quoi quand meme dans la variable ! |
| 155 | 155 | $ancre = str_replace(['<', '"', "'"], ['<', '"', ''], $ancre); |
| 156 | - $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte; |
|
| 156 | + $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte; |
|
| 157 | 157 | } |
| 158 | 158 | } else { |
| 159 | 159 | include_spip('inc/headers'); |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | $sign = _request('formulaire_action_sign'); |
| 196 | 196 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 197 | 197 | if (empty($sign)) { |
| 198 | - spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires' . _LOG_ERREUR); |
|
| 198 | + spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires'._LOG_ERREUR); |
|
| 199 | 199 | return false; |
| 200 | 200 | } |
| 201 | 201 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 202 | 202 | $secu = $securiser_action($form, $args, '', -1); |
| 203 | 203 | if ($sign !== $secu['hash']) { |
| 204 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires' . _LOG_ERREUR); |
|
| 204 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires'._LOG_ERREUR); |
|
| 205 | 205 | return false; |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | else { |
| 209 | 209 | if (!empty($sign)) { |
| 210 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires' . _LOG_ERREUR); |
|
| 210 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires'._LOG_ERREUR); |
|
| 211 | 211 | return false; |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | include_spip('inc/filtres'); |
| 216 | 216 | if (($args = decoder_contexte_ajax($args, $form)) === false) { |
| 217 | - spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires' . _LOG_ERREUR); |
|
| 217 | + spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires'._LOG_ERREUR); |
|
| 218 | 218 | |
| 219 | 219 | return false; // continuons le hit comme si de rien etait |
| 220 | 220 | } else { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | // on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7 |
| 331 | 331 | // sans cela le formulaire n'est pas actif apres le hit ajax |
| 332 | 332 | // la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe |
| 333 | - $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour; |
|
| 333 | + $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour; |
|
| 334 | 334 | ajax_retour($retour, false); |
| 335 | 335 | |
| 336 | 336 | return true; // on a fini le hit |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | if (strlen($dossier) && !str_ends_with($dossier, '/')) { |
| 53 | 53 | $dossier .= '/'; |
| 54 | 54 | } |
| 55 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 55 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 56 | 56 | |
| 57 | 57 | if (function_exists($f)) { |
| 58 | 58 | return $f; |
| 59 | 59 | } |
| 60 | - if (function_exists($g = $f . '_dist')) { |
|
| 60 | + if (function_exists($g = $f.'_dist')) { |
|
| 61 | 61 | return $g; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | // passer en minuscules (cf les balises de formulaires) |
| 79 | 79 | // et inclure le fichier |
| 80 | 80 | if ( |
| 81 | - !($inc = include_spip($dossier . ($d = strtolower($nom)))) |
|
| 81 | + !($inc = include_spip($dossier.($d = strtolower($nom)))) |
|
| 82 | 82 | && strlen(dirname($dossier)) |
| 83 | 83 | && dirname($dossier) != '.' |
| 84 | 84 | ) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Echec : message d'erreur |
| 99 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 99 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 100 | 100 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 101 | 101 | |
| 102 | 102 | include_spip('inc/minipres'); |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | echo minipres( |
| 105 | 105 | _T('forum_titre_erreur'), |
| 106 | 106 | $inc ? |
| 107 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 107 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 108 | 108 | . '<br />' |
| 109 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 109 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 110 | 110 | : |
| 111 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 112 | - ['all_inline' => true,'status' => 404] |
|
| 111 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 112 | + ['all_inline' => true, 'status' => 404] |
|
| 113 | 113 | ); |
| 114 | 114 | exit; |
| 115 | 115 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * - string : chemin du fichier trouvé |
| 156 | 156 | **/ |
| 157 | 157 | function include_spip($f, $include = true) { |
| 158 | - return find_in_path($f . '.php', '', $include); |
|
| 158 | + return find_in_path($f.'.php', '', $include); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * - string : chemin du fichier trouvé |
| 176 | 176 | **/ |
| 177 | 177 | function require_spip($f) { |
| 178 | - return find_in_path($f . '.php', '', 'required'); |
|
| 178 | + return find_in_path($f.'.php', '', 'required'); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | // donc il faut l'inclure "en globals" |
| 193 | 193 | if ($f = find_in_path('mes_fonctions.php')) { |
| 194 | 194 | global $dossier_squelettes; |
| 195 | - include_once(_ROOT_CWD . $f); |
|
| 195 | + include_once(_ROOT_CWD.$f); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | // appliquer notre fonction si elle existe |
| 300 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 300 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 301 | 301 | if (function_exists($fonc)) { |
| 302 | 302 | $val = $fonc($val); |
| 303 | 303 | } // plantage ? |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | function spip_log($message = null, $name = null) { |
| 363 | 363 | static $pre = []; |
| 364 | 364 | static $log; |
| 365 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 365 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 366 | 366 | if (!isset($regs[1]) || !$logname = $regs[1]) { |
| 367 | 367 | $logname = null; |
| 368 | 368 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (!is_string($message)) { |
| 391 | 391 | $message = print_r($message, true); |
| 392 | 392 | } |
| 393 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 393 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -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 (!str_ends_with($r[1], '[]')) { |
| 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 = (str_ends_with($k, '[]')) ? $k : ($k . '[]'); |
|
| 650 | + $id = (str_ends_with($k, '[]')) ? $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 | /** |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | * @return bool |
| 811 | 811 | */ |
| 812 | 812 | function test_plugin_actif($plugin) { |
| 813 | - return ($plugin && defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 813 | + return ($plugin && defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | /** |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | $value = interdire_scripts($value, -1); |
| 943 | 943 | } |
| 944 | 944 | if (!empty($options['class'])) { |
| 945 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 945 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 946 | 946 | } |
| 947 | 947 | $text = str_replace("@$name@", (string) $value, (string) $text); |
| 948 | 948 | unset($args[$name]); |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | // Si des variables n'ont pas ete inserees, le signaler |
| 952 | 952 | // (chaines de langues pas a jour) |
| 953 | 953 | if ($args) { |
| 954 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 954 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | function joli_repertoire($rep) { |
| 976 | 976 | $a = substr($rep, 0, 1); |
| 977 | 977 | if ($a <> '.' && $a <> '/') { |
| 978 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 978 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 979 | 979 | } |
| 980 | 980 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 981 | 981 | |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | $p -= ($x * 1000); |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1032 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1033 | 1033 | } |
| 1034 | 1034 | } |
| 1035 | 1035 | |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | if ($taches && count($taches) && !spip_connect()) { |
| 1097 | 1097 | return false; |
| 1098 | 1098 | } |
| 1099 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1099 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1100 | 1100 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1101 | 1101 | return $genie($taches); |
| 1102 | 1102 | } |
@@ -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') && defined('_MEMOIZE_MEMORY') && _MEMOIZE_MEMORY) { |
@@ -1269,8 +1269,8 @@ discard block |
||
| 1269 | 1269 | $src = ''; |
| 1270 | 1270 | } |
| 1271 | 1271 | if ($script) { |
| 1272 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1273 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1272 | + $script = ("/*<![CDATA[*/\n". |
|
| 1273 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1274 | 1274 | '/*]]>*/'); |
| 1275 | 1275 | } |
| 1276 | 1276 | if ($noscript) { |
@@ -1359,13 +1359,13 @@ discard block |
||
| 1359 | 1359 | if ($path_base == null) { |
| 1360 | 1360 | // Chemin standard depuis l'espace public |
| 1361 | 1361 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1362 | - _DIR_RACINE . ':' . |
|
| 1363 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1364 | - _DIR_RACINE . 'prive/:' . |
|
| 1362 | + _DIR_RACINE.':'. |
|
| 1363 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1364 | + _DIR_RACINE.'prive/:'. |
|
| 1365 | 1365 | _DIR_RESTREINT; |
| 1366 | 1366 | // Ajouter squelettes/ |
| 1367 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1368 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1367 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1368 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1369 | 1369 | } |
| 1370 | 1370 | foreach (explode(':', $path) as $dir) { |
| 1371 | 1371 | if (strlen($dir) && !str_ends_with($dir, '/')) { |
@@ -1377,7 +1377,7 @@ discard block |
||
| 1377 | 1377 | // Et le(s) dossier(s) des squelettes nommes |
| 1378 | 1378 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1379 | 1379 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1380 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1380 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1381 | 1381 | } |
| 1382 | 1382 | } |
| 1383 | 1383 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | |
| 1389 | 1389 | if (is_array($dir_path) || strlen($dir_path)) { |
| 1390 | 1390 | $tete = ''; |
| 1391 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1391 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1392 | 1392 | $tete = array_shift($path_base); |
| 1393 | 1393 | } |
| 1394 | 1394 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | // Et le(s) dossier(s) des squelettes nommes |
| 1410 | 1410 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1411 | 1411 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1412 | - array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1412 | + array_unshift($path_full, ((isset($d[0]) && $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1413 | 1413 | } |
| 1414 | 1414 | } |
| 1415 | 1415 | |
@@ -1485,14 +1485,14 @@ discard block |
||
| 1485 | 1485 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1486 | 1486 | if ( |
| 1487 | 1487 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1488 | - && ($file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg') |
|
| 1488 | + && ($file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg') |
|
| 1489 | 1489 | && ($f = find_in_theme("$file_svg_generique")) |
| 1490 | 1490 | ) { |
| 1491 | - if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) { |
|
| 1491 | + if (($fsize = substr($f, 0, -6).$m[1].'.svg') && file_exists($fsize)) { |
|
| 1492 | 1492 | return $themefiles["$subdir$file"] = $fsize; |
| 1493 | 1493 | } |
| 1494 | 1494 | else { |
| 1495 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1495 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1496 | 1496 | } |
| 1497 | 1497 | } |
| 1498 | 1498 | |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | return $themefiles["$subdir$file"] = $f; |
| 1503 | 1503 | } |
| 1504 | 1504 | } |
| 1505 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1505 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1506 | 1506 | |
| 1507 | 1507 | return $themefiles["$subdir$file"] = ''; |
| 1508 | 1508 | } |
@@ -1610,8 +1610,8 @@ discard block |
||
| 1610 | 1610 | return false; |
| 1611 | 1611 | } |
| 1612 | 1612 | if ($include && !isset($inc[$dirname][$file])) { |
| 1613 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1614 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1613 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1614 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1624,14 +1624,14 @@ discard block |
||
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | foreach (creer_chemin() as $dir) { |
| 1627 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1628 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1627 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1628 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1629 | 1629 | } |
| 1630 | 1630 | if ($dirs[$a]) { |
| 1631 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1631 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1632 | 1632 | if ($include && !isset($inc[$dirname][$file])) { |
| 1633 | - include_once _ROOT_CWD . $a; |
|
| 1634 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1633 | + include_once _ROOT_CWD.$a; |
|
| 1634 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | if (!defined('_SAUVER_CHEMIN')) { |
| 1637 | 1637 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1641,7 +1641,7 @@ discard block |
||
| 1641 | 1641 | define('_SAUVER_CHEMIN', true); |
| 1642 | 1642 | } |
| 1643 | 1643 | |
| 1644 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1644 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1645 | 1645 | } |
| 1646 | 1646 | } |
| 1647 | 1647 | } |
@@ -1667,7 +1667,7 @@ discard block |
||
| 1667 | 1667 | define('_SAUVER_CHEMIN', true); |
| 1668 | 1668 | } |
| 1669 | 1669 | |
| 1670 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1670 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1671 | 1671 | } |
| 1672 | 1672 | |
| 1673 | 1673 | function clear_path_cache() { |
@@ -1737,12 +1737,12 @@ discard block |
||
| 1737 | 1737 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1738 | 1738 | // on a pas encore inclus flock.php |
| 1739 | 1739 | if (!function_exists('preg_files')) { |
| 1740 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1740 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | // Parcourir le chemin |
| 1744 | 1744 | foreach (creer_chemin() as $d) { |
| 1745 | - $f = $d . $dir; |
|
| 1745 | + $f = $d.$dir; |
|
| 1746 | 1746 | if (@is_dir($f)) { |
| 1747 | 1747 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1748 | 1748 | foreach ($liste as $chemin) { |
@@ -1794,8 +1794,8 @@ discard block |
||
| 1794 | 1794 | if ($type === 'defaut') { |
| 1795 | 1795 | $objet = objet_type($quoi); |
| 1796 | 1796 | if ( |
| 1797 | - ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true)) |
|
| 1798 | - || ($f = charger_fonction('generer_url_' . $objet, 'urls', true)) // deprecated |
|
| 1797 | + ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true)) |
|
| 1798 | + || ($f = charger_fonction('generer_url_'.$objet, 'urls', true)) // deprecated |
|
| 1799 | 1799 | ) { |
| 1800 | 1800 | return $f; |
| 1801 | 1801 | } |
@@ -1808,7 +1808,7 @@ discard block |
||
| 1808 | 1808 | } |
| 1809 | 1809 | |
| 1810 | 1810 | // inclure le module d'url |
| 1811 | - include_spip('urls/' . $url_type); |
|
| 1811 | + include_spip('urls/'.$url_type); |
|
| 1812 | 1812 | |
| 1813 | 1813 | switch ($quoi) { |
| 1814 | 1814 | case 'page': |
@@ -1908,7 +1908,7 @@ discard block |
||
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | // On a ete gentil mais la .... |
| 1911 | - spip_log("generer_objet_url: entite $entite " . ($public ? "($f)" : '') . " inconnue $type $public $connect", _LOG_ERREUR); |
|
| 1911 | + spip_log("generer_objet_url: entite $entite ".($public ? "($f)" : '')." inconnue $type $public $connect", _LOG_ERREUR); |
|
| 1912 | 1912 | |
| 1913 | 1913 | return ''; |
| 1914 | 1914 | } |
@@ -1959,8 +1959,8 @@ discard block |
||
| 1959 | 1959 | include_spip('base/connect_sql'); |
| 1960 | 1960 | $id_type = id_table_objet($entite, $public); |
| 1961 | 1961 | |
| 1962 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1963 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1962 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1963 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1964 | 1964 | . (!$args ? '' : "&$args") |
| 1965 | 1965 | . (!$ancre ? '' : "#$ancre"); |
| 1966 | 1966 | } |
@@ -2129,7 +2129,7 @@ discard block |
||
| 2129 | 2129 | !empty($_SERVER['QUERY_STRING']) |
| 2130 | 2130 | && !str_contains($_SERVER['REQUEST_URI'], '?') |
| 2131 | 2131 | ) { |
| 2132 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2132 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2133 | 2133 | } |
| 2134 | 2134 | } |
| 2135 | 2135 | } |
@@ -2167,9 +2167,9 @@ discard block |
||
| 2167 | 2167 | array_shift($myself); |
| 2168 | 2168 | $myself = implode('/', $myself); |
| 2169 | 2169 | } |
| 2170 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2170 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2171 | 2171 | |
| 2172 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2172 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2173 | 2173 | |
| 2174 | 2174 | return $url; |
| 2175 | 2175 | } |
@@ -2208,16 +2208,16 @@ discard block |
||
| 2208 | 2208 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2209 | 2209 | $script ??= ''; |
| 2210 | 2210 | if (!$rel) { |
| 2211 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2211 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2212 | 2212 | } else { |
| 2213 | 2213 | if (!is_string($rel)) { |
| 2214 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2214 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2215 | 2215 | } |
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2219 | 2219 | if ($script && ($script <> 'accueil' || $rel)) { |
| 2220 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2220 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2221 | 2221 | } elseif ($args) { |
| 2222 | 2222 | $args = "?$args"; |
| 2223 | 2223 | } |
@@ -2225,7 +2225,7 @@ discard block |
||
| 2225 | 2225 | $args .= "#$ancre"; |
| 2226 | 2226 | } |
| 2227 | 2227 | |
| 2228 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2228 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2229 | 2229 | } |
| 2230 | 2230 | |
| 2231 | 2231 | // |
@@ -2307,10 +2307,10 @@ discard block |
||
| 2307 | 2307 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2308 | 2308 | } |
| 2309 | 2309 | if ($args) { |
| 2310 | - $action .= (str_contains($action, '?') ? '&' : '?') . $args; |
|
| 2310 | + $action .= (str_contains($action, '?') ? '&' : '?').$args; |
|
| 2311 | 2311 | } |
| 2312 | 2312 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2313 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2313 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2314 | 2314 | } |
| 2315 | 2315 | |
| 2316 | 2316 | if (!$no_entities) { |
@@ -2322,7 +2322,7 @@ discard block |
||
| 2322 | 2322 | |
| 2323 | 2323 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2324 | 2324 | |
| 2325 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2325 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2326 | 2326 | } |
| 2327 | 2327 | |
| 2328 | 2328 | // Pour les formulaires en methode POST, |
@@ -2357,8 +2357,7 @@ discard block |
||
| 2357 | 2357 | . "><div>\n" |
| 2358 | 2358 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2359 | 2359 | . $corps |
| 2360 | - . (!$submit ? '' : |
|
| 2361 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2360 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2362 | 2361 | . "</div></form>\n"; |
| 2363 | 2362 | } |
| 2364 | 2363 | |
@@ -2383,14 +2382,14 @@ discard block |
||
| 2383 | 2382 | ? generer_url_ecrire(_request('exec')) |
| 2384 | 2383 | : generer_url_public(); |
| 2385 | 2384 | |
| 2386 | - return "\n<form action='" . |
|
| 2387 | - $h . |
|
| 2388 | - "'" . |
|
| 2389 | - $atts . |
|
| 2390 | - ">\n" . |
|
| 2391 | - '<div>' . |
|
| 2392 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2393 | - $corps . |
|
| 2385 | + return "\n<form action='". |
|
| 2386 | + $h. |
|
| 2387 | + "'". |
|
| 2388 | + $atts. |
|
| 2389 | + ">\n". |
|
| 2390 | + '<div>'. |
|
| 2391 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2392 | + $corps. |
|
| 2394 | 2393 | '</div></form>'; |
| 2395 | 2394 | } |
| 2396 | 2395 | |
@@ -2418,7 +2417,7 @@ discard block |
||
| 2418 | 2417 | : generer_url_public('', '', false, false); |
| 2419 | 2418 | $url = parametre_url($url, 'action', $script); |
| 2420 | 2419 | if ($args) { |
| 2421 | - $url .= quote_amp('&' . $args); |
|
| 2420 | + $url .= quote_amp('&'.$args); |
|
| 2422 | 2421 | } |
| 2423 | 2422 | |
| 2424 | 2423 | if ($no_entities) { |
@@ -2452,9 +2451,9 @@ discard block |
||
| 2452 | 2451 | } |
| 2453 | 2452 | $url = |
| 2454 | 2453 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2455 | - . $script . '/' |
|
| 2454 | + . $script.'/' |
|
| 2456 | 2455 | . ($path ? trim($path, '/') : '') |
| 2457 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2456 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2458 | 2457 | |
| 2459 | 2458 | if ($no_entities) { |
| 2460 | 2459 | $url = str_replace('&', '&', $url); |
@@ -2503,22 +2502,22 @@ discard block |
||
| 2503 | 2502 | |
| 2504 | 2503 | // le nom du repertoire plugins/ activables/desactivables |
| 2505 | 2504 | if (!defined('_DIR_PLUGINS')) { |
| 2506 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2505 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2507 | 2506 | } |
| 2508 | 2507 | |
| 2509 | 2508 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2510 | 2509 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2511 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2510 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2512 | 2511 | } |
| 2513 | 2512 | |
| 2514 | 2513 | // le nom du repertoire des librairies |
| 2515 | 2514 | if (!defined('_DIR_LIB')) { |
| 2516 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2515 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2517 | 2516 | } |
| 2518 | 2517 | |
| 2519 | 2518 | // répertoire des libs via Composer |
| 2520 | 2519 | if (!defined('_DIR_VENDOR')) { |
| 2521 | - define('_DIR_VENDOR', _DIR_RACINE . 'vendor/'); |
|
| 2520 | + define('_DIR_VENDOR', _DIR_RACINE.'vendor/'); |
|
| 2522 | 2521 | } |
| 2523 | 2522 | |
| 2524 | 2523 | if (!defined('_DIR_IMG')) { |
@@ -2528,29 +2527,29 @@ discard block |
||
| 2528 | 2527 | define('_DIR_LOGOS', $pa); |
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_DIR_IMG_ICONES')) { |
| 2531 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2530 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | |
| 2534 | 2533 | if (!defined('_DIR_DUMP')) { |
| 2535 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2534 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2536 | 2535 | } |
| 2537 | 2536 | if (!defined('_DIR_SESSIONS')) { |
| 2538 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2537 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2539 | 2538 | } |
| 2540 | 2539 | if (!defined('_DIR_TRANSFERT')) { |
| 2541 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2540 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2542 | 2541 | } |
| 2543 | 2542 | if (!defined('_DIR_CACHE')) { |
| 2544 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2543 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2545 | 2544 | } |
| 2546 | 2545 | if (!defined('_DIR_CACHE_XML')) { |
| 2547 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2546 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2548 | 2547 | } |
| 2549 | 2548 | if (!defined('_DIR_SKELS')) { |
| 2550 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2549 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2551 | 2550 | } |
| 2552 | 2551 | if (!defined('_DIR_AIDE')) { |
| 2553 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2552 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2554 | 2553 | } |
| 2555 | 2554 | if (!defined('_DIR_TMP')) { |
| 2556 | 2555 | define('_DIR_TMP', $ti); |
@@ -2579,27 +2578,27 @@ discard block |
||
| 2579 | 2578 | // Declaration des fichiers |
| 2580 | 2579 | |
| 2581 | 2580 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2582 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2581 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2585 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2584 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2588 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2587 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2589 | 2588 | } |
| 2590 | 2589 | if (!defined('_CACHE_PIPELINES')) { |
| 2591 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2590 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2592 | 2591 | } |
| 2593 | 2592 | if (!defined('_CACHE_CHEMIN')) { |
| 2594 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2593 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2595 | 2594 | } |
| 2596 | 2595 | |
| 2597 | 2596 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2598 | 2597 | if (!defined('_FILE_META')) { |
| 2599 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2598 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2600 | 2599 | } |
| 2601 | 2600 | if (!defined('_DIR_LOG')) { |
| 2602 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2601 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2603 | 2602 | } |
| 2604 | 2603 | if (!defined('_FILE_LOG')) { |
| 2605 | 2604 | define('_FILE_LOG', 'spip'); |
@@ -2615,7 +2614,7 @@ discard block |
||
| 2615 | 2614 | if (!defined('_FILE_CONNECT')) { |
| 2616 | 2615 | define( |
| 2617 | 2616 | '_FILE_CONNECT', |
| 2618 | - @is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : false |
|
| 2617 | + @is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f : false |
|
| 2619 | 2618 | ); |
| 2620 | 2619 | } |
| 2621 | 2620 | |
@@ -2626,7 +2625,7 @@ discard block |
||
| 2626 | 2625 | if (!defined('_FILE_CHMOD')) { |
| 2627 | 2626 | define( |
| 2628 | 2627 | '_FILE_CHMOD', |
| 2629 | - @is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f : false |
|
| 2628 | + @is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f : false |
|
| 2630 | 2629 | ); |
| 2631 | 2630 | } |
| 2632 | 2631 | |
@@ -2638,10 +2637,10 @@ discard block |
||
| 2638 | 2637 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2639 | 2638 | } |
| 2640 | 2639 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2641 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2640 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2642 | 2641 | } |
| 2643 | 2642 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2644 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2643 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2645 | 2644 | } |
| 2646 | 2645 | |
| 2647 | 2646 | // Definition des droits d'acces en ecriture |
@@ -2659,13 +2658,13 @@ discard block |
||
| 2659 | 2658 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2660 | 2659 | } |
| 2661 | 2660 | if (!defined('_ROOT_PLUGINS')) { |
| 2662 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2661 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2663 | 2662 | } |
| 2664 | 2663 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2665 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2664 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2666 | 2665 | } |
| 2667 | 2666 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2668 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2667 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2669 | 2668 | } |
| 2670 | 2669 | |
| 2671 | 2670 | // La taille des Log |
@@ -2702,7 +2701,7 @@ discard block |
||
| 2702 | 2701 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2703 | 2702 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2704 | 2703 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2705 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2704 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2706 | 2705 | |
| 2707 | 2706 | // charger tout de suite le path et son cache |
| 2708 | 2707 | load_path_cache(); |
@@ -2738,7 +2737,7 @@ discard block |
||
| 2738 | 2737 | !empty($_SERVER['QUERY_STRING']) |
| 2739 | 2738 | && !strpos($_SERVER['REQUEST_URI'], '?') |
| 2740 | 2739 | ) { |
| 2741 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2740 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2742 | 2741 | } |
| 2743 | 2742 | } |
| 2744 | 2743 | |
@@ -2774,7 +2773,7 @@ discard block |
||
| 2774 | 2773 | ) { |
| 2775 | 2774 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2776 | 2775 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2777 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2776 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2778 | 2777 | } else { |
| 2779 | 2778 | $uri_ref = ''; |
| 2780 | 2779 | } |
@@ -2868,7 +2867,7 @@ discard block |
||
| 2868 | 2867 | } |
| 2869 | 2868 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2870 | 2869 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2871 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2870 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2872 | 2871 | } |
| 2873 | 2872 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2874 | 2873 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3091,7 +3090,7 @@ discard block |
||
| 3091 | 3090 | } |
| 3092 | 3091 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3093 | 3092 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3094 | - . ' ' . _VAR_MODE); |
|
| 3093 | + . ' '._VAR_MODE); |
|
| 3095 | 3094 | } |
| 3096 | 3095 | } // pas autorise ? |
| 3097 | 3096 | else { |
@@ -3106,7 +3105,7 @@ discard block |
||
| 3106 | 3105 | if (!str_contains($self, 'page=login')) { |
| 3107 | 3106 | include_spip('inc/headers'); |
| 3108 | 3107 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3109 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3108 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3110 | 3109 | } |
| 3111 | 3110 | } |
| 3112 | 3111 | // sinon tant pis |
@@ -3156,10 +3155,10 @@ discard block |
||
| 3156 | 3155 | **/ |
| 3157 | 3156 | function verifier_visiteur() { |
| 3158 | 3157 | @spip_initialisation_core( |
| 3159 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3160 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3161 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3162 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3158 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3159 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3160 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3161 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3163 | 3162 | ); |
| 3164 | 3163 | |
| 3165 | 3164 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3192,7 +3191,7 @@ discard block |
||
| 3192 | 3191 | } |
| 3193 | 3192 | |
| 3194 | 3193 | $h = (isset($_SERVER['PHP_AUTH_USER']) && !$GLOBALS['ignore_auth_http']); |
| 3195 | - if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3194 | + if ($h || isset($_COOKIE['spip_session']) || isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3196 | 3195 | $session = charger_fonction('session', 'inc'); |
| 3197 | 3196 | if ($session()) { |
| 3198 | 3197 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3272,7 +3271,7 @@ discard block |
||
| 3272 | 3271 | if (!empty($GLOBALS['visiteur_session'])) { |
| 3273 | 3272 | include_spip('inc/session'); |
| 3274 | 3273 | $cookie = lire_cookie_session(); |
| 3275 | - $s = serialize($GLOBALS['visiteur_session']) . '_' . ($cookie ?: ''); |
|
| 3274 | + $s = serialize($GLOBALS['visiteur_session']).'_'.($cookie ?: ''); |
|
| 3276 | 3275 | } |
| 3277 | 3276 | $s = pipeline('definir_session', $s); |
| 3278 | 3277 | $session = ($s ? substr(md5($s), 0, 8) : ''); |
@@ -3320,8 +3319,8 @@ discard block |
||
| 3320 | 3319 | foreach ($cookies_masques as $k) { |
| 3321 | 3320 | if (!empty($_COOKIE[$k])) { |
| 3322 | 3321 | $cookies_backup[$k] = $_COOKIE[$k]; |
| 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'] ?? []); |
|
| 3322 | + $_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3323 | + $_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3325 | 3324 | $_COOKIE[$k] = $mask; |
| 3326 | 3325 | } |
| 3327 | 3326 | } |
@@ -3439,11 +3438,11 @@ discard block |
||
| 3439 | 3438 | $GLOBALS['_INC_PUBLIC']++; |
| 3440 | 3439 | |
| 3441 | 3440 | // fix #4235 |
| 3442 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3441 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3443 | 3442 | |
| 3444 | 3443 | |
| 3445 | 3444 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3446 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3445 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3447 | 3446 | |
| 3448 | 3447 | $page = evaluer_fond($f, $contexte, $connect); |
| 3449 | 3448 | if ($page === '') { |
@@ -3528,7 +3527,7 @@ discard block |
||
| 3528 | 3527 | * @return array|string |
| 3529 | 3528 | */ |
| 3530 | 3529 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3531 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3530 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3532 | 3531 | if (!$pathinfo) { |
| 3533 | 3532 | return $f; |
| 3534 | 3533 | } |