@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($GLOBALS['spip_version_base'] != $GLOBALS['meta']['version_installee']) { |
| 57 | 57 | if (!is_numeric(_request('reinstall'))) { |
| 58 | 58 | include_spip('base/create'); |
| 59 | - spip_log('recree les tables eventuellement disparues', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 59 | + spip_log('recree les tables eventuellement disparues', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 60 | 60 | creer_base(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | exit; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 72 | + spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 73 | 73 | |
| 74 | 74 | // supprimer quelques fichiers temporaires qui peuvent se retrouver invalides |
| 75 | 75 | @spip_unlink(_CACHE_RUBRIQUES); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | @spip_unlink(_CACHE_PLUGINS_OPT); |
| 79 | 79 | @spip_unlink(_CACHE_PLUGINS_FCT); |
| 80 | 80 | @spip_unlink(_CACHE_CHEMIN); |
| 81 | - @spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz'); |
|
| 81 | + @spip_unlink(_DIR_TMP.'plugin_xml_cache.gz'); |
|
| 82 | 82 | |
| 83 | 83 | include_spip('inc/auth'); |
| 84 | 84 | auth_synchroniser_distant(); |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $version_installee = $GLOBALS['meta']['version_installee'] ?? null; |
| 118 | 118 | |
| 119 | 119 | spip_log( |
| 120 | - "Version anterieure: $version_installee. Courante: " . $GLOBALS['spip_version_base'], |
|
| 121 | - 'maj.' . _LOG_INFO_IMPORTANTE |
|
| 120 | + "Version anterieure: $version_installee. Courante: ".$GLOBALS['spip_version_base'], |
|
| 121 | + 'maj.'._LOG_INFO_IMPORTANTE |
|
| 122 | 122 | ); |
| 123 | 123 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 124 | 124 | sql_replace( |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | $res = maj_while($version_installee, $cible, $GLOBALS['maj'], 'version_installee', 'meta', $redirect, $debut_page); |
| 152 | 152 | if ($res) { |
| 153 | 153 | if (!is_array($res)) { |
| 154 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_ERREUR); |
|
| 154 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_ERREUR); |
|
| 155 | 155 | } else { |
| 156 | - echo _T('avis_operation_echec') . ' ' . join(' ', $res); |
|
| 156 | + echo _T('avis_operation_echec').' '.join(' ', $res); |
|
| 157 | 157 | echo install_fin_html(); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | $res = maj_while($current_version, $version_cible, $maj, $nom_meta_base_version, $table_meta, $redirect); |
| 242 | 242 | if ($res) { |
| 243 | 243 | if (!is_array($res)) { |
| 244 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_ERREUR); |
|
| 244 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_ERREUR); |
|
| 245 | 245 | } else { |
| 246 | - echo '<p>' . _T('avis_operation_echec') . ' ' . join(' ', $res) . '</p>'; |
|
| 246 | + echo '<p>'._T('avis_operation_echec').' '.join(' ', $res).'</p>'; |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | echo(install_debut_html($titre)); |
| 300 | 300 | // script de rechargement auto sur timeout |
| 301 | 301 | $redirect = generer_url_ecrire('upgrade', "reinstall=$installee&meta=$meta&table=$table", true); |
| 302 | - echo http_script("window.setTimeout('location.href=\"" . $redirect . "\";'," . ($timeout * 1000) . ')'); |
|
| 302 | + echo http_script("window.setTimeout('location.href=\"".$redirect."\";',".($timeout * 1000).')'); |
|
| 303 | 303 | echo "<div style='text-align: left'>\n"; |
| 304 | 304 | if (ob_get_level()) { |
| 305 | 305 | ob_flush(); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | return [$v, $etape]; |
| 389 | 389 | } |
| 390 | 390 | $n = time() - $time; |
| 391 | - spip_log("$table $meta: $v en $n secondes", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 391 | + spip_log("$table $meta: $v en $n secondes", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 392 | 392 | if ($meta) { |
| 393 | 393 | ecrire_meta($meta, $installee = $v, 'oui', $table); |
| 394 | 394 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | if ($meta) { |
| 405 | 405 | ecrire_meta($meta, $cible, 'oui', $table); |
| 406 | 406 | } |
| 407 | - spip_log("MAJ terminee. $meta: $installee", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 407 | + spip_log("MAJ terminee. $meta: $installee", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 408 | 408 | |
| 409 | 409 | return []; |
| 410 | 410 | } |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * @return int |
| 430 | 430 | */ |
| 431 | 431 | function serie_alter($serie, $q = [], $meta = '', $table = 'meta', $redirect = '') { |
| 432 | - $meta2 = $meta . '_maj_' . $serie; |
|
| 432 | + $meta2 = $meta.'_maj_'.$serie; |
|
| 433 | 433 | $etape = 0; |
| 434 | 434 | if (isset($GLOBALS[$table][$meta2])) { |
| 435 | 435 | $etape = intval($GLOBALS[$table][$meta2]); |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | and function_exists($f = array_shift($r)) |
| 443 | 443 | ) { |
| 444 | 444 | // note: $r (arguments de la fonction $f) peut avoir des données tabulaires |
| 445 | - spip_log("$msg: $f " . @join(',', $r), 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 445 | + spip_log("$msg: $f ".@join(',', $r), 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 446 | 446 | // pour les fonctions atomiques sql_xx |
| 447 | 447 | // on enregistre le meta avant de lancer la fonction, |
| 448 | 448 | // de maniere a eviter de boucler sur timeout |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | relance_maj($meta, $table, $redirect); |
| 461 | 461 | } |
| 462 | 462 | ecrire_meta($meta2, $i + 1, 'non', $table); |
| 463 | - spip_log("$meta2: ok", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 463 | + spip_log("$meta2: ok", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 464 | 464 | } else { |
| 465 | 465 | if (!is_array($r)) { |
| 466 | - spip_log("maj $i format incorrect", 'maj.' . _LOG_ERREUR); |
|
| 466 | + spip_log("maj $i format incorrect", 'maj.'._LOG_ERREUR); |
|
| 467 | 467 | } else { |
| 468 | - spip_log("maj $i fonction $f non definie", 'maj.' . _LOG_ERREUR); |
|
| 468 | + spip_log("maj $i fonction $f non definie", 'maj.'._LOG_ERREUR); |
|
| 469 | 469 | } |
| 470 | 470 | // en cas d'erreur serieuse, on s'arrete |
| 471 | 471 | // mais on permet de passer par dessus en rechargeant la page. |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | include_spip('inc/lang'); |
| 100 | 100 | |
| 101 | 101 | if ($GLOBALS['spip_lang'] <> $default) { |
| 102 | - $opt = lang_select($default); # et remplace |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | 103 | if ($GLOBALS['spip_lang'] <> $default) { |
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | 105 | if ($opt) { |
| 106 | 106 | lang_select(); |
| 107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | # lien a partir de / |
| 112 | 112 | $cible = parametre_url(self(), 'lang', '', '&'); |
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), true); |
|
| 113 | + $post = generer_url_action('converser', 'redirect='.rawurlencode($cible), true); |
|
| 114 | 114 | |
| 115 | 115 | return [ |
| 116 | 116 | 'formulaires/menu_lang', |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | -require_once _ROOT_RESTREINT . 'base/objets.php'; |
|
| 21 | +require_once _ROOT_RESTREINT.'base/objets.php'; |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $f = (!preg_match('/^[\w\.]*$/', $serveur)) |
| 60 | 60 | ? '' // nom de serveur mal ecrit |
| 61 | 61 | : ($serveur ? |
| 62 | - (_DIR_CONNECT . $serveur . '.php') // serveur externe |
|
| 62 | + (_DIR_CONNECT.$serveur.'.php') // serveur externe |
|
| 63 | 63 | : (_FILE_CONNECT ?: ($install ? _FILE_CONNECT_TMP // init du serveur principal |
| 64 | 64 | : ''))); // installation pas faite |
| 65 | 65 | |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | // chargement de la version du jeu de fonctions |
| 102 | 102 | // si pas dans le fichier par defaut |
| 103 | 103 | $type = $GLOBALS['db_ok']['type']; |
| 104 | - $jeu = 'spip_' . $type . '_functions_' . $version; |
|
| 104 | + $jeu = 'spip_'.$type.'_functions_'.$version; |
|
| 105 | 105 | if (!isset($GLOBALS[$jeu])) { |
| 106 | - if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) { |
|
| 106 | + if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) { |
|
| 107 | 107 | spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS); |
| 108 | 108 | |
| 109 | 109 | // ne plus reessayer |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | $connexion = spip_connect($serveur); |
| 166 | 166 | $e = sql_errno($serveur); |
| 167 | 167 | $t = ($connexion['type'] ?? 'sql'); |
| 168 | - $m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']); |
|
| 169 | - $f = $t . $serveur; |
|
| 170 | - spip_log($m, $f . '.' . _LOG_ERREUR); |
|
| 168 | + $m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']); |
|
| 169 | + $f = $t.$serveur; |
|
| 170 | + spip_log($m, $f.'.'._LOG_ERREUR); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | // si en cours d'installation ou si db=@test@ on ne pose rien |
| 254 | 254 | // car c'est un test de connexion |
| 255 | 255 | if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') { |
| 256 | - $f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out'; |
|
| 256 | + $f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out'; |
|
| 257 | 257 | } elseif ($db == '@test@') { |
| 258 | 258 | $db = ''; |
| 259 | 259 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // En cas d'indisponibilite du serveur, eviter de le bombarder |
| 293 | 293 | if ($f) { |
| 294 | 294 | @touch($f); |
| 295 | - spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS); |
|
| 295 | + spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS); |
|
| 296 | 296 | } |
| 297 | 297 | return null; |
| 298 | 298 | } |
@@ -390,11 +390,11 @@ discard block |
||
| 390 | 390 | } elseif (is_array($a)) { |
| 391 | 391 | return join(',', array_map('_q', $a)); |
| 392 | 392 | } elseif (is_scalar($a)) { |
| 393 | - return ("'" . addslashes($a) . "'"); |
|
| 393 | + return ("'".addslashes($a)."'"); |
|
| 394 | 394 | } elseif ($a === null) { |
| 395 | 395 | return "''"; |
| 396 | 396 | } |
| 397 | - throw new \RuntimeException("Can’t use _q with " . gettype($a)); |
|
| 397 | + throw new \RuntimeException("Can’t use _q with ".gettype($a)); |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /** |
@@ -437,14 +437,14 @@ discard block |
||
| 437 | 437 | $parts = []; |
| 438 | 438 | $currentpos = 0; |
| 439 | 439 | $k = 0; |
| 440 | - while(count($textes)) { |
|
| 440 | + while (count($textes)) { |
|
| 441 | 441 | $part = array_shift($textes); |
| 442 | 442 | $nextpos = strpos($query_echappees, $part, $currentpos); |
| 443 | 443 | // si besoin recoller ensemble les doubles '' de sqlite (echappement des ') |
| 444 | 444 | while (count($textes) and substr($part, -1) === "'") { |
| 445 | 445 | $next = reset($textes); |
| 446 | 446 | if (strpos($next, "'") === 0 |
| 447 | - and strpos($query_echappees, $part . $next, $currentpos) === $nextpos) { |
|
| 447 | + and strpos($query_echappees, $part.$next, $currentpos) === $nextpos) { |
|
| 448 | 448 | $part .= array_shift($textes); |
| 449 | 449 | } |
| 450 | 450 | else { |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | // et on replace les parts une par une en commencant par la fin |
| 464 | - while ($k>0) { |
|
| 464 | + while ($k > 0) { |
|
| 465 | 465 | $query_echappees = substr_replace($query_echappees, $parts[$k]['placeholder'], $parts[$k]['position'], strlen($parts[$k]['texte'])); |
| 466 | 466 | $k--; |
| 467 | 467 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $n = intval(sql_errno()); |
| 62 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 62 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 63 | 63 | |
| 64 | 64 | return $n ?: 1; |
| 65 | 65 | } |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | // erreur SQL a afficher |
| 86 | 86 | $raison = minipres( |
| 87 | 87 | _T('info_travaux_titre'), |
| 88 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 88 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 89 | 89 | ); |
| 90 | 90 | } elseif (@$raison['statut']) { |
| 91 | 91 | // un simple visiteur n'a pas acces a l'espace prive |
| 92 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 92 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 93 | 93 | $raison = minipres(_T('avis_erreur_connexion'), _T('avis_erreur_visiteur')); |
| 94 | 94 | } else { |
| 95 | 95 | // auteur en fin de droits ... |
@@ -179,8 +179,7 @@ discard block |
||
| 179 | 179 | $where = (is_numeric($id_auteur) |
| 180 | 180 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 181 | 181 | ) ? |
| 182 | - "id_auteur=$id_auteur" : |
|
| 183 | - (!strlen($GLOBALS['connect_login']) ? '' : 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 182 | + "id_auteur=$id_auteur" : (!strlen($GLOBALS['connect_login']) ? '' : 'login='.sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 184 | 183 | |
| 185 | 184 | if (!$where) { |
| 186 | 185 | return ''; |
@@ -222,7 +221,7 @@ discard block |
||
| 222 | 221 | $GLOBALS['connect_login'] = $row['login']; |
| 223 | 222 | $GLOBALS['connect_statut'] = $row['statut']; |
| 224 | 223 | |
| 225 | - $GLOBALS['visiteur_session'] = array_merge((array)$GLOBALS['visiteur_session'], $row); |
|
| 224 | + $GLOBALS['visiteur_session'] = array_merge((array) $GLOBALS['visiteur_session'], $row); |
|
| 226 | 225 | |
| 227 | 226 | // au cas ou : ne pas memoriser les champs sensibles |
| 228 | 227 | unset($GLOBALS['visiteur_session']['pass']); |
@@ -295,7 +294,7 @@ discard block |
||
| 295 | 294 | * @return string |
| 296 | 295 | */ |
| 297 | 296 | function auth_a_loger() { |
| 298 | - $redirect = generer_url_public('login', 'url=' . rawurlencode(self('&', true)), true); |
|
| 297 | + $redirect = generer_url_public('login', 'url='.rawurlencode(self('&', true)), true); |
|
| 299 | 298 | |
| 300 | 299 | // un echec au "bonjour" (login initial) quand le statut est |
| 301 | 300 | // inconnu signale sans doute un probleme de cookies |
@@ -331,7 +330,7 @@ discard block |
||
| 331 | 330 | $date ??= date('Y-m-d H:i:s'); |
| 332 | 331 | |
| 333 | 332 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 334 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 333 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.intval($row['id_auteur'])); |
|
| 335 | 334 | $row['en_ligne'] = $date; |
| 336 | 335 | } |
| 337 | 336 | |
@@ -440,13 +439,13 @@ discard block |
||
| 440 | 439 | if ( |
| 441 | 440 | !$login |
| 442 | 441 | or !$login_base = auth_retrouver_login($login, $serveur) |
| 443 | - or !$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 442 | + or !$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 444 | 443 | ) { |
| 445 | 444 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 446 | 445 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
| 447 | 446 | include_spip('inc/securiser_action'); |
| 448 | - $fauxalea1 = md5('fauxalea' . secret_du_site() . $login . floor(date('U') / 86400)); |
|
| 449 | - $fauxalea2 = md5('fauxalea' . secret_du_site() . $login . ceil(date('U') / 86400)); |
|
| 447 | + $fauxalea1 = md5('fauxalea'.secret_du_site().$login.floor(date('U') / 86400)); |
|
| 448 | + $fauxalea2 = md5('fauxalea'.secret_du_site().$login.ceil(date('U') / 86400)); |
|
| 450 | 449 | |
| 451 | 450 | $row = [ |
| 452 | 451 | 'login' => $login, |
@@ -568,7 +567,7 @@ discard block |
||
| 568 | 567 | sql_updateq( |
| 569 | 568 | 'spip_auteurs', |
| 570 | 569 | ['prefs' => serialize($p)], |
| 571 | - 'id_auteur=' . intval($auteur['id_auteur']) |
|
| 570 | + 'id_auteur='.intval($auteur['id_auteur']) |
|
| 572 | 571 | ); |
| 573 | 572 | |
| 574 | 573 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -732,7 +731,7 @@ discard block |
||
| 732 | 731 | return false; |
| 733 | 732 | } |
| 734 | 733 | |
| 735 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 734 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 736 | 735 | |
| 737 | 736 | if (!$row) { |
| 738 | 737 | if ( |
@@ -786,11 +785,11 @@ discard block |
||
| 786 | 785 | $retour = $retour ?: _T('icone_retour'); |
| 787 | 786 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 788 | 787 | if ($url) { |
| 789 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 788 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 790 | 789 | } |
| 791 | 790 | |
| 792 | 791 | if ($lien) { |
| 793 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 792 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 794 | 793 | } |
| 795 | 794 | include_spip('inc/minipres'); |
| 796 | 795 | echo minipres($pb, $corps); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | static $t1 = ['&', '<', '>']; |
| 121 | 121 | static $t2 = ['&', '<', '>']; |
| 122 | 122 | |
| 123 | - return '<pre>' . str_replace($t1, $t2, (string) $t) . '</pre>'; |
|
| 123 | + return '<pre>'.str_replace($t1, $t2, (string) $t).'</pre>'; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | foreach ($lignes as &$l) { |
| 141 | 141 | $l = join('|', $l); |
| 142 | 142 | } |
| 143 | - $corps = join("\n", $lignes) . "\n"; |
|
| 144 | - $corps = $caption . |
|
| 145 | - "\n|{{" . |
|
| 146 | - join('}}|{{', $entete) . |
|
| 147 | - '}}|' . |
|
| 148 | - "\n|" . |
|
| 143 | + $corps = join("\n", $lignes)."\n"; |
|
| 144 | + $corps = $caption. |
|
| 145 | + "\n|{{". |
|
| 146 | + join('}}|{{', $entete). |
|
| 147 | + '}}|'. |
|
| 148 | + "\n|". |
|
| 149 | 149 | str_replace("\n", "|\n|", $corps); |
| 150 | 150 | include_spip('inc/texte'); |
| 151 | 151 | |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 190 | - $t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t)); |
|
| 190 | + $t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t)); |
|
| 191 | 191 | |
| 192 | - return (!$style ? '' : "\n<style>" . $style . '</style>') . $t; |
|
| 192 | + return (!$style ? '' : "\n<style>".$style.'</style>').$t; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // mais apres la fonction autoriser() |
| 123 | 123 | if ($f = find_in_path('mes_fonctions.php')) { |
| 124 | 124 | global $dossier_squelettes; |
| 125 | - include_once(_ROOT_CWD . $f); |
|
| 125 | + include_once(_ROOT_CWD.$f); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 165 | 165 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 166 | 166 | } elseif (is_numeric($qui)) { |
| 167 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 167 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | spip_log( |
| 177 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 178 | - 'autoriser' . _LOG_DEBUG |
|
| 177 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 178 | + 'autoriser'._LOG_DEBUG |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | // passer par objet_type pour avoir les alias |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 192 | 192 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 193 | 193 | ) { |
| 194 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 194 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -200,18 +200,18 @@ discard block |
||
| 200 | 200 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 201 | 201 | $fonctions = $type |
| 202 | 202 | ? [ |
| 203 | - 'autoriser_' . $type . '_' . $faire, |
|
| 204 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 205 | - 'autoriser_' . $type, |
|
| 206 | - 'autoriser_' . $type . '_dist', |
|
| 207 | - 'autoriser_' . $faire, |
|
| 208 | - 'autoriser_' . $faire . '_dist', |
|
| 203 | + 'autoriser_'.$type.'_'.$faire, |
|
| 204 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 205 | + 'autoriser_'.$type, |
|
| 206 | + 'autoriser_'.$type.'_dist', |
|
| 207 | + 'autoriser_'.$faire, |
|
| 208 | + 'autoriser_'.$faire.'_dist', |
|
| 209 | 209 | 'autoriser_defaut', |
| 210 | 210 | 'autoriser_defaut_dist' |
| 211 | 211 | ] |
| 212 | 212 | : [ |
| 213 | - 'autoriser_' . $faire, |
|
| 214 | - 'autoriser_' . $faire . '_dist', |
|
| 213 | + 'autoriser_'.$faire, |
|
| 214 | + 'autoriser_'.$faire.'_dist', |
|
| 215 | 215 | 'autoriser_defaut', |
| 216 | 216 | 'autoriser_defaut_dist' |
| 217 | 217 | ]; |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | spip_log( |
| 227 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 228 | - 'autoriser' . _LOG_DEBUG |
|
| 227 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 228 | + 'autoriser'._LOG_DEBUG |
|
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | return $a; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 375 | 375 | |
| 376 | 376 | // Le visiteur a-t-il un statut prevu par la config ? |
| 377 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 377 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 378 | 378 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } // pas de champ passe a la demande => NIET |
| 433 | 433 | $previsu = explode(',', $c['previsu']); |
| 434 | 434 | // regarder si ce statut est autorise pour l'auteur |
| 435 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 435 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 436 | 436 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 437 | 437 | // sinon l’auteur en session |
| 438 | 438 | include_spip('inc/securiser_action'); |
@@ -446,12 +446,12 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | if (!$id_auteur) { |
| 448 | 448 | return false; |
| 449 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 449 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 450 | 450 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 451 | 451 | } elseif ( |
| 452 | 452 | !sql_countsel( |
| 453 | 453 | 'spip_auteurs_liens', |
| 454 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 454 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 455 | 455 | ) |
| 456 | 456 | ) { |
| 457 | 457 | return false; |
@@ -496,16 +496,16 @@ discard block |
||
| 496 | 496 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 497 | 497 | $primary = id_table_objet($type); |
| 498 | 498 | if ($table != 'spip_rubriques') { |
| 499 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 499 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 500 | 500 | } else { |
| 501 | 501 | $id_rubrique = $id; |
| 502 | 502 | } |
| 503 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 503 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 504 | 504 | if (!$id_secteur > 0) { |
| 505 | 505 | $id_secteur = $id_rubrique; |
| 506 | 506 | } |
| 507 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 508 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 507 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 508 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 509 | 509 | if ($langue_secteur != $langue_objet) { |
| 510 | 510 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 511 | 511 | return true; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 514 | 514 | return false; |
| 515 | 515 | } else { |
| 516 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 516 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 517 | 517 | if ($id_parent != 0) { |
| 518 | 518 | // sous-rubriques : pas de choix de langue |
| 519 | 519 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | if (!isset($opt['statut'])) { |
| 567 | 567 | if (isset($desc['field']['statut'])) { |
| 568 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 568 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 569 | 569 | } else { |
| 570 | 570 | $statut = 'publie'; |
| 571 | 571 | } // pas de statut => publie |
@@ -739,11 +739,11 @@ discard block |
||
| 739 | 739 | return false; |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 742 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 743 | 743 | return false; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 746 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 747 | 747 | return false; |
| 748 | 748 | } |
| 749 | 749 | |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | if (!$id) { |
| 781 | 781 | return false; |
| 782 | 782 | } |
| 783 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 783 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 784 | 784 | |
| 785 | 785 | return |
| 786 | 786 | $r |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 792 | 792 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 793 | 793 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 794 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 794 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 795 | 795 | ) |
| 796 | 796 | ); |
| 797 | 797 | } |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if (!$id) { |
| 850 | 850 | return false; |
| 851 | 851 | } |
| 852 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 852 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | return |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | or |
| 861 | 861 | ($id |
| 862 | 862 | and $qui['id_auteur'] |
| 863 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 863 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | |
@@ -881,8 +881,8 @@ discard block |
||
| 881 | 881 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 882 | 882 | # securite, mais on aurait pas du arriver ici ! |
| 883 | 883 | if ( |
| 884 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 885 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 884 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 885 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 886 | 886 | ) { |
| 887 | 887 | return $f($faire, $type, $id, $qui, $opt); |
| 888 | 888 | } |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $n = sql_fetsel( |
| 1014 | 1014 | 'A.id_article', |
| 1015 | 1015 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1016 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1016 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1017 | 1017 | ); |
| 1018 | 1018 | |
| 1019 | 1019 | return $n ? true : false; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | and $r = sql_allfetsel( |
| 1226 | 1226 | 'id_objet', |
| 1227 | 1227 | 'spip_auteurs_liens', |
| 1228 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1228 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1229 | 1229 | ) |
| 1230 | 1230 | and is_countable($r) ? count($r) : 0 |
| 1231 | 1231 | ) { |
@@ -1910,8 +1910,8 @@ discard block |
||
| 1910 | 1910 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1911 | 1911 | $objet = objet_type($objet); |
| 1912 | 1912 | $where = [ |
| 1913 | - 'objet=' . sql_quote($objet), |
|
| 1914 | - 'id_objet=' . intval($id_objet) |
|
| 1913 | + 'objet='.sql_quote($objet), |
|
| 1914 | + 'id_objet='.intval($id_objet) |
|
| 1915 | 1915 | ]; |
| 1916 | 1916 | if (!empty($cond)) { |
| 1917 | 1917 | if (is_array($cond)) { |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | return sql_allfetsel( |
| 1947 | 1947 | 'id_auteur', |
| 1948 | 1948 | 'spip_auteurs_liens', |
| 1949 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1949 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1950 | 1950 | ); |
| 1951 | 1951 | } |
| 1952 | 1952 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2_097_152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | else { |
| 121 | - spip_log("copie_locale : recuperation $source sur $localrac OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 121 | + spip_log("copie_locale : recuperation $source sur $localrac OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 122 | 122 | } |
| 123 | 123 | if (!$res or !$res['length']) { |
| 124 | 124 | // si $t c'est sans doute juste un not-modified-since |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if (!$is_known_host) { |
| 209 | 209 | $host = trim($parsed_url['host'], '.'); |
| 210 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 210 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 211 | 211 | $ip = gethostbyname($host); |
| 212 | 212 | if ($ip === $host) { |
| 213 | 213 | // Error condition for gethostbyname() |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | if ($ip) { |
| 231 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 231 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 232 | 232 | return false; |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | $port = $parsed_url['port']; |
| 242 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 242 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 243 | 243 | return $url; |
| 244 | 244 | } |
| 245 | 245 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | if ($taille > 500) { |
| 312 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 312 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -337,16 +337,16 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | } else { |
| 339 | 339 | // fabrique une chaine HTTP simple pour un POST |
| 340 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 340 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 341 | 341 | $chaine = []; |
| 342 | 342 | if (is_array($donnees)) { |
| 343 | 343 | foreach ($donnees as $cle => $valeur) { |
| 344 | 344 | if (is_array($valeur)) { |
| 345 | 345 | foreach ($valeur as $val2) { |
| 346 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 346 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 347 | 347 | } |
| 348 | 348 | } else { |
| 349 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 349 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $chaine = implode('&', $chaine); |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - spip_log("recuperer_url " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG); |
|
| 454 | + spip_log("recuperer_url ".$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 455 | 455 | |
| 456 | 456 | // Ajout des en-têtes spécifiques si besoin |
| 457 | 457 | $formatted_data = ''; |
| 458 | 458 | if (!empty($options['headers'])) { |
| 459 | 459 | foreach ($options['headers'] as $champ => $valeur) { |
| 460 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 460 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 466 | 466 | $head .= $formatted_data; |
| 467 | 467 | if (stripos($head, 'Content-Length:') === false) { |
| 468 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 468 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 469 | 469 | } |
| 470 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 470 | + $formatted_data = $head."\r\n".$postdata; |
|
| 471 | 471 | if ( |
| 472 | 472 | strlen($postdata) |
| 473 | 473 | and !$methode_demandee |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 482 | 482 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 483 | 483 | if (!tester_url_absolue($url)) { |
| 484 | - $url = 'http://' . $url; |
|
| 484 | + $url = 'http://'.$url; |
|
| 485 | 485 | } elseif (strncmp($url, '//', 2) == 0) { |
| 486 | - $url = 'http:' . $url; |
|
| 486 | + $url = 'http:'.$url; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $url = url_to_ascii($url); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $options['if_modified_since'] |
| 513 | 513 | ); |
| 514 | 514 | if (!$handle) { |
| 515 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 515 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 516 | 516 | |
| 517 | 517 | return false; |
| 518 | 518 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | 'status' => 200, |
| 543 | 543 | ]; |
| 544 | 544 | } else { |
| 545 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 545 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 546 | 546 | return false; |
| 547 | 547 | } |
| 548 | 548 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -558,11 +558,11 @@ discard block |
||
| 558 | 558 | $options['datas'] = ''; |
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | - spip_log("recuperer_url recommence " . $options['methode']. " sur $url", 'distant' . _LOG_DEBUG); |
|
| 561 | + spip_log("recuperer_url recommence ".$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 562 | 562 | |
| 563 | 563 | return recuperer_url($url, $options); |
| 564 | 564 | } elseif ($res['status'] !== 200) { |
| 565 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 565 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 566 | 566 | } |
| 567 | 567 | $result['status'] = $res['status']; |
| 568 | 568 | if (isset($res['headers'])) { |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | // on ne veut que les entetes |
| 580 | 580 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 581 | - spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 581 | + spip_log("RESULTAT recuperer_url ".$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 582 | 582 | return $result; |
| 583 | 583 | } |
| 584 | 584 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | |
| 589 | 589 | $gz = false; |
| 590 | 590 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 591 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 591 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $trace = json_decode(json_encode($result), true); |
| 626 | 626 | $trace['page'] = '...'; |
| 627 | - spip_log("RESULTAT recuperer_url " . $options['methode']. " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 627 | + spip_log("RESULTAT recuperer_url ".$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 628 | 628 | |
| 629 | 629 | return $result; |
| 630 | 630 | } |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | $sig['url'] = $url; |
| 679 | 679 | |
| 680 | 680 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 681 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 681 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 682 | 682 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 683 | 683 | $cache = "$sub$cache"; |
| 684 | 684 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $fp = false; |
| 733 | 733 | if ($fichier) { |
| 734 | 734 | include_spip('inc/acces'); |
| 735 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 735 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 736 | 736 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 737 | 737 | if (!$fp and file_exists($fichier)) { |
| 738 | 738 | return filesize($fichier); |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | $result['status'] = intval($r[1]); |
| 793 | 793 | while ($s = trim(fgets($handle, 16384))) { |
| 794 | - $result['headers'][] = $s . "\n"; |
|
| 794 | + $result['headers'][] = $s."\n"; |
|
| 795 | 795 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 796 | 796 | [, $d, $v] = $r; |
| 797 | 797 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | |
| 841 | 841 | // on se place tout le temps comme si on etait a la racine |
| 842 | 842 | if (_DIR_RACINE) { |
| 843 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 843 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | $m = md5($source); |
| 847 | 847 | |
| 848 | 848 | return $d |
| 849 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 849 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 850 | 850 | . substr($m, 0, 4) |
| 851 | 851 | . ".$extension"; |
| 852 | 852 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | // Si c'est deja local pas de souci |
| 870 | 870 | if (!tester_url_absolue($source)) { |
| 871 | 871 | if (_DIR_RACINE) { |
| 872 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 872 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | return $source; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $ext |
| 888 | 888 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 889 | 889 | and $f = nom_fichier_copie_locale($source, $ext) |
| 890 | - and file_exists(_DIR_RACINE . $f) |
|
| 890 | + and file_exists(_DIR_RACINE.$f) |
|
| 891 | 891 | ) { |
| 892 | 892 | return $f; |
| 893 | 893 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | // Si c'est deja dans la table des documents, |
| 897 | 897 | // ramener le nom de sa copie potentielle |
| 898 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 898 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 899 | 899 | |
| 900 | 900 | if ($ext) { |
| 901 | 901 | return nom_fichier_copie_locale($source, $ext); |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 908 | 908 | |
| 909 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 909 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 910 | 910 | $f = nom_fichier_copie_locale($source, $ext); |
| 911 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 911 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 912 | 912 | return $f; |
| 913 | 913 | } |
| 914 | 914 | } |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | // Ping pour voir si son extension est connue et autorisee |
| 917 | 917 | // avec mise en cache du resultat du ping |
| 918 | 918 | |
| 919 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 919 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 920 | 920 | if ( |
| 921 | 921 | !@file_exists($cache) |
| 922 | 922 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -926,10 +926,10 @@ discard block |
||
| 926 | 926 | ecrire_fichier($cache, serialize($path_parts)); |
| 927 | 927 | } |
| 928 | 928 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 929 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 929 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 930 | 930 | return nom_fichier_copie_locale($source, $ext); |
| 931 | 931 | } |
| 932 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 932 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | } else { |
| 1014 | 1014 | if ($a['body']) { |
| 1015 | 1015 | $a['extension'] = $extension; |
| 1016 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1016 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1017 | 1017 | ecrire_fichier($a['fichier'], $a['body']); |
| 1018 | 1018 | $size_image = @spip_getimagesize($a['fichier']); |
| 1019 | 1019 | $a['largeur'] = intval($size_image[0]); |
@@ -1081,20 +1081,20 @@ discard block |
||
| 1081 | 1081 | !$t |
| 1082 | 1082 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1083 | 1083 | ) { |
| 1084 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1084 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1085 | 1085 | } |
| 1086 | 1086 | if ( |
| 1087 | 1087 | !$t |
| 1088 | 1088 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1089 | 1089 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1090 | 1090 | ) { |
| 1091 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1091 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1096 | 1096 | if (!$t) { |
| 1097 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1097 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1105,11 +1105,11 @@ discard block |
||
| 1105 | 1105 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1106 | 1106 | ) { |
| 1107 | 1107 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1108 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1108 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | if ($t) { |
| 1112 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1112 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1113 | 1113 | return $t['extension']; |
| 1114 | 1114 | } else { |
| 1115 | 1115 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | } |
| 1213 | 1213 | } else { |
| 1214 | 1214 | $scheme = $t['scheme']; |
| 1215 | - $noproxy = $scheme . '://'; |
|
| 1215 | + $noproxy = $scheme.'://'; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | if (isset($t['user'])) { |
| 1218 | 1218 | $user = [$t['user'], $t['pass']]; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | if (!empty($t['query'])) { |
| 1229 | - $path .= '?' . $t['query']; |
|
| 1229 | + $path .= '?'.$t['query']; |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1300,29 +1300,29 @@ discard block |
||
| 1300 | 1300 | $proxy_user = ''; |
| 1301 | 1301 | $http_proxy = need_proxy($host); |
| 1302 | 1302 | if ($user) { |
| 1303 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1303 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | $connect = ''; |
| 1307 | 1307 | if ($http_proxy) { |
| 1308 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1309 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1310 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1308 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1309 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1310 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1311 | 1311 | . "Host: $path_host\r\n" |
| 1312 | 1312 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1313 | 1313 | } else { |
| 1314 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1314 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1315 | 1315 | . (!$user ? '' : "$user@") |
| 1316 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1316 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1317 | 1317 | } |
| 1318 | 1318 | $t2 = @parse_url($http_proxy); |
| 1319 | 1319 | $first_host = $t2['host']; |
| 1320 | 1320 | $port = ($t2['port'] ?? null) ?: 80; |
| 1321 | 1321 | if ($t2['user'] ?? null) { |
| 1322 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1322 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | } else { |
| 1325 | - $first_host = $noproxy . $host; |
|
| 1325 | + $first_host = $noproxy.$host; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | if ($connect) { |
@@ -1344,7 +1344,7 @@ discard block |
||
| 1344 | 1344 | ); |
| 1345 | 1345 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1346 | 1346 | if (!$f) { |
| 1347 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1347 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1348 | 1348 | return $errno; |
| 1349 | 1349 | } |
| 1350 | 1350 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | or !count($res = explode(' ', $res)) |
| 1358 | 1358 | or $res[1] !== '200' |
| 1359 | 1359 | ) { |
| 1360 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1360 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1361 | 1361 | fclose($f); |
| 1362 | 1362 | |
| 1363 | 1363 | return false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1375 | 1375 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1376 | 1376 | if (!$f) { |
| 1377 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1377 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1378 | 1378 | |
| 1379 | 1379 | return $errno; |
| 1380 | 1380 | } |
@@ -1384,16 +1384,16 @@ discard block |
||
| 1384 | 1384 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1385 | 1385 | |
| 1386 | 1386 | $host_port = $host; |
| 1387 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1387 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1388 | 1388 | $host_port .= ":$port"; |
| 1389 | 1389 | } |
| 1390 | 1390 | $req = "$method $path $vers\r\n" |
| 1391 | 1391 | . "Host: $host_port\r\n" |
| 1392 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1393 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1392 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1393 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1394 | 1394 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1395 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1396 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1395 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1396 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1397 | 1397 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1398 | 1398 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1399 | 1399 | |
@@ -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)) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // affichage "GIT [master: abcdef]" |
| 240 | 240 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 241 | 241 | if ($desc['branch']) { |
| 242 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 242 | + $commit = $desc['branch'].': '.$commit; |
|
| 243 | 243 | } |
| 244 | 244 | return "{$desc['vcs']} [$commit]"; |
| 245 | 245 | } |
@@ -258,9 +258,9 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | // version installee par GIT |
| 261 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 261 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 262 | 262 | $currentHead = trim(substr($c, 4)); |
| 263 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 263 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 264 | 264 | return [ |
| 265 | 265 | 'vcs' => 'GIT', |
| 266 | 266 | 'branch' => basename($currentHead), |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | $dir = '.'; |
| 288 | 288 | } |
| 289 | 289 | // version installee par SVN |
| 290 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 290 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 292 | 292 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 293 | 293 | if ($result) { |
| 294 | 294 | $row = $result->fetchArray(); |
@@ -306,12 +306,12 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 308 | 308 | // et laisser passer les fonctions personnelles baptisees image_... |
| 309 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 310 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 311 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 312 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 313 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 314 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 311 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 312 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 313 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 314 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 315 | 315 | |
| 316 | 316 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 317 | 317 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | */ |
| 471 | 471 | function filtre_debug($val, $key = null) { |
| 472 | 472 | $debug = ( |
| 473 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 474 | - ) . var_export($val, true); |
|
| 473 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 474 | + ).var_export($val, true); |
|
| 475 | 475 | |
| 476 | 476 | include_spip('inc/autoriser'); |
| 477 | 477 | if (autoriser('webmestre')) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $is_file = false; |
| 526 | 526 | } |
| 527 | 527 | if ($is_file) { |
| 528 | - $is_local_file = function ($path) { |
|
| 528 | + $is_local_file = function($path) { |
|
| 529 | 529 | if (strpos($path, '?') !== false) { |
| 530 | 530 | $path = supprimer_timestamp($path); |
| 531 | 531 | // remove ?24px added by find_in_theme on .svg files |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 578 | 578 | $srcover = $match[1]; |
| 579 | 579 | array_shift($args); |
| 580 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 580 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 581 | 581 | $srcover_filter = call_user_func_array($filtre, $args); |
| 582 | 582 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 583 | 583 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | if (!$srcHeight) { |
| 654 | 654 | $hauteur_img[$src] = $srcHeight = $imagesize[1]; |
| 655 | 655 | } |
| 656 | - if (!$srcSize){ |
|
| 656 | + if (!$srcSize) { |
|
| 657 | 657 | $poids_img[$src] = filesize($src); |
| 658 | 658 | } |
| 659 | 659 | } |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | if (!$srcHeight) { |
| 668 | 668 | $hauteur_img[$src] = $srcHeight = $height; |
| 669 | 669 | } |
| 670 | - if (!$srcSize){ |
|
| 670 | + if (!$srcSize) { |
|
| 671 | 671 | $poids_img[$src] = $srcSize = strlen($src); |
| 672 | 672 | } |
| 673 | 673 | } |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | if (!$srcHeight) { |
| 686 | 686 | $hauteur_img[$src] = $srcHeight = $valeurs['hauteur_dest']; |
| 687 | 687 | } |
| 688 | - if (!$srcSize){ |
|
| 688 | + if (!$srcSize) { |
|
| 689 | 689 | $poids_img[$src] = $srcSize = 0; |
| 690 | 690 | } |
| 691 | 691 | } |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | return $infos['poids']; |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | -function taille_image($img, $force_refresh = false){ |
|
| 714 | +function taille_image($img, $force_refresh = false) { |
|
| 715 | 715 | $infos = infos_image($img, $force_refresh); |
| 716 | 716 | return [$infos['hauteur'], $infos['largeur']]; |
| 717 | 717 | } |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | // " -> " et tout ce genre de choses |
| 981 | 981 | $u = $GLOBALS['meta']['pcre_u']; |
| 982 | 982 | $texte = str_replace(' ', ' ', $texte); |
| 983 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 983 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 984 | 984 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 985 | 985 | $texte = entites_html($texte, false, false); |
| 986 | 986 | // mais bien echapper les double quotes ! |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | **/ |
| 1041 | 1041 | function supprimer_numero($texte) { |
| 1042 | 1042 | return preg_replace( |
| 1043 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1043 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1044 | 1044 | '', |
| 1045 | 1045 | $texte |
| 1046 | 1046 | ); |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | function recuperer_numero($texte) { |
| 1069 | 1069 | if ( |
| 1070 | 1070 | preg_match( |
| 1071 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1071 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1072 | 1072 | $texte, |
| 1073 | 1073 | $regs |
| 1074 | 1074 | ) |
@@ -1159,8 +1159,8 @@ discard block |
||
| 1159 | 1159 | **/ |
| 1160 | 1160 | function textebrut($texte) { |
| 1161 | 1161 | $u = $GLOBALS['meta']['pcre_u']; |
| 1162 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1163 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1162 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1163 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1164 | 1164 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1165 | 1165 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1166 | 1166 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | ) |
| 1195 | 1195 | ) { |
| 1196 | 1196 | foreach ($liens[0] as $a) { |
| 1197 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1197 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1198 | 1198 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1199 | 1199 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1200 | 1200 | $texte = str_replace($a, $ablank, $texte); |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | foreach ($regs[0] as $a) { |
| 1220 | 1220 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1221 | 1221 | if (strpos($rel, 'nofollow') === false) { |
| 1222 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1222 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1223 | 1223 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1224 | 1224 | $texte = str_replace($a, $anofollow, $texte); |
| 1225 | 1225 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $u = $GLOBALS['meta']['pcre_u']; |
| 1249 | 1249 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1250 | 1250 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1251 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1251 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1252 | 1252 | |
| 1253 | 1253 | return $texte; |
| 1254 | 1254 | } |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | return $texte; |
| 1280 | 1280 | } |
| 1281 | 1281 | include_spip('inc/texte'); |
| 1282 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1282 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1283 | 1283 | 'div' : 'span'; |
| 1284 | 1284 | |
| 1285 | 1285 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | } |
| 1392 | 1392 | $u = $GLOBALS['meta']['pcre_u']; |
| 1393 | 1393 | if ($textebrut) { |
| 1394 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1394 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1395 | 1395 | } |
| 1396 | 1396 | $texte = texte_backend($texte); |
| 1397 | 1397 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | # un message pour abs_url |
| 1427 | 1427 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1428 | 1428 | $url = trim($url); |
| 1429 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1429 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1430 | 1430 | |
| 1431 | 1431 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1432 | 1432 | } |
@@ -1626,14 +1626,14 @@ discard block |
||
| 1626 | 1626 | if (strpos($texte, '<') !== false) { |
| 1627 | 1627 | include_spip('inc/lien'); |
| 1628 | 1628 | if (defined('_PREG_MODELE')) { |
| 1629 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1629 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1630 | 1630 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1631 | 1631 | } |
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | $debut = ''; |
| 1635 | 1635 | $suite = $texte; |
| 1636 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1636 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1637 | 1637 | $debut .= substr($suite, 0, $t - 1); |
| 1638 | 1638 | $suite = substr($suite, $t); |
| 1639 | 1639 | $car = substr($suite, 0, 1); |
@@ -1651,11 +1651,11 @@ discard block |
||
| 1651 | 1651 | $suite = substr($suite, strlen($regs[0])); |
| 1652 | 1652 | } |
| 1653 | 1653 | } |
| 1654 | - $texte = $debut . $suite; |
|
| 1654 | + $texte = $debut.$suite; |
|
| 1655 | 1655 | |
| 1656 | 1656 | $texte = echappe_retour($texte); |
| 1657 | 1657 | |
| 1658 | - return $texte . $fin; |
|
| 1658 | + return $texte.$fin; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | foreach ($regs as $reg) { |
| 1720 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1720 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1721 | 1721 | $desc = $traduire($cle, $lang, true); |
| 1722 | 1722 | $l = $desc->langue; |
| 1723 | 1723 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1831,9 +1831,9 @@ discard block |
||
| 1831 | 1831 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1832 | 1832 | include_spip('inc/texte'); |
| 1833 | 1833 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1834 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1834 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1835 | 1835 | if ($mode === 'div') { |
| 1836 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1836 | + $trad = rtrim($trad)."\n\n"; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1839 | 1839 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2001,7 +2001,7 @@ discard block |
||
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | // un index compris entre 0 et num exclus |
| 2004 | - $i = ((intval($i) -1) % $num); // dans ]-$num;$num[ |
|
| 2004 | + $i = ((intval($i) - 1) % $num); // dans ]-$num;$num[ |
|
| 2005 | 2005 | $i = ($i + $num) % $num; // dans [0;$num[ |
| 2006 | 2006 | // renvoyer le i-ieme argument, modulo le nombre d'arguments |
| 2007 | 2007 | return $args[$i]; |
@@ -2033,7 +2033,7 @@ discard block |
||
| 2033 | 2033 | if (is_array($balise)) { |
| 2034 | 2034 | array_walk( |
| 2035 | 2035 | $balise, |
| 2036 | - function (&$a, $key, $t) { |
|
| 2036 | + function(&$a, $key, $t) { |
|
| 2037 | 2037 | $a = extraire_attribut($a, $t); |
| 2038 | 2038 | }, |
| 2039 | 2039 | $attribut |
@@ -2130,14 +2130,14 @@ discard block |
||
| 2130 | 2130 | |
| 2131 | 2131 | if ($old !== null) { |
| 2132 | 2132 | // Remplacer l'ancien attribut du meme nom |
| 2133 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2133 | + $balise = $r[1].$insert.$r[5]; |
|
| 2134 | 2134 | } else { |
| 2135 | 2135 | // preferer une balise " />" (comme <img />) |
| 2136 | 2136 | if (preg_match(',/>,', $balise)) { |
| 2137 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2137 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2138 | 2138 | } // sinon une balise <a ...> ... </a> |
| 2139 | 2139 | else { |
| 2140 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2140 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2141 | 2141 | } |
| 2142 | 2142 | } |
| 2143 | 2143 | |
@@ -2192,7 +2192,7 @@ discard block |
||
| 2192 | 2192 | if ( |
| 2193 | 2193 | $class_courante |
| 2194 | 2194 | and strpos($class_courante, (string) $c) !== false |
| 2195 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2195 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2196 | 2196 | ) { |
| 2197 | 2197 | $is_class_presente = true; |
| 2198 | 2198 | } |
@@ -2200,12 +2200,12 @@ discard block |
||
| 2200 | 2200 | in_array($operation, ['ajouter', 'commuter']) |
| 2201 | 2201 | and !$is_class_presente |
| 2202 | 2202 | ) { |
| 2203 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2203 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2204 | 2204 | } elseif ( |
| 2205 | 2205 | in_array($operation, ['supprimer', 'commuter']) |
| 2206 | 2206 | and $is_class_presente |
| 2207 | 2207 | ) { |
| 2208 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2208 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2209 | 2209 | } |
| 2210 | 2210 | } |
| 2211 | 2211 | |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | // Quelques fonctions de calcul arithmetique |
| 2269 | 2269 | // |
| 2270 | 2270 | function floatstr($a) { |
| 2271 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2271 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2272 | 2272 | } |
| 2273 | 2273 | function strize($f, $a, $b) { |
| 2274 | 2274 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2404,13 +2404,13 @@ discard block |
||
| 2404 | 2404 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2405 | 2405 | define('_TAGS_NOM_AUTEUR', ''); |
| 2406 | 2406 | } |
| 2407 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2407 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2408 | 2408 | foreach ($tags_acceptes as $tag) { |
| 2409 | 2409 | if (strlen($tag)) { |
| 2410 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2411 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2412 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2413 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2410 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2411 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2412 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2413 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2414 | 2414 | } |
| 2415 | 2415 | } |
| 2416 | 2416 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2464,7 +2464,7 @@ discard block |
||
| 2464 | 2464 | . http_img_pack( |
| 2465 | 2465 | 'attachment-16.png', |
| 2466 | 2466 | $t, |
| 2467 | - 'title="' . attribut_html($t) . '"' |
|
| 2467 | + 'title="'.attribut_html($t).'"' |
|
| 2468 | 2468 | ) |
| 2469 | 2469 | . '</a>', |
| 2470 | 2470 | $tag |
@@ -2528,10 +2528,10 @@ discard block |
||
| 2528 | 2528 | $fichier = basename($url); |
| 2529 | 2529 | |
| 2530 | 2530 | return '<a rel="enclosure"' |
| 2531 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2532 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2533 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2534 | - . '>' . $fichier . '</a>'; |
|
| 2531 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2532 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2533 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2534 | + . '>'.$fichier.'</a>'; |
|
| 2535 | 2535 | } |
| 2536 | 2536 | |
| 2537 | 2537 | /** |
@@ -2559,9 +2559,9 @@ discard block |
||
| 2559 | 2559 | } # vieux data |
| 2560 | 2560 | $fichier = basename($url); |
| 2561 | 2561 | $enclosures[] = '<enclosure' |
| 2562 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2563 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2564 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2562 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2563 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2564 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2565 | 2565 | . ' />'; |
| 2566 | 2566 | } |
| 2567 | 2567 | } |
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2588 | 2588 | $subjects .= '<dc:subject>' |
| 2589 | 2589 | . texte_backend(textebrut($e)) |
| 2590 | - . '</dc:subject>' . "\n"; |
|
| 2590 | + . '</dc:subject>'."\n"; |
|
| 2591 | 2591 | } |
| 2592 | 2592 | } |
| 2593 | 2593 | |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | if (is_array($texte)) { |
| 2624 | 2624 | array_walk( |
| 2625 | 2625 | $texte, |
| 2626 | - function (&$a, $key, $t) { |
|
| 2626 | + function(&$a, $key, $t) { |
|
| 2627 | 2627 | $a = extraire_balise($a, $t); |
| 2628 | 2628 | }, |
| 2629 | 2629 | $tag |
@@ -2671,7 +2671,7 @@ discard block |
||
| 2671 | 2671 | if (is_array($texte)) { |
| 2672 | 2672 | array_walk( |
| 2673 | 2673 | $texte, |
| 2674 | - function (&$a, $key, $t) { |
|
| 2674 | + function(&$a, $key, $t) { |
|
| 2675 | 2675 | $a = extraire_balises($a, $t); |
| 2676 | 2676 | }, |
| 2677 | 2677 | $tag |
@@ -2804,7 +2804,7 @@ discard block |
||
| 2804 | 2804 | if ($fond != '404') { |
| 2805 | 2805 | $contexte = array_shift($p); |
| 2806 | 2806 | $contexte['page'] = $fond; |
| 2807 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2807 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2808 | 2808 | } |
| 2809 | 2809 | } |
| 2810 | 2810 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2859,9 +2859,9 @@ discard block |
||
| 2859 | 2859 | . '"' |
| 2860 | 2860 | . (is_null($val) |
| 2861 | 2861 | ? '' |
| 2862 | - : ' value="' . entites_html($val) . '"' |
|
| 2862 | + : ' value="'.entites_html($val).'"' |
|
| 2863 | 2863 | ) |
| 2864 | - . ' type="hidden"' . "\n/>"; |
|
| 2864 | + . ' type="hidden"'."\n/>"; |
|
| 2865 | 2865 | } |
| 2866 | 2866 | |
| 2867 | 2867 | return join('', $hidden); |
@@ -2971,7 +2971,7 @@ discard block |
||
| 2971 | 2971 | |
| 2972 | 2972 | return preg_replace_callback( |
| 2973 | 2973 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2974 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2974 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2975 | 2975 | $contenu |
| 2976 | 2976 | ); |
| 2977 | 2977 | } |
@@ -3032,14 +3032,14 @@ discard block |
||
| 3032 | 3032 | ) { |
| 3033 | 3033 | $distant = true; |
| 3034 | 3034 | $cssf = parse_url($css); |
| 3035 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3035 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3036 | 3036 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3037 | 3037 | } else { |
| 3038 | 3038 | $distant = false; |
| 3039 | 3039 | $cssf = $css; |
| 3040 | 3040 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3041 | 3041 | //propose (rien a faire dans ce cas) |
| 3042 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3042 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3043 | 3043 | if (@file_exists($f)) { |
| 3044 | 3044 | return $f; |
| 3045 | 3045 | } |
@@ -3049,7 +3049,7 @@ discard block |
||
| 3049 | 3049 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3050 | 3050 | $f = $dir_var |
| 3051 | 3051 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3052 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3052 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3053 | 3053 | |
| 3054 | 3054 | // la css peut etre distante (url absolue !) |
| 3055 | 3055 | if ($distant) { |
@@ -3095,8 +3095,8 @@ discard block |
||
| 3095 | 3095 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3096 | 3096 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3097 | 3097 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3098 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3099 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3098 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3099 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | $src[] = $regs[0][$k]; |
| 3102 | 3102 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3145,7 +3145,7 @@ discard block |
||
| 3145 | 3145 | |
| 3146 | 3146 | $f = basename($css, '.css'); |
| 3147 | 3147 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3148 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3148 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3149 | 3149 | . '.css'; |
| 3150 | 3150 | |
| 3151 | 3151 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3155,7 +3155,7 @@ discard block |
||
| 3155 | 3155 | if ($url_absolue_css == $css) { |
| 3156 | 3156 | if ( |
| 3157 | 3157 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3158 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3158 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3159 | 3159 | ) { |
| 3160 | 3160 | include_spip('inc/distant'); |
| 3161 | 3161 | $contenu = recuperer_url($css); |
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | $expression = str_replace('\/', '/', $expression); |
| 3268 | 3268 | $expression = str_replace('/', '\/', $expression); |
| 3269 | 3269 | |
| 3270 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3270 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3271 | 3271 | if (isset($r[$capte])) { |
| 3272 | 3272 | return $r[$capte]; |
| 3273 | 3273 | } else { |
@@ -3305,7 +3305,7 @@ discard block |
||
| 3305 | 3305 | $expression = str_replace('\/', '/', $expression); |
| 3306 | 3306 | $expression = str_replace('/', '\/', $expression); |
| 3307 | 3307 | |
| 3308 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3308 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3309 | 3309 | } |
| 3310 | 3310 | |
| 3311 | 3311 | |
@@ -3324,7 +3324,7 @@ discard block |
||
| 3324 | 3324 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3325 | 3325 | |
| 3326 | 3326 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3327 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3327 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3328 | 3328 | |
| 3329 | 3329 | if ( |
| 3330 | 3330 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3338,7 +3338,7 @@ discard block |
||
| 3338 | 3338 | if (!isset($doublons['documents'])) { |
| 3339 | 3339 | $doublons['documents'] = ''; |
| 3340 | 3340 | } |
| 3341 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3341 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3342 | 3342 | } |
| 3343 | 3343 | |
| 3344 | 3344 | return $letexte; |
@@ -3395,7 +3395,7 @@ discard block |
||
| 3395 | 3395 | if ($env) { |
| 3396 | 3396 | foreach ($env as $i => $j) { |
| 3397 | 3397 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3398 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3398 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3399 | 3399 | } |
| 3400 | 3400 | } |
| 3401 | 3401 | } |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | if ($env) { |
| 3435 | 3435 | foreach ($env as $i => $j) { |
| 3436 | 3436 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3437 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3437 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3438 | 3438 | } |
| 3439 | 3439 | } |
| 3440 | 3440 | } |
@@ -3508,10 +3508,10 @@ discard block |
||
| 3508 | 3508 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3509 | 3509 | if ( |
| 3510 | 3510 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3511 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3511 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3512 | 3512 | and file_exists($variante_svg_generique) |
| 3513 | 3513 | ) { |
| 3514 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3514 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3515 | 3515 | $img_file = $variante_svg_size; |
| 3516 | 3516 | } |
| 3517 | 3517 | else { |
@@ -3569,7 +3569,7 @@ discard block |
||
| 3569 | 3569 | return ''; |
| 3570 | 3570 | } |
| 3571 | 3571 | } |
| 3572 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3572 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3573 | 3573 | } |
| 3574 | 3574 | |
| 3575 | 3575 | if (file_exists($img_file)) { |
@@ -3579,14 +3579,14 @@ discard block |
||
| 3579 | 3579 | $alt = ''; |
| 3580 | 3580 | } |
| 3581 | 3581 | elseif ($alt or $alt === '') { |
| 3582 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3582 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3583 | 3583 | } |
| 3584 | 3584 | else { |
| 3585 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3585 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3586 | 3586 | } |
| 3587 | 3587 | return "<img src='$img_file'$alt" |
| 3588 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3589 | - . ' ' . ltrim($atts) |
|
| 3588 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3589 | + . ' '.ltrim($atts) |
|
| 3590 | 3590 | . ' />'; |
| 3591 | 3591 | } |
| 3592 | 3592 | |
@@ -3600,10 +3600,10 @@ discard block |
||
| 3600 | 3600 | */ |
| 3601 | 3601 | function http_style_background($img, $att = '', $size = null) { |
| 3602 | 3602 | if ($size and is_numeric($size)) { |
| 3603 | - $size = trim($size) . 'px'; |
|
| 3603 | + $size = trim($size).'px'; |
|
| 3604 | 3604 | } |
| 3605 | - return " style='background" . |
|
| 3606 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3605 | + return " style='background". |
|
| 3606 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3607 | 3607 | . ($size ? "background-size:{$size};" : '') |
| 3608 | 3608 | . "'"; |
| 3609 | 3609 | } |
@@ -3718,7 +3718,7 @@ discard block |
||
| 3718 | 3718 | $img = http_img_pack( |
| 3719 | 3719 | $img, |
| 3720 | 3720 | $alt, |
| 3721 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3721 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3722 | 3722 | '', |
| 3723 | 3723 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3724 | 3724 | ); |
@@ -3803,7 +3803,7 @@ discard block |
||
| 3803 | 3803 | $balise_svg_source = $balise_svg; |
| 3804 | 3804 | |
| 3805 | 3805 | // entete XML Ã supprimer |
| 3806 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3806 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3807 | 3807 | |
| 3808 | 3808 | // IE est toujours mon ami |
| 3809 | 3809 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3821,9 +3821,9 @@ discard block |
||
| 3821 | 3821 | // regler le alt |
| 3822 | 3822 | if ($alt) { |
| 3823 | 3823 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3824 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3824 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3825 | 3825 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3826 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3826 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3827 | 3827 | $balise_svg .= $title; |
| 3828 | 3828 | } |
| 3829 | 3829 | else { |
@@ -3871,7 +3871,7 @@ discard block |
||
| 3871 | 3871 | if (is_array($tableau)) { |
| 3872 | 3872 | foreach ($tableau as $k => $v) { |
| 3873 | 3873 | $res = recuperer_fond( |
| 3874 | - 'modeles/' . $modele, |
|
| 3874 | + 'modeles/'.$modele, |
|
| 3875 | 3875 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3876 | 3876 | ); |
| 3877 | 3877 | $texte .= $res; |
@@ -4056,7 +4056,7 @@ discard block |
||
| 4056 | 4056 | } |
| 4057 | 4057 | |
| 4058 | 4058 | $c = serialize($c); |
| 4059 | - $cle = calculer_cle_action($form . $c); |
|
| 4059 | + $cle = calculer_cle_action($form.$c); |
|
| 4060 | 4060 | $c = "$cle:$c"; |
| 4061 | 4061 | |
| 4062 | 4062 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4114,15 +4114,15 @@ discard block |
||
| 4114 | 4114 | } |
| 4115 | 4115 | // toujours encoder l'url source dans le bloc ajax |
| 4116 | 4116 | $r = self(); |
| 4117 | - $r = ' data-origin="' . $r . '"'; |
|
| 4117 | + $r = ' data-origin="'.$r.'"'; |
|
| 4118 | 4118 | $class = 'ajaxbloc'; |
| 4119 | 4119 | if ($ajaxid and is_string($ajaxid)) { |
| 4120 | 4120 | // ajaxid est normalement conforme a un nom de classe css |
| 4121 | 4121 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4122 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4122 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4123 | 4123 | } |
| 4124 | 4124 | |
| 4125 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4125 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4126 | 4126 | } |
| 4127 | 4127 | |
| 4128 | 4128 | /** |
@@ -4166,7 +4166,7 @@ discard block |
||
| 4166 | 4166 | $cle = substr($c, 0, $p); |
| 4167 | 4167 | $c = substr($c, $p + 1); |
| 4168 | 4168 | |
| 4169 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4169 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4170 | 4170 | $env = @unserialize($c); |
| 4171 | 4171 | return $env; |
| 4172 | 4172 | } |
@@ -4287,13 +4287,13 @@ discard block |
||
| 4287 | 4287 | } |
| 4288 | 4288 | } |
| 4289 | 4289 | } |
| 4290 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4290 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4291 | 4291 | } else { |
| 4292 | 4292 | $bal = 'a'; |
| 4293 | 4293 | $att = "href='$url'" |
| 4294 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4295 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4296 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4294 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4295 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4296 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4297 | 4297 | . $evt; |
| 4298 | 4298 | } |
| 4299 | 4299 | if ($libelle === null) { |
@@ -4432,7 +4432,7 @@ discard block |
||
| 4432 | 4432 | |
| 4433 | 4433 | // Icône |
| 4434 | 4434 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4435 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4435 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4436 | 4436 | |
| 4437 | 4437 | // Markup final |
| 4438 | 4438 | if ($type == 'lien') { |
@@ -4709,20 +4709,20 @@ discard block |
||
| 4709 | 4709 | $class_form = 'ajax'; |
| 4710 | 4710 | $class = str_replace('ajax', '', $class); |
| 4711 | 4711 | } |
| 4712 | - $class_btn = 'submit ' . trim($class); |
|
| 4712 | + $class_btn = 'submit '.trim($class); |
|
| 4713 | 4713 | |
| 4714 | 4714 | if ($confirm) { |
| 4715 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4715 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4716 | 4716 | if ($callback) { |
| 4717 | 4717 | $callback = "$confirm?($callback):false"; |
| 4718 | 4718 | } else { |
| 4719 | 4719 | $callback = $confirm; |
| 4720 | 4720 | } |
| 4721 | 4721 | } |
| 4722 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4722 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4723 | 4723 | $title = $title ? " title='$title'" : ''; |
| 4724 | 4724 | |
| 4725 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4725 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4726 | 4726 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4727 | 4727 | } |
| 4728 | 4728 | |
@@ -4787,14 +4787,14 @@ discard block |
||
| 4787 | 4787 | $champ_titre = ''; |
| 4788 | 4788 | if ($demande_titre) { |
| 4789 | 4789 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4790 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4790 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4791 | 4791 | } |
| 4792 | 4792 | include_spip('base/abstract_sql'); |
| 4793 | 4793 | include_spip('base/connect_sql'); |
| 4794 | 4794 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4795 | - '*' . $champ_titre, |
|
| 4795 | + '*'.$champ_titre, |
|
| 4796 | 4796 | $desc['table_sql'], |
| 4797 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4797 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4798 | 4798 | ); |
| 4799 | 4799 | |
| 4800 | 4800 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4887,8 +4887,7 @@ discard block |
||
| 4887 | 4887 | if (isset($ligne_sql['chapo'])) { |
| 4888 | 4888 | $chapo = $ligne_sql['chapo']; |
| 4889 | 4889 | $texte = strlen($descriptif) ? |
| 4890 | - '' : |
|
| 4891 | - "$chapo \n\n $texte"; |
|
| 4890 | + '' : "$chapo \n\n $texte"; |
|
| 4892 | 4891 | } |
| 4893 | 4892 | |
| 4894 | 4893 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4963,7 +4962,7 @@ discard block |
||
| 4963 | 4962 | return $texte; |
| 4964 | 4963 | } |
| 4965 | 4964 | |
| 4966 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4965 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4967 | 4966 | |
| 4968 | 4967 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4969 | 4968 | $Pile = [0 => $env]; |
@@ -4997,7 +4996,7 @@ discard block |
||
| 4997 | 4996 | } |
| 4998 | 4997 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4999 | 4998 | |
| 5000 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4999 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 5001 | 5000 | } |
| 5002 | 5001 | |
| 5003 | 5002 | /** |
@@ -5023,10 +5022,10 @@ discard block |
||
| 5023 | 5022 | function wrap($texte, $wrap) { |
| 5024 | 5023 | $balises = extraire_balises($wrap); |
| 5025 | 5024 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5026 | - $texte = $wrap . $texte; |
|
| 5025 | + $texte = $wrap.$texte; |
|
| 5027 | 5026 | $regs = array_reverse($regs[1]); |
| 5028 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5029 | - $texte = $texte . $wrap; |
|
| 5027 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5028 | + $texte = $texte.$wrap; |
|
| 5030 | 5029 | } |
| 5031 | 5030 | |
| 5032 | 5031 | return $texte; |
@@ -5057,7 +5056,7 @@ discard block |
||
| 5057 | 5056 | |
| 5058 | 5057 | // caster $u en array si besoin |
| 5059 | 5058 | if (is_object($u)) { |
| 5060 | - $u = (array)$u; |
|
| 5059 | + $u = (array) $u; |
|
| 5061 | 5060 | } |
| 5062 | 5061 | |
| 5063 | 5062 | if (is_array($u)) { |
@@ -5079,7 +5078,7 @@ discard block |
||
| 5079 | 5078 | // sinon on passe a la ligne et on indente |
| 5080 | 5079 | $i_str = str_pad('', $indent, 'Â '); |
| 5081 | 5080 | foreach ($u as $k => $v) { |
| 5082 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5081 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5083 | 5082 | } |
| 5084 | 5083 | |
| 5085 | 5084 | return $out; |
@@ -5133,7 +5132,7 @@ discard block |
||
| 5133 | 5132 | * @return string |
| 5134 | 5133 | */ |
| 5135 | 5134 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5136 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5135 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5137 | 5136 | $icone = chemin_image($icone); |
| 5138 | 5137 | $balise_img = charger_filtre('balise_img'); |
| 5139 | 5138 | |
@@ -5159,7 +5158,7 @@ discard block |
||
| 5159 | 5158 | */ |
| 5160 | 5159 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5161 | 5160 | $chaine = explode(':', $chaine); |
| 5162 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5161 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5163 | 5162 | return $t; |
| 5164 | 5163 | } |
| 5165 | 5164 | $chaine = implode(':', $chaine); |
@@ -5225,7 +5224,7 @@ discard block |
||
| 5225 | 5224 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5226 | 5225 | |
| 5227 | 5226 | // calculer le nom de la css |
| 5228 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5227 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5229 | 5228 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5230 | 5229 | $contexte_implicite = calculer_contexte_implicite(); |
| 5231 | 5230 | |
@@ -5233,14 +5232,14 @@ discard block |
||
| 5233 | 5232 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5234 | 5233 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5235 | 5234 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5236 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5235 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5237 | 5236 | } |
| 5238 | 5237 | else { |
| 5239 | 5238 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5240 | 5239 | ksort($contexte); |
| 5241 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5240 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5242 | 5241 | } |
| 5243 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5242 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5244 | 5243 | |
| 5245 | 5244 | // mettre a jour le fichier si il n'existe pas |
| 5246 | 5245 | // ou trop ancien |
@@ -5248,8 +5247,8 @@ discard block |
||
| 5248 | 5247 | // et recopie sur le fichier cible uniquement si il change |
| 5249 | 5248 | if ( |
| 5250 | 5249 | !file_exists($filename) |
| 5251 | - or !file_exists($filename . '.last') |
|
| 5252 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5250 | + or !file_exists($filename.'.last') |
|
| 5251 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5253 | 5252 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5254 | 5253 | ) { |
| 5255 | 5254 | $contenu = $cache['texte']; |
@@ -5270,10 +5269,10 @@ discard block |
||
| 5270 | 5269 | } |
| 5271 | 5270 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5272 | 5271 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5273 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5272 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5274 | 5273 | } |
| 5275 | 5274 | // et ecrire le fichier si il change |
| 5276 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5275 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5277 | 5276 | } |
| 5278 | 5277 | |
| 5279 | 5278 | return timestamp($filename); |
@@ -5499,7 +5498,7 @@ discard block |
||
| 5499 | 5498 | if ($e > 0 and strlen($mid) > 8) { |
| 5500 | 5499 | $mid = '***...***'; |
| 5501 | 5500 | } |
| 5502 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5501 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5503 | 5502 | } |
| 5504 | 5503 | |
| 5505 | 5504 | |
@@ -5561,7 +5560,7 @@ discard block |
||
| 5561 | 5560 | case 'id': |
| 5562 | 5561 | case 'anchor': |
| 5563 | 5562 | if (preg_match(',^\d,', $texte)) { |
| 5564 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5563 | + $texte = substr($type, 0, 1).$texte; |
|
| 5565 | 5564 | } |
| 5566 | 5565 | } |
| 5567 | 5566 | |
@@ -5571,9 +5570,9 @@ discard block |
||
| 5571 | 5570 | |
| 5572 | 5571 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5573 | 5572 | if (preg_match(',^\d,', $texte)) { |
| 5574 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5573 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5575 | 5574 | } |
| 5576 | - $texte .= $separateur . md5($original); |
|
| 5575 | + $texte .= $separateur.md5($original); |
|
| 5577 | 5576 | $texte = substr($texte, 0, $longueur_mini); |
| 5578 | 5577 | } |
| 5579 | 5578 | |
@@ -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,7 +98,7 @@ 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'); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | .'<br />' |
| 110 | 110 | ._T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>'. spip_htmlentities($d).'</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1779,9 +1779,9 @@ discard block |
||
| 1779 | 1779 | function charger_fonction_url(string $quoi, string $type = '') { |
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | - if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1782 | + if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1783 | 1783 | // deprecated |
| 1784 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1784 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1785 | 1785 | ) { |
| 1786 | 1786 | return $f; |
| 1787 | 1787 | } |
@@ -1902,7 +1902,7 @@ discard block |
||
| 1902 | 1902 | * @deprecated 4.1 |
| 1903 | 1903 | * @see generer_objet_url |
| 1904 | 1904 | */ |
| 1905 | -function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null){ |
|
| 1905 | +function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null) { |
|
| 1906 | 1906 | if ($public and is_string($public)) { |
| 1907 | 1907 | return generer_objet_url(intval($id), $entite, $args ?: '', $ancre ?: '', true, $type ?? '', $public); |
| 1908 | 1908 | } |
@@ -1937,7 +1937,7 @@ discard block |
||
| 1937 | 1937 | * @deprecated 4.1 |
| 1938 | 1938 | * @see generer_objet_url_ecrire_edit |
| 1939 | 1939 | */ |
| 1940 | -function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){ |
|
| 1940 | +function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') { |
|
| 1941 | 1941 | return generer_objet_url_ecrire_edit(intval($id), $entite, $args, $ancre); |
| 1942 | 1942 | } |
| 1943 | 1943 | |
@@ -1946,8 +1946,8 @@ discard block |
||
| 1946 | 1946 | include_spip('base/connect_sql'); |
| 1947 | 1947 | $id_type = id_table_objet($entite, $public); |
| 1948 | 1948 | |
| 1949 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1950 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1949 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1950 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1951 | 1951 | . (!$args ? '' : "&$args") |
| 1952 | 1952 | . (!$ancre ? '' : "#$ancre"); |
| 1953 | 1953 | } |
@@ -2001,7 +2001,7 @@ discard block |
||
| 2001 | 2001 | * @deprecated 4.1 |
| 2002 | 2002 | * @see generer_objet_url_absolue |
| 2003 | 2003 | */ |
| 2004 | -function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null){ |
|
| 2004 | +function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null) { |
|
| 2005 | 2005 | return generer_objet_url_absolue(intval($id), $entite, $args, $ancre, true, '', $connect); |
| 2006 | 2006 | } |
| 2007 | 2007 | |
@@ -2118,7 +2118,7 @@ discard block |
||
| 2118 | 2118 | !empty($_SERVER['QUERY_STRING']) |
| 2119 | 2119 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2120 | 2120 | ) { |
| 2121 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2121 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2122 | 2122 | } |
| 2123 | 2123 | } |
| 2124 | 2124 | } |
@@ -2153,9 +2153,9 @@ discard block |
||
| 2153 | 2153 | array_shift($myself); |
| 2154 | 2154 | $myself = implode('/', $myself); |
| 2155 | 2155 | } |
| 2156 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2156 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2157 | 2157 | |
| 2158 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2158 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2159 | 2159 | |
| 2160 | 2160 | return $url; |
| 2161 | 2161 | } |
@@ -2193,16 +2193,16 @@ discard block |
||
| 2193 | 2193 | **/ |
| 2194 | 2194 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2195 | 2195 | if (!$rel) { |
| 2196 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2196 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2197 | 2197 | } else { |
| 2198 | 2198 | if (!is_string($rel)) { |
| 2199 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2199 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2200 | 2200 | } |
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | 2203 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2204 | 2204 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2205 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2205 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2206 | 2206 | } elseif ($args) { |
| 2207 | 2207 | $args = "?$args"; |
| 2208 | 2208 | } |
@@ -2210,7 +2210,7 @@ discard block |
||
| 2210 | 2210 | $args .= "#$ancre"; |
| 2211 | 2211 | } |
| 2212 | 2212 | |
| 2213 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2213 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2214 | 2214 | } |
| 2215 | 2215 | |
| 2216 | 2216 | // |
@@ -2292,10 +2292,10 @@ discard block |
||
| 2292 | 2292 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2293 | 2293 | } |
| 2294 | 2294 | if ($args) { |
| 2295 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2295 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2296 | 2296 | } |
| 2297 | 2297 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2298 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2298 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2299 | 2299 | } |
| 2300 | 2300 | |
| 2301 | 2301 | if (!$no_entities) { |
@@ -2307,7 +2307,7 @@ discard block |
||
| 2307 | 2307 | |
| 2308 | 2308 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2309 | 2309 | |
| 2310 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2310 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2311 | 2311 | } |
| 2312 | 2312 | |
| 2313 | 2313 | // Pour les formulaires en methode POST, |
@@ -2342,8 +2342,7 @@ discard block |
||
| 2342 | 2342 | . "><div>\n" |
| 2343 | 2343 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2344 | 2344 | . $corps |
| 2345 | - . (!$submit ? '' : |
|
| 2346 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2345 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2347 | 2346 | . "</div></form>\n"; |
| 2348 | 2347 | } |
| 2349 | 2348 | |
@@ -2368,14 +2367,14 @@ discard block |
||
| 2368 | 2367 | ? generer_url_ecrire(_request('exec')) |
| 2369 | 2368 | : generer_url_public(); |
| 2370 | 2369 | |
| 2371 | - return "\n<form action='" . |
|
| 2372 | - $h . |
|
| 2373 | - "'" . |
|
| 2374 | - $atts . |
|
| 2375 | - ">\n" . |
|
| 2376 | - '<div>' . |
|
| 2377 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2378 | - $corps . |
|
| 2370 | + return "\n<form action='". |
|
| 2371 | + $h. |
|
| 2372 | + "'". |
|
| 2373 | + $atts. |
|
| 2374 | + ">\n". |
|
| 2375 | + '<div>'. |
|
| 2376 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2377 | + $corps. |
|
| 2379 | 2378 | '</div></form>'; |
| 2380 | 2379 | } |
| 2381 | 2380 | |
@@ -2403,7 +2402,7 @@ discard block |
||
| 2403 | 2402 | : generer_url_public('', '', false, false); |
| 2404 | 2403 | $url = parametre_url($url, 'action', $script); |
| 2405 | 2404 | if ($args) { |
| 2406 | - $url .= quote_amp('&' . $args); |
|
| 2405 | + $url .= quote_amp('&'.$args); |
|
| 2407 | 2406 | } |
| 2408 | 2407 | |
| 2409 | 2408 | if ($no_entities) { |
@@ -2437,9 +2436,9 @@ discard block |
||
| 2437 | 2436 | } |
| 2438 | 2437 | $url = |
| 2439 | 2438 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2440 | - . $script . '/' |
|
| 2439 | + . $script.'/' |
|
| 2441 | 2440 | . ($path ? trim($path, '/') : '') |
| 2442 | - . ($args ? "?" . quote_amp($args) : ''); |
|
| 2441 | + . ($args ? "?".quote_amp($args) : ''); |
|
| 2443 | 2442 | |
| 2444 | 2443 | if ($no_entities) { |
| 2445 | 2444 | $url = str_replace('&', '&', $url); |
@@ -2488,17 +2487,17 @@ discard block |
||
| 2488 | 2487 | |
| 2489 | 2488 | // le nom du repertoire plugins/ activables/desactivables |
| 2490 | 2489 | if (!defined('_DIR_PLUGINS')) { |
| 2491 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2490 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2492 | 2491 | } |
| 2493 | 2492 | |
| 2494 | 2493 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2495 | 2494 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2496 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2495 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2497 | 2496 | } |
| 2498 | 2497 | |
| 2499 | 2498 | // le nom du repertoire des librairies |
| 2500 | 2499 | if (!defined('_DIR_LIB')) { |
| 2501 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2500 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2502 | 2501 | } |
| 2503 | 2502 | |
| 2504 | 2503 | if (!defined('_DIR_IMG')) { |
@@ -2508,29 +2507,29 @@ discard block |
||
| 2508 | 2507 | define('_DIR_LOGOS', $pa); |
| 2509 | 2508 | } |
| 2510 | 2509 | if (!defined('_DIR_IMG_ICONES')) { |
| 2511 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2510 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2512 | 2511 | } |
| 2513 | 2512 | |
| 2514 | 2513 | if (!defined('_DIR_DUMP')) { |
| 2515 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2514 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2516 | 2515 | } |
| 2517 | 2516 | if (!defined('_DIR_SESSIONS')) { |
| 2518 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2517 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2519 | 2518 | } |
| 2520 | 2519 | if (!defined('_DIR_TRANSFERT')) { |
| 2521 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2520 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2522 | 2521 | } |
| 2523 | 2522 | if (!defined('_DIR_CACHE')) { |
| 2524 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2523 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2525 | 2524 | } |
| 2526 | 2525 | if (!defined('_DIR_CACHE_XML')) { |
| 2527 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2526 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2528 | 2527 | } |
| 2529 | 2528 | if (!defined('_DIR_SKELS')) { |
| 2530 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2529 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2531 | 2530 | } |
| 2532 | 2531 | if (!defined('_DIR_AIDE')) { |
| 2533 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2532 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_TMP')) { |
| 2536 | 2535 | define('_DIR_TMP', $ti); |
@@ -2559,27 +2558,27 @@ discard block |
||
| 2559 | 2558 | // Declaration des fichiers |
| 2560 | 2559 | |
| 2561 | 2560 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2562 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2561 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2563 | 2562 | } |
| 2564 | 2563 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2565 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2564 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2566 | 2565 | } |
| 2567 | 2566 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2568 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2567 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2569 | 2568 | } |
| 2570 | 2569 | if (!defined('_CACHE_PIPELINES')) { |
| 2571 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2570 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2572 | 2571 | } |
| 2573 | 2572 | if (!defined('_CACHE_CHEMIN')) { |
| 2574 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2573 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2575 | 2574 | } |
| 2576 | 2575 | |
| 2577 | 2576 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2578 | 2577 | if (!defined('_FILE_META')) { |
| 2579 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2578 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2580 | 2579 | } |
| 2581 | 2580 | if (!defined('_DIR_LOG')) { |
| 2582 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2581 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | if (!defined('_FILE_LOG')) { |
| 2585 | 2584 | define('_FILE_LOG', 'spip'); |
@@ -2596,8 +2595,8 @@ discard block |
||
| 2596 | 2595 | if (!defined('_FILE_CONNECT')) { |
| 2597 | 2596 | define( |
| 2598 | 2597 | '_FILE_CONNECT', |
| 2599 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2600 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2598 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2599 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2601 | 2600 | : false)) |
| 2602 | 2601 | ); |
| 2603 | 2602 | } |
@@ -2609,7 +2608,7 @@ discard block |
||
| 2609 | 2608 | if (!defined('_FILE_CHMOD')) { |
| 2610 | 2609 | define( |
| 2611 | 2610 | '_FILE_CHMOD', |
| 2612 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2611 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2613 | 2612 | : false) |
| 2614 | 2613 | ); |
| 2615 | 2614 | } |
@@ -2622,10 +2621,10 @@ discard block |
||
| 2622 | 2621 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2623 | 2622 | } |
| 2624 | 2623 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2625 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2624 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2626 | 2625 | } |
| 2627 | 2626 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2628 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2627 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2629 | 2628 | } |
| 2630 | 2629 | |
| 2631 | 2630 | // Definition des droits d'acces en ecriture |
@@ -2643,13 +2642,13 @@ discard block |
||
| 2643 | 2642 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2644 | 2643 | } |
| 2645 | 2644 | if (!defined('_ROOT_PLUGINS')) { |
| 2646 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2645 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2647 | 2646 | } |
| 2648 | 2647 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2649 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2648 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2650 | 2649 | } |
| 2651 | 2650 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2652 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2651 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2653 | 2652 | } |
| 2654 | 2653 | |
| 2655 | 2654 | // La taille des Log |
@@ -2686,7 +2685,7 @@ discard block |
||
| 2686 | 2685 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2687 | 2686 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2688 | 2687 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2689 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2688 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2690 | 2689 | |
| 2691 | 2690 | // charger tout de suite le path et son cache |
| 2692 | 2691 | load_path_cache(); |
@@ -2734,7 +2733,7 @@ discard block |
||
| 2734 | 2733 | !empty($_SERVER['QUERY_STRING']) |
| 2735 | 2734 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2736 | 2735 | ) { |
| 2737 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2736 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2738 | 2737 | } |
| 2739 | 2738 | } |
| 2740 | 2739 | |
@@ -2770,7 +2769,7 @@ discard block |
||
| 2770 | 2769 | ) { |
| 2771 | 2770 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2772 | 2771 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2773 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2772 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2774 | 2773 | } else { |
| 2775 | 2774 | $uri_ref = ''; |
| 2776 | 2775 | } |
@@ -2864,7 +2863,7 @@ discard block |
||
| 2864 | 2863 | } |
| 2865 | 2864 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2866 | 2865 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2867 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2866 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2868 | 2867 | } |
| 2869 | 2868 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2870 | 2869 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -2968,7 +2967,7 @@ discard block |
||
| 2968 | 2967 | $memory *= 1024; |
| 2969 | 2968 | } |
| 2970 | 2969 | if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) { |
| 2971 | - @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M'); |
|
| 2970 | + @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M'); |
|
| 2972 | 2971 | if (trim(ini_get('memory_limit')) != $m) { |
| 2973 | 2972 | if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) { |
| 2974 | 2973 | define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true); |
@@ -3119,7 +3118,7 @@ discard block |
||
| 3119 | 3118 | } |
| 3120 | 3119 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3121 | 3120 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3122 | - . ' ' . _VAR_MODE); |
|
| 3121 | + . ' '._VAR_MODE); |
|
| 3123 | 3122 | } |
| 3124 | 3123 | } // pas autorise ? |
| 3125 | 3124 | else { |
@@ -3134,7 +3133,7 @@ discard block |
||
| 3134 | 3133 | if (strpos($self, 'page=login') === false) { |
| 3135 | 3134 | include_spip('inc/headers'); |
| 3136 | 3135 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3137 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3136 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3138 | 3137 | } |
| 3139 | 3138 | } |
| 3140 | 3139 | // sinon tant pis |
@@ -3176,10 +3175,10 @@ discard block |
||
| 3176 | 3175 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3177 | 3176 | // certaines constantes |
| 3178 | 3177 | @spip_initialisation_core( |
| 3179 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3180 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3181 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3182 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3178 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3179 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3180 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3181 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3183 | 3182 | ); |
| 3184 | 3183 | |
| 3185 | 3184 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3212,7 +3211,7 @@ discard block |
||
| 3212 | 3211 | } |
| 3213 | 3212 | |
| 3214 | 3213 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3215 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3214 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3216 | 3215 | $session = charger_fonction('session', 'inc'); |
| 3217 | 3216 | if ($session()) { |
| 3218 | 3217 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3292,7 +3291,7 @@ discard block |
||
| 3292 | 3291 | 'definir_session', |
| 3293 | 3292 | $GLOBALS['visiteur_session'] |
| 3294 | 3293 | ? serialize($GLOBALS['visiteur_session']) |
| 3295 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3294 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3296 | 3295 | : '' |
| 3297 | 3296 | ); |
| 3298 | 3297 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3448,11 +3447,11 @@ discard block |
||
| 3448 | 3447 | $GLOBALS['_INC_PUBLIC']++; |
| 3449 | 3448 | |
| 3450 | 3449 | // fix #4235 |
| 3451 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3450 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3452 | 3451 | |
| 3453 | 3452 | |
| 3454 | 3453 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3455 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3454 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3456 | 3455 | |
| 3457 | 3456 | $page = evaluer_fond($f, $contexte, $connect); |
| 3458 | 3457 | if ($page === '') { |
@@ -3537,7 +3536,7 @@ discard block |
||
| 3537 | 3536 | * @return array|string |
| 3538 | 3537 | */ |
| 3539 | 3538 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3540 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3539 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3541 | 3540 | if (!$pathinfo) { |
| 3542 | 3541 | return $f; |
| 3543 | 3542 | } |