@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 23 | 23 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 24 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 24 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | if ($dir) { |
| 379 | 379 | $dir .= '/'; |
| 380 | 380 | } |
| 381 | - $dir .= 'procure:' . $procure['nom']; |
|
| 381 | + $dir .= 'procure:'.$procure['nom']; |
|
| 382 | 382 | |
| 383 | 383 | $procure['etat'] = '?'; |
| 384 | 384 | $procure['dir_type'] = $resume['dir_type']; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | $plug = $resume['dir']; |
| 559 | 559 | $k = $infos[$dir_type][$plug]; |
| 560 | 560 | |
| 561 | - $plug = constant($dir_type) . $plug; |
|
| 561 | + $plug = constant($dir_type).$plug; |
|
| 562 | 562 | if (!isset($msg[$p])) { |
| 563 | 563 | if (isset($resume['erreur']) && $resume['erreur']) { |
| 564 | 564 | $msg[$p] = [$resume['erreur']]; |
@@ -601,10 +601,10 @@ discard block |
||
| 601 | 601 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 602 | 602 | } elseif (!$raw) { |
| 603 | 603 | foreach ($list as $plug => $msg) { |
| 604 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 604 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 606 | 606 | } |
| 607 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 607 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 608 | 608 | } |
| 609 | 609 | if ($raz) { |
| 610 | 610 | effacer_meta('plugin_erreur_activation'); |
@@ -718,13 +718,13 @@ discard block |
||
| 718 | 718 | if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) { |
| 719 | 719 | return _T("plugin_{$balise}_{$type}", [ |
| 720 | 720 | 'plugin' => $nom, |
| 721 | - 'version' => ' ≥ ' . $minimum |
|
| 721 | + 'version' => ' ≥ '.$minimum |
|
| 722 | 722 | ]); |
| 723 | 723 | } |
| 724 | 724 | if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) { |
| 725 | 725 | return _T("plugin_{$balise}_{$type}", [ |
| 726 | 726 | 'plugin' => $nom, |
| 727 | - 'version' => ' > ' . $minimum |
|
| 727 | + 'version' => ' > '.$minimum |
|
| 728 | 728 | ]); |
| 729 | 729 | } |
| 730 | 730 | } |
@@ -733,13 +733,13 @@ discard block |
||
| 733 | 733 | if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) { |
| 734 | 734 | return _T("plugin_{$balise}_{$type}", [ |
| 735 | 735 | 'plugin' => $nom, |
| 736 | - 'version' => ' ≤ ' . $maximum |
|
| 736 | + 'version' => ' ≤ '.$maximum |
|
| 737 | 737 | ]); |
| 738 | 738 | } |
| 739 | 739 | if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) { |
| 740 | 740 | return _T("plugin_{$balise}_plugin", [ |
| 741 | 741 | 'plugin' => $nom, |
| 742 | - 'version' => ' < ' . $maximum |
|
| 742 | + 'version' => ' < '.$maximum |
|
| 743 | 743 | ]); |
| 744 | 744 | } |
| 745 | 745 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | include_spip('inc/charger_plugin'); |
| 759 | 759 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 760 | 760 | }*/ |
| 761 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 761 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($plugin_valides as $p => $resume) { |
| 858 | 858 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 859 | 859 | if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') { |
| 860 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 860 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 861 | 861 | } |
| 862 | 862 | if ($resume['dir']) { |
| 863 | 863 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $header = strtolower(implode(',', $header)); |
| 883 | 883 | if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) { |
| 884 | 884 | ecrire_fichier( |
| 885 | - _DIR_VAR . 'config.txt', |
|
| 886 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 885 | + _DIR_VAR.'config.txt', |
|
| 886 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 887 | 887 | ); |
| 888 | 888 | } else { |
| 889 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 889 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 890 | 890 | } |
| 891 | 891 | // generer charger_plugins_chemin.php |
| 892 | 892 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | // definir le plugin, donc le path avant l'include du fichier options |
| 941 | 941 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 942 | 942 | |
| 943 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 943 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 944 | 944 | |
| 945 | 945 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 946 | 946 | if ( |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if (!$info['chemin']) { |
| 952 | 952 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 953 | 953 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 954 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 954 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 955 | 955 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 956 | } |
| 957 | 957 | } |
@@ -973,13 +973,13 @@ discard block |
||
| 973 | 973 | $dir = ''; |
| 974 | 974 | } |
| 975 | 975 | if (strlen($dir)) { |
| 976 | - $dir = rtrim($dir, '/') . '/'; |
|
| 976 | + $dir = rtrim($dir, '/').'/'; |
|
| 977 | 977 | } |
| 978 | 978 | if (!isset($chemin['type']) || $chemin['type'] == 'public') { |
| 979 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 980 | 980 | } |
| 981 | 981 | if (!isset($chemin['type']) || $chemin['type'] == 'prive') { |
| 982 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | } |
@@ -988,11 +988,11 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | if (count($chemins['public']) || count($chemins['prive'])) { |
| 991 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 991 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 992 | 992 | ',', |
| 993 | 993 | array_reverse($chemins['public']) |
| 994 | - ) . "]);\n" |
|
| 995 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 994 | + )."]);\n" |
|
| 995 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | && !str_contains($dir, ':') |
| 1042 | 1042 | && file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1043 | 1043 | ) { |
| 1044 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1044 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1045 | 1045 | $info[$charge] = [$file]; |
| 1046 | 1046 | } |
| 1047 | 1047 | } |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | ) { |
| 1057 | 1057 | unset($info[$charge][$k]); |
| 1058 | 1058 | } else { |
| 1059 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1059 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1060 | 1060 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | } |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1069 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1070 | 1070 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1071 | 1071 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1072 | 1072 | |
@@ -1101,12 +1101,12 @@ discard block |
||
| 1101 | 1101 | define("_UPDATED_$nom", $val); |
| 1102 | 1102 | define("_UPDATED_md5_$nom", $md5); |
| 1103 | 1103 | } |
| 1104 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1104 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1105 | 1105 | |
| 1106 | 1106 | return |
| 1107 | 1107 | "if (!function_exists('$nom')) {\n" |
| 1108 | 1108 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1109 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1109 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1110 | 1110 | . "}\n"; |
| 1111 | 1111 | } |
| 1112 | 1112 | |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1130 | 1130 | include_once(_CACHE_PLUGINS_OPT); |
| 1131 | 1131 | } else { |
| 1132 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1132 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } |
| 1135 | 1135 | |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1167 | 1167 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1168 | 1168 | $plug = $plugin_valides[$p]['dir']; |
| 1169 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1169 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1170 | 1170 | if (isset($info['pipeline']) && is_array($info['pipeline'])) { |
| 1171 | 1171 | foreach ($info['pipeline'] as $pipe) { |
| 1172 | 1172 | $nom = $pipe['nom']; |
@@ -1200,7 +1200,7 @@ discard block |
||
| 1200 | 1200 | } |
| 1201 | 1201 | if (isset($pipe['inclure'])) { |
| 1202 | 1202 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1203 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1203 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1204 | 1204 | } |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $prepend_code['taches_generales_cron'] = ''; |
| 1211 | 1211 | } |
| 1212 | 1212 | foreach ($info['genie'] as $genie) { |
| 1213 | - $nom = $prefix . $genie['nom']; |
|
| 1213 | + $nom = $prefix.$genie['nom']; |
|
| 1214 | 1214 | $periode = max(60, intval($genie['periode'])); |
| 1215 | 1215 | if (charger_fonction($nom, 'genie', true)) { |
| 1216 | 1216 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1228,13 +1228,13 @@ discard block |
||
| 1228 | 1228 | } |
| 1229 | 1229 | foreach ($info['style'] as $style) { |
| 1230 | 1230 | if (isset($style['path']) && $style['path']) { |
| 1231 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1231 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1232 | 1232 | } else { |
| 1233 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1233 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1234 | 1234 | } |
| 1235 | 1235 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1236 | 1236 | if (isset($style['media']) && strlen($style['media'])) { |
| 1237 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1237 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | $code .= "/>';\n"; |
| 1240 | 1240 | if ($style['type'] != 'prive') { |
@@ -1254,9 +1254,9 @@ discard block |
||
| 1254 | 1254 | if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) { |
| 1255 | 1255 | foreach ($info['script'] as $script) { |
| 1256 | 1256 | if (isset($script['path']) && $script['path']) { |
| 1257 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1257 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1258 | 1258 | } else { |
| 1259 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1259 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1262 | 1262 | if ($script['type'] != 'prive') { |
@@ -1319,10 +1319,10 @@ discard block |
||
| 1319 | 1319 | unset($GLOBALS['spip_pipeline']['all']); |
| 1320 | 1320 | $all_pipes = trim(array_shift($a)); |
| 1321 | 1321 | if ($all_pipes) { |
| 1322 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1322 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | if (count($a)) { |
| 1325 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1325 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | } |
| 1328 | 1328 | $content = ''; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1340 | 1340 | foreach ($pipe as $fonc) { |
| 1341 | 1341 | $fonc = trim($fonc); |
| 1342 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1342 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1343 | 1343 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1344 | 1344 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1345 | 1345 | $file = "'$file'"; |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | if (defined($root_dir)) { |
| 1351 | 1351 | $dir = $root_dir; |
| 1352 | 1352 | } |
| 1353 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1353 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1354 | 1354 | $file = str_replace("''.", '', $file); |
| 1355 | 1355 | $file = str_replace(constant($dir), '', $file); |
| 1356 | 1356 | } |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | $content .= "// Pipeline $action \n" |
| 1364 | 1364 | . "function execute_pipeline_$action(&\$val){\n" |
| 1365 | 1365 | . $s_inc |
| 1366 | - . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1366 | + . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1367 | 1367 | . $s_call |
| 1368 | 1368 | . "return \$val;\n}\n"; |
| 1369 | 1369 | } |
@@ -1419,9 +1419,9 @@ discard block |
||
| 1419 | 1419 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1420 | 1420 | if (_IS_CLI) { |
| 1421 | 1421 | include_spip('inc/filtres'); |
| 1422 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1423 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1424 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1422 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1423 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1424 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1425 | 1425 | $trace, |
| 1426 | 1426 | "\n"; |
| 1427 | 1427 | } |
@@ -1456,15 +1456,15 @@ discard block |
||
| 1456 | 1456 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1459 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1460 | 1460 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1461 | 1461 | // si pas de modif on ne touche pas au fichier initial |
| 1462 | 1462 | if (file_exists($nom)) { |
| 1463 | 1463 | if (str_ends_with($nom, '.php')) { |
| 1464 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1464 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1465 | 1465 | } |
| 1466 | 1466 | else { |
| 1467 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1467 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1468 | 1468 | } |
| 1469 | 1469 | file_put_contents($fichier_tmp, $contenu); |
| 1470 | 1470 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $n = (int) sql_errno(); |
| 61 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 61 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 62 | 62 | |
| 63 | 63 | return $n ?: 1; |
| 64 | 64 | } |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | // erreur SQL a afficher |
| 102 | 102 | $raison = minipres( |
| 103 | 103 | _T('info_travaux_titre'), |
| 104 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 104 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 105 | 105 | ); |
| 106 | 106 | } elseif (@$raison['statut']) { |
| 107 | 107 | // un simple visiteur n'a pas acces a l'espace prive |
| 108 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 108 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 109 | 109 | $est_connecte = (!empty($GLOBALS['visiteur_session']['login']) && !empty($GLOBALS['visiteur_session']['statut'])); // idem test balise #URL_LOGOUT |
| 110 | 110 | $raison = minipres( |
| 111 | 111 | _T('avis_erreur_connexion'), |
| 112 | 112 | _T('avis_erreur_visiteur') |
| 113 | 113 | // Lien vers le site public |
| 114 | - . '<br /><a href="' . url_de_base() . '">' . _T('login_retour_public') . '</a>' |
|
| 114 | + . '<br /><a href="'.url_de_base().'">'._T('login_retour_public').'</a>' |
|
| 115 | 115 | // Si la personne est connectée, lien de déconnexion ramenant vers la page de login |
| 116 | - . ($est_connecte ? ' | <a href="' . generer_url_public('', 'action=logout&logout=prive') . '">' . _T('icone_deconnecter') . '</a>' : '') |
|
| 116 | + . ($est_connecte ? ' | <a href="'.generer_url_public('', 'action=logout&logout=prive').'">'._T('icone_deconnecter').'</a>' : '') |
|
| 117 | 117 | ); |
| 118 | 118 | } else { |
| 119 | 119 | // auteur en fin de droits ... |
@@ -201,8 +201,7 @@ discard block |
||
| 201 | 201 | $where = (is_numeric($id_auteur) |
| 202 | 202 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 203 | 203 | ) ? |
| 204 | - "id_auteur=$id_auteur" : |
|
| 205 | - (strlen((string) $GLOBALS['connect_login']) ? 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text') : ''); |
|
| 204 | + "id_auteur=$id_auteur" : (strlen((string) $GLOBALS['connect_login']) ? 'login='.sql_quote($GLOBALS['connect_login'], '', 'text') : ''); |
|
| 206 | 205 | |
| 207 | 206 | if (!$where) { |
| 208 | 207 | return ''; |
@@ -327,7 +326,7 @@ discard block |
||
| 327 | 326 | * @return string |
| 328 | 327 | */ |
| 329 | 328 | function auth_a_loger() { |
| 330 | - $redirect = generer_url_public('login', 'url=' . rawurlencode((string) self('&', true)), true); |
|
| 329 | + $redirect = generer_url_public('login', 'url='.rawurlencode((string) self('&', true)), true); |
|
| 331 | 330 | |
| 332 | 331 | // un echec au "bonjour" (login initial) quand le statut est |
| 333 | 332 | // inconnu signale sans doute un probleme de cookies |
@@ -363,7 +362,7 @@ discard block |
||
| 363 | 362 | $date ??= date('Y-m-d H:i:s'); |
| 364 | 363 | |
| 365 | 364 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 366 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . (int) $row['id_auteur']); |
|
| 365 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.(int) $row['id_auteur']); |
|
| 367 | 366 | $row['en_ligne'] = $date; |
| 368 | 367 | } |
| 369 | 368 | |
@@ -471,7 +470,7 @@ discard block |
||
| 471 | 470 | if ( |
| 472 | 471 | !$login |
| 473 | 472 | || !($login_base = auth_retrouver_login($login, $serveur)) |
| 474 | - || !($row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur)) |
|
| 473 | + || !($row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur)) |
|
| 475 | 474 | ) { |
| 476 | 475 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 477 | 476 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
@@ -581,7 +580,7 @@ discard block |
||
| 581 | 580 | sql_updateq( |
| 582 | 581 | 'spip_auteurs', |
| 583 | 582 | ['prefs' => serialize($p)], |
| 584 | - 'id_auteur=' . (int) $auteur['id_auteur'] |
|
| 583 | + 'id_auteur='.(int) $auteur['id_auteur'] |
|
| 585 | 584 | ); |
| 586 | 585 | |
| 587 | 586 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -745,7 +744,7 @@ discard block |
||
| 745 | 744 | return false; |
| 746 | 745 | } |
| 747 | 746 | |
| 748 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 747 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 749 | 748 | |
| 750 | 749 | if (!$row) { |
| 751 | 750 | if ( |
@@ -801,11 +800,11 @@ discard block |
||
| 801 | 800 | $retour = $retour ?: _T('icone_retour'); |
| 802 | 801 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 803 | 802 | if ($url) { |
| 804 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 803 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 805 | 804 | } |
| 806 | 805 | |
| 807 | 806 | if ($lien) { |
| 808 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 807 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 809 | 808 | } |
| 810 | 809 | include_spip('inc/minipres'); |
| 811 | 810 | echo minipres($pb, $corps); |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (is_null($liste_langues)) { |
| 46 | - $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 46 | + $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 47 | 47 | } else { |
| 48 | 48 | if (is_array($liste_langues)) { |
| 49 | 49 | $liste_langues = implode(',', $liste_langues); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 52 | + $liste_langues = ','.$liste_langues.','; |
|
| 53 | 53 | |
| 54 | 54 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 55 | 55 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | } |
| 192 | 192 | foreach ($langues as $l) { |
| 193 | 193 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 194 | - $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n"; |
|
| 194 | + $ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n"; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (!test_espace_prive()) { |
@@ -209,21 +209,20 @@ discard block |
||
| 209 | 209 | $base, |
| 210 | 210 | $cible, |
| 211 | 211 | (select_langues($nom_select, $change, $ret) |
| 212 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 212 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 213 | 213 | " method='post'" |
| 214 | 214 | ); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | function select_langues($nom_select, $change, $options, $label = '') { |
| 218 | 218 | static $cpt = 0; |
| 219 | - $id = 'menu_langues' . $cpt++; |
|
| 219 | + $id = 'menu_langues'.$cpt++; |
|
| 220 | 220 | |
| 221 | 221 | return |
| 222 | - "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' . |
|
| 222 | + "<label for='$id'>".($label ?: _T('info_langues')).'</label> '. |
|
| 223 | 223 | "<select name='$nom_select' id='$id' " |
| 224 | 224 | . ((test_espace_prive()) ? |
| 225 | - (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : |
|
| 226 | - ("class='forml menu_langues'")) |
|
| 225 | + (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : ("class='forml menu_langues'")) |
|
| 227 | 226 | . $change |
| 228 | 227 | . ">\n" |
| 229 | 228 | . $options |
@@ -346,7 +345,7 @@ discard block |
||
| 346 | 345 | isset($GLOBALS['meta']['langue_site']) |
| 347 | 346 | && (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 348 | 347 | ) { |
| 349 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 348 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 350 | 349 | } |
| 351 | 350 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 352 | 351 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -458,7 +457,7 @@ discard block |
||
| 458 | 457 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 459 | 458 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 460 | 459 | $GLOBALS['meta']['langue_site'] = $tout = |
| 461 | - (!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,")) |
|
| 460 | + (!$all_langs || str_contains(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,")) |
|
| 462 | 461 | ? _LANGUE_PAR_DEFAUT |
| 463 | 462 | : substr((string) $all_langs, 0, strpos((string) $all_langs, ',')); |
| 464 | 463 | ecrire_meta('langue_site', $tout); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return $x . $texte; |
|
| 66 | + return $x.$texte; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 141 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 141 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 142 | 142 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | $texte = substr_replace($texte, $x, $pos, 0); |
| 172 | 172 | // pas de preview en fenetre enfant |
| 173 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 173 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes((string) $GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 174 | 174 | if ((!$pos = stripos($texte, '<head')) || (!$pos = strpos($texte, '>', $pos))) { |
| 175 | 175 | $pos = -1; |
| 176 | 176 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 243 | 243 | if (($p = strpos($texte, '</body>')) !== false) { |
| 244 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 244 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 245 | 245 | } else { |
| 246 | 246 | $texte .= $code; |
| 247 | 247 | } |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | foreach (['script', 'iframe'] as $tag) { |
| 107 | 107 | if ( |
| 108 | 108 | stripos($t, (string) "<$tag") !== false |
| 109 | - && preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER) |
|
| 109 | + && preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER) |
|
| 110 | 110 | ) { |
| 111 | 111 | foreach ($r as $regs) { |
| 112 | 112 | $t = str_replace( |
| 113 | 113 | $regs[0], |
| 114 | - "<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', |
|
| 114 | + "<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>', |
|
| 115 | 115 | $t |
| 116 | 116 | ); |
| 117 | 117 | } |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // echapper les tags asp/php |
| 167 | - $t = str_replace('<' . '%', '<%', $arg); |
|
| 167 | + $t = str_replace('<'.'%', '<%', $arg); |
|
| 168 | 168 | |
| 169 | 169 | // echapper le php |
| 170 | - $t = str_replace('<' . '?', '<?', $t); |
|
| 170 | + $t = str_replace('<'.'?', '<?', $t); |
|
| 171 | 171 | |
| 172 | 172 | // echapper le < script language=php > |
| 173 | 173 | $t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '<\1', $t); |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | // Reinserer les echappements des modeles |
| 191 | 191 | if (defined('_PROTEGE_JS_MODELES')) { |
| 192 | - $t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES); |
|
| 192 | + $t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES); |
|
| 193 | 193 | } |
| 194 | 194 | if (defined('_PROTEGE_PHP_MODELES')) { |
| 195 | - $t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES); |
|
| 195 | + $t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | return $dejavu[$mode_filtre][$arg] = $t; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | define('_TYPO_PROTEGER', "!':;?~%-"); |
| 291 | 291 | define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8"); |
| 292 | 292 | |
| 293 | -define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS'); |
|
| 293 | +define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS'); |
|
| 294 | 294 | |
| 295 | 295 | /** |
| 296 | 296 | * Corrige la typographie |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | function spip_setcookie( |
| 53 | 53 | string $name = '', |
| 54 | 54 | string $value = '', |
| 55 | - int|array $expires_or_options = 0, |
|
| 55 | + int | array $expires_or_options = 0, |
|
| 56 | 56 | string $path = '', |
| 57 | 57 | string $domain = '', |
| 58 | 58 | bool $secure = false, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // in fine renommer le prefixe si besoin |
| 103 | 103 | if (str_starts_with($name, 'spip_')) { |
| 104 | - $name = $GLOBALS['cookie_prefix'] . '_' . substr($name, 5); |
|
| 104 | + $name = $GLOBALS['cookie_prefix'].'_'.substr($name, 5); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | #spip_log("cookie('$name', '$value', " . json_encode($options, true) . ")", "cookies"); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | foreach ($_COOKIE as $name => $value) { |
| 161 | 161 | if (substr($name, 0, $prefix_long) == $cookie_prefix) { |
| 162 | - $spipname = preg_replace('/^' . $cookie_prefix . '_/', 'spip_', $name); |
|
| 162 | + $spipname = preg_replace('/^'.$cookie_prefix.'_/', 'spip_', $name); |
|
| 163 | 163 | $_COOKIE[$spipname] = $value; |
| 164 | 164 | $GLOBALS[$spipname] = $value; |
| 165 | 165 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // confirmation du deplacement |
| 117 | 117 | if ( |
| 118 | 118 | sql_table_exists('spip_breves') |
| 119 | - && ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet)) |
|
| 119 | + && ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.(int) $id_objet)) |
|
| 120 | 120 | && $contient_breves > 0 |
| 121 | 121 | ) { |
| 122 | 122 | // FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | ); |
| 131 | 131 | $confirm .= "\n<div class='confirmer_deplacement verdana2'>" |
| 132 | 132 | . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>" |
| 133 | - . $scb . |
|
| 133 | + . $scb. |
|
| 134 | 134 | "</label></div></div>\n"; |
| 135 | 135 | } else { |
| 136 | 136 | $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n"; |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | $form .= $confirm; |
| 140 | 140 | if ($actionable) { |
| 141 | 141 | if (str_contains($form, '<select')) { |
| 142 | - $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 143 | - . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>' |
|
| 142 | + $form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 143 | + . '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>' |
|
| 144 | 144 | . '</div>'; |
| 145 | 145 | } |
| 146 | - $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form; |
|
| 146 | + $form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form; |
|
| 147 | 147 | if ($action = charger_fonction("editer_$objet", 'action', true)) { |
| 148 | 148 | $form = generer_action_auteur( |
| 149 | 149 | "editer_$objet", |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | include_spip('inc/presentation'); |
| 171 | 171 | |
| 172 | - return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur(); |
|
| 172 | + return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur(); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if ($statut == 'nouveau') { |
| 246 | 246 | if ($attente) { |
| 247 | 247 | $statut = $attente; |
| 248 | - $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')'; |
|
| 248 | + $plus = ' ('._T('info_statut_auteur_a_confirmer').')'; |
|
| 249 | 249 | } else { |
| 250 | 250 | return _T('info_statut_auteur_a_confirmer'); |
| 251 | 251 | } |
@@ -258,16 +258,16 @@ discard block |
||
| 258 | 258 | '5poubelle' => _T('texte_statut_poubelle'), // bouh |
| 259 | 259 | ]; |
| 260 | 260 | if (isset($recom[$statut])) { |
| 261 | - return $recom[$statut] . $plus; |
|
| 261 | + return $recom[$statut].$plus; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | // retrouver directement par le statut sinon |
| 265 | 265 | if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) { |
| 266 | 266 | if (isset($recom[$t])) { |
| 267 | - return $recom[$t] . $plus; |
|
| 267 | + return $recom[$t].$plus; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - return _T($t) . $plus; |
|
| 270 | + return _T($t).$plus; |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // si on a pas reussi a le traduire, retournons la chaine telle quelle |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) { |
| 389 | 389 | $in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0) |
| 390 | - ? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']) |
|
| 390 | + ? ' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']) |
|
| 391 | 391 | : ''; |
| 392 | 392 | |
| 393 | 393 | // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement |
@@ -426,13 +426,13 @@ discard block |
||
| 426 | 426 | $parts = parse_url($virtuel); |
| 427 | 427 | if (!empty($parts['query']) && str_contains($parts['query'], ']')) { |
| 428 | 428 | $query = str_replace(['[', ']'], [urlencode('['), urlencode(']')], $parts['query']); |
| 429 | - $virtuel = str_replace('?' . $parts['query'], "?$query", $virtuel); |
|
| 429 | + $virtuel = str_replace('?'.$parts['query'], "?$query", $virtuel); |
|
| 430 | 430 | } |
| 431 | 431 | if ($virtuel !== $joli) { |
| 432 | - $joli = propre('[' . $joli . ' -> ' . $virtuel . ']'); |
|
| 432 | + $joli = propre('['.$joli.' -> '.$virtuel.']'); |
|
| 433 | 433 | } |
| 434 | 434 | else { |
| 435 | - $joli = propre('[->' . $virtuel . ']'); |
|
| 435 | + $joli = propre('[->'.$virtuel.']'); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | return $joli; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | $clic = http_img_pack('rss-16.png', 'RSS', '', $title); |
| 463 | 463 | |
| 464 | 464 | $url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true); |
| 465 | - return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>"; |
|
| 465 | + return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>"; |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | ); |
| 535 | 535 | |
| 536 | 536 | if ($alertes = array_filter($alertes)) { |
| 537 | - return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" . |
|
| 537 | + return "<div class='wrap-messages-alertes'><div class='messages-alertes'>". |
|
| 538 | 538 | implode(' | ', $alertes) |
| 539 | 539 | . '</div></div>'; |
| 540 | 540 | } |
@@ -570,13 +570,13 @@ discard block |
||
| 570 | 570 | */ |
| 571 | 571 | function afficher_plus_info($lien, $titre = '+', $titre_lien = '') { |
| 572 | 572 | $titre = attribut_html($titre); |
| 573 | - $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" . |
|
| 574 | - http_img_pack('information-16.png', $titre) . '</a>'; |
|
| 573 | + $icone = "\n<a href='$lien' title='$titre' class='plus_info'>". |
|
| 574 | + http_img_pack('information-16.png', $titre).'</a>'; |
|
| 575 | 575 | |
| 576 | 576 | if (!$titre_lien) { |
| 577 | 577 | return $icone; |
| 578 | 578 | } else { |
| 579 | - return $icone . "\n<a href='$lien'>$titre_lien</a>"; |
|
| 579 | + return $icone."\n<a href='$lien'>$titre_lien</a>"; |
|
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 40 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 40 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 41 | 41 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 42 | 42 | } |
| 43 | - $fichier = $dir_tex . md5(trim((string) $tex)) . $ext; |
|
| 43 | + $fichier = $dir_tex.md5(trim((string) $tex)).$ext; |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | // Aller chercher l'image sur le serveur |
| 47 | 47 | if (!@file_exists($fichier) && $server) { |
| 48 | - spip_log($url = $server . '?' . rawurlencode((string) $tex)); |
|
| 48 | + spip_log($url = $server.'?'.rawurlencode((string) $tex)); |
|
| 49 | 49 | include_spip('inc/distant'); |
| 50 | 50 | recuperer_url($url, ['file' => $fichier]); |
| 51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return implode('', file($fichier)); |
| 60 | 60 | } // TeX |
| 61 | 61 | else { |
| 62 | - [, , , $size] = @spip_getimagesize($fichier); |
|
| 62 | + [,,, $size] = @spip_getimagesize($fichier); |
|
| 63 | 63 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 64 | 64 | |
| 65 | 65 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $expression = str_replace('&', '&', $expression); |
| 126 | 126 | } |
| 127 | 127 | $echap = produire_image_math($expression); |
| 128 | - $echap = ($t['pre'] ?? '') . $echap . ($t['post'] ?? ''); |
|
| 128 | + $echap = ($t['pre'] ?? '').$echap.($t['post'] ?? ''); |
|
| 129 | 129 | $echap = CollecteurHtmlTag::echappementHtmlBase64($echap, $source); |
| 130 | 130 | |
| 131 | 131 | $pos = strpos($texte_milieu, (string) $regs[0]); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * Mot de passe |
| 31 | 31 | **/ |
| 32 | 32 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 33 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 33 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 34 | 34 | |
| 35 | 35 | mt_srand($seed); |
| 36 | 36 | $s = ''; |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | if (!$s) { |
| 42 | 42 | $s = random_int(0, mt_getrandmax()); |
| 43 | 43 | } |
| 44 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 44 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 45 | 45 | } |
| 46 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 46 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 47 | 47 | $x = $r['r'] & 63; |
| 48 | 48 | if ($x < 10) { |
| 49 | 49 | $x = chr($x + 48); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | static $seeded; |
| 77 | 77 | |
| 78 | 78 | if (!$seeded) { |
| 79 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 79 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 80 | 80 | mt_srand($seed); |
| 81 | 81 | $seeded = true; |
| 82 | 82 | } |
@@ -162,10 +162,10 @@ discard block |
||
| 162 | 162 | ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); |
| 163 | 163 | } |
| 164 | 164 | } else { |
| 165 | - $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . (int) $id_auteur); |
|
| 165 | + $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.(int) $id_auteur); |
|
| 166 | 166 | if (!$low_sec) { |
| 167 | 167 | $low_sec = creer_pass_aleatoire(); |
| 168 | - sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . (int) $id_auteur); |
|
| 168 | + sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.(int) $id_auteur); |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) { |
| 217 | 217 | $id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0; |
| 218 | 218 | $cle = afficher_low_sec($id_auteur, "$script/$format $fond $args"); |
| 219 | - $path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : ''); |
|
| 219 | + $path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : ''); |
|
| 220 | 220 | |
| 221 | 221 | return generer_url_api($script, $path, $args, $no_entities, $public); |
| 222 | 222 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * Clé |
| 235 | 235 | **/ |
| 236 | 236 | function afficher_low_sec($id_auteur, $action = '') { |
| 237 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 237 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if (!$id_auteur = (int) $id_auteur) { |
| 266 | 266 | return; |
| 267 | 267 | } // jamais trop prudent ;) |
| 268 | - sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . (int) $id_auteur); |
|
| 268 | + sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.(int) $id_auteur); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | * - void sinon. |
| 284 | 284 | **/ |
| 285 | 285 | function ecrire_acces() { |
| 286 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 287 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 286 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 287 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 288 | 288 | |
| 289 | 289 | // Cette variable de configuration peut etre posee par un plugin |
| 290 | 290 | // par exemple acces_restreint ; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | (!isset($GLOBALS['meta']['creer_htpasswd']) || $GLOBALS['meta']['creer_htpasswd'] != 'oui') && !@file_exists($htaccess) |
| 294 | 294 | ) { |
| 295 | 295 | spip_unlink($htpasswd); |
| 296 | - spip_unlink($htpasswd . '-admin'); |
|
| 296 | + spip_unlink($htpasswd.'-admin'); |
|
| 297 | 297 | return; |
| 298 | 298 | } |
| 299 | 299 | |
@@ -321,10 +321,10 @@ discard block |
||
| 321 | 321 | $pwd_all = ''; // login:htpass pour tous |
| 322 | 322 | $pwd_admin = ''; // login:htpass pour les admins |
| 323 | 323 | |
| 324 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 324 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 325 | 325 | while ($row = sql_fetch($res)) { |
| 326 | 326 | if (strlen((string) $row['login']) && strlen((string) $row['htpass'])) { |
| 327 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 327 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 328 | 328 | $pwd_all .= $ligne; |
| 329 | 329 | if ($row['statut'] == '0minirezo') { |
| 330 | 330 | $pwd_admin .= $ligne; |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | * @return boolean |
| 368 | 368 | */ |
| 369 | 369 | function verifier_htaccess($rep, $force = false) { |
| 370 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 370 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 371 | 371 | if ((@file_exists($htaccess) || defined('_TEST_DIRS')) && !$force) { |
| 372 | 372 | return true; |
| 373 | 373 | } |
@@ -394,17 +394,17 @@ discard block |
||
| 394 | 394 | fwrite($ht, $deny); |
| 395 | 395 | fclose($ht); |
| 396 | 396 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 397 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 397 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 398 | 398 | if ($ht = @fopen($t, 'w')) { |
| 399 | 399 | @fclose($ht); |
| 400 | 400 | include_spip('inc/distant'); |
| 401 | 401 | $t = substr($t, strlen(_DIR_RACINE)); |
| 402 | - $t = url_de_base() . $t; |
|
| 402 | + $t = url_de_base().$t; |
|
| 403 | 403 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 404 | 404 | $ht = ($ht['status'] ?? null) === 403; |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 407 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 408 | 408 | |
| 409 | 409 | return $ht; |
| 410 | 410 | } |
@@ -430,11 +430,11 @@ discard block |
||
| 430 | 430 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 431 | 431 | $dirs[] = ['extension' => 'distant']; |
| 432 | 432 | foreach ($dirs as $e) { |
| 433 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 433 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 434 | 434 | if ($f) { |
| 435 | 435 | verifier_htaccess($dir); |
| 436 | 436 | } else { |
| 437 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 437 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | } |