@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | // mais apres la fonction autoriser() |
| 120 | 120 | if ($f = find_in_path('mes_fonctions.php')) { |
| 121 | 121 | global $dossier_squelettes; |
| 122 | - include_once(_ROOT_CWD . $f); |
|
| 122 | + include_once(_ROOT_CWD.$f); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 161 | 161 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 162 | 162 | } elseif (is_numeric($qui)) { |
| 163 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 163 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 164 | 164 | if (!$qui) { |
| 165 | 165 | return false; |
| 166 | 166 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | spip_log( |
| 176 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 177 | - 'autoriser' . _LOG_DEBUG |
|
| 176 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 177 | + 'autoriser'._LOG_DEBUG |
|
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | 180 | $type = autoriser_type($type); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) |
| 185 | 185 | && autoriser_exception($faire, $type, $id, 'verifier') || isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) && autoriser_exception($faire, $type, '*', 'verifier') |
| 186 | 186 | ) { |
| 187 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 187 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 188 | 188 | return true; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 194 | 194 | $fonctions = $type |
| 195 | 195 | ? [ |
| 196 | - 'autoriser_' . $type . '_' . $faire, |
|
| 197 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 198 | - 'autoriser_' . $type, |
|
| 199 | - 'autoriser_' . $type . '_dist', |
|
| 200 | - 'autoriser_' . $faire, |
|
| 201 | - 'autoriser_' . $faire . '_dist', |
|
| 196 | + 'autoriser_'.$type.'_'.$faire, |
|
| 197 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 198 | + 'autoriser_'.$type, |
|
| 199 | + 'autoriser_'.$type.'_dist', |
|
| 200 | + 'autoriser_'.$faire, |
|
| 201 | + 'autoriser_'.$faire.'_dist', |
|
| 202 | 202 | 'autoriser_defaut', |
| 203 | 203 | 'autoriser_defaut_dist' |
| 204 | 204 | ] |
| 205 | 205 | : [ |
| 206 | - 'autoriser_' . $faire, |
|
| 207 | - 'autoriser_' . $faire . '_dist', |
|
| 206 | + 'autoriser_'.$faire, |
|
| 207 | + 'autoriser_'.$faire.'_dist', |
|
| 208 | 208 | 'autoriser_defaut', |
| 209 | 209 | 'autoriser_defaut_dist' |
| 210 | 210 | ]; |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | spip_log( |
| 221 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 222 | - 'autoriser' . _LOG_DEBUG |
|
| 221 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 222 | + 'autoriser'._LOG_DEBUG |
|
| 223 | 223 | ); |
| 224 | 224 | |
| 225 | 225 | if (!is_bool($a)) { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 386 | 386 | |
| 387 | 387 | // Le visiteur a-t-il un statut prevu par la config ? |
| 388 | - if (str_contains((string) $GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',')) { |
|
| 388 | + if (str_contains((string) $GLOBALS['meta']['preview'], ','.$qui['statut'].',')) { |
|
| 389 | 389 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 390 | 390 | } |
| 391 | 391 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | } // pas de champ passe a la demande => NIET |
| 440 | 440 | $previsu = explode(',', (string) $c['previsu']); |
| 441 | 441 | // regarder si ce statut est autorise pour l'auteur |
| 442 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 442 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 443 | 443 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 444 | 444 | // sinon l’auteur en session |
| 445 | 445 | include_spip('inc/securiser_action'); |
@@ -453,12 +453,12 @@ discard block |
||
| 453 | 453 | |
| 454 | 454 | if (!$id_auteur) { |
| 455 | 455 | return false; |
| 456 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 456 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 457 | 457 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 458 | 458 | } elseif ( |
| 459 | 459 | !sql_countsel( |
| 460 | 460 | 'spip_auteurs_liens', |
| 461 | - 'id_auteur=' . (int) $id_auteur . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . (int) $id |
|
| 461 | + 'id_auteur='.(int) $id_auteur.' AND objet='.sql_quote($type).' AND id_objet='.(int) $id |
|
| 462 | 462 | ) |
| 463 | 463 | ) { |
| 464 | 464 | return false; |
@@ -503,14 +503,14 @@ discard block |
||
| 503 | 503 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 504 | 504 | $primary = id_table_objet($type); |
| 505 | 505 | $id_rubrique = $table != 'spip_rubriques' |
| 506 | - ? sql_getfetsel('id_rubrique', "$table", "$primary=" . (int) $id) |
|
| 506 | + ? sql_getfetsel('id_rubrique', "$table", "$primary=".(int) $id) |
|
| 507 | 507 | : $id; |
| 508 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique); |
|
| 508 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique); |
|
| 509 | 509 | if (!$id_secteur > 0) { |
| 510 | 510 | $id_secteur = $id_rubrique; |
| 511 | 511 | } |
| 512 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . (int) $id_secteur); |
|
| 513 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . (int) $id); |
|
| 512 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.(int) $id_secteur); |
|
| 513 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".(int) $id); |
|
| 514 | 514 | if ($langue_secteur != $langue_objet) { |
| 515 | 515 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 516 | 516 | return true; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 519 | 519 | return false; |
| 520 | 520 | } else { |
| 521 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . (int) $id); |
|
| 521 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.(int) $id); |
|
| 522 | 522 | if ($id_parent != 0) { |
| 523 | 523 | // sous-rubriques : pas de choix de langue |
| 524 | 524 | return false; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | |
| 571 | 571 | if (!isset($opt['statut'])) { |
| 572 | 572 | if (isset($desc['field']['statut'])) { |
| 573 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . (int) $id); |
|
| 573 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.(int) $id); |
|
| 574 | 574 | } else { |
| 575 | 575 | $statut = 'publie'; |
| 576 | 576 | } // pas de statut => publie |
@@ -735,11 +735,11 @@ discard block |
||
| 735 | 735 | return false; |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | - if (sql_countsel('spip_rubriques', 'id_parent=' . (int) $id)) { |
|
| 738 | + if (sql_countsel('spip_rubriques', 'id_parent='.(int) $id)) { |
|
| 739 | 739 | return false; |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if (sql_countsel('spip_articles', 'id_rubrique=' . (int) $id . " AND (statut<>'poubelle')")) { |
|
| 742 | + if (sql_countsel('spip_articles', 'id_rubrique='.(int) $id." AND (statut<>'poubelle')")) { |
|
| 743 | 743 | return false; |
| 744 | 744 | } |
| 745 | 745 | |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | if (!$id) { |
| 777 | 777 | return false; |
| 778 | 778 | } |
| 779 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 779 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 780 | 780 | |
| 781 | 781 | return $r && ( |
| 782 | 782 | autoriser('publierdans', 'rubrique', $r['id_rubrique'], $qui, $opt) |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | (!isset($opt['statut']) || !in_array($opt['statut'], ['publie', 'refuse'], true)) |
| 785 | 785 | && in_array($qui['statut'], ['0minirezo', '1comite']) |
| 786 | 786 | && in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 787 | - && auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 787 | + && auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 788 | 788 | ) |
| 789 | 789 | ); |
| 790 | 790 | } |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | if (!$id) { |
| 843 | 843 | return false; |
| 844 | 844 | } |
| 845 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . (int) $id); |
|
| 845 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.(int) $id); |
|
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | return |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | in_array($statut, ['prop', 'publie']) |
| 852 | 852 | // sinon si on est auteur, on a le droit de le voir, evidemment ! |
| 853 | 853 | |
| 854 | - || $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']); |
|
| 854 | + || $id && $qui['id_auteur'] && auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']); |
|
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | |
@@ -872,8 +872,8 @@ discard block |
||
| 872 | 872 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 873 | 873 | # securite, mais on aurait pas du arriver ici ! |
| 874 | 874 | if ( |
| 875 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 876 | - || function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 875 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 876 | + || function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 877 | 877 | ) { |
| 878 | 878 | return $f($faire, $type, $id, $qui, $opt); |
| 879 | 879 | } |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | $n = sql_fetsel( |
| 999 | 999 | 'A.id_article', |
| 1000 | 1000 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1001 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1001 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1002 | 1002 | ); |
| 1003 | 1003 | |
| 1004 | 1004 | return (bool) $n; |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | && ($r = sql_allfetsel( |
| 1197 | 1197 | 'id_objet', |
| 1198 | 1198 | 'spip_auteurs_liens', |
| 1199 | - 'id_auteur=' . (int) $id_auteur . " AND objet='rubrique' AND id_objet!=0" |
|
| 1199 | + 'id_auteur='.(int) $id_auteur." AND objet='rubrique' AND id_objet!=0" |
|
| 1200 | 1200 | )) |
| 1201 | 1201 | && (is_countable($r) ? count($r) : 0) |
| 1202 | 1202 | ) { |
@@ -1873,8 +1873,8 @@ discard block |
||
| 1873 | 1873 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1874 | 1874 | $objet = objet_type($objet); |
| 1875 | 1875 | $where = [ |
| 1876 | - 'objet=' . sql_quote($objet), |
|
| 1877 | - 'id_objet=' . (int) $id_objet |
|
| 1876 | + 'objet='.sql_quote($objet), |
|
| 1877 | + 'id_objet='.(int) $id_objet |
|
| 1878 | 1878 | ]; |
| 1879 | 1879 | if (!empty($cond)) { |
| 1880 | 1880 | if (is_array($cond)) { |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | ['id_article', 'lang'], |
| 24 | 24 | 'spip_articles', |
| 25 | 25 | [ |
| 26 | - 'statut = ' . sql_quote('publie'), |
|
| 27 | - 'lang != ' . sql_quote('') |
|
| 26 | + 'statut = '.sql_quote('publie'), |
|
| 27 | + 'lang != '.sql_quote('') |
|
| 28 | 28 | ], |
| 29 | 29 | limit: '0,1', |
| 30 | 30 | ); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | // on se met dans une autre langue que celle de l'article |
| 36 | 36 | lang_select($lang === 'eo' ? 'fa' : 'eo'); |
| 37 | 37 | |
| 38 | - $case = '[->' . $id_article . ']'; |
|
| 38 | + $case = '[->'.$id_article.']'; |
|
| 39 | 39 | $propre = propre($case); |
| 40 | 40 | $this->assertEquals( |
| 41 | 41 | $lang, |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | #[DataProvider('providerLiensClassCss')] |
| 48 | 48 | public function testLiensClassCss(string $table, ?string $short, bool $in) { |
| 49 | - $id = sql_getfetsel(id_table_objet($table), $table, "statut='publie'", limit: '0,1'); |
|
| 49 | + $id = sql_getfetsel(id_table_objet($table), $table, "statut='publie'", limit : '0,1'); |
|
| 50 | 50 | $type = objet_type($table); |
| 51 | 51 | if (!$id) { |
| 52 | 52 | $this->markTestSkipped(sprintf('Necessite un·e %s publié', $type)); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $GLOBALS['contexte'] = calculer_contexte(); |
| 35 | 35 | $page = ['contexte_implicite' => calculer_contexte_implicite()]; |
| 36 | - $page['contexte_implicite']['cache'] = $fond . preg_replace( |
|
| 36 | + $page['contexte_implicite']['cache'] = $fond.preg_replace( |
|
| 37 | 37 | ',\.[a-zA-Z0-9]*$,', |
| 38 | 38 | '', |
| 39 | 39 | preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI']) |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($page === '') { |
| 134 | 134 | $erreur = _T( |
| 135 | 135 | 'info_erreur_squelette2', |
| 136 | - ['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES] |
|
| 136 | + ['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES] |
|
| 137 | 137 | ); |
| 138 | 138 | erreur_squelette($erreur); |
| 139 | 139 | // eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4 |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | if ( |
| 175 | 175 | $lastmodified && !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !isset($page['entetes']['Last-Modified']) |
| 176 | 176 | ) { |
| 177 | - $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT'; |
|
| 177 | + $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT'; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // fermer la connexion apres les headers si requete HEAD |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (!defined('_CONTEXTE_IGNORE_LISTE_VARIABLES')) { |
| 207 | 207 | nettoyer_uri_var(''); |
| 208 | 208 | } |
| 209 | - $preg_ignore_variables = '/(' . implode('|',_CONTEXTE_IGNORE_LISTE_VARIABLES) . ')/'; |
|
| 209 | + $preg_ignore_variables = '/('.implode('|', _CONTEXTE_IGNORE_LISTE_VARIABLES).')/'; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $contexte = []; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | 'spip_version_code' => $GLOBALS['spip_version_code'], |
| 248 | 248 | ]; |
| 249 | 249 | if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { |
| 250 | - $contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 250 | + $contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return $contexte_implicite; |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | if (is_null($id)) { |
| 585 | - $msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 585 | + $msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 586 | 586 | erreur_squelette($msg); |
| 587 | 587 | // on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant |
| 588 | 588 | $id = 0; |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | if (preg_match(',^[a-z0-9_]+$,', $soustype)) { |
| 628 | - if (!trouve_modele($fond = ($type . '_' . $soustype))) { |
|
| 628 | + if (!trouve_modele($fond = ($type.'_'.$soustype))) { |
|
| 629 | 629 | $fond = ''; |
| 630 | 630 | $class = $soustype; |
| 631 | 631 | } |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $compteur--; |
| 641 | 641 | return false; |
| 642 | 642 | } |
| 643 | - $fond = 'modeles/' . $fond; |
|
| 643 | + $fond = 'modeles/'.$fond; |
|
| 644 | 644 | // Creer le contexte |
| 645 | 645 | $contexte = $env; |
| 646 | 646 | // securiser le contexte des modèles : tout ce qui arrive de _request() doit être sanitizé |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | if (is_scalar($v)) { |
| 651 | 651 | $v = spip_securise_valeur_env_modele($v); |
| 652 | 652 | } else { |
| 653 | - array_walk_recursive($v, function (&$value, $index) { |
|
| 653 | + array_walk_recursive($v, function(&$value, $index) { |
|
| 654 | 654 | $value = spip_securise_valeur_env_modele($value); |
| 655 | 655 | }); |
| 656 | 656 | } |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | // sinon, s'il y a un lien, on l'ajoute classiquement |
| 696 | 696 | if ( |
| 697 | 697 | strstr( |
| 698 | - ' ' . ($classes = extraire_attribut($retour, 'class')) . ' ', |
|
| 698 | + ' '.($classes = extraire_attribut($retour, 'class')).' ', |
|
| 699 | 699 | 'spip_lien_ok' |
| 700 | 700 | ) |
| 701 | 701 | ) { |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | ); |
| 707 | 707 | } else { |
| 708 | 708 | if ($lien) { |
| 709 | - $retour = '<a href="' . $lien['href'] . '" class="' . $lien['class'] . '">' . $retour . '</a>'; |
|
| 709 | + $retour = '<a href="'.$lien['href'].'" class="'.$lien['class'].'">'.$retour.'</a>'; |
|
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | if (is_numeric($valeur) || is_bool($valeur) || is_null($valeur)) { |
| 732 | 732 | return $valeur; |
| 733 | 733 | } |
| 734 | - $valeur = (string)$valeur; |
|
| 734 | + $valeur = (string) $valeur; |
|
| 735 | 735 | if (str_starts_with($valeur, '@') && is_numeric(substr($valeur, 1))) { |
| 736 | 736 | return $valeur; |
| 737 | 737 | } |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | return $page; |
| 752 | 752 | } |
| 753 | 753 | // eval $page et affecte $res |
| 754 | - include _ROOT_RESTREINT . 'public/evaluer_page.php'; |
|
| 754 | + include _ROOT_RESTREINT.'public/evaluer_page.php'; |
|
| 755 | 755 | |
| 756 | 756 | // Lever un drapeau (global) si le fond utilise #SESSION |
| 757 | 757 | // a destination de public/parametrer |
@@ -819,16 +819,16 @@ discard block |
||
| 819 | 819 | if (($pos = strpos($head, '<head>')) !== false) { |
| 820 | 820 | $head = substr_replace($head, $base, $pos + 6, 0); |
| 821 | 821 | } elseif (preg_match(',<head[^>]*>,i', $head, $r)) { |
| 822 | - $head = str_replace($r[0], $r[0] . $base, $head); |
|
| 822 | + $head = str_replace($r[0], $r[0].$base, $head); |
|
| 823 | 823 | } |
| 824 | - $texte = $head . substr($texte, $poshead); |
|
| 824 | + $texte = $head.substr($texte, $poshead); |
|
| 825 | 825 | } |
| 826 | 826 | if ($href_base) { |
| 827 | 827 | // gerer les ancres |
| 828 | 828 | $base = $_SERVER['REQUEST_URI']; |
| 829 | 829 | // pas de guillemets ni < dans l'URL qu'on insere dans le HTML |
| 830 | 830 | if (str_contains($base, "'") || str_contains($base, '"') || str_contains($base, '<')) { |
| 831 | - $base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base); |
|
| 831 | + $base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base); |
|
| 832 | 832 | } |
| 833 | 833 | if (str_contains($texte, "href='#")) { |
| 834 | 834 | $texte = str_replace("href='#", "href='$base#", $texte); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $contenu = @gzfile($fichier); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return is_array($contenu) ? implode('', $contenu) : (string)$contenu; |
|
| 124 | + return is_array($contenu) ? implode('', $contenu) : (string) $contenu; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | function ecrire_fichier_securise($fichier, $contenu, $ecrire_quand_meme = false, $truncate = true) { |
| 323 | 323 | if (!str_ends_with($fichier, '.php')) { |
| 324 | - spip_log('Erreur de programmation: ' . $fichier . ' doit finir par .php'); |
|
| 324 | + spip_log('Erreur de programmation: '.$fichier.' doit finir par .php'); |
|
| 325 | 325 | } |
| 326 | - $contenu = '<' . "?php die ('Acces interdit'); ?" . ">\n" . $contenu; |
|
| 326 | + $contenu = '<'."?php die ('Acces interdit'); ?".">\n".$contenu; |
|
| 327 | 327 | |
| 328 | 328 | return ecrire_fichier($fichier, $contenu, $ecrire_quand_meme, $truncate); |
| 329 | 329 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | * @return bool |
| 337 | 337 | */ |
| 338 | 338 | function ecrire_fichier_calcule_si_modifie($fichier, $contenu, $force = false, $use_copy = false) { |
| 339 | - $fichier_tmp = $fichier . '.last'; |
|
| 339 | + $fichier_tmp = $fichier.'.last'; |
|
| 340 | 340 | if (!ecrire_fichier($fichier_tmp, $contenu, true)) { |
| 341 | 341 | return false; |
| 342 | 342 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | function lire_fichier_securise($fichier, &$contenu, $options = []) { |
| 378 | 378 | if ($res = lire_fichier($fichier, $contenu, $options)) { |
| 379 | - $contenu = substr((string) $contenu, strlen('<?php die (\'Acces interdit\'); ?>' . "\n")); |
|
| 379 | + $contenu = substr((string) $contenu, strlen('<?php die (\'Acces interdit\'); ?>'."\n")); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return $res; |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $wait = 0; |
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | - spip_log('Probleme de configuration opcache.revalidate_freq ' . $duree . 's : on attend ' . $wait . 's', _LOG_INFO_IMPORTANTE); |
|
| 549 | + spip_log('Probleme de configuration opcache.revalidate_freq '.$duree.'s : on attend '.$wait.'s', _LOG_INFO_IMPORTANTE); |
|
| 550 | 550 | if ($wait) { |
| 551 | 551 | sleep($duree + 1); |
| 552 | 552 | } |
@@ -574,9 +574,9 @@ discard block |
||
| 574 | 574 | if ($item == '.' || $item == '..') { |
| 575 | 575 | continue; |
| 576 | 576 | } |
| 577 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 578 | - @chmod($dir . '/' . $item, 0777); |
|
| 579 | - if (!supprimer_repertoire($dir . '/' . $item)) { |
|
| 577 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 578 | + @chmod($dir.'/'.$item, 0777); |
|
| 579 | + if (!supprimer_repertoire($dir.'/'.$item)) { |
|
| 580 | 580 | return false; |
| 581 | 581 | } |
| 582 | 582 | }; |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | if (!strlen($subdir)) { |
| 622 | 622 | $n = strrpos($base, '/'); |
| 623 | 623 | if ($n === false) { |
| 624 | - return $nobase ? '' : ($base . '/'); |
|
| 624 | + return $nobase ? '' : ($base.'/'); |
|
| 625 | 625 | } |
| 626 | 626 | $subdir = substr($base, $n + 1); |
| 627 | 627 | $base = substr($base, 0, $n + 1); |
@@ -631,14 +631,14 @@ discard block |
||
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | $baseaff = $nobase ? '' : $base; |
| 634 | - if (isset($dirs[$base . $subdir])) { |
|
| 635 | - return $baseaff . $dirs[$base . $subdir]; |
|
| 634 | + if (isset($dirs[$base.$subdir])) { |
|
| 635 | + return $baseaff.$dirs[$base.$subdir]; |
|
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - $path = $base . $subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 638 | + $path = $base.$subdir; # $path = 'IMG/distant/pdf' ou 'IMG/distant_pdf' |
|
| 639 | 639 | |
| 640 | 640 | if (file_exists("$path/.ok")) { |
| 641 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 641 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | @mkdir($path, _SPIP_CHMOD); |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | @touch("$path/.ok"); |
| 649 | 649 | spip_log("creation $base$subdir/"); |
| 650 | 650 | |
| 651 | - return $baseaff . ($dirs[$base . $subdir] = "$subdir/"); |
|
| 651 | + return $baseaff.($dirs[$base.$subdir] = "$subdir/"); |
|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | // en cas d'echec c'est peut etre tout simplement que le disque est plein : |
@@ -659,10 +659,10 @@ discard block |
||
| 659 | 659 | } |
| 660 | 660 | // FIXME: throw an Exception… |
| 661 | 661 | if (!_DIR_RESTREINT) { |
| 662 | - $base = preg_replace(',^' . _DIR_RACINE . ',', '', $base); |
|
| 662 | + $base = preg_replace(',^'._DIR_RACINE.',', '', $base); |
|
| 663 | 663 | } |
| 664 | 664 | $base .= $subdir; |
| 665 | - raler_fichier($base . '/.ok'); |
|
| 665 | + raler_fichier($base.'/.ok'); |
|
| 666 | 666 | } |
| 667 | 667 | |
| 668 | 668 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $maxfiles - $nbfiles, |
| 735 | 735 | $recurs |
| 736 | 736 | ); |
| 737 | - $fichiers = array_merge((array)$beginning, (array)$end); |
|
| 737 | + $fichiers = array_merge((array) $beginning, (array) $end); |
|
| 738 | 738 | $nbfiles = count($fichiers); |
| 739 | 739 | } |
| 740 | 740 | } |
@@ -21,22 +21,22 @@ discard block |
||
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -require_once __DIR__ . '/bootstrap/config/initial.php'; |
|
| 24 | +require_once __DIR__.'/bootstrap/config/initial.php'; |
|
| 25 | 25 | |
| 26 | 26 | // inclure l'ecran de securite si il n'a pas été inclus en prepend php |
| 27 | 27 | if ( |
| 28 | 28 | !defined('_ECRAN_SECURITE') |
| 29 | - && @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php') |
|
| 29 | + && @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php') |
|
| 30 | 30 | ) { |
| 31 | 31 | include $f; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // et on peut lancer l'autoloader |
| 35 | -require_once dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 35 | +require_once dirname(__DIR__).'/vendor/autoload.php'; |
|
| 36 | 36 | |
| 37 | -require_once __DIR__ . '/bootstrap/config/globals.php'; |
|
| 38 | -require_once __DIR__ . '/bootstrap/proxy.php'; |
|
| 39 | -require_once __DIR__ . '/bootstrap/mitigation.php'; |
|
| 37 | +require_once __DIR__.'/bootstrap/config/globals.php'; |
|
| 38 | +require_once __DIR__.'/bootstrap/proxy.php'; |
|
| 39 | +require_once __DIR__.'/bootstrap/mitigation.php'; |
|
| 40 | 40 | |
| 41 | 41 | // numero de branche, utilise par les plugins |
| 42 | 42 | // pour specifier les versions de SPIP necessaires |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | // |
| 71 | 71 | // Charger les fonctions liees aux serveurs Http et Sql. |
| 72 | 72 | // |
| 73 | -require_once __DIR__ . '/bootstrap/functions.php'; |
|
| 73 | +require_once __DIR__.'/bootstrap/functions.php'; |
|
| 74 | 74 | |
| 75 | 75 | // Definition personnelles eventuelles |
| 76 | 76 | |
@@ -94,10 +94,10 @@ discard block |
||
| 94 | 94 | // ===> on execute en neutralisant les messages d'erreur |
| 95 | 95 | |
| 96 | 96 | spip_initialisation_core( |
| 97 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 98 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 99 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 100 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 97 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 98 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 99 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 100 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | // chargement des plugins : doit arriver en dernier |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | include_spip('inc/lang'); |
| 154 | 154 | utiliser_langue_visiteur(); |
| 155 | 155 | include_spip('inc/minipres'); |
| 156 | - echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]); |
|
| 156 | + echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]); |
|
| 157 | 157 | exit; |
| 158 | 158 | } |
| 159 | 159 | // autrement c'est une install ad hoc (spikini...), on sait pas faire |
@@ -192,12 +192,12 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) { |
| 194 | 194 | include_spip('inc/filtres_mini'); |
| 195 | - header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt')); |
|
| 195 | + header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt')); |
|
| 196 | 196 | } else { |
| 197 | 197 | // header minimal |
| 198 | - header(_HEADER_COMPOSED_BY . ' @ www.spip.net'); |
|
| 198 | + header(_HEADER_COMPOSED_BY.' @ www.spip.net'); |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : '')); |
| 203 | -spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG); |
|
| 203 | +spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG); |
|
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | # la matrice standard (fichiers definissant les fonctions a inclure) |
| 165 | 165 | $spip_matrice = []; |
| 166 | 166 | # les plugins a activer |
| 167 | -$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 167 | +$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 168 | 168 | # les surcharges de include_spip() |
| 169 | 169 | $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php' |
| 170 | 170 | |
@@ -6,19 +6,19 @@ |
||
| 6 | 6 | * Ces fichiers ne peuvent pas être surchargés dans des plugins |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/inc/auth.php'; |
|
| 10 | -include_once __DIR__ . '/inc/form.php'; |
|
| 11 | -include_once __DIR__ . '/inc/initialization.php'; |
|
| 12 | -include_once __DIR__ . '/inc/i18n.php'; |
|
| 13 | -include_once __DIR__ . '/inc/jobs.php'; |
|
| 14 | -include_once __DIR__ . '/inc/loading.php'; |
|
| 15 | -include_once __DIR__ . '/inc/logging.php'; |
|
| 16 | -include_once __DIR__ . '/inc/path.php'; |
|
| 17 | -include_once __DIR__ . '/inc/pipeline.php'; |
|
| 18 | -include_once __DIR__ . '/inc/request.php'; |
|
| 19 | -include_once __DIR__ . '/inc/sanitize.php'; |
|
| 20 | -include_once __DIR__ . '/inc/templating.php'; |
|
| 21 | -include_once __DIR__ . '/inc/utils.php'; |
|
| 22 | -include_once __DIR__ . '/inc/urls.php'; |
|
| 23 | -require_once dirname(__DIR__) . '/base/connect_sql.php'; |
|
| 9 | +include_once __DIR__.'/inc/auth.php'; |
|
| 10 | +include_once __DIR__.'/inc/form.php'; |
|
| 11 | +include_once __DIR__.'/inc/initialization.php'; |
|
| 12 | +include_once __DIR__.'/inc/i18n.php'; |
|
| 13 | +include_once __DIR__.'/inc/jobs.php'; |
|
| 14 | +include_once __DIR__.'/inc/loading.php'; |
|
| 15 | +include_once __DIR__.'/inc/logging.php'; |
|
| 16 | +include_once __DIR__.'/inc/path.php'; |
|
| 17 | +include_once __DIR__.'/inc/pipeline.php'; |
|
| 18 | +include_once __DIR__.'/inc/request.php'; |
|
| 19 | +include_once __DIR__.'/inc/sanitize.php'; |
|
| 20 | +include_once __DIR__.'/inc/templating.php'; |
|
| 21 | +include_once __DIR__.'/inc/utils.php'; |
|
| 22 | +include_once __DIR__.'/inc/urls.php'; |
|
| 23 | +require_once dirname(__DIR__).'/base/connect_sql.php'; |
|
| 24 | 24 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | // UA plus cibles |
| 16 | 16 | . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' |
| 17 | 17 | . ',i', |
| 18 | - (string)$_SERVER['HTTP_USER_AGENT'] |
|
| 18 | + (string) $_SERVER['HTTP_USER_AGENT'] |
|
| 19 | 19 | ) |
| 20 | 20 | ); |
| 21 | 21 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $value = interdire_scripts($value, -1); |
| 130 | 130 | } |
| 131 | 131 | if (!empty($options['class'])) { |
| 132 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 132 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 133 | 133 | } |
| 134 | 134 | $text = str_replace("@$name@", (string) $value, (string) $text); |
| 135 | 135 | unset($args[$name]); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | // Si des variables n'ont pas ete inserees, le signaler |
| 139 | 139 | // (chaines de langues pas a jour) |
| 140 | 140 | if ($args) { |
| 141 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 141 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |