@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | foreach ($debug['sourcefile'] as $k => $v) { |
| 103 | 103 | if (strpos($v, 'administration.') !== false) { |
| 104 | - if (isset($debug['resultat'][$k . 'tout'])) { |
|
| 105 | - return $debug['resultat'][$k . 'tout']; |
|
| 104 | + if (isset($debug['resultat'][$k.'tout'])) { |
|
| 105 | + return $debug['resultat'][$k.'tout']; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | and $id = intval($id) |
| 181 | 181 | and $desc = $trouver_table(table_objet_sql($type)) |
| 182 | 182 | ) { |
| 183 | - $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . intval($id)); |
|
| 183 | + $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
|
| 184 | 184 | if ($id) { |
| 185 | 185 | $env[$_id_type] = $id; |
| 186 | 186 | $env['objet'] = $type; |
| 187 | 187 | $env['id_objet'] = $id; |
| 188 | - $env['voir_' . $obj] = |
|
| 188 | + $env['voir_'.$obj] = |
|
| 189 | 189 | str_replace('&', '&', generer_objet_url($id, $obj, '', '', false)); |
| 190 | 190 | if ( |
| 191 | 191 | isset($desc['field']['id_rubrique']) |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $notpub = sql_in('statut', ['prop', 'prive']); |
| 240 | 240 | |
| 241 | 241 | if ($type == 'article' and $GLOBALS['meta']['post_dates'] != 'oui') { |
| 242 | - $notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ')'; |
|
| 242 | + $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).')'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . '=' . $id . " AND ($notpub)"); |
|
| 245 | + return sql_fetsel('1', table_objet_sql($type), id_table_objet($type).'='.$id." AND ($notpub)"); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | $alang = ''; |
| 257 | 257 | if (!empty($_COOKIE['spip_admin'])) { |
| 258 | 258 | $email_or_login = preg_replace(',^@,', '', $_COOKIE['spip_admin']); |
| 259 | - $alang = sql_getfetsel('lang', 'spip_auteurs', 'email=' . sql_quote($email_or_login)); |
|
| 259 | + $alang = sql_getfetsel('lang', 'spip_auteurs', 'email='.sql_quote($email_or_login)); |
|
| 260 | 260 | if (!$alang) { |
| 261 | - $alang = sql_getfetsel('lang', 'spip_auteurs', 'login=' . sql_quote($email_or_login)); |
|
| 261 | + $alang = sql_getfetsel('lang', 'spip_auteurs', 'login='.sql_quote($email_or_login)); |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | if (!$alang) { |
@@ -283,9 +283,8 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | return ((!isset($GLOBALS['xhtml']) or $GLOBALS['xhtml'] !== 'true') ? |
| 285 | 285 | (parametre_url(self(), 'var_mode', 'debug', '&') |
| 286 | - . '&var_mode_affiche=validation') : |
|
| 287 | - ('http://validator.w3.org/check?uri=' |
|
| 288 | - . rawurlencode('http://' . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 286 | + . '&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri=' |
|
| 287 | + . rawurlencode('http://'.$_SERVER['HTTP_HOST'].nettoyer_uri()))); |
|
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | /** |
@@ -54,12 +54,12 @@ |
||
| 54 | 54 | $_params = '['; |
| 55 | 55 | $nb_params = is_countable($p->param[0]) ? count($p->param[0]) : 0; // 1ère valeur vide donc 1 en plus |
| 56 | 56 | for ($i = 3; $i < $nb_params; $i++) { |
| 57 | - $_params .= interprete_argument_balise($i, $p) . ','; |
|
| 57 | + $_params .= interprete_argument_balise($i, $p).','; |
|
| 58 | 58 | } |
| 59 | 59 | $_params .= ']'; |
| 60 | 60 | |
| 61 | 61 | $info_sql = strtolower(substr($info, 5)); |
| 62 | - $code = "generer_objet_info($id_objet, $type_objet, '$info_sql', " . ($p->etoile ? _q($p->etoile) : "''") . ", $_params)"; |
|
| 62 | + $code = "generer_objet_info($id_objet, $type_objet, '$info_sql', ".($p->etoile ? _q($p->etoile) : "''").", $_params)"; |
|
| 63 | 63 | $p->code = champ_sql($info, $p, $code); |
| 64 | 64 | $p->interdire_scripts = true; |
| 65 | 65 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite |
| 24 | 24 | define('_separateur_urls_page', ''); |
| 25 | 25 | # on peut indiquer '' si on a installe le .htaccess |
| 26 | -define('_debut_urls_page', get_spip_script('./') . '?'); |
|
| 26 | +define('_debut_urls_page', get_spip_script('./').'?'); |
|
| 27 | 27 | ####### |
| 28 | 28 | |
| 29 | 29 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | - . $id . \_terminaison_urls_page; |
|
| 49 | + $url = \_debut_urls_page.$objet.\_separateur_urls_page |
|
| 50 | + . $id.\_terminaison_urls_page; |
|
| 51 | 51 | |
| 52 | 52 | if ($args) { |
| 53 | 53 | $args = strpos($url, '?') ? "&$args" : "?$args"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 56 | + return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : ''); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $result = sql_select( |
| 44 | 44 | 'id_rubrique, id_parent, titre, descriptif, lang', |
| 45 | 45 | 'spip_rubriques', |
| 46 | - 'id_parent=' . intval($collection), |
|
| 46 | + 'id_parent='.intval($collection), |
|
| 47 | 47 | '', |
| 48 | 48 | '0+titre,titre', |
| 49 | 49 | "$debut,$limite" |
@@ -74,19 +74,18 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : |
|
| 78 | - http_img_pack( |
|
| 77 | + $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack( |
|
| 79 | 78 | 'auteur-0minirezo-16.png', |
| 80 | 79 | '', |
| 81 | 80 | " width='16' height='16'", |
| 82 | 81 | _T('image_administrer_rubrique') |
| 83 | - )) . |
|
| 84 | - " <a class='titremlien' dir='$lang_dir'" . |
|
| 85 | - ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . |
|
| 86 | - " href='" . |
|
| 87 | - generer_objet_url($id_rubrique, 'rubrique') . |
|
| 88 | - "'><span class='titre'>" . |
|
| 89 | - $rang . $titre |
|
| 82 | + )). |
|
| 83 | + " <a class='titremlien' dir='$lang_dir'". |
|
| 84 | + ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : ''). |
|
| 85 | + " href='". |
|
| 86 | + generer_objet_url($id_rubrique, 'rubrique'). |
|
| 87 | + "'><span class='titre'>". |
|
| 88 | + $rang.$titre |
|
| 90 | 89 | . '</span>' |
| 91 | 90 | . (is_string($logo) ? $logo : '') |
| 92 | 91 | . '</a>'; |
@@ -96,8 +95,8 @@ discard block |
||
| 96 | 95 | ; |
| 97 | 96 | |
| 98 | 97 | $res[] = |
| 99 | - debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) . |
|
| 100 | - $les_sous_enfants . |
|
| 98 | + debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre). |
|
| 99 | + $les_sous_enfants. |
|
| 101 | 100 | fin_cadre_sous_rub(); |
| 102 | 101 | } |
| 103 | 102 | } |
@@ -116,7 +115,7 @@ discard block |
||
| 116 | 115 | * Le contenu du bloc dépliable |
| 117 | 116 | */ |
| 118 | 117 | function sous_enfant_rub($collection2) { |
| 119 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2)); |
|
| 118 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2)); |
|
| 120 | 119 | |
| 121 | 120 | $retour = ''; |
| 122 | 121 | $pagination = ''; |
@@ -128,23 +127,23 @@ discard block |
||
| 128 | 127 | * Si > 500 on affiche une pagination |
| 129 | 128 | */ |
| 130 | 129 | if ($nb > $limite) { |
| 131 | - $debut = _request('debut_rubrique' . $collection2) ?: $debut; |
|
| 130 | + $debut = _request('debut_rubrique'.$collection2) ?: $debut; |
|
| 132 | 131 | $pagination = chercher_filtre('pagination'); |
| 133 | - $pagination = '<p class="pagination">' . $pagination( |
|
| 132 | + $pagination = '<p class="pagination">'.$pagination( |
|
| 134 | 133 | $nb, |
| 135 | - '_rubrique' . $collection2, |
|
| 134 | + '_rubrique'.$collection2, |
|
| 136 | 135 | $debut, |
| 137 | 136 | $limite, |
| 138 | 137 | true, |
| 139 | 138 | 'prive' |
| 140 | - ) . '</p>'; |
|
| 139 | + ).'</p>'; |
|
| 141 | 140 | $limite = $debut + $limite; |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | $result = sql_select( |
| 145 | 144 | 'id_rubrique, id_parent, titre, lang', |
| 146 | 145 | 'spip_rubriques', |
| 147 | - 'id_parent=' . intval($collection2), |
|
| 146 | + 'id_parent='.intval($collection2), |
|
| 148 | 147 | '', |
| 149 | 148 | '0+titre,titre', |
| 150 | 149 | "$debut,$limite" |
@@ -164,14 +163,14 @@ discard block |
||
| 164 | 163 | changer_typo($row['lang']); |
| 165 | 164 | $lang_dir = lang_dir($row['lang']); |
| 166 | 165 | if (autoriser('voir', 'rubrique', $id_rubrique2)) { |
| 167 | - $retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_objet_url( |
|
| 166 | + $retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_objet_url( |
|
| 168 | 167 | $id_rubrique2, |
| 169 | 168 | 'rubrique' |
| 170 | - ) . "'>" . $rang2 . $titre2 . "</a></li>\n"; |
|
| 169 | + )."'>".$rang2.$titre2."</a></li>\n"; |
|
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | - $retour = $pagination . $retour . $pagination; |
|
| 173 | + $retour = $pagination.$retour.$pagination; |
|
| 175 | 174 | |
| 176 | 175 | if (!$retour) { |
| 177 | 176 | return ''; |
@@ -180,7 +179,7 @@ discard block |
||
| 180 | 179 | return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2") |
| 181 | 180 | . "\n<ul class='liste-items sous-sous-rub'>\n" |
| 182 | 181 | . $retour |
| 183 | - . "</ul>\n" . fin_block() . "\n\n"; |
|
| 182 | + . "</ul>\n".fin_block()."\n\n"; |
|
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | /** |
@@ -199,13 +198,13 @@ discard block |
||
| 199 | 198 | $debut = 0; |
| 200 | 199 | $limite = 500; |
| 201 | 200 | |
| 202 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique)); |
|
| 201 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)); |
|
| 203 | 202 | |
| 204 | 203 | if ($nb > $limite) { |
| 205 | - $debut = _request('debut_rubrique' . $id_rubrique) ?: $debut; |
|
| 204 | + $debut = _request('debut_rubrique'.$id_rubrique) ?: $debut; |
|
| 206 | 205 | $pagination = chercher_filtre('pagination'); |
| 207 | - $pagination = '<br class="nettoyeur"><p class="pagination">' . |
|
| 208 | - $pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') . |
|
| 206 | + $pagination = '<br class="nettoyeur"><p class="pagination">'. |
|
| 207 | + $pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive'). |
|
| 209 | 208 | '</p>'; |
| 210 | 209 | } |
| 211 | 210 | |
@@ -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,14 +98,14 @@ 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 | - _T('fichier_introuvable', ['fichier' => '<b>' . spip_htmlentities($d) . '</b>']), |
|
| 108 | - ['all_inline' => true,'status' => 404] |
|
| 107 | + _T('fichier_introuvable', ['fichier' => '<b>'.spip_htmlentities($d).'</b>']), |
|
| 108 | + ['all_inline' => true, 'status' => 404] |
|
| 109 | 109 | ); |
| 110 | 110 | exit; |
| 111 | 111 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * - string : chemin du fichier trouvé |
| 152 | 152 | **/ |
| 153 | 153 | function include_spip($f, $include = true) { |
| 154 | - return find_in_path($f . '.php', '', $include); |
|
| 154 | + return find_in_path($f.'.php', '', $include); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * - string : chemin du fichier trouvé |
| 172 | 172 | **/ |
| 173 | 173 | function require_spip($f) { |
| 174 | - return find_in_path($f . '.php', '', 'required'); |
|
| 174 | + return find_in_path($f.'.php', '', 'required'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // donc il faut l'inclure "en globals" |
| 189 | 189 | if ($f = find_in_path('mes_fonctions.php')) { |
| 190 | 190 | global $dossier_squelettes; |
| 191 | - include_once(_ROOT_CWD . $f); |
|
| 191 | + include_once(_ROOT_CWD.$f); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | // appliquer notre fonction si elle existe |
| 296 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 296 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 297 | 297 | if (function_exists($fonc)) { |
| 298 | 298 | $val = $fonc($val); |
| 299 | 299 | } // plantage ? |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | function spip_log($message = null, $name = null) { |
| 359 | 359 | static $pre = []; |
| 360 | 360 | static $log; |
| 361 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 361 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 362 | 362 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 363 | 363 | $logname = null; |
| 364 | 364 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | if (!is_string($message)) { |
| 387 | 387 | $message = print_r($message, true); |
| 388 | 388 | } |
| 389 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 389 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | $a = './'; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 590 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 591 | 591 | $ajouts = array_flip(explode('|', $c)); |
| 592 | 592 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 593 | 593 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 615 | 615 | // pour un tableau ce sera fait dans la prochaine boucle |
| 616 | 616 | elseif (substr($r[1], -2) != '[]') { |
| 617 | - $url[$n] = $r[1] . '=' . $u; |
|
| 617 | + $url[$n] = $r[1].'='.$u; |
|
| 618 | 618 | unset($ajouts[$r[1]]); |
| 619 | 619 | } |
| 620 | 620 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -635,11 +635,11 @@ discard block |
||
| 635 | 635 | } elseif ($testv) { |
| 636 | 636 | foreach ($ajouts as $k => $n) { |
| 637 | 637 | if (!is_array($v)) { |
| 638 | - $url[] = $k . '=' . $u; |
|
| 638 | + $url[] = $k.'='.$u; |
|
| 639 | 639 | } else { |
| 640 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 640 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 641 | 641 | foreach ($v as $w) { |
| 642 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 642 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 643 | 643 | } |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -650,10 +650,10 @@ discard block |
||
| 650 | 650 | |
| 651 | 651 | // recomposer l'adresse |
| 652 | 652 | if ($url) { |
| 653 | - $a .= '?' . join($sep, $url); |
|
| 653 | + $a .= '?'.join($sep, $url); |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | - return $a . $ancre; |
|
| 656 | + return $a.$ancre; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | /** |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | translitteration($ancre) |
| 686 | 686 | ); |
| 687 | 687 | } |
| 688 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 688 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | /** |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | * @return bool |
| 802 | 802 | */ |
| 803 | 803 | function test_plugin_actif($plugin) { |
| 804 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 804 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | /** |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | $value = interdire_scripts($value, -1); |
| 934 | 934 | } |
| 935 | 935 | if (!empty($options['class'])) { |
| 936 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 936 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 937 | 937 | } |
| 938 | 938 | $text = str_replace("@$name@", $value, $text); |
| 939 | 939 | unset($args[$name]); |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | // Si des variables n'ont pas ete inserees, le signaler |
| 943 | 943 | // (chaines de langues pas a jour) |
| 944 | 944 | if ($args) { |
| 945 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 945 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | function joli_repertoire($rep) { |
| 967 | 967 | $a = substr($rep, 0, 1); |
| 968 | 968 | if ($a <> '.' and $a <> '/') { |
| 969 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 969 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 970 | 970 | } |
| 971 | 971 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 972 | 972 | |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | $p -= ($x * 1000); |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1023 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1024 | 1024 | } |
| 1025 | 1025 | } |
| 1026 | 1026 | |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | if ($taches and count($taches) and !spip_connect()) { |
| 1088 | 1088 | return false; |
| 1089 | 1089 | } |
| 1090 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1090 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1091 | 1091 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1092 | 1092 | return $genie($taches); |
| 1093 | 1093 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | if ($queue_next_job_time == -1) { |
| 1193 | 1193 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1194 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1194 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | // utiliser un cache memoire si dispo |
| 1197 | 1197 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1260,8 +1260,8 @@ discard block |
||
| 1260 | 1260 | $src = ''; |
| 1261 | 1261 | } |
| 1262 | 1262 | if ($script) { |
| 1263 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1264 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1263 | + $script = ("/*<![CDATA[*/\n". |
|
| 1264 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1265 | 1265 | '/*]]>*/'); |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($noscript) { |
@@ -1347,13 +1347,13 @@ discard block |
||
| 1347 | 1347 | if ($path_base == null) { |
| 1348 | 1348 | // Chemin standard depuis l'espace public |
| 1349 | 1349 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1350 | - _DIR_RACINE . ':' . |
|
| 1351 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1352 | - _DIR_RACINE . 'prive/:' . |
|
| 1350 | + _DIR_RACINE.':'. |
|
| 1351 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1352 | + _DIR_RACINE.'prive/:'. |
|
| 1353 | 1353 | _DIR_RESTREINT; |
| 1354 | 1354 | // Ajouter squelettes/ |
| 1355 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1356 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1355 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1356 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1357 | 1357 | } |
| 1358 | 1358 | foreach (explode(':', $path) as $dir) { |
| 1359 | 1359 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | // Et le(s) dossier(s) des squelettes nommes |
| 1366 | 1366 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1367 | 1367 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1368 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1368 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | |
| 1377 | 1377 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1378 | 1378 | $tete = ''; |
| 1379 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1379 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1380 | 1380 | $tete = array_shift($path_base); |
| 1381 | 1381 | } |
| 1382 | 1382 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | // Et le(s) dossier(s) des squelettes nommes |
| 1398 | 1398 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1399 | 1399 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1400 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1400 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -1468,14 +1468,14 @@ discard block |
||
| 1468 | 1468 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1469 | 1469 | if ( |
| 1470 | 1470 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1471 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1471 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1472 | 1472 | and $f = find_in_theme("$file_svg_generique") |
| 1473 | 1473 | ) { |
| 1474 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1474 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1475 | 1475 | return $themefiles["$subdir$file"] = $fsize; |
| 1476 | 1476 | } |
| 1477 | 1477 | else { |
| 1478 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1478 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1479 | 1479 | } |
| 1480 | 1480 | } |
| 1481 | 1481 | |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | return $themefiles["$subdir$file"] = $f; |
| 1486 | 1486 | } |
| 1487 | 1487 | } |
| 1488 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1488 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1489 | 1489 | |
| 1490 | 1490 | return $themefiles["$subdir$file"] = ''; |
| 1491 | 1491 | } |
@@ -1593,8 +1593,8 @@ discard block |
||
| 1593 | 1593 | return false; |
| 1594 | 1594 | } |
| 1595 | 1595 | if ($include and !isset($inc[$dirname][$file])) { |
| 1596 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1596 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1607,14 +1607,14 @@ discard block |
||
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | foreach (creer_chemin() as $dir) { |
| 1610 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1611 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1610 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1611 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1612 | 1612 | } |
| 1613 | 1613 | if ($dirs[$a]) { |
| 1614 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1614 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1615 | 1615 | if ($include and !isset($inc[$dirname][$file])) { |
| 1616 | - include_once _ROOT_CWD . $a; |
|
| 1617 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1616 | + include_once _ROOT_CWD.$a; |
|
| 1617 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | if (!defined('_SAUVER_CHEMIN')) { |
| 1620 | 1620 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | define('_SAUVER_CHEMIN', true); |
| 1625 | 1625 | } |
| 1626 | 1626 | |
| 1627 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1627 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | } |
| 1630 | 1630 | } |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | define('_SAUVER_CHEMIN', true); |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1653 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | function clear_path_cache() { |
@@ -1720,12 +1720,12 @@ discard block |
||
| 1720 | 1720 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1721 | 1721 | // on a pas encore inclus flock.php |
| 1722 | 1722 | if (!function_exists('preg_files')) { |
| 1723 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1723 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | 1726 | // Parcourir le chemin |
| 1727 | 1727 | foreach (creer_chemin() as $d) { |
| 1728 | - $f = $d . $dir; |
|
| 1728 | + $f = $d.$dir; |
|
| 1729 | 1729 | if (@is_dir($f)) { |
| 1730 | 1730 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1731 | 1731 | foreach ($liste as $chemin) { |
@@ -1774,9 +1774,9 @@ discard block |
||
| 1774 | 1774 | function charger_fonction_url(string $quoi, string $type = '') { |
| 1775 | 1775 | if ($type === 'defaut') { |
| 1776 | 1776 | $objet = objet_type($quoi); |
| 1777 | - if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1777 | + if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1778 | 1778 | // deprecated |
| 1779 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1779 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1780 | 1780 | ) { |
| 1781 | 1781 | return $f; |
| 1782 | 1782 | } |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | * @deprecated 4.1 |
| 1896 | 1896 | * @see generer_objet_url |
| 1897 | 1897 | */ |
| 1898 | -function generer_url_entite($id = '', $entite = '', $args = '', $ancre = '', $public = null, $type = null){ |
|
| 1898 | +function generer_url_entite($id = '', $entite = '', $args = '', $ancre = '', $public = null, $type = null) { |
|
| 1899 | 1899 | return generer_objet_url($id, $entite, $args, $ancre, $public, $type); |
| 1900 | 1900 | } |
| 1901 | 1901 | |
@@ -1926,7 +1926,7 @@ discard block |
||
| 1926 | 1926 | * @deprecated 4.1 |
| 1927 | 1927 | * @see generer_objet_url_ecrire_edit |
| 1928 | 1928 | */ |
| 1929 | -function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){ |
|
| 1929 | +function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') { |
|
| 1930 | 1930 | return generer_objet_url_ecrire_edit($id, $entite, $args, $ancre); |
| 1931 | 1931 | } |
| 1932 | 1932 | |
@@ -1935,8 +1935,8 @@ discard block |
||
| 1935 | 1935 | include_spip('base/connect_sql'); |
| 1936 | 1936 | $id_type = id_table_objet($entite, $public); |
| 1937 | 1937 | |
| 1938 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1939 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1938 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1939 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1940 | 1940 | . (!$args ? '' : "&$args") |
| 1941 | 1941 | . (!$ancre ? '' : "#$ancre"); |
| 1942 | 1942 | } |
@@ -1990,7 +1990,7 @@ discard block |
||
| 1990 | 1990 | * @deprecated 4.1 |
| 1991 | 1991 | * @see generer_objet_url_absolue |
| 1992 | 1992 | */ |
| 1993 | -function generer_url_entite_absolue($id = '', $entite = '', $args = '', $ancre = '', $connect = null){ |
|
| 1993 | +function generer_url_entite_absolue($id = '', $entite = '', $args = '', $ancre = '', $connect = null) { |
|
| 1994 | 1994 | return generer_objet_url_absolue($id, $entite, $args, $args, $ancre, $connect); |
| 1995 | 1995 | } |
| 1996 | 1996 | |
@@ -2107,7 +2107,7 @@ discard block |
||
| 2107 | 2107 | !empty($_SERVER['QUERY_STRING']) |
| 2108 | 2108 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2109 | 2109 | ) { |
| 2110 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2110 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2111 | 2111 | } |
| 2112 | 2112 | } |
| 2113 | 2113 | } |
@@ -2142,9 +2142,9 @@ discard block |
||
| 2142 | 2142 | array_shift($myself); |
| 2143 | 2143 | $myself = implode('/', $myself); |
| 2144 | 2144 | } |
| 2145 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2145 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2146 | 2146 | |
| 2147 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2147 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2148 | 2148 | |
| 2149 | 2149 | return $url; |
| 2150 | 2150 | } |
@@ -2182,16 +2182,16 @@ discard block |
||
| 2182 | 2182 | **/ |
| 2183 | 2183 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2184 | 2184 | if (!$rel) { |
| 2185 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2185 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2186 | 2186 | } else { |
| 2187 | 2187 | if (!is_string($rel)) { |
| 2188 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2188 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2189 | 2189 | } |
| 2190 | 2190 | } |
| 2191 | 2191 | |
| 2192 | 2192 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2193 | 2193 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2194 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2194 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2195 | 2195 | } elseif ($args) { |
| 2196 | 2196 | $args = "?$args"; |
| 2197 | 2197 | } |
@@ -2199,7 +2199,7 @@ discard block |
||
| 2199 | 2199 | $args .= "#$ancre"; |
| 2200 | 2200 | } |
| 2201 | 2201 | |
| 2202 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2202 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | 2205 | // |
@@ -2281,10 +2281,10 @@ discard block |
||
| 2281 | 2281 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2282 | 2282 | } |
| 2283 | 2283 | if ($args) { |
| 2284 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2284 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2285 | 2285 | } |
| 2286 | 2286 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2287 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2287 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2288 | 2288 | } |
| 2289 | 2289 | |
| 2290 | 2290 | if (!$no_entities) { |
@@ -2296,7 +2296,7 @@ discard block |
||
| 2296 | 2296 | |
| 2297 | 2297 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2298 | 2298 | |
| 2299 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2299 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2300 | 2300 | } |
| 2301 | 2301 | |
| 2302 | 2302 | // Pour les formulaires en methode POST, |
@@ -2331,8 +2331,7 @@ discard block |
||
| 2331 | 2331 | . "><div>\n" |
| 2332 | 2332 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2333 | 2333 | . $corps |
| 2334 | - . (!$submit ? '' : |
|
| 2335 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2334 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2336 | 2335 | . "</div></form>\n"; |
| 2337 | 2336 | } |
| 2338 | 2337 | |
@@ -2357,14 +2356,14 @@ discard block |
||
| 2357 | 2356 | ? generer_url_ecrire(_request('exec')) |
| 2358 | 2357 | : generer_url_public(); |
| 2359 | 2358 | |
| 2360 | - return "\n<form action='" . |
|
| 2361 | - $h . |
|
| 2362 | - "'" . |
|
| 2363 | - $atts . |
|
| 2364 | - ">\n" . |
|
| 2365 | - '<div>' . |
|
| 2366 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2367 | - $corps . |
|
| 2359 | + return "\n<form action='". |
|
| 2360 | + $h. |
|
| 2361 | + "'". |
|
| 2362 | + $atts. |
|
| 2363 | + ">\n". |
|
| 2364 | + '<div>'. |
|
| 2365 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2366 | + $corps. |
|
| 2368 | 2367 | '</div></form>'; |
| 2369 | 2368 | } |
| 2370 | 2369 | |
@@ -2392,7 +2391,7 @@ discard block |
||
| 2392 | 2391 | : generer_url_public('', '', false, false); |
| 2393 | 2392 | $url = parametre_url($url, 'action', $script); |
| 2394 | 2393 | if ($args) { |
| 2395 | - $url .= quote_amp('&' . $args); |
|
| 2394 | + $url .= quote_amp('&'.$args); |
|
| 2396 | 2395 | } |
| 2397 | 2396 | |
| 2398 | 2397 | if ($no_entities) { |
@@ -2442,17 +2441,17 @@ discard block |
||
| 2442 | 2441 | |
| 2443 | 2442 | // le nom du repertoire plugins/ activables/desactivables |
| 2444 | 2443 | if (!defined('_DIR_PLUGINS')) { |
| 2445 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2444 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2446 | 2445 | } |
| 2447 | 2446 | |
| 2448 | 2447 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2449 | 2448 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2450 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2449 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2451 | 2450 | } |
| 2452 | 2451 | |
| 2453 | 2452 | // le nom du repertoire des librairies |
| 2454 | 2453 | if (!defined('_DIR_LIB')) { |
| 2455 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2454 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2456 | 2455 | } |
| 2457 | 2456 | |
| 2458 | 2457 | if (!defined('_DIR_IMG')) { |
@@ -2462,29 +2461,29 @@ discard block |
||
| 2462 | 2461 | define('_DIR_LOGOS', $pa); |
| 2463 | 2462 | } |
| 2464 | 2463 | if (!defined('_DIR_IMG_ICONES')) { |
| 2465 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2464 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2466 | 2465 | } |
| 2467 | 2466 | |
| 2468 | 2467 | if (!defined('_DIR_DUMP')) { |
| 2469 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2468 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2470 | 2469 | } |
| 2471 | 2470 | if (!defined('_DIR_SESSIONS')) { |
| 2472 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2471 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2473 | 2472 | } |
| 2474 | 2473 | if (!defined('_DIR_TRANSFERT')) { |
| 2475 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2474 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2476 | 2475 | } |
| 2477 | 2476 | if (!defined('_DIR_CACHE')) { |
| 2478 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2477 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2479 | 2478 | } |
| 2480 | 2479 | if (!defined('_DIR_CACHE_XML')) { |
| 2481 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2480 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2482 | 2481 | } |
| 2483 | 2482 | if (!defined('_DIR_SKELS')) { |
| 2484 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2483 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2485 | 2484 | } |
| 2486 | 2485 | if (!defined('_DIR_AIDE')) { |
| 2487 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2486 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2488 | 2487 | } |
| 2489 | 2488 | if (!defined('_DIR_TMP')) { |
| 2490 | 2489 | define('_DIR_TMP', $ti); |
@@ -2513,27 +2512,27 @@ discard block |
||
| 2513 | 2512 | // Declaration des fichiers |
| 2514 | 2513 | |
| 2515 | 2514 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2516 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2515 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2517 | 2516 | } |
| 2518 | 2517 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2519 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2518 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2522 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2521 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_CACHE_PIPELINES')) { |
| 2525 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2524 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_CACHE_CHEMIN')) { |
| 2528 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2527 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | |
| 2531 | 2530 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2532 | 2531 | if (!defined('_FILE_META')) { |
| 2533 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2532 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_LOG')) { |
| 2536 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2535 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_FILE_LOG')) { |
| 2539 | 2538 | define('_FILE_LOG', 'spip'); |
@@ -2550,8 +2549,8 @@ discard block |
||
| 2550 | 2549 | if (!defined('_FILE_CONNECT')) { |
| 2551 | 2550 | define( |
| 2552 | 2551 | '_FILE_CONNECT', |
| 2553 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2554 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2552 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2553 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2555 | 2554 | : false)) |
| 2556 | 2555 | ); |
| 2557 | 2556 | } |
@@ -2563,7 +2562,7 @@ discard block |
||
| 2563 | 2562 | if (!defined('_FILE_CHMOD')) { |
| 2564 | 2563 | define( |
| 2565 | 2564 | '_FILE_CHMOD', |
| 2566 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2565 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2567 | 2566 | : false) |
| 2568 | 2567 | ); |
| 2569 | 2568 | } |
@@ -2576,10 +2575,10 @@ discard block |
||
| 2576 | 2575 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2577 | 2576 | } |
| 2578 | 2577 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2579 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2578 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2580 | 2579 | } |
| 2581 | 2580 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2582 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2581 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | |
| 2585 | 2584 | // Definition des droits d'acces en ecriture |
@@ -2597,13 +2596,13 @@ discard block |
||
| 2597 | 2596 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2598 | 2597 | } |
| 2599 | 2598 | if (!defined('_ROOT_PLUGINS')) { |
| 2600 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2599 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2601 | 2600 | } |
| 2602 | 2601 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2603 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2602 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2604 | 2603 | } |
| 2605 | 2604 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2606 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2605 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2607 | 2606 | } |
| 2608 | 2607 | |
| 2609 | 2608 | // La taille des Log |
@@ -2640,7 +2639,7 @@ discard block |
||
| 2640 | 2639 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2641 | 2640 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2642 | 2641 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2643 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2642 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2644 | 2643 | |
| 2645 | 2644 | // charger tout de suite le path et son cache |
| 2646 | 2645 | load_path_cache(); |
@@ -2688,7 +2687,7 @@ discard block |
||
| 2688 | 2687 | !empty($_SERVER['QUERY_STRING']) |
| 2689 | 2688 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2690 | 2689 | ) { |
| 2691 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2690 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2692 | 2691 | } |
| 2693 | 2692 | } |
| 2694 | 2693 | |
@@ -2724,7 +2723,7 @@ discard block |
||
| 2724 | 2723 | ) { |
| 2725 | 2724 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2726 | 2725 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2727 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2726 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2728 | 2727 | } else { |
| 2729 | 2728 | $uri_ref = ''; |
| 2730 | 2729 | } |
@@ -2818,7 +2817,7 @@ discard block |
||
| 2818 | 2817 | } |
| 2819 | 2818 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2820 | 2819 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2821 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2820 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2822 | 2821 | } |
| 2823 | 2822 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2824 | 2823 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -2922,7 +2921,7 @@ discard block |
||
| 2922 | 2921 | $memory *= 1024; |
| 2923 | 2922 | } |
| 2924 | 2923 | if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) { |
| 2925 | - @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M'); |
|
| 2924 | + @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M'); |
|
| 2926 | 2925 | if (trim(ini_get('memory_limit')) != $m) { |
| 2927 | 2926 | if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) { |
| 2928 | 2927 | define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true); |
@@ -3073,7 +3072,7 @@ discard block |
||
| 3073 | 3072 | } |
| 3074 | 3073 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3075 | 3074 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3076 | - . ' ' . _VAR_MODE); |
|
| 3075 | + . ' '._VAR_MODE); |
|
| 3077 | 3076 | } |
| 3078 | 3077 | } // pas autorise ? |
| 3079 | 3078 | else { |
@@ -3088,7 +3087,7 @@ discard block |
||
| 3088 | 3087 | if (strpos($self, 'page=login') === false) { |
| 3089 | 3088 | include_spip('inc/headers'); |
| 3090 | 3089 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3091 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3090 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3092 | 3091 | } |
| 3093 | 3092 | } |
| 3094 | 3093 | // sinon tant pis |
@@ -3130,10 +3129,10 @@ discard block |
||
| 3130 | 3129 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3131 | 3130 | // certaines constantes |
| 3132 | 3131 | @spip_initialisation_core( |
| 3133 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3134 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3135 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3136 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3132 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3133 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3134 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3135 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3137 | 3136 | ); |
| 3138 | 3137 | |
| 3139 | 3138 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3166,7 +3165,7 @@ discard block |
||
| 3166 | 3165 | } |
| 3167 | 3166 | |
| 3168 | 3167 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3169 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3168 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3170 | 3169 | $session = charger_fonction('session', 'inc'); |
| 3171 | 3170 | if ($session()) { |
| 3172 | 3171 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3246,7 +3245,7 @@ discard block |
||
| 3246 | 3245 | 'definir_session', |
| 3247 | 3246 | $GLOBALS['visiteur_session'] |
| 3248 | 3247 | ? serialize($GLOBALS['visiteur_session']) |
| 3249 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3248 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3250 | 3249 | : '' |
| 3251 | 3250 | ); |
| 3252 | 3251 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3402,11 +3401,11 @@ discard block |
||
| 3402 | 3401 | $GLOBALS['_INC_PUBLIC']++; |
| 3403 | 3402 | |
| 3404 | 3403 | // fix #4235 |
| 3405 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3404 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3406 | 3405 | |
| 3407 | 3406 | |
| 3408 | 3407 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3409 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3408 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3410 | 3409 | |
| 3411 | 3410 | $page = evaluer_fond($f, $contexte, $connect); |
| 3412 | 3411 | if ($page === '') { |
@@ -3491,7 +3490,7 @@ discard block |
||
| 3491 | 3490 | * @return array|string |
| 3492 | 3491 | */ |
| 3493 | 3492 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3494 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3493 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3495 | 3494 | if (!$pathinfo) { |
| 3496 | 3495 | return $f; |
| 3497 | 3496 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // affichage "GIT [master: abcdef]" |
| 224 | 224 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 225 | 225 | if ($desc['branch']) { |
| 226 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 226 | + $commit = $desc['branch'].': '.$commit; |
|
| 227 | 227 | } |
| 228 | 228 | return "{$desc['vcs']} [$commit]"; |
| 229 | 229 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // version installee par GIT |
| 245 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 246 | 246 | $currentHead = trim(substr($c, 4)); |
| 247 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 247 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 248 | 248 | return [ |
| 249 | 249 | 'vcs' => 'GIT', |
| 250 | 250 | 'branch' => basename($currentHead), |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | $dir = '.'; |
| 272 | 272 | } |
| 273 | 273 | // version installee par SVN |
| 274 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 274 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 276 | 276 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 277 | 277 | if ($result) { |
| 278 | 278 | $row = $result->fetchArray(); |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 292 | 292 | // et laisser passer les fonctions personnelles baptisees image_... |
| 293 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 294 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 295 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 296 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 297 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 298 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 293 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 294 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 295 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 296 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 297 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 298 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 299 | 299 | |
| 300 | 300 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 301 | 301 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | function filtre_debug($val, $key = null) { |
| 456 | 456 | $debug = ( |
| 457 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 458 | - ) . var_export($val, true); |
|
| 457 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 458 | + ).var_export($val, true); |
|
| 459 | 459 | |
| 460 | 460 | include_spip('inc/autoriser'); |
| 461 | 461 | if (autoriser('webmestre')) { |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $is_file = false; |
| 510 | 510 | } |
| 511 | 511 | if ($is_file) { |
| 512 | - $is_local_file = function ($path) { |
|
| 512 | + $is_local_file = function($path) { |
|
| 513 | 513 | if (strpos($path, '?') !== false) { |
| 514 | 514 | $path = supprimer_timestamp($path); |
| 515 | 515 | // remove ?24px added by find_in_theme on .svg files |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 562 | 562 | $srcover = $match[1]; |
| 563 | 563 | array_shift($args); |
| 564 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 564 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 565 | 565 | $srcover_filter = call_user_func_array($filtre, $args); |
| 566 | 566 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 567 | 567 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | // " -> " et tout ce genre de choses |
| 929 | 929 | $u = $GLOBALS['meta']['pcre_u']; |
| 930 | 930 | $texte = str_replace(' ', ' ', $texte); |
| 931 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 931 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 932 | 932 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 933 | 933 | $texte = entites_html($texte, false, false); |
| 934 | 934 | // mais bien echapper les double quotes ! |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | **/ |
| 989 | 989 | function supprimer_numero($texte) { |
| 990 | 990 | return preg_replace( |
| 991 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 991 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 992 | 992 | '', |
| 993 | 993 | $texte |
| 994 | 994 | ); |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | function recuperer_numero($texte) { |
| 1017 | 1017 | if ( |
| 1018 | 1018 | preg_match( |
| 1019 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1019 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1020 | 1020 | $texte, |
| 1021 | 1021 | $regs |
| 1022 | 1022 | ) |
@@ -1107,8 +1107,8 @@ discard block |
||
| 1107 | 1107 | **/ |
| 1108 | 1108 | function textebrut($texte) { |
| 1109 | 1109 | $u = $GLOBALS['meta']['pcre_u']; |
| 1110 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1111 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1110 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1111 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1112 | 1112 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1113 | 1113 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1114 | 1114 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | ) |
| 1143 | 1143 | ) { |
| 1144 | 1144 | foreach ($liens[0] as $a) { |
| 1145 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1145 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1146 | 1146 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1147 | 1147 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1148 | 1148 | $texte = str_replace($a, $ablank, $texte); |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | foreach ($regs[0] as $a) { |
| 1168 | 1168 | $rel = extraire_attribut($a, 'rel'); |
| 1169 | 1169 | if (strpos($rel, 'nofollow') === false) { |
| 1170 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1170 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1171 | 1171 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1172 | 1172 | $texte = str_replace($a, $anofollow, $texte); |
| 1173 | 1173 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | $u = $GLOBALS['meta']['pcre_u']; |
| 1197 | 1197 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1198 | 1198 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1199 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1199 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1200 | 1200 | |
| 1201 | 1201 | return $texte; |
| 1202 | 1202 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | return $texte; |
| 1228 | 1228 | } |
| 1229 | 1229 | include_spip('inc/texte'); |
| 1230 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1230 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1231 | 1231 | 'div' : 'span'; |
| 1232 | 1232 | |
| 1233 | 1233 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | } |
| 1340 | 1340 | $u = $GLOBALS['meta']['pcre_u']; |
| 1341 | 1341 | if ($textebrut) { |
| 1342 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1342 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1343 | 1343 | } |
| 1344 | 1344 | $texte = texte_backend($texte); |
| 1345 | 1345 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | # un message pour abs_url |
| 1375 | 1375 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1376 | 1376 | $url = trim($url); |
| 1377 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1377 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1378 | 1378 | |
| 1379 | 1379 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1380 | 1380 | } |
@@ -1578,14 +1578,14 @@ discard block |
||
| 1578 | 1578 | if (strpos($texte, '<') !== false) { |
| 1579 | 1579 | include_spip('inc/lien'); |
| 1580 | 1580 | if (defined('_PREG_MODELE')) { |
| 1581 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1581 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1582 | 1582 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1583 | 1583 | } |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | 1586 | $debut = ''; |
| 1587 | 1587 | $suite = $texte; |
| 1588 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1588 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1589 | 1589 | $debut .= substr($suite, 0, $t - 1); |
| 1590 | 1590 | $suite = substr($suite, $t); |
| 1591 | 1591 | $car = substr($suite, 0, 1); |
@@ -1603,11 +1603,11 @@ discard block |
||
| 1603 | 1603 | $suite = substr($suite, strlen($regs[0])); |
| 1604 | 1604 | } |
| 1605 | 1605 | } |
| 1606 | - $texte = $debut . $suite; |
|
| 1606 | + $texte = $debut.$suite; |
|
| 1607 | 1607 | |
| 1608 | 1608 | $texte = echappe_retour($texte); |
| 1609 | 1609 | |
| 1610 | - return $texte . $fin; |
|
| 1610 | + return $texte.$fin; |
|
| 1611 | 1611 | } |
| 1612 | 1612 | |
| 1613 | 1613 | |
@@ -1669,7 +1669,7 @@ discard block |
||
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | 1671 | foreach ($regs as $reg) { |
| 1672 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1672 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1673 | 1673 | $desc = $traduire($cle, $lang, true); |
| 1674 | 1674 | $l = $desc->langue; |
| 1675 | 1675 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1783,9 +1783,9 @@ discard block |
||
| 1783 | 1783 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1784 | 1784 | include_spip('inc/texte'); |
| 1785 | 1785 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1786 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1786 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1787 | 1787 | if ($mode === 'div') { |
| 1788 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1788 | + $trad = rtrim($trad)."\n\n"; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1791 | 1791 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -1981,7 +1981,7 @@ discard block |
||
| 1981 | 1981 | if (is_array($balise)) { |
| 1982 | 1982 | array_walk( |
| 1983 | 1983 | $balise, |
| 1984 | - function (&$a, $key, $t) { |
|
| 1984 | + function(&$a, $key, $t) { |
|
| 1985 | 1985 | $a = extraire_attribut($a, $t); |
| 1986 | 1986 | }, |
| 1987 | 1987 | $attribut |
@@ -2078,14 +2078,14 @@ discard block |
||
| 2078 | 2078 | |
| 2079 | 2079 | if ($old !== null) { |
| 2080 | 2080 | // Remplacer l'ancien attribut du meme nom |
| 2081 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2081 | + $balise = $r[1].$insert.$r[5]; |
|
| 2082 | 2082 | } else { |
| 2083 | 2083 | // preferer une balise " />" (comme <img />) |
| 2084 | 2084 | if (preg_match(',/>,', $balise)) { |
| 2085 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2085 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2086 | 2086 | } // sinon une balise <a ...> ... </a> |
| 2087 | 2087 | else { |
| 2088 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2088 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2089 | 2089 | } |
| 2090 | 2090 | } |
| 2091 | 2091 | |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | if ( |
| 2141 | 2141 | $class_courante |
| 2142 | 2142 | and strpos($class_courante, (string) $c) !== false |
| 2143 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2143 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2144 | 2144 | ) { |
| 2145 | 2145 | $is_class_presente = true; |
| 2146 | 2146 | } |
@@ -2148,12 +2148,12 @@ discard block |
||
| 2148 | 2148 | in_array($operation, ['ajouter', 'commuter']) |
| 2149 | 2149 | and !$is_class_presente |
| 2150 | 2150 | ) { |
| 2151 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2151 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2152 | 2152 | } elseif ( |
| 2153 | 2153 | in_array($operation, ['supprimer', 'commuter']) |
| 2154 | 2154 | and $is_class_presente |
| 2155 | 2155 | ) { |
| 2156 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2156 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2157 | 2157 | } |
| 2158 | 2158 | } |
| 2159 | 2159 | |
@@ -2216,7 +2216,7 @@ discard block |
||
| 2216 | 2216 | // Quelques fonctions de calcul arithmetique |
| 2217 | 2217 | // |
| 2218 | 2218 | function floatstr($a) { |
| 2219 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2219 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2220 | 2220 | } |
| 2221 | 2221 | function strize($f, $a, $b) { |
| 2222 | 2222 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2352,13 +2352,13 @@ discard block |
||
| 2352 | 2352 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2353 | 2353 | define('_TAGS_NOM_AUTEUR', ''); |
| 2354 | 2354 | } |
| 2355 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2355 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2356 | 2356 | foreach ($tags_acceptes as $tag) { |
| 2357 | 2357 | if (strlen($tag)) { |
| 2358 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2359 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2360 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2361 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2358 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2359 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2360 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2361 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2362 | 2362 | } |
| 2363 | 2363 | } |
| 2364 | 2364 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2412,7 +2412,7 @@ discard block |
||
| 2412 | 2412 | . http_img_pack( |
| 2413 | 2413 | 'attachment-16.png', |
| 2414 | 2414 | $t, |
| 2415 | - 'title="' . attribut_html($t) . '"' |
|
| 2415 | + 'title="'.attribut_html($t).'"' |
|
| 2416 | 2416 | ) |
| 2417 | 2417 | . '</a>', |
| 2418 | 2418 | $tag |
@@ -2476,10 +2476,10 @@ discard block |
||
| 2476 | 2476 | $fichier = basename($url); |
| 2477 | 2477 | |
| 2478 | 2478 | return '<a rel="enclosure"' |
| 2479 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2480 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2481 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2482 | - . '>' . $fichier . '</a>'; |
|
| 2479 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2480 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2481 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2482 | + . '>'.$fichier.'</a>'; |
|
| 2483 | 2483 | } |
| 2484 | 2484 | |
| 2485 | 2485 | /** |
@@ -2507,9 +2507,9 @@ discard block |
||
| 2507 | 2507 | } # vieux data |
| 2508 | 2508 | $fichier = basename($url); |
| 2509 | 2509 | $enclosures[] = '<enclosure' |
| 2510 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2511 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2512 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2510 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2511 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2512 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2513 | 2513 | . ' />'; |
| 2514 | 2514 | } |
| 2515 | 2515 | } |
@@ -2535,7 +2535,7 @@ discard block |
||
| 2535 | 2535 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2536 | 2536 | $subjects .= '<dc:subject>' |
| 2537 | 2537 | . texte_backend(textebrut($e)) |
| 2538 | - . '</dc:subject>' . "\n"; |
|
| 2538 | + . '</dc:subject>'."\n"; |
|
| 2539 | 2539 | } |
| 2540 | 2540 | } |
| 2541 | 2541 | |
@@ -2571,7 +2571,7 @@ discard block |
||
| 2571 | 2571 | if (is_array($texte)) { |
| 2572 | 2572 | array_walk( |
| 2573 | 2573 | $texte, |
| 2574 | - function (&$a, $key, $t) { |
|
| 2574 | + function(&$a, $key, $t) { |
|
| 2575 | 2575 | $a = extraire_balise($a, $t); |
| 2576 | 2576 | }, |
| 2577 | 2577 | $tag |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | if (is_array($texte)) { |
| 2620 | 2620 | array_walk( |
| 2621 | 2621 | $texte, |
| 2622 | - function (&$a, $key, $t) { |
|
| 2622 | + function(&$a, $key, $t) { |
|
| 2623 | 2623 | $a = extraire_balises($a, $t); |
| 2624 | 2624 | }, |
| 2625 | 2625 | $tag |
@@ -2751,7 +2751,7 @@ discard block |
||
| 2751 | 2751 | if ($fond != '404') { |
| 2752 | 2752 | $contexte = array_shift($p); |
| 2753 | 2753 | $contexte['page'] = $fond; |
| 2754 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2754 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2755 | 2755 | } |
| 2756 | 2756 | } |
| 2757 | 2757 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2806,9 +2806,9 @@ discard block |
||
| 2806 | 2806 | . '"' |
| 2807 | 2807 | . (is_null($val) |
| 2808 | 2808 | ? '' |
| 2809 | - : ' value="' . entites_html($val) . '"' |
|
| 2809 | + : ' value="'.entites_html($val).'"' |
|
| 2810 | 2810 | ) |
| 2811 | - . ' type="hidden"' . "\n/>"; |
|
| 2811 | + . ' type="hidden"'."\n/>"; |
|
| 2812 | 2812 | } |
| 2813 | 2813 | |
| 2814 | 2814 | return join('', $hidden); |
@@ -2918,7 +2918,7 @@ discard block |
||
| 2918 | 2918 | |
| 2919 | 2919 | return preg_replace_callback( |
| 2920 | 2920 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2921 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2921 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2922 | 2922 | $contenu |
| 2923 | 2923 | ); |
| 2924 | 2924 | } |
@@ -2979,14 +2979,14 @@ discard block |
||
| 2979 | 2979 | ) { |
| 2980 | 2980 | $distant = true; |
| 2981 | 2981 | $cssf = parse_url($css); |
| 2982 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 2982 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 2983 | 2983 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 2984 | 2984 | } else { |
| 2985 | 2985 | $distant = false; |
| 2986 | 2986 | $cssf = $css; |
| 2987 | 2987 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2988 | 2988 | //propose (rien a faire dans ce cas) |
| 2989 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2989 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2990 | 2990 | if (@file_exists($f)) { |
| 2991 | 2991 | return $f; |
| 2992 | 2992 | } |
@@ -2996,7 +2996,7 @@ discard block |
||
| 2996 | 2996 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2997 | 2997 | $f = $dir_var |
| 2998 | 2998 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2999 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2999 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3000 | 3000 | |
| 3001 | 3001 | // la css peut etre distante (url absolue !) |
| 3002 | 3002 | if ($distant) { |
@@ -3042,8 +3042,8 @@ discard block |
||
| 3042 | 3042 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3043 | 3043 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3044 | 3044 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3045 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3046 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3045 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3046 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3047 | 3047 | } |
| 3048 | 3048 | $src[] = $regs[0][$k]; |
| 3049 | 3049 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3092,7 +3092,7 @@ discard block |
||
| 3092 | 3092 | |
| 3093 | 3093 | $f = basename($css, '.css'); |
| 3094 | 3094 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3095 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3095 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3096 | 3096 | . '.css'; |
| 3097 | 3097 | |
| 3098 | 3098 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3102,7 +3102,7 @@ discard block |
||
| 3102 | 3102 | if ($url_absolue_css == $css) { |
| 3103 | 3103 | if ( |
| 3104 | 3104 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3105 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3105 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3106 | 3106 | ) { |
| 3107 | 3107 | include_spip('inc/distant'); |
| 3108 | 3108 | $contenu = recuperer_url($css); |
@@ -3214,7 +3214,7 @@ discard block |
||
| 3214 | 3214 | $expression = str_replace('\/', '/', $expression); |
| 3215 | 3215 | $expression = str_replace('/', '\/', $expression); |
| 3216 | 3216 | |
| 3217 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3217 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3218 | 3218 | if (isset($r[$capte])) { |
| 3219 | 3219 | return $r[$capte]; |
| 3220 | 3220 | } else { |
@@ -3252,7 +3252,7 @@ discard block |
||
| 3252 | 3252 | $expression = str_replace('\/', '/', $expression); |
| 3253 | 3253 | $expression = str_replace('/', '\/', $expression); |
| 3254 | 3254 | |
| 3255 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3255 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3256 | 3256 | } |
| 3257 | 3257 | |
| 3258 | 3258 | |
@@ -3271,7 +3271,7 @@ discard block |
||
| 3271 | 3271 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3272 | 3272 | |
| 3273 | 3273 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3274 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3274 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3275 | 3275 | |
| 3276 | 3276 | if ( |
| 3277 | 3277 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3285,7 +3285,7 @@ discard block |
||
| 3285 | 3285 | if (!isset($doublons['documents'])) { |
| 3286 | 3286 | $doublons['documents'] = ''; |
| 3287 | 3287 | } |
| 3288 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3288 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3289 | 3289 | } |
| 3290 | 3290 | |
| 3291 | 3291 | return $letexte; |
@@ -3342,7 +3342,7 @@ discard block |
||
| 3342 | 3342 | if ($env) { |
| 3343 | 3343 | foreach ($env as $i => $j) { |
| 3344 | 3344 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3345 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3345 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3346 | 3346 | } |
| 3347 | 3347 | } |
| 3348 | 3348 | } |
@@ -3381,7 +3381,7 @@ discard block |
||
| 3381 | 3381 | if ($env) { |
| 3382 | 3382 | foreach ($env as $i => $j) { |
| 3383 | 3383 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3384 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3384 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3385 | 3385 | } |
| 3386 | 3386 | } |
| 3387 | 3387 | } |
@@ -3455,10 +3455,10 @@ discard block |
||
| 3455 | 3455 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3456 | 3456 | if ( |
| 3457 | 3457 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3458 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3458 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3459 | 3459 | and file_exists($variante_svg_generique) |
| 3460 | 3460 | ) { |
| 3461 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3461 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3462 | 3462 | $img_file = $variante_svg_size; |
| 3463 | 3463 | } |
| 3464 | 3464 | else { |
@@ -3516,7 +3516,7 @@ discard block |
||
| 3516 | 3516 | return ''; |
| 3517 | 3517 | } |
| 3518 | 3518 | } |
| 3519 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3519 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3520 | 3520 | } |
| 3521 | 3521 | |
| 3522 | 3522 | if (file_exists($img_file)) { |
@@ -3526,14 +3526,14 @@ discard block |
||
| 3526 | 3526 | $alt = ''; |
| 3527 | 3527 | } |
| 3528 | 3528 | elseif ($alt or $alt === '') { |
| 3529 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3529 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3530 | 3530 | } |
| 3531 | 3531 | else { |
| 3532 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3532 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3533 | 3533 | } |
| 3534 | 3534 | return "<img src='$img_file'$alt" |
| 3535 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3536 | - . ' ' . ltrim($atts) |
|
| 3535 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3536 | + . ' '.ltrim($atts) |
|
| 3537 | 3537 | . ' />'; |
| 3538 | 3538 | } |
| 3539 | 3539 | |
@@ -3547,10 +3547,10 @@ discard block |
||
| 3547 | 3547 | */ |
| 3548 | 3548 | function http_style_background($img, $att = '', $size = null) { |
| 3549 | 3549 | if ($size and is_numeric($size)) { |
| 3550 | - $size = trim($size) . 'px'; |
|
| 3550 | + $size = trim($size).'px'; |
|
| 3551 | 3551 | } |
| 3552 | - return " style='background" . |
|
| 3553 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3552 | + return " style='background". |
|
| 3553 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3554 | 3554 | . ($size ? "background-size:{$size};" : '') |
| 3555 | 3555 | . "'"; |
| 3556 | 3556 | } |
@@ -3665,7 +3665,7 @@ discard block |
||
| 3665 | 3665 | $img = http_img_pack( |
| 3666 | 3666 | $img, |
| 3667 | 3667 | $alt, |
| 3668 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3668 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3669 | 3669 | '', |
| 3670 | 3670 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3671 | 3671 | ); |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | $balise_svg_source = $balise_svg; |
| 3751 | 3751 | |
| 3752 | 3752 | // entete XML à supprimer |
| 3753 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3753 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3754 | 3754 | |
| 3755 | 3755 | // IE est toujours mon ami |
| 3756 | 3756 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3768,9 +3768,9 @@ discard block |
||
| 3768 | 3768 | // regler le alt |
| 3769 | 3769 | if ($alt) { |
| 3770 | 3770 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3771 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3771 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3772 | 3772 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3773 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3773 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3774 | 3774 | $balise_svg .= $title; |
| 3775 | 3775 | } |
| 3776 | 3776 | else { |
@@ -3818,7 +3818,7 @@ discard block |
||
| 3818 | 3818 | if (is_array($tableau)) { |
| 3819 | 3819 | foreach ($tableau as $k => $v) { |
| 3820 | 3820 | $res = recuperer_fond( |
| 3821 | - 'modeles/' . $modele, |
|
| 3821 | + 'modeles/'.$modele, |
|
| 3822 | 3822 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3823 | 3823 | ); |
| 3824 | 3824 | $texte .= $res; |
@@ -4003,7 +4003,7 @@ discard block |
||
| 4003 | 4003 | } |
| 4004 | 4004 | |
| 4005 | 4005 | $c = serialize($c); |
| 4006 | - $cle = calculer_cle_action($form . $c); |
|
| 4006 | + $cle = calculer_cle_action($form.$c); |
|
| 4007 | 4007 | $c = "$cle:$c"; |
| 4008 | 4008 | |
| 4009 | 4009 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4061,15 +4061,15 @@ discard block |
||
| 4061 | 4061 | } |
| 4062 | 4062 | // toujours encoder l'url source dans le bloc ajax |
| 4063 | 4063 | $r = self(); |
| 4064 | - $r = ' data-origin="' . $r . '"'; |
|
| 4064 | + $r = ' data-origin="'.$r.'"'; |
|
| 4065 | 4065 | $class = 'ajaxbloc'; |
| 4066 | 4066 | if ($ajaxid and is_string($ajaxid)) { |
| 4067 | 4067 | // ajaxid est normalement conforme a un nom de classe css |
| 4068 | 4068 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4069 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4069 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4070 | 4070 | } |
| 4071 | 4071 | |
| 4072 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4072 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4073 | 4073 | } |
| 4074 | 4074 | |
| 4075 | 4075 | /** |
@@ -4113,7 +4113,7 @@ discard block |
||
| 4113 | 4113 | $cle = substr($c, 0, $p); |
| 4114 | 4114 | $c = substr($c, $p + 1); |
| 4115 | 4115 | |
| 4116 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4116 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4117 | 4117 | $env = @unserialize($c); |
| 4118 | 4118 | return $env; |
| 4119 | 4119 | } |
@@ -4234,13 +4234,13 @@ discard block |
||
| 4234 | 4234 | } |
| 4235 | 4235 | } |
| 4236 | 4236 | } |
| 4237 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4237 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4238 | 4238 | } else { |
| 4239 | 4239 | $bal = 'a'; |
| 4240 | 4240 | $att = "href='$url'" |
| 4241 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4242 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4243 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4241 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4242 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4243 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4244 | 4244 | . $evt; |
| 4245 | 4245 | } |
| 4246 | 4246 | if ($libelle === null) { |
@@ -4379,7 +4379,7 @@ discard block |
||
| 4379 | 4379 | |
| 4380 | 4380 | // Icône |
| 4381 | 4381 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4382 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4382 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4383 | 4383 | |
| 4384 | 4384 | // Markup final |
| 4385 | 4385 | if ($type == 'lien') { |
@@ -4656,20 +4656,20 @@ discard block |
||
| 4656 | 4656 | $class_form = 'ajax'; |
| 4657 | 4657 | $class = str_replace('ajax', '', $class); |
| 4658 | 4658 | } |
| 4659 | - $class_btn = 'submit ' . trim($class); |
|
| 4659 | + $class_btn = 'submit '.trim($class); |
|
| 4660 | 4660 | |
| 4661 | 4661 | if ($confirm) { |
| 4662 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4662 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4663 | 4663 | if ($callback) { |
| 4664 | 4664 | $callback = "$confirm?($callback):false"; |
| 4665 | 4665 | } else { |
| 4666 | 4666 | $callback = $confirm; |
| 4667 | 4667 | } |
| 4668 | 4668 | } |
| 4669 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4669 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4670 | 4670 | $title = $title ? " title='$title'" : ''; |
| 4671 | 4671 | |
| 4672 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4672 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4673 | 4673 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4674 | 4674 | } |
| 4675 | 4675 | |
@@ -4734,14 +4734,14 @@ discard block |
||
| 4734 | 4734 | $champ_titre = ''; |
| 4735 | 4735 | if ($demande_titre) { |
| 4736 | 4736 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4737 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4737 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4738 | 4738 | } |
| 4739 | 4739 | include_spip('base/abstract_sql'); |
| 4740 | 4740 | include_spip('base/connect_sql'); |
| 4741 | 4741 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4742 | - '*' . $champ_titre, |
|
| 4742 | + '*'.$champ_titre, |
|
| 4743 | 4743 | $desc['table_sql'], |
| 4744 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4744 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4745 | 4745 | ); |
| 4746 | 4746 | |
| 4747 | 4747 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4834,8 +4834,7 @@ discard block |
||
| 4834 | 4834 | if (isset($ligne_sql['chapo'])) { |
| 4835 | 4835 | $chapo = $ligne_sql['chapo']; |
| 4836 | 4836 | $texte = strlen($descriptif) ? |
| 4837 | - '' : |
|
| 4838 | - "$chapo \n\n $texte"; |
|
| 4837 | + '' : "$chapo \n\n $texte"; |
|
| 4839 | 4838 | } |
| 4840 | 4839 | |
| 4841 | 4840 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4910,7 +4909,7 @@ discard block |
||
| 4910 | 4909 | return $texte; |
| 4911 | 4910 | } |
| 4912 | 4911 | |
| 4913 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4912 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4914 | 4913 | |
| 4915 | 4914 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4916 | 4915 | $Pile = [0 => $env]; |
@@ -4944,7 +4943,7 @@ discard block |
||
| 4944 | 4943 | } |
| 4945 | 4944 | $url = generer_objet_url($id_objet, $objet, '', '', $connect); |
| 4946 | 4945 | |
| 4947 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4946 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4948 | 4947 | } |
| 4949 | 4948 | |
| 4950 | 4949 | /** |
@@ -4970,10 +4969,10 @@ discard block |
||
| 4970 | 4969 | function wrap($texte, $wrap) { |
| 4971 | 4970 | $balises = extraire_balises($wrap); |
| 4972 | 4971 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4973 | - $texte = $wrap . $texte; |
|
| 4972 | + $texte = $wrap.$texte; |
|
| 4974 | 4973 | $regs = array_reverse($regs[1]); |
| 4975 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 4976 | - $texte = $texte . $wrap; |
|
| 4974 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 4975 | + $texte = $texte.$wrap; |
|
| 4977 | 4976 | } |
| 4978 | 4977 | |
| 4979 | 4978 | return $texte; |
@@ -5004,7 +5003,7 @@ discard block |
||
| 5004 | 5003 | |
| 5005 | 5004 | // caster $u en array si besoin |
| 5006 | 5005 | if (is_object($u)) { |
| 5007 | - $u = (array)$u; |
|
| 5006 | + $u = (array) $u; |
|
| 5008 | 5007 | } |
| 5009 | 5008 | |
| 5010 | 5009 | if (is_array($u)) { |
@@ -5026,7 +5025,7 @@ discard block |
||
| 5026 | 5025 | // sinon on passe a la ligne et on indente |
| 5027 | 5026 | $i_str = str_pad('', $indent, ' '); |
| 5028 | 5027 | foreach ($u as $k => $v) { |
| 5029 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5028 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5030 | 5029 | } |
| 5031 | 5030 | |
| 5032 | 5031 | return $out; |
@@ -5080,7 +5079,7 @@ discard block |
||
| 5080 | 5079 | * @return string |
| 5081 | 5080 | */ |
| 5082 | 5081 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5083 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5082 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5084 | 5083 | $icone = chemin_image($icone); |
| 5085 | 5084 | $balise_img = charger_filtre('balise_img'); |
| 5086 | 5085 | |
@@ -5106,7 +5105,7 @@ discard block |
||
| 5106 | 5105 | */ |
| 5107 | 5106 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5108 | 5107 | $chaine = explode(':', $chaine); |
| 5109 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5108 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5110 | 5109 | return $t; |
| 5111 | 5110 | } |
| 5112 | 5111 | $chaine = implode(':', $chaine); |
@@ -5172,7 +5171,7 @@ discard block |
||
| 5172 | 5171 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5173 | 5172 | |
| 5174 | 5173 | // calculer le nom de la css |
| 5175 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5174 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5176 | 5175 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5177 | 5176 | $contexte_implicite = calculer_contexte_implicite(); |
| 5178 | 5177 | |
@@ -5180,14 +5179,14 @@ discard block |
||
| 5180 | 5179 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5181 | 5180 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5182 | 5181 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5183 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5182 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5184 | 5183 | } |
| 5185 | 5184 | else { |
| 5186 | 5185 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5187 | 5186 | ksort($contexte); |
| 5188 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5187 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5189 | 5188 | } |
| 5190 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5189 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5191 | 5190 | |
| 5192 | 5191 | // mettre a jour le fichier si il n'existe pas |
| 5193 | 5192 | // ou trop ancien |
@@ -5195,8 +5194,8 @@ discard block |
||
| 5195 | 5194 | // et recopie sur le fichier cible uniquement si il change |
| 5196 | 5195 | if ( |
| 5197 | 5196 | !file_exists($filename) |
| 5198 | - or !file_exists($filename . '.last') |
|
| 5199 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5197 | + or !file_exists($filename.'.last') |
|
| 5198 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5200 | 5199 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5201 | 5200 | ) { |
| 5202 | 5201 | $contenu = $cache['texte']; |
@@ -5217,10 +5216,10 @@ discard block |
||
| 5217 | 5216 | } |
| 5218 | 5217 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5219 | 5218 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5220 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5219 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5221 | 5220 | } |
| 5222 | 5221 | // et ecrire le fichier si il change |
| 5223 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5222 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5224 | 5223 | } |
| 5225 | 5224 | |
| 5226 | 5225 | return timestamp($filename); |
@@ -5446,7 +5445,7 @@ discard block |
||
| 5446 | 5445 | if ($e > 0 and strlen($mid) > 8) { |
| 5447 | 5446 | $mid = '***...***'; |
| 5448 | 5447 | } |
| 5449 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5448 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5450 | 5449 | } |
| 5451 | 5450 | |
| 5452 | 5451 | |
@@ -5508,7 +5507,7 @@ discard block |
||
| 5508 | 5507 | case 'id': |
| 5509 | 5508 | case 'anchor': |
| 5510 | 5509 | if (preg_match(',^\d,', $texte)) { |
| 5511 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5510 | + $texte = substr($type, 0, 1).$texte; |
|
| 5512 | 5511 | } |
| 5513 | 5512 | } |
| 5514 | 5513 | |
@@ -5518,9 +5517,9 @@ discard block |
||
| 5518 | 5517 | |
| 5519 | 5518 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5520 | 5519 | if (preg_match(',^\d,', $texte)) { |
| 5521 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5520 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5522 | 5521 | } |
| 5523 | - $texte .= $separateur . md5($original); |
|
| 5522 | + $texte .= $separateur.md5($original); |
|
| 5524 | 5523 | $texte = substr($texte, 0, $longueur_mini); |
| 5525 | 5524 | } |
| 5526 | 5525 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ) { |
| 204 | 204 | $r = nettoyer_url_page($url, $contexte); |
| 205 | 205 | if ($r) { |
| 206 | - [$contexte, $type, , , $suite] = $r; |
|
| 206 | + [$contexte, $type,,, $suite] = $r; |
|
| 207 | 207 | $_id = id_table_objet($type); |
| 208 | 208 | $id_objet = $contexte[$_id]; |
| 209 | 209 | $url_propre = generer_objet_url($id_objet, $type); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function nettoyer_url_page($url, $contexte = []) { |
| 276 | 276 | $url_objets = urls_liste_objets(); |
| 277 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 277 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 280 | 280 | |
| 281 | 281 | if ( |
| 282 | 282 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | static $furls = []; |
| 315 | 315 | if (!isset($furls[$objet])) { |
| 316 | 316 | if ( |
| 317 | - function_exists($f = 'generer_' . $objet . '_url_ecrire') |
|
| 317 | + function_exists($f = 'generer_'.$objet.'_url_ecrire') |
|
| 318 | 318 | // ou definie par un plugin |
| 319 | 319 | or $f = charger_fonction($f, 'urls', true) |
| 320 | 320 | // deprecated |
| 321 | - or function_exists($f = 'generer_url_ecrire_' . $objet) or $f = charger_fonction($f, 'urls', true) |
|
| 321 | + or function_exists($f = 'generer_url_ecrire_'.$objet) or $f = charger_fonction($f, 'urls', true) |
|
| 322 | 322 | ) { |
| 323 | 323 | $furls[$objet] = $f; |
| 324 | 324 | } else { |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | if ($public or $connect) { |
| 337 | 337 | return generer_objet_url_absolue($id, $objet, $args, $ancre, $connect); |
| 338 | 338 | } |
| 339 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 339 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 340 | 340 | if (!function_exists('objet_info')) { |
| 341 | 341 | include_spip('inc/filtres'); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 344 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
| 40 | 40 | if (!autoriser('ecrire')) { |
| 41 | 41 | $retour = |
| 42 | - '<ul class="deroulant__sous-menu" data-profondeur="1">' . |
|
| 43 | - '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' . |
|
| 44 | - '<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' . |
|
| 45 | - '<span class="libelle">' . _T('public:lien_connecter') . '</span>' . |
|
| 46 | - '</a>' . |
|
| 47 | - '</li>' . |
|
| 42 | + '<ul class="deroulant__sous-menu" data-profondeur="1">'. |
|
| 43 | + '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'. |
|
| 44 | + '<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'. |
|
| 45 | + '<span class="libelle">'._T('public:lien_connecter').'</span>'. |
|
| 46 | + '</a>'. |
|
| 47 | + '</li>'. |
|
| 48 | 48 | '</ul>'; |
| 49 | 49 | include_spip('inc/actions'); |
| 50 | 50 | ajax_retour($retour); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ($date = intval(_request('date'))) { |
| 55 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT'); |
|
| 55 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date).' GMT'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $r = gen_liste_rubriques(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/') |
| 63 | 63 | ) { |
| 64 | 64 | include_spip('inc/headers'); |
| 65 | - header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 65 | + header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 66 | 66 | http_response_code(304); |
| 67 | 67 | exit; |
| 68 | 68 | } else { |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | **/ |
| 86 | 86 | function menu_rubriques($complet = true) { |
| 87 | 87 | $ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">' |
| 88 | - . '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">' |
|
| 89 | - . '<span class="libelle">' . _T('info_tout_site') . '</span>' |
|
| 88 | + . '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">' |
|
| 89 | + . '<span class="libelle">'._T('info_tout_site').'</span>' |
|
| 90 | 90 | . '</a>' |
| 91 | 91 | . '</li>'; |
| 92 | 92 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | static $zmax = 6; |
| 146 | 146 | $profondeur_next = $profondeur + 1; |
| 147 | 147 | |
| 148 | - $nav = '<a class="deroulant__lien" href="' . generer_objet_url($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">" |
|
| 149 | - . '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>' |
|
| 148 | + $nav = '<a class="deroulant__lien" href="'.generer_objet_url($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">" |
|
| 149 | + . '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>' |
|
| 150 | 150 | . "</a>\n"; |
| 151 | 151 | |
| 152 | 152 | // Limiter volontairement le nombre de sous-menus |