@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | static $t1 = ['&', '<', '>']; |
| 121 | 121 | static $t2 = ['&', '<', '>']; |
| 122 | 122 | |
| 123 | - return '<pre>' . str_replace($t1, $t2, (string) $t) . '</pre>'; |
|
| 123 | + return '<pre>'.str_replace($t1, $t2, (string) $t).'</pre>'; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | foreach ($lignes as &$l) { |
| 141 | 141 | $l = join('|', $l); |
| 142 | 142 | } |
| 143 | - $corps = join("\n", $lignes) . "\n"; |
|
| 144 | - $corps = $caption . |
|
| 145 | - "\n|{{" . |
|
| 146 | - join('}}|{{', $entete) . |
|
| 147 | - '}}|' . |
|
| 148 | - "\n|" . |
|
| 143 | + $corps = join("\n", $lignes)."\n"; |
|
| 144 | + $corps = $caption. |
|
| 145 | + "\n|{{". |
|
| 146 | + join('}}|{{', $entete). |
|
| 147 | + '}}|'. |
|
| 148 | + "\n|". |
|
| 149 | 149 | str_replace("\n", "|\n|", $corps); |
| 150 | 150 | include_spip('inc/texte'); |
| 151 | 151 | |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 190 | - $t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t)); |
|
| 190 | + $t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t)); |
|
| 191 | 191 | |
| 192 | - return (!$style ? '' : "\n<style>" . $style . '</style>') . $t; |
|
| 192 | + return (!$style ? '' : "\n<style>".$style.'</style>').$t; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // mais apres la fonction autoriser() |
| 123 | 123 | if ($f = find_in_path('mes_fonctions.php')) { |
| 124 | 124 | global $dossier_squelettes; |
| 125 | - include_once(_ROOT_CWD . $f); |
|
| 125 | + include_once(_ROOT_CWD.$f); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 165 | 165 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 166 | 166 | } elseif (is_numeric($qui)) { |
| 167 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 167 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | spip_log( |
| 177 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 178 | - 'autoriser' . _LOG_DEBUG |
|
| 177 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 178 | + 'autoriser'._LOG_DEBUG |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | // passer par objet_type pour avoir les alias |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 192 | 192 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 193 | 193 | ) { |
| 194 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 194 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -200,18 +200,18 @@ discard block |
||
| 200 | 200 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 201 | 201 | $fonctions = $type |
| 202 | 202 | ? [ |
| 203 | - 'autoriser_' . $type . '_' . $faire, |
|
| 204 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 205 | - 'autoriser_' . $type, |
|
| 206 | - 'autoriser_' . $type . '_dist', |
|
| 207 | - 'autoriser_' . $faire, |
|
| 208 | - 'autoriser_' . $faire . '_dist', |
|
| 203 | + 'autoriser_'.$type.'_'.$faire, |
|
| 204 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 205 | + 'autoriser_'.$type, |
|
| 206 | + 'autoriser_'.$type.'_dist', |
|
| 207 | + 'autoriser_'.$faire, |
|
| 208 | + 'autoriser_'.$faire.'_dist', |
|
| 209 | 209 | 'autoriser_defaut', |
| 210 | 210 | 'autoriser_defaut_dist' |
| 211 | 211 | ] |
| 212 | 212 | : [ |
| 213 | - 'autoriser_' . $faire, |
|
| 214 | - 'autoriser_' . $faire . '_dist', |
|
| 213 | + 'autoriser_'.$faire, |
|
| 214 | + 'autoriser_'.$faire.'_dist', |
|
| 215 | 215 | 'autoriser_defaut', |
| 216 | 216 | 'autoriser_defaut_dist' |
| 217 | 217 | ]; |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | spip_log( |
| 227 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 228 | - 'autoriser' . _LOG_DEBUG |
|
| 227 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 228 | + 'autoriser'._LOG_DEBUG |
|
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | return $a; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 375 | 375 | |
| 376 | 376 | // Le visiteur a-t-il un statut prevu par la config ? |
| 377 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 377 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 378 | 378 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } // pas de champ passe a la demande => NIET |
| 433 | 433 | $previsu = explode(',', $c['previsu']); |
| 434 | 434 | // regarder si ce statut est autorise pour l'auteur |
| 435 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 435 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 436 | 436 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 437 | 437 | // sinon l’auteur en session |
| 438 | 438 | include_spip('inc/securiser_action'); |
@@ -446,12 +446,12 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | if (!$id_auteur) { |
| 448 | 448 | return false; |
| 449 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 449 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 450 | 450 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 451 | 451 | } elseif ( |
| 452 | 452 | !sql_countsel( |
| 453 | 453 | 'spip_auteurs_liens', |
| 454 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 454 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 455 | 455 | ) |
| 456 | 456 | ) { |
| 457 | 457 | return false; |
@@ -496,16 +496,16 @@ discard block |
||
| 496 | 496 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 497 | 497 | $primary = id_table_objet($type); |
| 498 | 498 | if ($table != 'spip_rubriques') { |
| 499 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 499 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 500 | 500 | } else { |
| 501 | 501 | $id_rubrique = $id; |
| 502 | 502 | } |
| 503 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 503 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 504 | 504 | if (!$id_secteur > 0) { |
| 505 | 505 | $id_secteur = $id_rubrique; |
| 506 | 506 | } |
| 507 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 508 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 507 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 508 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 509 | 509 | if ($langue_secteur != $langue_objet) { |
| 510 | 510 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 511 | 511 | return true; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 514 | 514 | return false; |
| 515 | 515 | } else { |
| 516 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 516 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 517 | 517 | if ($id_parent != 0) { |
| 518 | 518 | // sous-rubriques : pas de choix de langue |
| 519 | 519 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | if (!isset($opt['statut'])) { |
| 567 | 567 | if (isset($desc['field']['statut'])) { |
| 568 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 568 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 569 | 569 | } else { |
| 570 | 570 | $statut = 'publie'; |
| 571 | 571 | } // pas de statut => publie |
@@ -739,11 +739,11 @@ discard block |
||
| 739 | 739 | return false; |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 742 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 743 | 743 | return false; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 746 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 747 | 747 | return false; |
| 748 | 748 | } |
| 749 | 749 | |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | if (!$id) { |
| 781 | 781 | return false; |
| 782 | 782 | } |
| 783 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 783 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 784 | 784 | |
| 785 | 785 | return |
| 786 | 786 | $r |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 792 | 792 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 793 | 793 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 794 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 794 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 795 | 795 | ) |
| 796 | 796 | ); |
| 797 | 797 | } |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if (!$id) { |
| 850 | 850 | return false; |
| 851 | 851 | } |
| 852 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 852 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | return |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | or |
| 861 | 861 | ($id |
| 862 | 862 | and $qui['id_auteur'] |
| 863 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 863 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | |
@@ -881,8 +881,8 @@ discard block |
||
| 881 | 881 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 882 | 882 | # securite, mais on aurait pas du arriver ici ! |
| 883 | 883 | if ( |
| 884 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 885 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 884 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 885 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 886 | 886 | ) { |
| 887 | 887 | return $f($faire, $type, $id, $qui, $opt); |
| 888 | 888 | } |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $n = sql_fetsel( |
| 1014 | 1014 | 'A.id_article', |
| 1015 | 1015 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1016 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1016 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1017 | 1017 | ); |
| 1018 | 1018 | |
| 1019 | 1019 | return $n ? true : false; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | and $r = sql_allfetsel( |
| 1226 | 1226 | 'id_objet', |
| 1227 | 1227 | 'spip_auteurs_liens', |
| 1228 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1228 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1229 | 1229 | ) |
| 1230 | 1230 | and is_countable($r) ? count($r) : 0 |
| 1231 | 1231 | ) { |
@@ -1910,8 +1910,8 @@ discard block |
||
| 1910 | 1910 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1911 | 1911 | $objet = objet_type($objet); |
| 1912 | 1912 | $where = [ |
| 1913 | - 'objet=' . sql_quote($objet), |
|
| 1914 | - 'id_objet=' . intval($id_objet) |
|
| 1913 | + 'objet='.sql_quote($objet), |
|
| 1914 | + 'id_objet='.intval($id_objet) |
|
| 1915 | 1915 | ]; |
| 1916 | 1916 | if (!empty($cond)) { |
| 1917 | 1917 | if (is_array($cond)) { |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | return sql_allfetsel( |
| 1947 | 1947 | 'id_auteur', |
| 1948 | 1948 | 'spip_auteurs_liens', |
| 1949 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1949 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1950 | 1950 | ); |
| 1951 | 1951 | } |
| 1952 | 1952 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | if ( |
| 222 | 222 | $config_fonc |
| 223 | 223 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 224 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 224 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 225 | 225 | ) { |
| 226 | 226 | if ( |
| 227 | 227 | $args = test_formulaire_inclus_par_modele() |
@@ -236,12 +236,12 @@ discard block |
||
| 236 | 236 | // Appel direct dans un squelette |
| 237 | 237 | if (!$row) { |
| 238 | 238 | if (!$new or $lier_trad) { |
| 239 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 239 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 240 | 240 | $row = $select($id, $id_parent, $lier_trad); |
| 241 | 241 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 242 | 242 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 243 | 243 | } else { |
| 244 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 244 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 245 | 245 | } |
| 246 | 246 | if (!$new) { |
| 247 | 247 | $md5 = controles_md5($row ?? []); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if ($config_fonc) { |
| 292 | 292 | $contexte['config'] = $config = $config_fonc($contexte); |
| 293 | 293 | if (!$lang_default) { |
| 294 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 294 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | $config = $config + [ |
@@ -315,13 +315,12 @@ discard block |
||
| 315 | 315 | unset($contexte['lang']); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 319 | - (!$lier_trad ? '' : |
|
| 320 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 321 | - $lier_trad . |
|
| 322 | - "' />" . |
|
| 323 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 324 | - $lang_default . |
|
| 318 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 319 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 320 | + $lier_trad. |
|
| 321 | + "' />". |
|
| 322 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 323 | + $lang_default. |
|
| 325 | 324 | "' />")) |
| 326 | 325 | . $hidden |
| 327 | 326 | . ($md5 ?? ''); |
@@ -361,14 +360,14 @@ discard block |
||
| 361 | 360 | $aider = charger_fonction('aider', 'inc'); |
| 362 | 361 | if (strlen($texte) > 28 * 1024) { |
| 363 | 362 | $texte = str_replace("\r\n", "\n", $texte); |
| 364 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 363 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 365 | 364 | if ($pos > 0 and $pos < 32 * 1024) { |
| 366 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 365 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 367 | 366 | $suite = substr($texte, $pos + 2); |
| 368 | 367 | } else { |
| 369 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 368 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 370 | 369 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 371 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 370 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 372 | 371 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 373 | 372 | } else { |
| 374 | 373 | $decalage = 1; |
@@ -399,13 +398,13 @@ discard block |
||
| 399 | 398 | } |
| 400 | 399 | |
| 401 | 400 | include_spip('inc/barre'); |
| 402 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 401 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 403 | 402 | $nombre = 0; |
| 404 | 403 | |
| 405 | 404 | while (strlen($texte) > 29 * 1024) { |
| 406 | 405 | $nombre++; |
| 407 | 406 | [$texte1, $texte] = coupe_trop_long($texte); |
| 408 | - $textes_supplement .= '<br />' . |
|
| 407 | + $textes_supplement .= '<br />'. |
|
| 409 | 408 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 410 | 409 | } |
| 411 | 410 | |
@@ -488,7 +487,7 @@ discard block |
||
| 488 | 487 | $ctr = []; |
| 489 | 488 | foreach ($data as $key => $val) { |
| 490 | 489 | $m = md5($val ?? ''); |
| 491 | - $k = $prefixe . $key; |
|
| 490 | + $k = $prefixe.$key; |
|
| 492 | 491 | |
| 493 | 492 | switch ($format) { |
| 494 | 493 | case 'html': |
@@ -501,7 +500,7 @@ discard block |
||
| 501 | 500 | } |
| 502 | 501 | |
| 503 | 502 | if ($format === 'html') { |
| 504 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 503 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 505 | 504 | } else { |
| 506 | 505 | return $ctr; |
| 507 | 506 | } |
@@ -653,7 +652,7 @@ discard block |
||
| 653 | 652 | // On elimine les donnees non modifiees par le formulaire (mais |
| 654 | 653 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 655 | 654 | foreach ($champs as $key => $val) { |
| 656 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 655 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 657 | 656 | if (is_scalar($val) and $m == md5($val)) { |
| 658 | 657 | unset($champs[$key]); |
| 659 | 658 | } |
@@ -682,7 +681,7 @@ discard block |
||
| 682 | 681 | // de conflit. |
| 683 | 682 | $ctrh = $ctrq = $conflits = []; |
| 684 | 683 | foreach (array_keys($champs) as $key) { |
| 685 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 684 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 686 | 685 | $ctrh[$key] = $m; |
| 687 | 686 | $ctrq[] = $key; |
| 688 | 687 | } |
@@ -716,8 +715,8 @@ discard block |
||
| 716 | 715 | */ |
| 717 | 716 | function display_conflit_champ($x) { |
| 718 | 717 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 719 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 718 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 720 | 719 | } else { |
| 721 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 720 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 722 | 721 | } |
| 723 | 722 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $md5args = md5($arguments); |
| 71 | 71 | |
| 72 | 72 | // si pas de date programee, des que possible |
| 73 | - $duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND '; |
|
| 73 | + $duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND '; |
|
| 74 | 74 | if (!$time) { |
| 75 | 75 | $time = time(); |
| 76 | 76 | $duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution |
@@ -96,9 +96,8 @@ discard block |
||
| 96 | 96 | 'id_job', |
| 97 | 97 | 'spip_jobs', |
| 98 | 98 | $duplicate_where = |
| 99 | - $duplicate_where . 'fonction=' . sql_quote($function) |
|
| 100 | - . (($no_duplicate === 'function_only') ? '' : |
|
| 101 | - ' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file)) |
|
| 99 | + $duplicate_where.'fonction='.sql_quote($function) |
|
| 100 | + . (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file)) |
|
| 102 | 101 | ) |
| 103 | 102 | ) { |
| 104 | 103 | return $id_job; |
@@ -111,9 +110,9 @@ discard block |
||
| 111 | 110 | if ( |
| 112 | 111 | $no_duplicate |
| 113 | 112 | and |
| 114 | - $id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where") |
|
| 113 | + $id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where") |
|
| 115 | 114 | ) { |
| 116 | - sql_delete('spip_jobs', 'id_job=' . intval($id_job)); |
|
| 115 | + sql_delete('spip_jobs', 'id_job='.intval($id_job)); |
|
| 117 | 116 | |
| 118 | 117 | return $id_prev; |
| 119 | 118 | } |
@@ -125,9 +124,9 @@ discard block |
||
| 125 | 124 | // ie cas d'un char non acceptables sur certains type de champs |
| 126 | 125 | // qui coupe la valeur |
| 127 | 126 | if (defined('_JQ_INSERT_CHECK_ARGS') and $id_job) { |
| 128 | - $args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job)); |
|
| 127 | + $args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job)); |
|
| 129 | 128 | if ($args !== $arguments) { |
| 130 | - spip_log('arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' . var_export( |
|
| 129 | + spip_log('arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : '.var_export( |
|
| 131 | 130 | $arguments, |
| 132 | 131 | true |
| 133 | 132 | ), 'queue'); |
@@ -157,7 +156,7 @@ discard block |
||
| 157 | 156 | function queue_purger() { |
| 158 | 157 | include_spip('base/abstract_sql'); |
| 159 | 158 | sql_delete('spip_jobs'); |
| 160 | - sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')'); |
|
| 159 | + sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')'); |
|
| 161 | 160 | include_spip('inc/genie'); |
| 162 | 161 | genie_queue_watch_dist(); |
| 163 | 162 | } |
@@ -173,8 +172,8 @@ discard block |
||
| 173 | 172 | include_spip('base/abstract_sql'); |
| 174 | 173 | |
| 175 | 174 | if ( |
| 176 | - $row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job)) |
|
| 177 | - and $res = sql_delete('spip_jobs', 'id_job=' . intval($id_job)) |
|
| 175 | + $row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job)) |
|
| 176 | + and $res = sql_delete('spip_jobs', 'id_job='.intval($id_job)) |
|
| 178 | 177 | ) { |
| 179 | 178 | queue_unlink_job($id_job); |
| 180 | 179 | // est-ce une tache cron qu'il faut relancer ? |
@@ -224,7 +223,7 @@ discard block |
||
| 224 | 223 | * resultat du sql_delete |
| 225 | 224 | */ |
| 226 | 225 | function queue_unlink_job($id_job) { |
| 227 | - return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job)); |
|
| 226 | + return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job)); |
|
| 228 | 227 | } |
| 229 | 228 | |
| 230 | 229 | /** |
@@ -240,7 +239,7 @@ discard block |
||
| 240 | 239 | // deserialiser les arguments |
| 241 | 240 | $args = unserialize($row['args']); |
| 242 | 241 | if ($args === false) { |
| 243 | - spip_log('arguments job errones ' . var_export($row, true), 'queue'); |
|
| 242 | + spip_log('arguments job errones '.var_export($row, true), 'queue'); |
|
| 244 | 243 | $args = []; |
| 245 | 244 | } |
| 246 | 245 | |
@@ -257,15 +256,14 @@ discard block |
||
| 257 | 256 | } |
| 258 | 257 | |
| 259 | 258 | if (!function_exists($fonction)) { |
| 260 | - spip_log("fonction $fonction ($inclure) inexistante " . var_export($row, true), 'queue'); |
|
| 259 | + spip_log("fonction $fonction ($inclure) inexistante ".var_export($row, true), 'queue'); |
|
| 261 | 260 | |
| 262 | 261 | return false; |
| 263 | 262 | } |
| 264 | 263 | |
| 265 | - spip_log('queue [' . $row['id_job'] . "]: $fonction() start", 'queue'); |
|
| 264 | + spip_log('queue ['.$row['id_job']."]: $fonction() start", 'queue'); |
|
| 266 | 265 | switch (is_countable($args) ? count($args) : 0) { |
| 267 | - case 0: |
|
| 268 | - $res = $fonction(); |
|
| 266 | + case 0 : $res = $fonction(); |
|
| 269 | 267 | break; |
| 270 | 268 | case 1: |
| 271 | 269 | $res = $fonction($args[0]); |
@@ -312,7 +310,7 @@ discard block |
||
| 312 | 310 | # plus lent mais completement generique |
| 313 | 311 | $res = $fonction(...$args); |
| 314 | 312 | } |
| 315 | - spip_log('queue [' . $row['id_job'] . "]: $fonction() end", 'queue'); |
|
| 313 | + spip_log('queue ['.$row['id_job']."]: $fonction() end", 'queue'); |
|
| 316 | 314 | |
| 317 | 315 | return $res; |
| 318 | 316 | } |
@@ -343,14 +341,14 @@ discard block |
||
| 343 | 341 | function queue_schedule($force_jobs = null) { |
| 344 | 342 | $time = time(); |
| 345 | 343 | if (defined('_DEBUG_BLOCK_QUEUE')) { |
| 346 | - spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq' . _LOG_DEBUG); |
|
| 344 | + spip_log('_DEBUG_BLOCK_QUEUE : schedule stop', 'jq'._LOG_DEBUG); |
|
| 347 | 345 | |
| 348 | 346 | return; |
| 349 | 347 | } |
| 350 | 348 | |
| 351 | 349 | // rien a faire si le prochain job est encore dans le futur |
| 352 | 350 | if (queue_sleep_time_to_next_job() > 0 and (!$force_jobs or !count($force_jobs))) { |
| 353 | - spip_log('queue_sleep_time_to_next_job', 'jq' . _LOG_DEBUG); |
|
| 351 | + spip_log('queue_sleep_time_to_next_job', 'jq'._LOG_DEBUG); |
|
| 354 | 352 | |
| 355 | 353 | return; |
| 356 | 354 | } |
@@ -371,7 +369,7 @@ discard block |
||
| 371 | 369 | } |
| 372 | 370 | $end_time = $time + _JQ_MAX_JOBS_TIME_TO_EXECUTE; |
| 373 | 371 | |
| 374 | - spip_log("JQ schedule $time / $end_time", 'jq' . _LOG_DEBUG); |
|
| 372 | + spip_log("JQ schedule $time / $end_time", 'jq'._LOG_DEBUG); |
|
| 375 | 373 | |
| 376 | 374 | if (!defined('_JQ_MAX_JOBS_EXECUTE')) { |
| 377 | 375 | define('_JQ_MAX_JOBS_EXECUTE', 200); |
@@ -385,19 +383,19 @@ discard block |
||
| 385 | 383 | // lorsqu'un job cron n'a pas fini, sa priorite est descendue |
| 386 | 384 | // pour qu'il ne bloque pas les autres jobs en attente |
| 387 | 385 | if (is_array($force_jobs) and count($force_jobs)) { |
| 388 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs); |
|
| 386 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs); |
|
| 389 | 387 | } else { |
| 390 | 388 | $now = date('Y-m-d H:i:s', $time); |
| 391 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now); |
|
| 389 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now); |
|
| 392 | 390 | } |
| 393 | 391 | |
| 394 | 392 | register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible |
| 395 | - $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 393 | + $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 396 | 394 | do { |
| 397 | 395 | if ($row = array_shift($res)) { |
| 398 | 396 | $nbj++; |
| 399 | 397 | // il faut un verrou, a base de sql_delete |
| 400 | - if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) { |
|
| 398 | + if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) { |
|
| 401 | 399 | #spip_log("JQ schedule job ".$nbj." OK",'jq'); |
| 402 | 400 | // on reinsert dans la base aussitot avec un status=_JQ_PENDING |
| 403 | 401 | $row['status'] = _JQ_PENDING; |
@@ -412,13 +410,13 @@ discard block |
||
| 412 | 410 | queue_close_job($row, $time, $result); |
| 413 | 411 | } |
| 414 | 412 | } |
| 415 | - spip_log('JQ schedule job end time ' . $time, 'jq' . _LOG_DEBUG); |
|
| 413 | + spip_log('JQ schedule job end time '.$time, 'jq'._LOG_DEBUG); |
|
| 416 | 414 | } while ($nbj < _JQ_MAX_JOBS_EXECUTE and $row and $time < $end_time); |
| 417 | - spip_log('JQ schedule end time ' . time(), 'jq' . _LOG_DEBUG); |
|
| 415 | + spip_log('JQ schedule end time '.time(), 'jq'._LOG_DEBUG); |
|
| 418 | 416 | |
| 419 | 417 | if ($row = array_shift($res)) { |
| 420 | 418 | queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP |
| 421 | - spip_log('JQ encore !', 'jq' . _LOG_DEBUG); |
|
| 419 | + spip_log('JQ encore !', 'jq'._LOG_DEBUG); |
|
| 422 | 420 | } else { |
| 423 | 421 | queue_update_next_job_time(); |
| 424 | 422 | } |
@@ -453,9 +451,9 @@ discard block |
||
| 453 | 451 | } |
| 454 | 452 | } |
| 455 | 453 | // purger ses liens eventuels avec des objets |
| 456 | - sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job'])); |
|
| 454 | + sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job'])); |
|
| 457 | 455 | // supprimer le job fini |
| 458 | - sql_delete('spip_jobs', 'id_job=' . intval($row['id_job'])); |
|
| 456 | + sql_delete('spip_jobs', 'id_job='.intval($row['id_job'])); |
|
| 459 | 457 | } |
| 460 | 458 | |
| 461 | 459 | /** |
@@ -528,18 +526,18 @@ discard block |
||
| 528 | 526 | $res = sql_allfetsel( |
| 529 | 527 | '*', |
| 530 | 528 | 'spip_jobs', |
| 531 | - 'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 529 | + 'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 532 | 530 | ); |
| 533 | 531 | if (is_array($res)) { |
| 534 | 532 | foreach ($res as $row) { |
| 535 | 533 | queue_close_job($row, $time); |
| 536 | - spip_log('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, 1), 'job_mort' . _LOG_ERREUR); |
|
| 534 | + spip_log('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, 1), 'job_mort'._LOG_ERREUR); |
|
| 537 | 535 | } |
| 538 | 536 | } |
| 539 | 537 | |
| 540 | 538 | // chercher la date du prochain job si pas connu |
| 541 | 539 | if (is_null($next) or is_null(queue_sleep_time_to_next_job())) { |
| 542 | - $date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 540 | + $date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 543 | 541 | $next = strtotime($date); |
| 544 | 542 | } |
| 545 | 543 | if (!is_null($next_time)) { |
@@ -552,7 +550,7 @@ discard block |
||
| 552 | 550 | if (is_null($nb_jobs_scheduled)) { |
| 553 | 551 | $nb_jobs_scheduled = sql_countsel( |
| 554 | 552 | 'spip_jobs', |
| 555 | - 'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 553 | + 'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 556 | 554 | ); |
| 557 | 555 | } elseif ($next <= $time) { |
| 558 | 556 | $nb_jobs_scheduled++; |
@@ -621,7 +619,7 @@ discard block |
||
| 621 | 619 | } |
| 622 | 620 | |
| 623 | 621 | // ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent |
| 624 | - if (file_exists($lock = _DIR_TMP . 'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 622 | + if (file_exists($lock = _DIR_TMP.'cron.lock') and !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 625 | 623 | return $texte; |
| 626 | 624 | } |
| 627 | 625 | |
@@ -693,7 +691,7 @@ discard block |
||
| 693 | 691 | $port = 80; |
| 694 | 692 | } |
| 695 | 693 | $fp = @fsockopen( |
| 696 | - $scheme . $parts['host'], |
|
| 694 | + $scheme.$parts['host'], |
|
| 697 | 695 | $parts['port'] ?? $port, |
| 698 | 696 | $errno, |
| 699 | 697 | $errstr, |
@@ -703,13 +701,13 @@ discard block |
||
| 703 | 701 | if ($fp) { |
| 704 | 702 | $host_sent = $parts['host']; |
| 705 | 703 | if (isset($parts['port']) and $parts['port'] !== $port) { |
| 706 | - $host_sent .= ':' . $parts['port']; |
|
| 704 | + $host_sent .= ':'.$parts['port']; |
|
| 707 | 705 | } |
| 708 | 706 | $timeout = 200; // ms |
| 709 | 707 | stream_set_timeout($fp, 0, $timeout * 1000); |
| 710 | - $query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : ''); |
|
| 711 | - $out = 'GET ' . $query . " HTTP/1.1\r\n"; |
|
| 712 | - $out .= 'Host: ' . $host_sent . "\r\n"; |
|
| 708 | + $query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : ''); |
|
| 709 | + $out = 'GET '.$query." HTTP/1.1\r\n"; |
|
| 710 | + $out .= 'Host: '.$host_sent."\r\n"; |
|
| 713 | 711 | $out .= "Connection: Close\r\n\r\n"; |
| 714 | 712 | fwrite($fp, $out); |
| 715 | 713 | spip_timer('read'); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $champ = preg_replace(',[\s]+,ms', ' ', $champ); |
| 39 | 39 | $champ = str_replace('"', '""', $champ); |
| 40 | 40 | |
| 41 | - return '"' . $champ . '"'; |
|
| 41 | + return '"'.$champ.'"'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if ($callback) { |
| 59 | 59 | $ligne = $callback($nb, $ligne, $delim, $importer_charset); |
| 60 | 60 | } |
| 61 | - $output = join($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n"; |
|
| 61 | + $output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n"; |
|
| 62 | 62 | if ($importer_charset) { |
| 63 | 63 | $output = str_replace('’', '\'', $output); |
| 64 | 64 | $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $fichier = 'php://output'; |
| 176 | 176 | } |
| 177 | 177 | else { |
| 178 | - $fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename; |
|
| 178 | + $fichier = sous_repertoire(_DIR_CACHE, 'export').$filename; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $fp = fopen($fichier, 'w'); |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | |
| 94 | 94 | $res = ltrim($res['texte']); |
| 95 | 95 | if (empty($res)) { |
| 96 | - spip_log("$arg $qs resultat vide", 'transmettre' . _LOG_INFO_IMPORTANTE); |
|
| 96 | + spip_log("$arg $qs resultat vide", 'transmettre'._LOG_INFO_IMPORTANTE); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | echo $res; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $row = sql_fetsel( |
| 57 | 57 | 'alea_actuel, alea_futur', |
| 58 | 58 | 'spip_auteurs', |
| 59 | - 'login=' . sql_quote($login, $serveur, 'text'), |
|
| 59 | + 'login='.sql_quote($login, $serveur, 'text'), |
|
| 60 | 60 | '', |
| 61 | 61 | '', |
| 62 | 62 | '', |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | if ($row) { |
| 68 | 68 | include_spip('auth/sha256.inc'); |
| 69 | - $shapass = spip_sha256($row['alea_actuel'] . $pass); |
|
| 70 | - $shanext = spip_sha256($row['alea_futur'] . $pass); |
|
| 71 | - $md5pass = md5($row['alea_actuel'] . $pass); |
|
| 69 | + $shapass = spip_sha256($row['alea_actuel'].$pass); |
|
| 70 | + $shanext = spip_sha256($row['alea_futur'].$pass); |
|
| 71 | + $md5pass = md5($row['alea_actuel'].$pass); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | $row = sql_fetsel( |
| 81 | 81 | '*', |
| 82 | 82 | 'spip_auteurs', |
| 83 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 83 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 84 | 84 | $shapass, |
| 85 | 85 | $serveur, |
| 86 | 86 | 'text' |
| 87 | - ) . " AND statut<>'5poubelle'", |
|
| 87 | + )." AND statut<>'5poubelle'", |
|
| 88 | 88 | '', |
| 89 | 89 | '', |
| 90 | 90 | '', |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | $row = sql_fetsel( |
| 98 | 98 | '*', |
| 99 | 99 | 'spip_auteurs', |
| 100 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 100 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 101 | 101 | $md5pass, |
| 102 | 102 | $serveur, |
| 103 | 103 | 'text' |
| 104 | - ) . " AND statut<>'5poubelle'", |
|
| 104 | + )." AND statut<>'5poubelle'", |
|
| 105 | 105 | '', |
| 106 | 106 | '', |
| 107 | 107 | '', |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | 'pass' => sql_quote($shanext, $serveur, 'text'), |
| 127 | 127 | 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text') |
| 128 | 128 | ], |
| 129 | - 'id_auteur=' . $row['id_auteur'] . ' AND pass IN (' . sql_quote( |
|
| 129 | + 'id_auteur='.$row['id_auteur'].' AND pass IN ('.sql_quote( |
|
| 130 | 130 | $shapass, |
| 131 | 131 | $serveur, |
| 132 | 132 | 'text' |
| 133 | - ) . ', ' . sql_quote($md5pass, $serveur, 'text') . ')', |
|
| 133 | + ).', '.sql_quote($md5pass, $serveur, 'text').')', |
|
| 134 | 134 | [], |
| 135 | 135 | $serveur |
| 136 | 136 | ); |
@@ -169,16 +169,16 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | // javascript qui gere la securite du login en evitant de faire circuler le pass en clair |
| 171 | 171 | $flux['data'] .= |
| 172 | - ($compat_md5 ? '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'md5.js"></script>' : '') |
|
| 173 | - . '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'login-sha-min.js"></script>' |
|
| 172 | + ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '') |
|
| 173 | + . '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>' |
|
| 174 | 174 | . '<script type="text/javascript">/*<![CDATA[*/' |
| 175 | - . "var login_info={'alea_actuel':'" . $flux['args']['contexte']['_alea_actuel'] . "'," |
|
| 176 | - . "'alea_futur':'" . $flux['args']['contexte']['_alea_futur'] . "'," |
|
| 177 | - . "'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 178 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 175 | + . "var login_info={'alea_actuel':'".$flux['args']['contexte']['_alea_actuel']."'," |
|
| 176 | + . "'alea_futur':'".$flux['args']['contexte']['_alea_futur']."'," |
|
| 177 | + . "'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 178 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 179 | 179 | . "'informe_auteur_en_cours':false," |
| 180 | 180 | . "'attente_informe':0," |
| 181 | - . "'compat_md5':" . ($compat_md5 ? 'true' : 'false') . '};' |
|
| 181 | + . "'compat_md5':".($compat_md5 ? 'true' : 'false').'};' |
|
| 182 | 182 | . "jQuery(function(){ |
| 183 | 183 | jQuery('#var_login').change(actualise_auteur); |
| 184 | 184 | jQuery('form#formulaire_login').submit(login_submit); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } else { |
| 223 | 223 | $n = sql_countsel( |
| 224 | 224 | 'spip_auteurs', |
| 225 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 225 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 226 | 226 | '', |
| 227 | 227 | '', |
| 228 | 228 | $serveur |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | if ( |
| 252 | 252 | !$id_auteur = intval($id_auteur) |
| 253 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 253 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 254 | 254 | ) { |
| 255 | 255 | return false; |
| 256 | 256 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $anciens = sql_allfetsel( |
| 266 | 266 | 'id_auteur', |
| 267 | 267 | 'spip_auteurs', |
| 268 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 268 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 269 | 269 | '', |
| 270 | 270 | '', |
| 271 | 271 | '', |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | $r = sql_getfetsel( |
| 300 | 300 | 'login', |
| 301 | 301 | 'spip_auteurs', |
| 302 | - "statut<>'5poubelle'" . |
|
| 303 | - ' AND (length(pass)>0)' . |
|
| 302 | + "statut<>'5poubelle'". |
|
| 303 | + ' AND (length(pass)>0)'. |
|
| 304 | 304 | " AND (login=$l)", |
| 305 | 305 | '', |
| 306 | 306 | '', |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | return sql_getfetsel( |
| 320 | 320 | 'login', |
| 321 | 321 | 'spip_auteurs', |
| 322 | - "statut<>'5poubelle'" . |
|
| 323 | - ' AND (length(pass)>0)' . |
|
| 322 | + "statut<>'5poubelle'". |
|
| 323 | + ' AND (length(pass)>0)'. |
|
| 324 | 324 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 325 | 325 | '', |
| 326 | 326 | '', |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | if ( |
| 413 | 413 | !$id_auteur = intval($id_auteur) |
| 414 | - or !sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 414 | + or !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 415 | 415 | ) { |
| 416 | 416 | return false; |
| 417 | 417 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $htpass = generer_htpass($new_pass); |
| 423 | 423 | $alea_actuel = creer_uniqid(); |
| 424 | 424 | $alea_futur = creer_uniqid(); |
| 425 | - $pass = spip_sha256($alea_actuel . $new_pass); |
|
| 425 | + $pass = spip_sha256($alea_actuel.$new_pass); |
|
| 426 | 426 | $c['pass'] = $pass; |
| 427 | 427 | $c['htpass'] = $htpass; |
| 428 | 428 | $c['alea_actuel'] = $alea_actuel; |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | or isset($champs['statut']) |
| 459 | 459 | or (isset($options['all']) and $options['all']) |
| 460 | 460 | ) { |
| 461 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 462 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 461 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 462 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 463 | 463 | |
| 464 | 464 | // Cette variable de configuration peut etre posee par un plugin |
| 465 | 465 | // par exemple acces_restreint ; |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | and !@file_exists($htaccess) |
| 470 | 470 | ) { |
| 471 | 471 | spip_unlink($htpasswd); |
| 472 | - spip_unlink($htpasswd . '-admin'); |
|
| 472 | + spip_unlink($htpasswd.'-admin'); |
|
| 473 | 473 | |
| 474 | 474 | return; |
| 475 | 475 | } |
@@ -487,16 +487,16 @@ discard block |
||
| 487 | 487 | ); |
| 488 | 488 | while ($t = sql_fetch($s)) { |
| 489 | 489 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 490 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 490 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 491 | 491 | if ($t['statut'] == '0minirezo') { |
| 492 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 492 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | sql_free($s); |
| 497 | 497 | if ($p1) { |
| 498 | 498 | ecrire_fichier($htpasswd, $p1); |
| 499 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 499 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 500 | 500 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 501 | 501 | } |
| 502 | 502 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1780,9 +1780,9 @@ discard block |
||
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | 1782 | if ( |
| 1783 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1783 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1784 | 1784 | // deprecated |
| 1785 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1785 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1786 | 1786 | ) { |
| 1787 | 1787 | return $f; |
| 1788 | 1788 | } |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | // inclure le module d'url |
| 1797 | - include_spip('urls/' . $type); |
|
| 1797 | + include_spip('urls/'.$type); |
|
| 1798 | 1798 | |
| 1799 | 1799 | switch ($quoi) { |
| 1800 | 1800 | case 'page': |
@@ -1950,8 +1950,8 @@ discard block |
||
| 1950 | 1950 | include_spip('base/connect_sql'); |
| 1951 | 1951 | $id_type = id_table_objet($entite, $public); |
| 1952 | 1952 | |
| 1953 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1954 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1953 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1954 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1955 | 1955 | . (!$args ? '' : "&$args") |
| 1956 | 1956 | . (!$ancre ? '' : "#$ancre"); |
| 1957 | 1957 | } |
@@ -2122,7 +2122,7 @@ discard block |
||
| 2122 | 2122 | !empty($_SERVER['QUERY_STRING']) |
| 2123 | 2123 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2124 | 2124 | ) { |
| 2125 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2125 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2126 | 2126 | } |
| 2127 | 2127 | } |
| 2128 | 2128 | } |
@@ -2157,9 +2157,9 @@ discard block |
||
| 2157 | 2157 | array_shift($myself); |
| 2158 | 2158 | $myself = implode('/', $myself); |
| 2159 | 2159 | } |
| 2160 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2160 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2161 | 2161 | |
| 2162 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2162 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2163 | 2163 | |
| 2164 | 2164 | return $url; |
| 2165 | 2165 | } |
@@ -2197,16 +2197,16 @@ discard block |
||
| 2197 | 2197 | **/ |
| 2198 | 2198 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2199 | 2199 | if (!$rel) { |
| 2200 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2200 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2201 | 2201 | } else { |
| 2202 | 2202 | if (!is_string($rel)) { |
| 2203 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2203 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2204 | 2204 | } |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | 2207 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2208 | 2208 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2209 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2209 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2210 | 2210 | } elseif ($args) { |
| 2211 | 2211 | $args = "?$args"; |
| 2212 | 2212 | } |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | $args .= "#$ancre"; |
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2217 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2218 | 2218 | } |
| 2219 | 2219 | |
| 2220 | 2220 | // |
@@ -2296,10 +2296,10 @@ discard block |
||
| 2296 | 2296 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2297 | 2297 | } |
| 2298 | 2298 | if ($args) { |
| 2299 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2299 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2300 | 2300 | } |
| 2301 | 2301 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2302 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2302 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | if (!$no_entities) { |
@@ -2311,7 +2311,7 @@ discard block |
||
| 2311 | 2311 | |
| 2312 | 2312 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2313 | 2313 | |
| 2314 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2314 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | // Pour les formulaires en methode POST, |
@@ -2346,8 +2346,7 @@ discard block |
||
| 2346 | 2346 | . "><div>\n" |
| 2347 | 2347 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2348 | 2348 | . $corps |
| 2349 | - . (!$submit ? '' : |
|
| 2350 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2349 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2351 | 2350 | . "</div></form>\n"; |
| 2352 | 2351 | } |
| 2353 | 2352 | |
@@ -2372,14 +2371,14 @@ discard block |
||
| 2372 | 2371 | ? generer_url_ecrire(_request('exec')) |
| 2373 | 2372 | : generer_url_public(); |
| 2374 | 2373 | |
| 2375 | - return "\n<form action='" . |
|
| 2376 | - $h . |
|
| 2377 | - "'" . |
|
| 2378 | - $atts . |
|
| 2379 | - ">\n" . |
|
| 2380 | - '<div>' . |
|
| 2381 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2382 | - $corps . |
|
| 2374 | + return "\n<form action='". |
|
| 2375 | + $h. |
|
| 2376 | + "'". |
|
| 2377 | + $atts. |
|
| 2378 | + ">\n". |
|
| 2379 | + '<div>'. |
|
| 2380 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2381 | + $corps. |
|
| 2383 | 2382 | '</div></form>'; |
| 2384 | 2383 | } |
| 2385 | 2384 | |
@@ -2407,7 +2406,7 @@ discard block |
||
| 2407 | 2406 | : generer_url_public('', '', false, false); |
| 2408 | 2407 | $url = parametre_url($url, 'action', $script); |
| 2409 | 2408 | if ($args) { |
| 2410 | - $url .= quote_amp('&' . $args); |
|
| 2409 | + $url .= quote_amp('&'.$args); |
|
| 2411 | 2410 | } |
| 2412 | 2411 | |
| 2413 | 2412 | if ($no_entities) { |
@@ -2441,9 +2440,9 @@ discard block |
||
| 2441 | 2440 | } |
| 2442 | 2441 | $url = |
| 2443 | 2442 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2444 | - . $script . '/' |
|
| 2443 | + . $script.'/' |
|
| 2445 | 2444 | . ($path ? trim($path, '/') : '') |
| 2446 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2445 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2447 | 2446 | |
| 2448 | 2447 | if ($no_entities) { |
| 2449 | 2448 | $url = str_replace('&', '&', $url); |
@@ -2492,17 +2491,17 @@ discard block |
||
| 2492 | 2491 | |
| 2493 | 2492 | // le nom du repertoire plugins/ activables/desactivables |
| 2494 | 2493 | if (!defined('_DIR_PLUGINS')) { |
| 2495 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2494 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2496 | 2495 | } |
| 2497 | 2496 | |
| 2498 | 2497 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2499 | 2498 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2500 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2499 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2501 | 2500 | } |
| 2502 | 2501 | |
| 2503 | 2502 | // le nom du repertoire des librairies |
| 2504 | 2503 | if (!defined('_DIR_LIB')) { |
| 2505 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2504 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2506 | 2505 | } |
| 2507 | 2506 | |
| 2508 | 2507 | if (!defined('_DIR_IMG')) { |
@@ -2512,29 +2511,29 @@ discard block |
||
| 2512 | 2511 | define('_DIR_LOGOS', $pa); |
| 2513 | 2512 | } |
| 2514 | 2513 | if (!defined('_DIR_IMG_ICONES')) { |
| 2515 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2514 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2516 | 2515 | } |
| 2517 | 2516 | |
| 2518 | 2517 | if (!defined('_DIR_DUMP')) { |
| 2519 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2518 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_DIR_SESSIONS')) { |
| 2522 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2521 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_DIR_TRANSFERT')) { |
| 2525 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2524 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_DIR_CACHE')) { |
| 2528 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2527 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_DIR_CACHE_XML')) { |
| 2531 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2530 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | if (!defined('_DIR_SKELS')) { |
| 2534 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2533 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2535 | 2534 | } |
| 2536 | 2535 | if (!defined('_DIR_AIDE')) { |
| 2537 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2536 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2538 | 2537 | } |
| 2539 | 2538 | if (!defined('_DIR_TMP')) { |
| 2540 | 2539 | define('_DIR_TMP', $ti); |
@@ -2563,27 +2562,27 @@ discard block |
||
| 2563 | 2562 | // Declaration des fichiers |
| 2564 | 2563 | |
| 2565 | 2564 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2566 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2565 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2567 | 2566 | } |
| 2568 | 2567 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2569 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2568 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2570 | 2569 | } |
| 2571 | 2570 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2572 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2571 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2573 | 2572 | } |
| 2574 | 2573 | if (!defined('_CACHE_PIPELINES')) { |
| 2575 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2574 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2576 | 2575 | } |
| 2577 | 2576 | if (!defined('_CACHE_CHEMIN')) { |
| 2578 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2577 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2579 | 2578 | } |
| 2580 | 2579 | |
| 2581 | 2580 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2582 | 2581 | if (!defined('_FILE_META')) { |
| 2583 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2582 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2584 | 2583 | } |
| 2585 | 2584 | if (!defined('_DIR_LOG')) { |
| 2586 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2585 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2587 | 2586 | } |
| 2588 | 2587 | if (!defined('_FILE_LOG')) { |
| 2589 | 2588 | define('_FILE_LOG', 'spip'); |
@@ -2600,8 +2599,8 @@ discard block |
||
| 2600 | 2599 | if (!defined('_FILE_CONNECT')) { |
| 2601 | 2600 | define( |
| 2602 | 2601 | '_FILE_CONNECT', |
| 2603 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2604 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2602 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2603 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2605 | 2604 | : false)) |
| 2606 | 2605 | ); |
| 2607 | 2606 | } |
@@ -2613,7 +2612,7 @@ discard block |
||
| 2613 | 2612 | if (!defined('_FILE_CHMOD')) { |
| 2614 | 2613 | define( |
| 2615 | 2614 | '_FILE_CHMOD', |
| 2616 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2615 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2617 | 2616 | : false) |
| 2618 | 2617 | ); |
| 2619 | 2618 | } |
@@ -2626,10 +2625,10 @@ discard block |
||
| 2626 | 2625 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2627 | 2626 | } |
| 2628 | 2627 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2629 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2628 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2630 | 2629 | } |
| 2631 | 2630 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2632 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2631 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2633 | 2632 | } |
| 2634 | 2633 | |
| 2635 | 2634 | // Definition des droits d'acces en ecriture |
@@ -2647,13 +2646,13 @@ discard block |
||
| 2647 | 2646 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2648 | 2647 | } |
| 2649 | 2648 | if (!defined('_ROOT_PLUGINS')) { |
| 2650 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2649 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2651 | 2650 | } |
| 2652 | 2651 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2653 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2652 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2654 | 2653 | } |
| 2655 | 2654 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2656 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2655 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2657 | 2656 | } |
| 2658 | 2657 | |
| 2659 | 2658 | // La taille des Log |
@@ -2690,7 +2689,7 @@ discard block |
||
| 2690 | 2689 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2691 | 2690 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2692 | 2691 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2693 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2692 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2694 | 2693 | |
| 2695 | 2694 | // charger tout de suite le path et son cache |
| 2696 | 2695 | load_path_cache(); |
@@ -2738,7 +2737,7 @@ discard block |
||
| 2738 | 2737 | !empty($_SERVER['QUERY_STRING']) |
| 2739 | 2738 | and !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 */ |
@@ -3090,7 +3089,7 @@ discard block |
||
| 3090 | 3089 | } |
| 3091 | 3090 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3092 | 3091 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3093 | - . ' ' . _VAR_MODE); |
|
| 3092 | + . ' '._VAR_MODE); |
|
| 3094 | 3093 | } |
| 3095 | 3094 | } // pas autorise ? |
| 3096 | 3095 | else { |
@@ -3105,7 +3104,7 @@ discard block |
||
| 3105 | 3104 | if (strpos($self, 'page=login') === false) { |
| 3106 | 3105 | include_spip('inc/headers'); |
| 3107 | 3106 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3108 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3107 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3109 | 3108 | } |
| 3110 | 3109 | } |
| 3111 | 3110 | // sinon tant pis |
@@ -3147,10 +3146,10 @@ discard block |
||
| 3147 | 3146 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3148 | 3147 | // certaines constantes |
| 3149 | 3148 | @spip_initialisation_core( |
| 3150 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3151 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3152 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3153 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3149 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3150 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3151 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3152 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3154 | 3153 | ); |
| 3155 | 3154 | |
| 3156 | 3155 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3183,7 +3182,7 @@ discard block |
||
| 3183 | 3182 | } |
| 3184 | 3183 | |
| 3185 | 3184 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3186 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3185 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3187 | 3186 | $session = charger_fonction('session', 'inc'); |
| 3188 | 3187 | if ($session()) { |
| 3189 | 3188 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3263,7 +3262,7 @@ discard block |
||
| 3263 | 3262 | 'definir_session', |
| 3264 | 3263 | $GLOBALS['visiteur_session'] |
| 3265 | 3264 | ? serialize($GLOBALS['visiteur_session']) |
| 3266 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3265 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3267 | 3266 | : '' |
| 3268 | 3267 | ); |
| 3269 | 3268 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3419,11 +3418,11 @@ discard block |
||
| 3419 | 3418 | $GLOBALS['_INC_PUBLIC']++; |
| 3420 | 3419 | |
| 3421 | 3420 | // fix #4235 |
| 3422 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3421 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3423 | 3422 | |
| 3424 | 3423 | |
| 3425 | 3424 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3426 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3425 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3427 | 3426 | |
| 3428 | 3427 | $page = evaluer_fond($f, $contexte, $connect); |
| 3429 | 3428 | if ($page === '') { |
@@ -3508,7 +3507,7 @@ discard block |
||
| 3508 | 3507 | * @return array|string |
| 3509 | 3508 | */ |
| 3510 | 3509 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3511 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3510 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3512 | 3511 | if (!$pathinfo) { |
| 3513 | 3512 | return $f; |
| 3514 | 3513 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2_097_152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | else { |
| 121 | - spip_log("copie_locale : recuperation $source sur $localrac OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 121 | + spip_log("copie_locale : recuperation $source sur $localrac OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 122 | 122 | } |
| 123 | 123 | if (!$res or !$res['length']) { |
| 124 | 124 | // si $t c'est sans doute juste un not-modified-since |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if (!$is_known_host) { |
| 209 | 209 | $host = trim($parsed_url['host'], '.'); |
| 210 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 210 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 211 | 211 | $ip = gethostbyname($host); |
| 212 | 212 | if ($ip === $host) { |
| 213 | 213 | // Error condition for gethostbyname() |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | if ($ip) { |
| 231 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 231 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 232 | 232 | return false; |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | $port = $parsed_url['port']; |
| 242 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 242 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 243 | 243 | return $url; |
| 244 | 244 | } |
| 245 | 245 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | if ($taille > 500) { |
| 312 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 312 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -337,16 +337,16 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | } else { |
| 339 | 339 | // fabrique une chaine HTTP simple pour un POST |
| 340 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 340 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 341 | 341 | $chaine = []; |
| 342 | 342 | if (is_array($donnees)) { |
| 343 | 343 | foreach ($donnees as $cle => $valeur) { |
| 344 | 344 | if (is_array($valeur)) { |
| 345 | 345 | foreach ($valeur as $val2) { |
| 346 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 346 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 347 | 347 | } |
| 348 | 348 | } else { |
| 349 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 349 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $chaine = implode('&', $chaine); |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 454 | + spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 455 | 455 | |
| 456 | 456 | // Ajout des en-têtes spécifiques si besoin |
| 457 | 457 | $formatted_data = ''; |
| 458 | 458 | if (!empty($options['headers'])) { |
| 459 | 459 | foreach ($options['headers'] as $champ => $valeur) { |
| 460 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 460 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 466 | 466 | $head .= $formatted_data; |
| 467 | 467 | if (stripos($head, 'Content-Length:') === false) { |
| 468 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 468 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 469 | 469 | } |
| 470 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 470 | + $formatted_data = $head."\r\n".$postdata; |
|
| 471 | 471 | if ( |
| 472 | 472 | strlen($postdata) |
| 473 | 473 | and !$methode_demandee |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 482 | 482 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 483 | 483 | if (!tester_url_absolue($url)) { |
| 484 | - $url = 'http://' . $url; |
|
| 484 | + $url = 'http://'.$url; |
|
| 485 | 485 | } elseif (strncmp($url, '//', 2) == 0) { |
| 486 | - $url = 'http:' . $url; |
|
| 486 | + $url = 'http:'.$url; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $url = url_to_ascii($url); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $options['if_modified_since'] |
| 513 | 513 | ); |
| 514 | 514 | if (!$handle) { |
| 515 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 515 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 516 | 516 | |
| 517 | 517 | return false; |
| 518 | 518 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | 'status' => 200, |
| 543 | 543 | ]; |
| 544 | 544 | } else { |
| 545 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 545 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 546 | 546 | return false; |
| 547 | 547 | } |
| 548 | 548 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -558,11 +558,11 @@ discard block |
||
| 558 | 558 | $options['datas'] = ''; |
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | - spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 561 | + spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 562 | 562 | |
| 563 | 563 | return recuperer_url($url, $options); |
| 564 | 564 | } elseif ($res['status'] !== 200) { |
| 565 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 565 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 566 | 566 | } |
| 567 | 567 | $result['status'] = $res['status']; |
| 568 | 568 | if (isset($res['headers'])) { |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | // on ne veut que les entetes |
| 580 | 580 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 581 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 581 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 582 | 582 | return $result; |
| 583 | 583 | } |
| 584 | 584 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | |
| 589 | 589 | $gz = false; |
| 590 | 590 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 591 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 591 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $trace = json_decode(json_encode($result), true); |
| 626 | 626 | $trace['page'] = '...'; |
| 627 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 627 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 628 | 628 | |
| 629 | 629 | return $result; |
| 630 | 630 | } |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | $sig['url'] = $url; |
| 679 | 679 | |
| 680 | 680 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 681 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 681 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 682 | 682 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 683 | 683 | $cache = "$sub$cache"; |
| 684 | 684 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $fp = false; |
| 733 | 733 | if ($fichier) { |
| 734 | 734 | include_spip('inc/acces'); |
| 735 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 735 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 736 | 736 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 737 | 737 | if (!$fp and file_exists($fichier)) { |
| 738 | 738 | return filesize($fichier); |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | $result['status'] = intval($r[1]); |
| 793 | 793 | while ($s = trim(fgets($handle, 16384))) { |
| 794 | - $result['headers'][] = $s . "\n"; |
|
| 794 | + $result['headers'][] = $s."\n"; |
|
| 795 | 795 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 796 | 796 | [, $d, $v] = $r; |
| 797 | 797 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | |
| 841 | 841 | // on se place tout le temps comme si on etait a la racine |
| 842 | 842 | if (_DIR_RACINE) { |
| 843 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 843 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | $m = md5($source); |
| 847 | 847 | |
| 848 | 848 | return $d |
| 849 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 849 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 850 | 850 | . substr($m, 0, 4) |
| 851 | 851 | . ".$extension"; |
| 852 | 852 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | // Si c'est deja local pas de souci |
| 870 | 870 | if (!tester_url_absolue($source)) { |
| 871 | 871 | if (_DIR_RACINE) { |
| 872 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 872 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | return $source; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $ext |
| 888 | 888 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 889 | 889 | and $f = nom_fichier_copie_locale($source, $ext) |
| 890 | - and file_exists(_DIR_RACINE . $f) |
|
| 890 | + and file_exists(_DIR_RACINE.$f) |
|
| 891 | 891 | ) { |
| 892 | 892 | return $f; |
| 893 | 893 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | // Si c'est deja dans la table des documents, |
| 897 | 897 | // ramener le nom de sa copie potentielle |
| 898 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 898 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 899 | 899 | |
| 900 | 900 | if ($ext) { |
| 901 | 901 | return nom_fichier_copie_locale($source, $ext); |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 908 | 908 | |
| 909 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 909 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 910 | 910 | $f = nom_fichier_copie_locale($source, $ext); |
| 911 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 911 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 912 | 912 | return $f; |
| 913 | 913 | } |
| 914 | 914 | } |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | // Ping pour voir si son extension est connue et autorisee |
| 917 | 917 | // avec mise en cache du resultat du ping |
| 918 | 918 | |
| 919 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 919 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 920 | 920 | if ( |
| 921 | 921 | !@file_exists($cache) |
| 922 | 922 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -926,10 +926,10 @@ discard block |
||
| 926 | 926 | ecrire_fichier($cache, serialize($path_parts)); |
| 927 | 927 | } |
| 928 | 928 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 929 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 929 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 930 | 930 | return nom_fichier_copie_locale($source, $ext); |
| 931 | 931 | } |
| 932 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 932 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | } else { |
| 1014 | 1014 | if ($a['body']) { |
| 1015 | 1015 | $a['extension'] = $extension; |
| 1016 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1016 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1017 | 1017 | ecrire_fichier($a['fichier'], $a['body']); |
| 1018 | 1018 | $size_image = @spip_getimagesize($a['fichier']); |
| 1019 | 1019 | $a['largeur'] = intval($size_image[0]); |
@@ -1081,20 +1081,20 @@ discard block |
||
| 1081 | 1081 | !$t |
| 1082 | 1082 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1083 | 1083 | ) { |
| 1084 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1084 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1085 | 1085 | } |
| 1086 | 1086 | if ( |
| 1087 | 1087 | !$t |
| 1088 | 1088 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1089 | 1089 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1090 | 1090 | ) { |
| 1091 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1091 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1096 | 1096 | if (!$t) { |
| 1097 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1097 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1105,11 +1105,11 @@ discard block |
||
| 1105 | 1105 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1106 | 1106 | ) { |
| 1107 | 1107 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1108 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1108 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | if ($t) { |
| 1112 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1112 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1113 | 1113 | return $t['extension']; |
| 1114 | 1114 | } else { |
| 1115 | 1115 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | } |
| 1213 | 1213 | } else { |
| 1214 | 1214 | $scheme = $t['scheme']; |
| 1215 | - $noproxy = $scheme . '://'; |
|
| 1215 | + $noproxy = $scheme.'://'; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | if (isset($t['user'])) { |
| 1218 | 1218 | $user = [$t['user'], $t['pass']]; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | if (!empty($t['query'])) { |
| 1229 | - $path .= '?' . $t['query']; |
|
| 1229 | + $path .= '?'.$t['query']; |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1300,29 +1300,29 @@ discard block |
||
| 1300 | 1300 | $proxy_user = ''; |
| 1301 | 1301 | $http_proxy = need_proxy($host); |
| 1302 | 1302 | if ($user) { |
| 1303 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1303 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | $connect = ''; |
| 1307 | 1307 | if ($http_proxy) { |
| 1308 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1309 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1310 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1308 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1309 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1310 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1311 | 1311 | . "Host: $path_host\r\n" |
| 1312 | 1312 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1313 | 1313 | } else { |
| 1314 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1314 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1315 | 1315 | . (!$user ? '' : "$user@") |
| 1316 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1316 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1317 | 1317 | } |
| 1318 | 1318 | $t2 = @parse_url($http_proxy); |
| 1319 | 1319 | $first_host = $t2['host']; |
| 1320 | 1320 | $port = ($t2['port'] ?? null) ?: 80; |
| 1321 | 1321 | if ($t2['user'] ?? null) { |
| 1322 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1322 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | } else { |
| 1325 | - $first_host = $noproxy . $host; |
|
| 1325 | + $first_host = $noproxy.$host; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | if ($connect) { |
@@ -1344,7 +1344,7 @@ discard block |
||
| 1344 | 1344 | ); |
| 1345 | 1345 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1346 | 1346 | if (!$f) { |
| 1347 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1347 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1348 | 1348 | return $errno; |
| 1349 | 1349 | } |
| 1350 | 1350 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | or !count($res = explode(' ', $res)) |
| 1358 | 1358 | or $res[1] !== '200' |
| 1359 | 1359 | ) { |
| 1360 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1360 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1361 | 1361 | fclose($f); |
| 1362 | 1362 | |
| 1363 | 1363 | return false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1375 | 1375 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1376 | 1376 | if (!$f) { |
| 1377 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1377 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1378 | 1378 | |
| 1379 | 1379 | return $errno; |
| 1380 | 1380 | } |
@@ -1384,16 +1384,16 @@ discard block |
||
| 1384 | 1384 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1385 | 1385 | |
| 1386 | 1386 | $host_port = $host; |
| 1387 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1387 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1388 | 1388 | $host_port .= ":$port"; |
| 1389 | 1389 | } |
| 1390 | 1390 | $req = "$method $path $vers\r\n" |
| 1391 | 1391 | . "Host: $host_port\r\n" |
| 1392 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1393 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1392 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1393 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1394 | 1394 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1395 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1396 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1395 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1396 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1397 | 1397 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1398 | 1398 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1399 | 1399 | |