@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 24 | 24 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 25 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 25 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if ($dir) { |
| 382 | 382 | $dir .= '/'; |
| 383 | 383 | } |
| 384 | - $dir .= 'procure:' . $procure['nom']; |
|
| 384 | + $dir .= 'procure:'.$procure['nom']; |
|
| 385 | 385 | |
| 386 | 386 | $procure['etat'] = '?'; |
| 387 | 387 | $procure['dir_type'] = $resume['dir_type']; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $plug = $resume['dir']; |
| 566 | 566 | $k = $infos[$dir_type][$plug]; |
| 567 | 567 | |
| 568 | - $plug = constant($dir_type) . $plug; |
|
| 568 | + $plug = constant($dir_type).$plug; |
|
| 569 | 569 | if (!isset($msg[$p])) { |
| 570 | 570 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 571 | 571 | $msg[$p] = [$resume['erreur']]; |
@@ -608,10 +608,10 @@ discard block |
||
| 608 | 608 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 609 | 609 | } elseif (!$raw) { |
| 610 | 610 | foreach ($list as $plug => $msg) { |
| 611 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 611 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 613 | 613 | } |
| 614 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 614 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 615 | 615 | } |
| 616 | 616 | if ($raz) { |
| 617 | 617 | effacer_meta('plugin_erreur_activation'); |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 726 | 726 | return _T("plugin_{$balise}_{$type}", [ |
| 727 | 727 | 'plugin' => $nom, |
| 728 | - 'version' => ' ≥ ' . $minimum |
|
| 728 | + 'version' => ' ≥ '.$minimum |
|
| 729 | 729 | ]); |
| 730 | 730 | } |
| 731 | 731 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 732 | 732 | return _T("plugin_{$balise}_{$type}", [ |
| 733 | 733 | 'plugin' => $nom, |
| 734 | - 'version' => ' > ' . $minimum |
|
| 734 | + 'version' => ' > '.$minimum |
|
| 735 | 735 | ]); |
| 736 | 736 | } |
| 737 | 737 | } |
@@ -740,13 +740,13 @@ discard block |
||
| 740 | 740 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 741 | 741 | return _T("plugin_{$balise}_{$type}", [ |
| 742 | 742 | 'plugin' => $nom, |
| 743 | - 'version' => ' ≤ ' . $maximum |
|
| 743 | + 'version' => ' ≤ '.$maximum |
|
| 744 | 744 | ]); |
| 745 | 745 | } |
| 746 | 746 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 747 | 747 | return _T("plugin_{$balise}_plugin", [ |
| 748 | 748 | 'plugin' => $nom, |
| 749 | - 'version' => ' < ' . $maximum |
|
| 749 | + 'version' => ' < '.$maximum |
|
| 750 | 750 | ]); |
| 751 | 751 | } |
| 752 | 752 | } |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | include_spip('inc/charger_plugin'); |
| 766 | 766 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 767 | 767 | }*/ |
| 768 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 768 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | foreach ($plugin_valides as $p => $resume) { |
| 866 | 866 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 867 | 867 | if (!str_starts_with($p, 'PHP:') and $p !== 'PHP') { |
| 868 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 868 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 869 | 869 | } |
| 870 | 870 | if ($resume['dir']) { |
| 871 | 871 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -890,11 +890,11 @@ discard block |
||
| 890 | 890 | $header = strtolower(implode(',', $header)); |
| 891 | 891 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 892 | 892 | ecrire_fichier( |
| 893 | - _DIR_VAR . 'config.txt', |
|
| 894 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 893 | + _DIR_VAR.'config.txt', |
|
| 894 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 895 | 895 | ); |
| 896 | 896 | } else { |
| 897 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 897 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 898 | 898 | } |
| 899 | 899 | // generer charger_plugins_chemin.php |
| 900 | 900 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | // definir le plugin, donc le path avant l'include du fichier options |
| 949 | 949 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 950 | 950 | |
| 951 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 951 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 952 | 952 | |
| 953 | 953 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 954 | 954 | if ( |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | if (!$info['chemin']) { |
| 960 | 960 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 961 | 961 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 962 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 962 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 963 | 963 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 964 | 964 | } |
| 965 | 965 | } |
@@ -980,13 +980,13 @@ discard block |
||
| 980 | 980 | $dir = ''; |
| 981 | 981 | } |
| 982 | 982 | if (strlen($dir)) { |
| 983 | - $dir = rtrim($dir, '/') . '/'; |
|
| 983 | + $dir = rtrim($dir, '/').'/'; |
|
| 984 | 984 | } |
| 985 | 985 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 986 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 986 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 987 | 987 | } |
| 988 | 988 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 989 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 989 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | } |
@@ -995,11 +995,11 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | } |
| 997 | 997 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 998 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 998 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 999 | 999 | ',', |
| 1000 | 1000 | array_reverse($chemins['public']) |
| 1001 | - ) . "]);\n" |
|
| 1002 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 1001 | + )."]);\n" |
|
| 1002 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | and !str_contains($dir, ':') // exclure le cas des procure: |
| 1049 | 1049 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1050 | 1050 | ) { |
| 1051 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1051 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1052 | 1052 | $info[$charge] = [$file]; |
| 1053 | 1053 | } |
| 1054 | 1054 | } |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | ) { |
| 1066 | 1066 | unset($info[$charge][$k]); |
| 1067 | 1067 | } else { |
| 1068 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1068 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1069 | 1069 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | } |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1078 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1079 | 1079 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1080 | 1080 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1081 | 1081 | |
@@ -1110,12 +1110,12 @@ discard block |
||
| 1110 | 1110 | define("_UPDATED_$nom", $val); |
| 1111 | 1111 | define("_UPDATED_md5_$nom", $md5); |
| 1112 | 1112 | } |
| 1113 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1113 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1114 | 1114 | |
| 1115 | 1115 | return |
| 1116 | 1116 | "if (!function_exists('$nom')) {\n" |
| 1117 | 1117 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1118 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1118 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1119 | 1119 | . "}\n"; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1139 | 1139 | include_once(_CACHE_PLUGINS_OPT); |
| 1140 | 1140 | } else { |
| 1141 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1141 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1176 | 1176 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1177 | 1177 | $plug = $plugin_valides[$p]['dir']; |
| 1178 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1178 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1179 | 1179 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1180 | 1180 | foreach ($info['pipeline'] as $pipe) { |
| 1181 | 1181 | $nom = $pipe['nom']; |
@@ -1209,7 +1209,7 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | if (isset($pipe['inclure'])) { |
| 1211 | 1211 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1212 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1212 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | $prepend_code['taches_generales_cron'] = ''; |
| 1220 | 1220 | } |
| 1221 | 1221 | foreach ($info['genie'] as $genie) { |
| 1222 | - $nom = $prefix . $genie['nom']; |
|
| 1222 | + $nom = $prefix.$genie['nom']; |
|
| 1223 | 1223 | $periode = max(60, intval($genie['periode'])); |
| 1224 | 1224 | if (charger_fonction($nom, 'genie', true)) { |
| 1225 | 1225 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1237,13 +1237,13 @@ discard block |
||
| 1237 | 1237 | } |
| 1238 | 1238 | foreach ($info['style'] as $style) { |
| 1239 | 1239 | if (isset($style['path']) and $style['path']) { |
| 1240 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1240 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1241 | 1241 | } else { |
| 1242 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1242 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1245 | 1245 | if (isset($style['media']) and strlen($style['media'])) { |
| 1246 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1246 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1247 | 1247 | } |
| 1248 | 1248 | $code .= "/>';\n"; |
| 1249 | 1249 | if ($style['type'] != 'prive') { |
@@ -1263,9 +1263,9 @@ discard block |
||
| 1263 | 1263 | if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) { |
| 1264 | 1264 | foreach ($info['script'] as $script) { |
| 1265 | 1265 | if (isset($script['path']) and $script['path']) { |
| 1266 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1266 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1267 | 1267 | } else { |
| 1268 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1268 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1269 | 1269 | } |
| 1270 | 1270 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1271 | 1271 | if ($script['type'] != 'prive') { |
@@ -1328,10 +1328,10 @@ discard block |
||
| 1328 | 1328 | unset($GLOBALS['spip_pipeline']['all']); |
| 1329 | 1329 | $all_pipes = trim(array_shift($a)); |
| 1330 | 1330 | if ($all_pipes) { |
| 1331 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1331 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | if (count($a)) { |
| 1334 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1334 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | } |
| 1337 | 1337 | $content = ''; |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1349 | 1349 | foreach ($pipe as $fonc) { |
| 1350 | 1350 | $fonc = trim($fonc); |
| 1351 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1351 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1352 | 1352 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1353 | 1353 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1354 | 1354 | $file = "'$file'"; |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | if (defined($root_dir)) { |
| 1360 | 1360 | $dir = $root_dir; |
| 1361 | 1361 | } |
| 1362 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1362 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1363 | 1363 | $file = str_replace("''.", '', $file); |
| 1364 | 1364 | $file = str_replace(constant($dir), '', $file); |
| 1365 | 1365 | } |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | $content .= "// Pipeline $action \n" |
| 1373 | 1373 | . "function execute_pipeline_$action(&\$val){\n" |
| 1374 | 1374 | . $s_inc |
| 1375 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1375 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1376 | 1376 | . $s_call |
| 1377 | 1377 | . "return \$val;\n}\n"; |
| 1378 | 1378 | } |
@@ -1428,9 +1428,9 @@ discard block |
||
| 1428 | 1428 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1429 | 1429 | if (_IS_CLI) { |
| 1430 | 1430 | include_spip('inc/filtres'); |
| 1431 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1432 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1433 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1431 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1432 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1433 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1434 | 1434 | $trace, |
| 1435 | 1435 | "\n"; |
| 1436 | 1436 | } |
@@ -1465,15 +1465,15 @@ discard block |
||
| 1465 | 1465 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1468 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1469 | 1469 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1470 | 1470 | // si pas de modif on ne touche pas au fichier initial |
| 1471 | 1471 | if (file_exists($nom)) { |
| 1472 | 1472 | if (substr($nom, -4) == '.php') { |
| 1473 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1473 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1474 | 1474 | } |
| 1475 | 1475 | else { |
| 1476 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1476 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1477 | 1477 | } |
| 1478 | 1478 | file_put_contents($fichier_tmp, $contenu); |
| 1479 | 1479 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | static $dirs = []; |
| 44 | 44 | $liste = []; |
| 45 | 45 | foreach (creer_chemin() as $dir) { |
| 46 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 46 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 47 | 47 | $dirs[$a] = (is_dir($a) || !$a); |
| 48 | 48 | } |
| 49 | 49 | if ($dirs[$a]) { |
@@ -69,21 +69,21 @@ discard block |
||
| 69 | 69 | **/ |
| 70 | 70 | function chercher_module_lang($module, $lang = '') { |
| 71 | 71 | if ($lang) { |
| 72 | - $lang = '_' . $lang; |
|
| 72 | + $lang = '_'.$lang; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 76 | 76 | if ( |
| 77 | 77 | $f = ($module == 'local' |
| 78 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 79 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 78 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 79 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 80 | 80 | ) { |
| 81 | 81 | return is_array($f) ? $f : [$f]; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 85 | 85 | return (($module == 'local') or strpos($module, '/')) |
| 86 | - ? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false) |
|
| 86 | + ? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false) |
|
| 87 | 87 | : false; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | **/ |
| 108 | 108 | function charger_langue($lang, $module = 'spip') { |
| 109 | 109 | static $langs = []; |
| 110 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 110 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 111 | 111 | if (!isset($langs[$lang])) { |
| 112 | 112 | $langs[$lang] = []; |
| 113 | 113 | if ($lang) { |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | foreach ($langs[$lang] as $l) { |
| 124 | 124 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 125 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 125 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 126 | 126 | $GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang)); |
| 127 | 127 | surcharger_langue($fichiers_lang); |
| 128 | 128 | if ($l !== $lang) { |
| 129 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 129 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 130 | 130 | } |
| 131 | - $GLOBALS['lang_' . $var] = $l; |
|
| 131 | + $GLOBALS['lang_'.$var] = $l; |
|
| 132 | 132 | #spip_log("module de langue : {$module}_$l.php", 'traduire'); |
| 133 | 133 | break; |
| 134 | 134 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | function lire_fichier_langue(string $fichier): array { |
| 148 | 148 | $idx_lang_before = $GLOBALS['idx_lang'] ?? null; |
| 149 | - $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire'; |
|
| 149 | + $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire'; |
|
| 150 | 150 | $GLOBALS['idx_lang'] = $idx_lang_tmp; |
| 151 | 151 | $idx_lang = include $fichier; |
| 152 | 152 | $GLOBALS['idx_lang'] = $idx_lang_before; |
@@ -257,27 +257,27 @@ discard block |
||
| 257 | 257 | } else { |
| 258 | 258 | $modules = ['spip', 'ecrire']; |
| 259 | 259 | $code = $ori; |
| 260 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 260 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $desc = new Description(); |
| 264 | 264 | |
| 265 | 265 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 266 | 266 | foreach ($modules as $module) { |
| 267 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 267 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 268 | 268 | |
| 269 | 269 | if (empty($GLOBALS[$var])) { |
| 270 | 270 | charger_langue($lang, $module); |
| 271 | 271 | // surcharges persos -- on cherche |
| 272 | 272 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 273 | - if (!isset($local['local_' . $lang])) { |
|
| 273 | + if (!isset($local['local_'.$lang])) { |
|
| 274 | 274 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 275 | 275 | $GLOBALS['idx_lang'] = $var; |
| 276 | 276 | // ... (lang/)local_xx.php |
| 277 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 277 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 278 | 278 | } |
| 279 | - if ($local['local_' . $lang]) { |
|
| 280 | - surcharger_langue($local['local_' . $lang]); |
|
| 279 | + if ($local['local_'.$lang]) { |
|
| 280 | + surcharger_langue($local['local_'.$lang]); |
|
| 281 | 281 | } |
| 282 | 282 | // ... puis (lang/)local.php |
| 283 | 283 | if (!isset($local['local'])) { |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if (isset($GLOBALS[$var][$code])) { |
| 292 | 292 | $desc->code = $code; |
| 293 | 293 | $desc->module = $module; |
| 294 | - $desc->langue = $GLOBALS['lang_' . $var] ?? $lang; |
|
| 294 | + $desc->langue = $GLOBALS['lang_'.$var] ?? $lang; |
|
| 295 | 295 | $desc->texte = $GLOBALS[$var][$code]; |
| 296 | 296 | break; |
| 297 | 297 | } |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | if (!$desc->mode and $desc->texte) { |
| 350 | 350 | // ne pas modifier 2 fois l'affichage |
| 351 | 351 | $desc->mode = 'traduction'; |
| 352 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 352 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 353 | 353 | $desc->texte = '<span ' |
| 354 | - . 'lang=' . $desc->langue |
|
| 355 | - . ' class=' . $classe |
|
| 356 | - . ' data-module=' . $desc->module |
|
| 357 | - . ' data-code=' . $desc->code |
|
| 358 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 354 | + . 'lang='.$desc->langue |
|
| 355 | + . ' class='.$classe |
|
| 356 | + . ' data-module='.$desc->module |
|
| 357 | + . ' data-code='.$desc->code |
|
| 358 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 359 | 359 | . $desc->texte |
| 360 | 360 | . '</span>'; |
| 361 | 361 | $desc->texte = str_replace( |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | foreach ($regexp as $r => $e) { |
| 598 | 598 | $regexp[$r] = str_replace('[]', '\[\]', preg_replace(',[^\w\d\[\]-],', '', $e)); |
| 599 | 599 | } |
| 600 | - $regexp = ',^(' . implode('|', $regexp) . '[[]?[]]?)(=.*)?$,'; |
|
| 600 | + $regexp = ',^('.implode('|', $regexp).'[[]?[]]?)(=.*)?$,'; |
|
| 601 | 601 | $ajouts = array_flip(explode('|', $c)); |
| 602 | 602 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 603 | 603 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 625 | 625 | // pour un tableau ce sera fait dans la prochaine boucle |
| 626 | 626 | elseif (substr($r[1], -2) != '[]') { |
| 627 | - $url[$n] = $r[1] . '=' . $u; |
|
| 627 | + $url[$n] = $r[1].'='.$u; |
|
| 628 | 628 | unset($ajouts[$r[1]]); |
| 629 | 629 | } |
| 630 | 630 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | } elseif ($testv) { |
| 646 | 646 | foreach ($ajouts as $k => $n) { |
| 647 | 647 | if (!is_array($v)) { |
| 648 | - $url[] = $k . '=' . $u; |
|
| 648 | + $url[] = $k.'='.$u; |
|
| 649 | 649 | } else { |
| 650 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 650 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 651 | 651 | foreach ($v as $w) { |
| 652 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 652 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | } |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // recomposer l'adresse |
| 662 | 662 | if ($url) { |
| 663 | - $a .= '?' . join($sep, $url); |
|
| 663 | + $a .= '?'.join($sep, $url); |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - return $a . $ancre; |
|
| 666 | + return $a.$ancre; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | translitteration($ancre) |
| 694 | 694 | ); |
| 695 | 695 | } |
| 696 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 696 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | * @return bool |
| 810 | 810 | */ |
| 811 | 811 | function test_plugin_actif($plugin) { |
| 812 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 812 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | /** |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $value = interdire_scripts($value, -1); |
| 942 | 942 | } |
| 943 | 943 | if (!empty($options['class'])) { |
| 944 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 944 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 945 | 945 | } |
| 946 | 946 | $text = str_replace("@$name@", $value, $text); |
| 947 | 947 | unset($args[$name]); |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | // Si des variables n'ont pas ete inserees, le signaler |
| 951 | 951 | // (chaines de langues pas a jour) |
| 952 | 952 | if ($args) { |
| 953 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 953 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 954 | 954 | } |
| 955 | 955 | } |
| 956 | 956 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | function joli_repertoire($rep) { |
| 975 | 975 | $a = substr($rep, 0, 1); |
| 976 | 976 | if ($a <> '.' and $a <> '/') { |
| 977 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 977 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 978 | 978 | } |
| 979 | 979 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 980 | 980 | |
@@ -1028,7 +1028,7 @@ discard block |
||
| 1028 | 1028 | $p -= ($x * 1000); |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1031 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | if ($taches and count($taches) and !spip_connect()) { |
| 1096 | 1096 | return false; |
| 1097 | 1097 | } |
| 1098 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1098 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1099 | 1099 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1100 | 1100 | return $genie($taches); |
| 1101 | 1101 | } |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | |
| 1200 | 1200 | if ($queue_next_job_time == -1) { |
| 1201 | 1201 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1202 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1202 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1203 | 1203 | } |
| 1204 | 1204 | // utiliser un cache memoire si dispo |
| 1205 | 1205 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1268,8 +1268,8 @@ discard block |
||
| 1268 | 1268 | $src = ''; |
| 1269 | 1269 | } |
| 1270 | 1270 | if ($script) { |
| 1271 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1272 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1271 | + $script = ("/*<![CDATA[*/\n". |
|
| 1272 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1273 | 1273 | '/*]]>*/'); |
| 1274 | 1274 | } |
| 1275 | 1275 | if ($noscript) { |
@@ -1355,13 +1355,13 @@ discard block |
||
| 1355 | 1355 | if ($path_base == null) { |
| 1356 | 1356 | // Chemin standard depuis l'espace public |
| 1357 | 1357 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1358 | - _DIR_RACINE . ':' . |
|
| 1359 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1360 | - _DIR_RACINE . 'prive/:' . |
|
| 1358 | + _DIR_RACINE.':'. |
|
| 1359 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1360 | + _DIR_RACINE.'prive/:'. |
|
| 1361 | 1361 | _DIR_RESTREINT; |
| 1362 | 1362 | // Ajouter squelettes/ |
| 1363 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1364 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1363 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1364 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1365 | 1365 | } |
| 1366 | 1366 | foreach (explode(':', $path) as $dir) { |
| 1367 | 1367 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | // Et le(s) dossier(s) des squelettes nommes |
| 1374 | 1374 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1375 | 1375 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1376 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1376 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1377 | 1377 | } |
| 1378 | 1378 | } |
| 1379 | 1379 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | |
| 1385 | 1385 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1386 | 1386 | $tete = ''; |
| 1387 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1387 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1388 | 1388 | $tete = array_shift($path_base); |
| 1389 | 1389 | } |
| 1390 | 1390 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1405,7 +1405,7 @@ discard block |
||
| 1405 | 1405 | // Et le(s) dossier(s) des squelettes nommes |
| 1406 | 1406 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1407 | 1407 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1408 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1408 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1409 | 1409 | } |
| 1410 | 1410 | } |
| 1411 | 1411 | |
@@ -1476,14 +1476,14 @@ discard block |
||
| 1476 | 1476 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1477 | 1477 | if ( |
| 1478 | 1478 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1479 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1479 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1480 | 1480 | and $f = find_in_theme("$file_svg_generique") |
| 1481 | 1481 | ) { |
| 1482 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1482 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1483 | 1483 | return $themefiles["$subdir$file"] = $fsize; |
| 1484 | 1484 | } |
| 1485 | 1485 | else { |
| 1486 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1486 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1487 | 1487 | } |
| 1488 | 1488 | } |
| 1489 | 1489 | |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | return $themefiles["$subdir$file"] = $f; |
| 1494 | 1494 | } |
| 1495 | 1495 | } |
| 1496 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1496 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1497 | 1497 | |
| 1498 | 1498 | return $themefiles["$subdir$file"] = ''; |
| 1499 | 1499 | } |
@@ -1601,8 +1601,8 @@ discard block |
||
| 1601 | 1601 | return false; |
| 1602 | 1602 | } |
| 1603 | 1603 | if ($include and !isset($inc[$dirname][$file])) { |
| 1604 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1605 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1604 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1605 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 1608 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1615,14 +1615,14 @@ discard block |
||
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | foreach (creer_chemin() as $dir) { |
| 1618 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1619 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1618 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1619 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1620 | 1620 | } |
| 1621 | 1621 | if ($dirs[$a]) { |
| 1622 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1622 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1623 | 1623 | if ($include and !isset($inc[$dirname][$file])) { |
| 1624 | - include_once _ROOT_CWD . $a; |
|
| 1625 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1624 | + include_once _ROOT_CWD.$a; |
|
| 1625 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1626 | 1626 | } |
| 1627 | 1627 | if (!defined('_SAUVER_CHEMIN')) { |
| 1628 | 1628 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | define('_SAUVER_CHEMIN', true); |
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1635 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1636 | 1636 | } |
| 1637 | 1637 | } |
| 1638 | 1638 | } |
@@ -1658,7 +1658,7 @@ discard block |
||
| 1658 | 1658 | define('_SAUVER_CHEMIN', true); |
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1661 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1662 | 1662 | } |
| 1663 | 1663 | |
| 1664 | 1664 | function clear_path_cache() { |
@@ -1728,12 +1728,12 @@ discard block |
||
| 1728 | 1728 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1729 | 1729 | // on a pas encore inclus flock.php |
| 1730 | 1730 | if (!function_exists('preg_files')) { |
| 1731 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1731 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | 1734 | // Parcourir le chemin |
| 1735 | 1735 | foreach (creer_chemin() as $d) { |
| 1736 | - $f = $d . $dir; |
|
| 1736 | + $f = $d.$dir; |
|
| 1737 | 1737 | if (@is_dir($f)) { |
| 1738 | 1738 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1739 | 1739 | foreach ($liste as $chemin) { |
@@ -1783,9 +1783,9 @@ discard block |
||
| 1783 | 1783 | if ($type === 'defaut') { |
| 1784 | 1784 | $objet = objet_type($quoi); |
| 1785 | 1785 | if ( |
| 1786 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1786 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1787 | 1787 | // deprecated |
| 1788 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1788 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1789 | 1789 | ) { |
| 1790 | 1790 | return $f; |
| 1791 | 1791 | } |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | // inclure le module d'url |
| 1801 | - include_spip('urls/' . $url_type); |
|
| 1801 | + include_spip('urls/'.$url_type); |
|
| 1802 | 1802 | |
| 1803 | 1803 | switch ($quoi) { |
| 1804 | 1804 | case 'page': |
@@ -1951,8 +1951,8 @@ discard block |
||
| 1951 | 1951 | include_spip('base/connect_sql'); |
| 1952 | 1952 | $id_type = id_table_objet($entite, $public); |
| 1953 | 1953 | |
| 1954 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1955 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1954 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1955 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1956 | 1956 | . (!$args ? '' : "&$args") |
| 1957 | 1957 | . (!$ancre ? '' : "#$ancre"); |
| 1958 | 1958 | } |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | !empty($_SERVER['QUERY_STRING']) |
| 2128 | 2128 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2129 | 2129 | ) { |
| 2130 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2130 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | } |
| 2133 | 2133 | } |
@@ -2165,9 +2165,9 @@ discard block |
||
| 2165 | 2165 | array_shift($myself); |
| 2166 | 2166 | $myself = implode('/', $myself); |
| 2167 | 2167 | } |
| 2168 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2168 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2169 | 2169 | |
| 2170 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2170 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2171 | 2171 | |
| 2172 | 2172 | return $url; |
| 2173 | 2173 | } |
@@ -2206,16 +2206,16 @@ discard block |
||
| 2206 | 2206 | function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) { |
| 2207 | 2207 | $script ??= ''; |
| 2208 | 2208 | if (!$rel) { |
| 2209 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2209 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2210 | 2210 | } else { |
| 2211 | 2211 | if (!is_string($rel)) { |
| 2212 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2212 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2213 | 2213 | } |
| 2214 | 2214 | } |
| 2215 | 2215 | |
| 2216 | 2216 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2217 | 2217 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2218 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2218 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2219 | 2219 | } elseif ($args) { |
| 2220 | 2220 | $args = "?$args"; |
| 2221 | 2221 | } |
@@ -2223,7 +2223,7 @@ discard block |
||
| 2223 | 2223 | $args .= "#$ancre"; |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2226 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | 2229 | // |
@@ -2305,10 +2305,10 @@ discard block |
||
| 2305 | 2305 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2306 | 2306 | } |
| 2307 | 2307 | if ($args) { |
| 2308 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2308 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2309 | 2309 | } |
| 2310 | 2310 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2311 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2311 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2312 | 2312 | } |
| 2313 | 2313 | |
| 2314 | 2314 | if (!$no_entities) { |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | |
| 2321 | 2321 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2322 | 2322 | |
| 2323 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2323 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2324 | 2324 | } |
| 2325 | 2325 | |
| 2326 | 2326 | // Pour les formulaires en methode POST, |
@@ -2355,8 +2355,7 @@ discard block |
||
| 2355 | 2355 | . "><div>\n" |
| 2356 | 2356 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2357 | 2357 | . $corps |
| 2358 | - . (!$submit ? '' : |
|
| 2359 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2358 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2360 | 2359 | . "</div></form>\n"; |
| 2361 | 2360 | } |
| 2362 | 2361 | |
@@ -2381,14 +2380,14 @@ discard block |
||
| 2381 | 2380 | ? generer_url_ecrire(_request('exec')) |
| 2382 | 2381 | : generer_url_public(); |
| 2383 | 2382 | |
| 2384 | - return "\n<form action='" . |
|
| 2385 | - $h . |
|
| 2386 | - "'" . |
|
| 2387 | - $atts . |
|
| 2388 | - ">\n" . |
|
| 2389 | - '<div>' . |
|
| 2390 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2391 | - $corps . |
|
| 2383 | + return "\n<form action='". |
|
| 2384 | + $h. |
|
| 2385 | + "'". |
|
| 2386 | + $atts. |
|
| 2387 | + ">\n". |
|
| 2388 | + '<div>'. |
|
| 2389 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2390 | + $corps. |
|
| 2392 | 2391 | '</div></form>'; |
| 2393 | 2392 | } |
| 2394 | 2393 | |
@@ -2416,7 +2415,7 @@ discard block |
||
| 2416 | 2415 | : generer_url_public('', '', false, false); |
| 2417 | 2416 | $url = parametre_url($url, 'action', $script); |
| 2418 | 2417 | if ($args) { |
| 2419 | - $url .= quote_amp('&' . $args); |
|
| 2418 | + $url .= quote_amp('&'.$args); |
|
| 2420 | 2419 | } |
| 2421 | 2420 | |
| 2422 | 2421 | if ($no_entities) { |
@@ -2450,9 +2449,9 @@ discard block |
||
| 2450 | 2449 | } |
| 2451 | 2450 | $url = |
| 2452 | 2451 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2453 | - . $script . '/' |
|
| 2452 | + . $script.'/' |
|
| 2454 | 2453 | . ($path ? trim($path, '/') : '') |
| 2455 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2454 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2456 | 2455 | |
| 2457 | 2456 | if ($no_entities) { |
| 2458 | 2457 | $url = str_replace('&', '&', $url); |
@@ -2501,22 +2500,22 @@ discard block |
||
| 2501 | 2500 | |
| 2502 | 2501 | // le nom du repertoire plugins/ activables/desactivables |
| 2503 | 2502 | if (!defined('_DIR_PLUGINS')) { |
| 2504 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2503 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2505 | 2504 | } |
| 2506 | 2505 | |
| 2507 | 2506 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2508 | 2507 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2509 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2508 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2510 | 2509 | } |
| 2511 | 2510 | |
| 2512 | 2511 | // le nom du repertoire des librairies |
| 2513 | 2512 | if (!defined('_DIR_LIB')) { |
| 2514 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2513 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2515 | 2514 | } |
| 2516 | 2515 | |
| 2517 | 2516 | // répertoire des libs via Composer |
| 2518 | 2517 | if (!defined('_DIR_VENDOR')) { |
| 2519 | - define('_DIR_VENDOR', _DIR_RACINE . 'vendor/'); |
|
| 2518 | + define('_DIR_VENDOR', _DIR_RACINE.'vendor/'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | |
| 2522 | 2521 | if (!defined('_DIR_IMG')) { |
@@ -2526,29 +2525,29 @@ discard block |
||
| 2526 | 2525 | define('_DIR_LOGOS', $pa); |
| 2527 | 2526 | } |
| 2528 | 2527 | if (!defined('_DIR_IMG_ICONES')) { |
| 2529 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2528 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2530 | 2529 | } |
| 2531 | 2530 | |
| 2532 | 2531 | if (!defined('_DIR_DUMP')) { |
| 2533 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2532 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2534 | 2533 | } |
| 2535 | 2534 | if (!defined('_DIR_SESSIONS')) { |
| 2536 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2535 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_TRANSFERT')) { |
| 2539 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2538 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_DIR_CACHE')) { |
| 2542 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2541 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2543 | 2542 | } |
| 2544 | 2543 | if (!defined('_DIR_CACHE_XML')) { |
| 2545 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2544 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2546 | 2545 | } |
| 2547 | 2546 | if (!defined('_DIR_SKELS')) { |
| 2548 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2547 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2549 | 2548 | } |
| 2550 | 2549 | if (!defined('_DIR_AIDE')) { |
| 2551 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2550 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2552 | 2551 | } |
| 2553 | 2552 | if (!defined('_DIR_TMP')) { |
| 2554 | 2553 | define('_DIR_TMP', $ti); |
@@ -2577,27 +2576,27 @@ discard block |
||
| 2577 | 2576 | // Declaration des fichiers |
| 2578 | 2577 | |
| 2579 | 2578 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2580 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2579 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2581 | 2580 | } |
| 2582 | 2581 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2583 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2582 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2584 | 2583 | } |
| 2585 | 2584 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2586 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2585 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2587 | 2586 | } |
| 2588 | 2587 | if (!defined('_CACHE_PIPELINES')) { |
| 2589 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2588 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2590 | 2589 | } |
| 2591 | 2590 | if (!defined('_CACHE_CHEMIN')) { |
| 2592 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2591 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2593 | 2592 | } |
| 2594 | 2593 | |
| 2595 | 2594 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2596 | 2595 | if (!defined('_FILE_META')) { |
| 2597 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2596 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2598 | 2597 | } |
| 2599 | 2598 | if (!defined('_DIR_LOG')) { |
| 2600 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2599 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2601 | 2600 | } |
| 2602 | 2601 | if (!defined('_FILE_LOG')) { |
| 2603 | 2602 | define('_FILE_LOG', 'spip'); |
@@ -2614,8 +2613,8 @@ discard block |
||
| 2614 | 2613 | if (!defined('_FILE_CONNECT')) { |
| 2615 | 2614 | define( |
| 2616 | 2615 | '_FILE_CONNECT', |
| 2617 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2618 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2616 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2617 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2619 | 2618 | : false)) |
| 2620 | 2619 | ); |
| 2621 | 2620 | } |
@@ -2627,7 +2626,7 @@ discard block |
||
| 2627 | 2626 | if (!defined('_FILE_CHMOD')) { |
| 2628 | 2627 | define( |
| 2629 | 2628 | '_FILE_CHMOD', |
| 2630 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2629 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2631 | 2630 | : false) |
| 2632 | 2631 | ); |
| 2633 | 2632 | } |
@@ -2640,10 +2639,10 @@ discard block |
||
| 2640 | 2639 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2641 | 2640 | } |
| 2642 | 2641 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2643 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2642 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2644 | 2643 | } |
| 2645 | 2644 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2646 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2645 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2647 | 2646 | } |
| 2648 | 2647 | |
| 2649 | 2648 | // Definition des droits d'acces en ecriture |
@@ -2661,13 +2660,13 @@ discard block |
||
| 2661 | 2660 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2662 | 2661 | } |
| 2663 | 2662 | if (!defined('_ROOT_PLUGINS')) { |
| 2664 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2663 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2665 | 2664 | } |
| 2666 | 2665 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2667 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2666 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2668 | 2667 | } |
| 2669 | 2668 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2670 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2669 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2671 | 2670 | } |
| 2672 | 2671 | |
| 2673 | 2672 | // La taille des Log |
@@ -2704,7 +2703,7 @@ discard block |
||
| 2704 | 2703 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2705 | 2704 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2706 | 2705 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2707 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2706 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2708 | 2707 | |
| 2709 | 2708 | // charger tout de suite le path et son cache |
| 2710 | 2709 | load_path_cache(); |
@@ -2740,7 +2739,7 @@ discard block |
||
| 2740 | 2739 | !empty($_SERVER['QUERY_STRING']) |
| 2741 | 2740 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2742 | 2741 | ) { |
| 2743 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2742 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2744 | 2743 | } |
| 2745 | 2744 | } |
| 2746 | 2745 | |
@@ -2776,7 +2775,7 @@ discard block |
||
| 2776 | 2775 | ) { |
| 2777 | 2776 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2778 | 2777 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2779 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2778 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2780 | 2779 | } else { |
| 2781 | 2780 | $uri_ref = ''; |
| 2782 | 2781 | } |
@@ -2870,7 +2869,7 @@ discard block |
||
| 2870 | 2869 | } |
| 2871 | 2870 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2872 | 2871 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2873 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2872 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2874 | 2873 | } |
| 2875 | 2874 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2876 | 2875 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3092,7 +3091,7 @@ discard block |
||
| 3092 | 3091 | } |
| 3093 | 3092 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3094 | 3093 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3095 | - . ' ' . _VAR_MODE); |
|
| 3094 | + . ' '._VAR_MODE); |
|
| 3096 | 3095 | } |
| 3097 | 3096 | } // pas autorise ? |
| 3098 | 3097 | else { |
@@ -3107,7 +3106,7 @@ discard block |
||
| 3107 | 3106 | if (strpos($self, 'page=login') === false) { |
| 3108 | 3107 | include_spip('inc/headers'); |
| 3109 | 3108 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3110 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3109 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3111 | 3110 | } |
| 3112 | 3111 | } |
| 3113 | 3112 | // sinon tant pis |
@@ -3157,10 +3156,10 @@ discard block |
||
| 3157 | 3156 | **/ |
| 3158 | 3157 | function verifier_visiteur() { |
| 3159 | 3158 | @spip_initialisation_core( |
| 3160 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3161 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3162 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3163 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3159 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3160 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3161 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3162 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3164 | 3163 | ); |
| 3165 | 3164 | |
| 3166 | 3165 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3193,7 +3192,7 @@ discard block |
||
| 3193 | 3192 | } |
| 3194 | 3193 | |
| 3195 | 3194 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3196 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3195 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3197 | 3196 | $session = charger_fonction('session', 'inc'); |
| 3198 | 3197 | if ($session()) { |
| 3199 | 3198 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3273,7 +3272,7 @@ discard block |
||
| 3273 | 3272 | 'definir_session', |
| 3274 | 3273 | $GLOBALS['visiteur_session'] |
| 3275 | 3274 | ? serialize($GLOBALS['visiteur_session']) |
| 3276 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3275 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3277 | 3276 | : '' |
| 3278 | 3277 | ); |
| 3279 | 3278 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3321,8 +3320,8 @@ discard block |
||
| 3321 | 3320 | foreach ($cookies_masques as $k) { |
| 3322 | 3321 | if (!empty($_COOKIE[$k])) { |
| 3323 | 3322 | $cookies_backup[$k] = $_COOKIE[$k]; |
| 3324 | - $_SERVER['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3325 | - $_ENV['HTTP_COOKIE'] = str_replace("$k=" . $_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3323 | + $_SERVER['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_SERVER['HTTP_COOKIE'] ?? []); |
|
| 3324 | + $_ENV['HTTP_COOKIE'] = str_replace("$k=".$_COOKIE[$k], "$k=$mask", $_ENV['HTTP_COOKIE'] ?? []); |
|
| 3326 | 3325 | $_COOKIE[$k] = $mask; |
| 3327 | 3326 | } |
| 3328 | 3327 | } |
@@ -3440,11 +3439,11 @@ discard block |
||
| 3440 | 3439 | $GLOBALS['_INC_PUBLIC']++; |
| 3441 | 3440 | |
| 3442 | 3441 | // fix #4235 |
| 3443 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3442 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3444 | 3443 | |
| 3445 | 3444 | |
| 3446 | 3445 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3447 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3446 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3448 | 3447 | |
| 3449 | 3448 | $page = evaluer_fond($f, $contexte, $connect); |
| 3450 | 3449 | if ($page === '') { |
@@ -3529,7 +3528,7 @@ discard block |
||
| 3529 | 3528 | * @return array|string |
| 3530 | 3529 | */ |
| 3531 | 3530 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3532 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3531 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3533 | 3532 | if (!$pathinfo) { |
| 3534 | 3533 | return $f; |
| 3535 | 3534 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $charset = 'cp1256'; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (find_in_path($charset . '.php', 'charsets/', true)) { |
|
| 93 | + if (find_in_path($charset.'.php', 'charsets/', true)) { |
|
| 94 | 94 | return $charset; |
| 95 | 95 | } else { |
| 96 | 96 | spip_log("Erreur: pas de fichier de conversion 'charsets/$charset'"); |
@@ -195,38 +195,38 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | if (!isset($trans[$charset][$charset_cible])) { |
| 197 | 197 | $trans[$charset][$charset_cible] = [ |
| 198 | - $p . chr(128) => '€', |
|
| 199 | - $p . chr(129) => ' ', # pas affecte |
|
| 200 | - $p . chr(130) => '‚', |
|
| 201 | - $p . chr(131) => 'ƒ', |
|
| 202 | - $p . chr(132) => '„', |
|
| 203 | - $p . chr(133) => '…', |
|
| 204 | - $p . chr(134) => '†', |
|
| 205 | - $p . chr(135) => '‡', |
|
| 206 | - $p . chr(136) => 'ˆ', |
|
| 207 | - $p . chr(137) => '‰', |
|
| 208 | - $p . chr(138) => 'Š', |
|
| 209 | - $p . chr(139) => '‹', |
|
| 210 | - $p . chr(140) => 'Œ', |
|
| 211 | - $p . chr(141) => ' ', # pas affecte |
|
| 212 | - $p . chr(142) => 'Ž', |
|
| 213 | - $p . chr(143) => ' ', # pas affecte |
|
| 214 | - $p . chr(144) => ' ', # pas affecte |
|
| 215 | - $p . chr(145) => '‘', |
|
| 216 | - $p . chr(146) => '’', |
|
| 217 | - $p . chr(147) => '“', |
|
| 218 | - $p . chr(148) => '”', |
|
| 219 | - $p . chr(149) => '•', |
|
| 220 | - $p . chr(150) => '–', |
|
| 221 | - $p . chr(151) => '—', |
|
| 222 | - $p . chr(152) => '˜', |
|
| 223 | - $p . chr(153) => '™', |
|
| 224 | - $p . chr(154) => 'š', |
|
| 225 | - $p . chr(155) => '›', |
|
| 226 | - $p . chr(156) => 'œ', |
|
| 227 | - $p . chr(157) => ' ', # pas affecte |
|
| 228 | - $p . chr(158) => 'ž', |
|
| 229 | - $p . chr(159) => 'Ÿ', |
|
| 198 | + $p.chr(128) => '€', |
|
| 199 | + $p.chr(129) => ' ', # pas affecte |
|
| 200 | + $p.chr(130) => '‚', |
|
| 201 | + $p.chr(131) => 'ƒ', |
|
| 202 | + $p.chr(132) => '„', |
|
| 203 | + $p.chr(133) => '…', |
|
| 204 | + $p.chr(134) => '†', |
|
| 205 | + $p.chr(135) => '‡', |
|
| 206 | + $p.chr(136) => 'ˆ', |
|
| 207 | + $p.chr(137) => '‰', |
|
| 208 | + $p.chr(138) => 'Š', |
|
| 209 | + $p.chr(139) => '‹', |
|
| 210 | + $p.chr(140) => 'Œ', |
|
| 211 | + $p.chr(141) => ' ', # pas affecte |
|
| 212 | + $p.chr(142) => 'Ž', |
|
| 213 | + $p.chr(143) => ' ', # pas affecte |
|
| 214 | + $p.chr(144) => ' ', # pas affecte |
|
| 215 | + $p.chr(145) => '‘', |
|
| 216 | + $p.chr(146) => '’', |
|
| 217 | + $p.chr(147) => '“', |
|
| 218 | + $p.chr(148) => '”', |
|
| 219 | + $p.chr(149) => '•', |
|
| 220 | + $p.chr(150) => '–', |
|
| 221 | + $p.chr(151) => '—', |
|
| 222 | + $p.chr(152) => '˜', |
|
| 223 | + $p.chr(153) => '™', |
|
| 224 | + $p.chr(154) => 'š', |
|
| 225 | + $p.chr(155) => '›', |
|
| 226 | + $p.chr(156) => 'œ', |
|
| 227 | + $p.chr(157) => ' ', # pas affecte |
|
| 228 | + $p.chr(158) => 'ž', |
|
| 229 | + $p.chr(159) => 'Ÿ', |
|
| 230 | 230 | ]; |
| 231 | 231 | if ($charset_cible != 'unicode') { |
| 232 | 232 | foreach ($trans[$charset][$charset_cible] as $k => $c) { |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | and is_array($GLOBALS['CHARSET'][$cset]) |
| 368 | 368 | ) { |
| 369 | 369 | foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) { |
| 370 | - $trans[$charset][chr($key)] = '&#' . $val . ';'; |
|
| 370 | + $trans[$charset][chr($key)] = '&#'.$val.';'; |
|
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | } |
@@ -433,11 +433,11 @@ discard block |
||
| 433 | 433 | $h = dechex($e); |
| 434 | 434 | if ($s = isset($CHARSET_REVERSE[$charset][$e])) { |
| 435 | 435 | $s = $CHARSET_REVERSE[$charset][$e]; |
| 436 | - $t['&#' . $e . ';'] = $t['�' . $e . ';'] = $t['�' . $e . ';'] = chr($s); |
|
| 437 | - $t['&#x' . $h . ';'] = $t['�' . $h . ';'] = $t['�' . $h . ';'] = chr($s); |
|
| 436 | + $t['&#'.$e.';'] = $t['�'.$e.';'] = $t['�'.$e.';'] = chr($s); |
|
| 437 | + $t['&#x'.$h.';'] = $t['�'.$h.';'] = $t['�'.$h.';'] = chr($s); |
|
| 438 | 438 | } else { |
| 439 | - $t['&#' . $e . ';'] = $t['�' . $e . ';'] = $t['�' . $e . ';'] = chr($e); |
|
| 440 | - $t['&#x' . $h . ';'] = $t['�' . $h . ';'] = $t['�' . $h . ';'] = chr($e); |
|
| 439 | + $t['&#'.$e.';'] = $t['�'.$e.';'] = $t['�'.$e.';'] = chr($e); |
|
| 440 | + $t['&#x'.$h.';'] = $t['�'.$h.';'] = $t['�'.$h.';'] = chr($e); |
|
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | 443 | } |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | and is_array($GLOBALS['CHARSET'][$cset]) |
| 485 | 485 | ) { |
| 486 | 486 | foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) { |
| 487 | - $trans[$charset][chr($key)] = unicode2charset('&#' . $val . ';'); |
|
| 487 | + $trans[$charset][chr($key)] = unicode2charset('&#'.$val.';'); |
|
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | } |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | } |
| 592 | 592 | $thisPos++; |
| 593 | 593 | } |
| 594 | - $encodedLetter = '&#' . preg_replace('/^0+/', '', $decimalCode) . ';'; |
|
| 594 | + $encodedLetter = '&#'.preg_replace('/^0+/', '', $decimalCode).';'; |
|
| 595 | 595 | $encodedString .= $encodedLetter; |
| 596 | 596 | } |
| 597 | 597 | } |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | } // ignorer le BOM - http://www.unicode.org/faq/utf_bom.html |
| 635 | 635 | else { |
| 636 | 636 | if ($word != 65279) { |
| 637 | - $texte .= '&#' . $word . ';'; |
|
| 637 | + $texte .= '&#'.$word.';'; |
|
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | } |
@@ -662,13 +662,13 @@ discard block |
||
| 662 | 662 | return chr($num); |
| 663 | 663 | } |
| 664 | 664 | if ($num < 2048) { |
| 665 | - return chr(($num >> 6) + 192) . chr(($num & 63) + 128); |
|
| 665 | + return chr(($num >> 6) + 192).chr(($num & 63) + 128); |
|
| 666 | 666 | } |
| 667 | 667 | if ($num < 65536) { |
| 668 | - return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
| 668 | + return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
| 669 | 669 | } |
| 670 | 670 | if ($num < 1_114_112) { |
| 671 | - return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
| 671 | + return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | return ''; |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | while (preg_match(',�*([0-9]+);,S', $texte, $regs) and !isset($vu[$regs[1]])) { |
| 736 | 736 | $num = $regs[1]; |
| 737 | 737 | $vu[$num] = true; |
| 738 | - $s = '\u' . sprintf('%04x', $num); |
|
| 738 | + $s = '\u'.sprintf('%04x', $num); |
|
| 739 | 739 | $texte = str_replace($regs[0], $s, $texte); |
| 740 | 740 | } |
| 741 | 741 | |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | **/ |
| 753 | 753 | function javascript_to_unicode($texte) { |
| 754 | 754 | while (preg_match(',%u([0-9A-F][0-9A-F][0-9A-F][0-9A-F]),', $texte, $regs)) { |
| 755 | - $texte = str_replace($regs[0], '&#' . hexdec($regs[1]) . ';', $texte); |
|
| 755 | + $texte = str_replace($regs[0], '&#'.hexdec($regs[1]).';', $texte); |
|
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | return $texte; |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | return $texte; |
| 798 | 798 | } |
| 799 | 799 | |
| 800 | - $table_translit = 'translit' . $complexe; |
|
| 800 | + $table_translit = 'translit'.$complexe; |
|
| 801 | 801 | |
| 802 | 802 | // 2. Translitterer grace a la table predefinie |
| 803 | 803 | if (!isset($trans[$complexe])) { |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | * true s'il a un BOM |
| 889 | 889 | **/ |
| 890 | 890 | function bom_utf8($texte): bool { |
| 891 | - return (substr($texte, 0, 3) === chr(0xEF) . chr(0xBB) . chr(0xBF)); |
|
| 891 | + return (substr($texte, 0, 3) === chr(0xEF).chr(0xBB).chr(0xBF)); |
|
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | /** |
@@ -1058,7 +1058,7 @@ discard block |
||
| 1058 | 1058 | |
| 1059 | 1059 | $lettre1 = mb_strtoupper(spip_substr($c, 0, 1)); |
| 1060 | 1060 | |
| 1061 | - return $lettre1 . spip_substr($c, 1); |
|
| 1061 | + return $lettre1.spip_substr($c, 1); |
|
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | 1064 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $res = admin_repair_tables(); |
| 40 | 40 | if (!$res) { |
| 41 | - $res = "<div class='error'>" . _T('avis_erreur_mysql') . ' ' . sql_errno() . ': ' . sql_error() . "</div>\n"; |
|
| 41 | + $res = "<div class='error'>"._T('avis_erreur_mysql').' '.sql_errno().': '.sql_error()."</div>\n"; |
|
| 42 | 42 | } else { |
| 43 | 43 | include_spip('inc/rubriques'); |
| 44 | 44 | calculer_rubriques(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $res .= pipeline('base_admin_repair', $res); |
| 49 | 49 | echo minipres( |
| 50 | 50 | _T('texte_tentative_recuperation'), |
| 51 | - $res . generer_form_ecrire('accueil', '', '', _T('public:accueil_site')) |
|
| 51 | + $res.generer_form_ecrire('accueil', '', '', _T('public:accueil_site')) |
|
| 52 | 52 | ); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | $count = sql_countsel($tab); |
| 92 | 92 | |
| 93 | 93 | if ($count > 1) { |
| 94 | - $m .= '(' . _T('texte_compte_elements', ['count' => $count]) . ")\n"; |
|
| 94 | + $m .= '('._T('texte_compte_elements', ['count' => $count]).")\n"; |
|
| 95 | 95 | } else { |
| 96 | 96 | if ($count == 1) { |
| 97 | - $m .= '(' . _T('texte_compte_element', ['count' => $count]) . ")\n"; |
|
| 97 | + $m .= '('._T('texte_compte_element', ['count' => $count]).")\n"; |
|
| 98 | 98 | } else { |
| 99 | - $m .= '(' . _T('texte_vide') . ")\n"; |
|
| 99 | + $m .= '('._T('texte_vide').")\n"; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | and $msg = join( |
| 106 | 106 | ' ', |
| 107 | 107 | (is_resource($result_repair) or is_object($result_repair)) ? sql_fetch($result_repair) : $result_repair |
| 108 | - ) . ' ' |
|
| 108 | + ).' ' |
|
| 109 | 109 | and !str_contains($msg, ' OK ') |
| 110 | 110 | ) { |
| 111 | 111 | $class = " class='notice'"; |
| 112 | - $m .= '<br /><tt>' . spip_htmlentities($msg) . "</tt>\n"; |
|
| 112 | + $m .= '<br /><tt>'.spip_htmlentities($msg)."</tt>\n"; |
|
| 113 | 113 | } else { |
| 114 | - $m .= ' ' . _T('texte_table_ok'); |
|
| 114 | + $m .= ' '._T('texte_table_ok'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $res .= "<div$class>$m</div>"; |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $t = $phraseur->ouvrant[$depth] ?? ' '; |
| 46 | 46 | // espace initial signifie: deja integree au resultat |
| 47 | 47 | if ($t[0] != ' ') { |
| 48 | - $phraseur->res .= '<' . $t . '>'; |
|
| 49 | - $phraseur->ouvrant[$depth] = ' ' . $t; |
|
| 48 | + $phraseur->res .= '<'.$t.'>'; |
|
| 49 | + $phraseur->ouvrant[$depth] = ' '.$t; |
|
| 50 | 50 | } |
| 51 | 51 | $t = $phraseur->contenu[$depth]; |
| 52 | 52 | // n'indenter que s'il y a un separateur avant |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | foreach ($attrs as $k => $v) { |
| 58 | 58 | $delim = !str_contains($v, "'") ? "'" : '"'; |
| 59 | 59 | $val = xml_entites_html($v); |
| 60 | - $att .= $sep . $k . '=' . $delim |
|
| 60 | + $att .= $sep.$k.'='.$delim |
|
| 61 | 61 | . ($delim !== '"' ? str_replace('"', '"', $val) : $val) |
| 62 | 62 | . $delim; |
| 63 | 63 | $sep = "\n $depth"; |
| 64 | 64 | } |
| 65 | 65 | $phraseur->depth .= ' '; |
| 66 | 66 | $phraseur->contenu[$phraseur->depth] = ''; |
| 67 | - $phraseur->ouvrant[$phraseur->depth] = $name . $att; |
|
| 67 | + $phraseur->ouvrant[$phraseur->depth] = $name.$att; |
|
| 68 | 68 | $phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | $ouv = $phraseur->ouvrant[$phraseur->depth]; |
| 73 | 73 | |
| 74 | 74 | if ($ouv[0] != ' ') { |
| 75 | - $phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv; |
|
| 75 | + $phraseur->ouvrant[$phraseur->depth] = ' '.$ouv; |
|
| 76 | 76 | } else { |
| 77 | 77 | $ouv = ''; |
| 78 | 78 | } |
| 79 | 79 | $t = $phraseur->contenu[$phraseur->depth]; |
| 80 | 80 | $phraseur->depth = substr($phraseur->depth, 2); |
| 81 | - $t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t); |
|
| 81 | + $t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t); |
|
| 82 | 82 | |
| 83 | 83 | // fusion <balise></balise> en <balise />. |
| 84 | 84 | // ATTENTION, certains clients http croient que fusion ==> pas d'atttributs |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | // (param fusion_bal) |
| 88 | 88 | |
| 89 | 89 | if ($t || (($ouv != $name) and !$fusion_bal)) { |
| 90 | - $phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . '</' . $name . '>'; |
|
| 90 | + $phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t.'</'.$name.'>'; |
|
| 91 | 91 | } else { |
| 92 | - $phraseur->res .= ($ouv ? ('<' . $ouv . ' />') : ('</' . $name . '>')); |
|
| 92 | + $phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ('</'.$name.'>')); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -131,16 +131,15 @@ discard block |
||
| 131 | 131 | coordonnees_erreur( |
| 132 | 132 | $phraseur, |
| 133 | 133 | xml_error_string(xml_get_error_code($phraseur->sax)) |
| 134 | - . "<br />\n" . |
|
| 135 | - (!$phraseur->depth ? '' : |
|
| 136 | - ('(' . |
|
| 137 | - _T('erreur_balise_non_fermee') . |
|
| 138 | - ' <tt>' . |
|
| 139 | - $phraseur->ouvrant[$phraseur->depth] . |
|
| 140 | - '</tt> ' . |
|
| 141 | - _T('ligne') . |
|
| 142 | - ' ' . |
|
| 143 | - $phraseur->reperes[$phraseur->depth] . |
|
| 134 | + . "<br />\n". |
|
| 135 | + (!$phraseur->depth ? '' : ('('. |
|
| 136 | + _T('erreur_balise_non_fermee'). |
|
| 137 | + ' <tt>'. |
|
| 138 | + $phraseur->ouvrant[$phraseur->depth]. |
|
| 139 | + '</tt> '. |
|
| 140 | + _T('ligne'). |
|
| 141 | + ' '. |
|
| 142 | + $phraseur->reperes[$phraseur->depth]. |
|
| 144 | 143 | ") <br />\n")) |
| 145 | 144 | ); |
| 146 | 145 | } |
@@ -181,7 +180,7 @@ discard block |
||
| 181 | 180 | // et escamoter le doctype que sax mange en php5 mais pas en php4 |
| 182 | 181 | if (!$doctype) { |
| 183 | 182 | if (!$r = analyser_doctype($page)) { |
| 184 | - $page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE |
|
| 183 | + $page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE |
|
| 185 | 184 | . preg_replace(_REGEXP_DOCTYPE, '', $page); |
| 186 | 185 | $r = analyser_doctype($page); |
| 187 | 186 | } |
@@ -288,18 +287,18 @@ discard block |
||
| 288 | 287 | 'rss-0.91.dtd' |
| 289 | 288 | ]; |
| 290 | 289 | } else { |
| 291 | - $dtd = $topelement . '.dtd'; |
|
| 290 | + $dtd = $topelement.'.dtd'; |
|
| 292 | 291 | $f = find_in_path($dtd); |
| 293 | 292 | if (file_exists($f)) { |
| 294 | 293 | return [$entete, 'SYSTEM', $f, $dtd]; |
| 295 | 294 | } |
| 296 | 295 | } |
| 297 | 296 | } |
| 298 | - spip_log('Dtd pas vu pour ' . substr($data, 0, 100)); |
|
| 297 | + spip_log('Dtd pas vu pour '.substr($data, 0, 100)); |
|
| 299 | 298 | |
| 300 | 299 | return []; |
| 301 | 300 | } |
| 302 | - [$entete, , $topelement, $avail, $suite] = $page; |
|
| 301 | + [$entete,, $topelement, $avail, $suite] = $page; |
|
| 303 | 302 | |
| 304 | 303 | if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r)) { |
| 305 | 304 | if (!preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r)) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | if (!$link) { |
| 65 | 65 | $erreurs[] = pg_last_error(); |
| 66 | 66 | foreach ($erreurs as $e) { |
| 67 | - spip_log('Echec pg_connect. Erreur : ' . $e, 'pg.' . _LOG_HS); |
|
| 67 | + spip_log('Echec pg_connect. Erreur : '.$e, 'pg.'._LOG_HS); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return false; |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | spip_log( |
| 85 | - "Connexion vers $host, base $db, prefixe $prefixe " . ($link ? 'operationnelle' : 'impossible'), |
|
| 86 | - 'pg.' . _LOG_DEBUG |
|
| 85 | + "Connexion vers $host, base $db, prefixe $prefixe ".($link ? 'operationnelle' : 'impossible'), |
|
| 86 | + 'pg.'._LOG_DEBUG |
|
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | 89 | return !$link ? false : [ |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } else { |
| 172 | 172 | $suite = ''; |
| 173 | 173 | } |
| 174 | - $query = preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite; |
|
| 174 | + $query = preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite; |
|
| 175 | 175 | |
| 176 | 176 | // renvoyer la requete inerte si demandee |
| 177 | 177 | if (!$requeter) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // ou revoir l'api de sql_alter en creant un |
| 240 | 240 | // sql_alter_table($table,array($actions)); |
| 241 | 241 | if (!preg_match('/\s*((\s*IGNORE)?\s*TABLE\s*([^\s]*))\s*(.*)?/is', $query, $regs)) { |
| 242 | - spip_log("$query mal comprise", 'pg.' . _LOG_ERREUR); |
|
| 242 | + spip_log("$query mal comprise", 'pg.'._LOG_ERREUR); |
|
| 243 | 243 | |
| 244 | 244 | return false; |
| 245 | 245 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $i = 0; |
| 253 | 253 | $ouverte = false; |
| 254 | 254 | while ($do = array_shift($todo)) { |
| 255 | - $todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do; |
|
| 255 | + $todo2[$i] = isset($todo2[$i]) ? $todo2[$i].','.$do : $do; |
|
| 256 | 256 | $o = (str_contains($do, '(')); |
| 257 | 257 | $f = (str_contains($do, ')')); |
| 258 | 258 | if ($o and !$f) { |
@@ -265,33 +265,33 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | $todo = $todo2; |
| 268 | - $query = $debut . ' ' . array_shift($todo); |
|
| 268 | + $query = $debut.' '.array_shift($todo); |
|
| 269 | 269 | |
| 270 | 270 | if (!preg_match('/^\s*(IGNORE\s*)?TABLE\s+(\w+)\s+(ADD|DROP|CHANGE|MODIFY|RENAME)\s*(.*)$/is', $query, $r)) { |
| 271 | - spip_log("$query incompris", 'pg.' . _LOG_ERREUR); |
|
| 271 | + spip_log("$query incompris", 'pg.'._LOG_ERREUR); |
|
| 272 | 272 | } else { |
| 273 | 273 | if ($r[1]) { |
| 274 | - spip_log("j'ignore IGNORE dans $query", 'pg.' . _LOG_AVERTISSEMENT); |
|
| 274 | + spip_log("j'ignore IGNORE dans $query", 'pg.'._LOG_AVERTISSEMENT); |
|
| 275 | 275 | } |
| 276 | - $f = 'spip_pg_alter_' . strtolower($r[3]); |
|
| 276 | + $f = 'spip_pg_alter_'.strtolower($r[3]); |
|
| 277 | 277 | if (function_exists($f)) { |
| 278 | 278 | $f($r[2], $r[4], $serveur, $requeter); |
| 279 | 279 | } else { |
| 280 | - spip_log("$query non prevu", 'pg.' . _LOG_ERREUR); |
|
| 280 | + spip_log("$query non prevu", 'pg.'._LOG_ERREUR); |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | // Alter a plusieurs args. Faudrait optimiser. |
| 284 | 284 | if ($todo) { |
| 285 | - spip_pg_alter("TABLE $table " . join(',', $todo)); |
|
| 285 | + spip_pg_alter("TABLE $table ".join(',', $todo)); |
|
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | function spip_pg_alter_change($table, $arg, $serveur = '', $requeter = true) { |
| 290 | 290 | if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) { |
| 291 | - spip_log("alter change: $arg incompris", 'pg.' . _LOG_ERREUR); |
|
| 291 | + spip_log("alter change: $arg incompris", 'pg.'._LOG_ERREUR); |
|
| 292 | 292 | } else { |
| 293 | 293 | [, $old, $new, $type, $default, $null, $def2] = $r; |
| 294 | - $actions = ["ALTER $old TYPE " . mysql2pg_type($type)]; |
|
| 294 | + $actions = ["ALTER $old TYPE ".mysql2pg_type($type)]; |
|
| 295 | 295 | if ($null) { |
| 296 | 296 | $actions[] = "ALTER $old SET NOT NULL"; |
| 297 | 297 | } else { |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | $actions[] = "ALTER $old DROP DEFAULT"; |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - spip_pg_query("ALTER TABLE $table " . join(', ', $actions)); |
|
| 307 | + spip_pg_query("ALTER TABLE $table ".join(', ', $actions)); |
|
| 308 | 308 | |
| 309 | 309 | if ($old != $new) { |
| 310 | 310 | spip_pg_query("ALTER TABLE $table RENAME $old TO $new", $serveur); |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | function spip_pg_alter_add($table, $arg, $serveur = '', $requeter = true) { |
| 316 | 316 | $nom_index = null; |
| 317 | 317 | if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*(.*)$/', $arg, $r)) { |
| 318 | - spip_log("alter add $arg incompris", 'pg.' . _LOG_ERREUR); |
|
| 318 | + spip_log("alter add $arg incompris", 'pg.'._LOG_ERREUR); |
|
| 319 | 319 | |
| 320 | 320 | return null; |
| 321 | 321 | } |
@@ -325,14 +325,14 @@ discard block |
||
| 325 | 325 | $m[2] = $n[1]; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | - return spip_pg_query("ALTER TABLE $table ADD " . $m[1] . ' ' . mysql2pg_type($m[2]), $serveur, $requeter); |
|
| 328 | + return spip_pg_query("ALTER TABLE $table ADD ".$m[1].' '.mysql2pg_type($m[2]), $serveur, $requeter); |
|
| 329 | 329 | } elseif ($r[1][0] == 'P') { |
| 330 | 330 | // la primary peut etre sur plusieurs champs |
| 331 | 331 | $r[2] = trim(str_replace('`', '', $r[2])); |
| 332 | 332 | $m = ($r[2][0] == '(') ? substr($r[2], 1, -1) : $r[2]; |
| 333 | 333 | |
| 334 | 334 | return spip_pg_query( |
| 335 | - "ALTER TABLE $table ADD CONSTRAINT $table" . '_pkey PRIMARY KEY (' . $m . ')', |
|
| 335 | + "ALTER TABLE $table ADD CONSTRAINT $table".'_pkey PRIMARY KEY ('.$m.')', |
|
| 336 | 336 | $serveur, |
| 337 | 337 | $requeter |
| 338 | 338 | ); |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $colonnes = substr($m[1], 1, -1); |
| 352 | 352 | if (str_contains(',', $colonnes)) { |
| 353 | 353 | spip_log('PG : Erreur, impossible de creer un index sur plusieurs colonnes' |
| 354 | - . " sans qu'il ait de nom ($table, ($colonnes))", 'pg.' . _LOG_ERREUR); |
|
| 354 | + . " sans qu'il ait de nom ($table, ($colonnes))", 'pg.'._LOG_ERREUR); |
|
| 355 | 355 | } else { |
| 356 | 356 | $nom_index = $colonnes; |
| 357 | 357 | } |
@@ -367,23 +367,23 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | function spip_pg_alter_drop($table, $arg, $serveur = '', $requeter = true) { |
| 369 | 369 | if (!preg_match('/^(COLUMN|INDEX|KEY|PRIMARY\s+KEY|)\s*`?(\w*)`?/', $arg, $r)) { |
| 370 | - spip_log("alter drop: $arg incompris", 'pg.' . _LOG_ERREUR); |
|
| 370 | + spip_log("alter drop: $arg incompris", 'pg.'._LOG_ERREUR); |
|
| 371 | 371 | } else { |
| 372 | 372 | if (!$r[1] or $r[1] == 'COLUMN') { |
| 373 | - return spip_pg_query("ALTER TABLE $table DROP " . $r[2], $serveur); |
|
| 373 | + return spip_pg_query("ALTER TABLE $table DROP ".$r[2], $serveur); |
|
| 374 | 374 | } elseif ($r[1][0] == 'P') { |
| 375 | - return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table" . '_pkey', $serveur); |
|
| 375 | + return spip_pg_query("ALTER TABLE $table DROP CONSTRAINT $table".'_pkey', $serveur); |
|
| 376 | 376 | } else { |
| 377 | - return spip_pg_query('DROP INDEX ' . $table . '_' . $r[2], $serveur); |
|
| 377 | + return spip_pg_query('DROP INDEX '.$table.'_'.$r[2], $serveur); |
|
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | function spip_pg_alter_modify($table, $arg, $serveur = '', $requeter = true) { |
| 383 | 383 | if (!preg_match('/^`?(\w+)`?\s+(.*)$/', $arg, $r)) { |
| 384 | - spip_log("alter modify: $arg incompris", 'pg.' . _LOG_ERREUR); |
|
| 384 | + spip_log("alter modify: $arg incompris", 'pg.'._LOG_ERREUR); |
|
| 385 | 385 | } else { |
| 386 | - return spip_pg_alter_change($table, $r[1] . ' ' . $arg, $serveur = '', $requeter = true); |
|
| 386 | + return spip_pg_alter_change($table, $r[1].' '.$arg, $serveur = '', $requeter = true); |
|
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | } elseif (preg_match('/^(TO)\s*`?(\w*)`?/', $arg, $r)) { |
| 400 | 400 | $rename = $r[2]; |
| 401 | 401 | } else { |
| 402 | - spip_log("alter rename: $arg incompris", 'pg.' . _LOG_ERREUR); |
|
| 402 | + spip_log("alter rename: $arg incompris", 'pg.'._LOG_ERREUR); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | return $rename ? spip_pg_query("ALTER TABLE $table RENAME TO $rename") : false; |
@@ -420,8 +420,8 @@ discard block |
||
| 420 | 420 | function spip_pg_create_index($nom, $table, $champs, $serveur = '', $requeter = true) { |
| 421 | 421 | if (!($nom or $table or $champs)) { |
| 422 | 422 | spip_log( |
| 423 | - "Champ manquant pour creer un index pg ($nom, $table, (" . @join(',', $champs) . '))', |
|
| 424 | - 'pg.' . _LOG_ERREUR |
|
| 423 | + "Champ manquant pour creer un index pg ($nom, $table, (".@join(',', $champs).'))', |
|
| 424 | + 'pg.'._LOG_ERREUR |
|
| 425 | 425 | ); |
| 426 | 426 | |
| 427 | 427 | return false; |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | // PG ne differentie pas noms des index en fonction des tables |
| 434 | 434 | // il faut donc creer des noms uniques d'index pour une base pg |
| 435 | - $nom = $table . '_' . $nom; |
|
| 435 | + $nom = $table.'_'.$nom; |
|
| 436 | 436 | // enlever d'eventuelles parentheses deja presentes sur champs |
| 437 | 437 | if (!is_array($champs)) { |
| 438 | 438 | if ($champs[0] == '(') { |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | $champs = [$champs]; |
| 442 | 442 | } |
| 443 | - $query = "CREATE INDEX $nom ON $table (" . join(',', $champs) . ')'; |
|
| 443 | + $query = "CREATE INDEX $nom ON $table (".join(',', $champs).')'; |
|
| 444 | 444 | if (!$requeter) { |
| 445 | 445 | return $query; |
| 446 | 446 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | } else { |
| 464 | 464 | $suite = ''; |
| 465 | 465 | } |
| 466 | - $query = 'EXPLAIN ' . preg_replace('/([,\s])spip_/', '\1' . $prefixe . '_', $query) . $suite; |
|
| 466 | + $query = 'EXPLAIN '.preg_replace('/([,\s])spip_/', '\1'.$prefixe.'_', $query).$suite; |
|
| 467 | 467 | |
| 468 | 468 | if (!$requeter) { |
| 469 | 469 | return $query; |
@@ -556,16 +556,16 @@ discard block |
||
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 | $from = spip_pg_from($from, $prefixe); |
| 559 | - $query = 'SELECT ' . $select |
|
| 559 | + $query = 'SELECT '.$select |
|
| 560 | 560 | . (!$from ? '' : "\nFROM $from") |
| 561 | - . (!$where ? '' : ("\nWHERE " . (!is_array($where) ? calculer_pg_where($where) : (join( |
|
| 561 | + . (!$where ? '' : ("\nWHERE ".(!is_array($where) ? calculer_pg_where($where) : (join( |
|
| 562 | 562 | "\n\tAND ", |
| 563 | 563 | array_map('calculer_pg_where', $where) |
| 564 | 564 | ))))) |
| 565 | 565 | . spip_pg_groupby($groupby, $from, $select) |
| 566 | 566 | . (!$having ? '' : "\nHAVING $having") |
| 567 | 567 | . ($orderby ? ("\nORDER BY $orderby") : '') |
| 568 | - . (!$limit ? '' : (" LIMIT $count" . (!$offset ? '' : " OFFSET $offset"))); |
|
| 568 | + . (!$limit ? '' : (" LIMIT $count".(!$offset ? '' : " OFFSET $offset"))); |
|
| 569 | 569 | |
| 570 | 570 | // renvoyer la requete inerte si demandee |
| 571 | 571 | if ($requeter === false) { |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | $from = spip_pg_select_as($from); |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | - return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1' . $prefixe . '_', $from); |
|
| 589 | + return !$prefixe ? $from : preg_replace('/(\b)spip_/', '\1'.$prefixe.'_', $from); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | function spip_pg_orderby($order, $select) { |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | $arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order)); |
| 595 | 595 | |
| 596 | 596 | foreach ($arg as $v) { |
| 597 | - if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+' . $v . '/', $select, $m)) { |
|
| 597 | + if (preg_match('/(case\s+.*?else\s+0\s+end)\s*AS\s+'.$v.'/', $select, $m)) { |
|
| 598 | 598 | $res[] = $m[1]; |
| 599 | 599 | } else { |
| 600 | 600 | $res[] = $v; |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | $n++; |
| 773 | 773 | $res .= "\nwhen $index=$v then $n"; |
| 774 | 774 | } |
| 775 | - $arg = $m[1] . "case $res else 0 end " |
|
| 775 | + $arg = $m[1]."case $res else 0 end " |
|
| 776 | 776 | . substr($arg, strlen($m[0])); |
| 777 | 777 | } |
| 778 | 778 | |
@@ -815,9 +815,9 @@ discard block |
||
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | if (strtoupper($join) === 'AND') { |
| 818 | - return $exp . join("\n\t$join ", array_map('calculer_pg_where', $v)); |
|
| 818 | + return $exp.join("\n\t$join ", array_map('calculer_pg_where', $v)); |
|
| 819 | 819 | } else { |
| 820 | - return $exp . join($join, $v); |
|
| 820 | + return $exp.join($join, $v); |
|
| 821 | 821 | } |
| 822 | 822 | } |
| 823 | 823 | |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if (substr($k, -1) == '@') { |
| 828 | 828 | // c'est une jointure qui se refere au from precedent |
| 829 | 829 | // pas de virgule |
| 830 | - $argsas .= ' ' . $v; |
|
| 830 | + $argsas .= ' '.$v; |
|
| 831 | 831 | } else { |
| 832 | 832 | $as = ''; |
| 833 | 833 | // spip_log("$k : $v", _LOG_DEBUG); |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | } elseif ($v != $k) { |
| 838 | 838 | $p = strpos($v, ' '); |
| 839 | 839 | if ($p) { |
| 840 | - $v = substr($v, 0, $p) . " AS $k" . substr($v, $p); |
|
| 840 | + $v = substr($v, 0, $p)." AS $k".substr($v, $p); |
|
| 841 | 841 | } else { |
| 842 | 842 | $as = " AS $k"; |
| 843 | 843 | } |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | } |
| 846 | 846 | // spip_log("subs $k : $v avec $as", _LOG_DEBUG); |
| 847 | 847 | // if (strpos($v, 'JOIN') === false) $argsas .= ', '; |
| 848 | - $argsas .= ', ' . $v . $as; |
|
| 848 | + $argsas .= ', '.$v.$as; |
|
| 849 | 849 | } |
| 850 | 850 | } |
| 851 | 851 | |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | $serveur = '', |
| 877 | 877 | $requeter = true |
| 878 | 878 | ) { |
| 879 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 879 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 880 | 880 | $r = spip_pg_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter); |
| 881 | 881 | if (!$requeter) { |
| 882 | 882 | return $r; |
@@ -977,8 +977,8 @@ discard block |
||
| 977 | 977 | |
| 978 | 978 | return spip_pg_insert( |
| 979 | 979 | $table, |
| 980 | - '(' . join(',', array_keys($couples)) . ')', |
|
| 981 | - '(' . join(',', $couples) . ')', |
|
| 980 | + '('.join(',', array_keys($couples)).')', |
|
| 981 | + '('.join(',', $couples).')', |
|
| 982 | 982 | $desc, |
| 983 | 983 | $serveur, |
| 984 | 984 | $requeter |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $c = $tab_couples[0] ?? []; |
| 1002 | 1002 | $les_cles = spip_pg_ajouter_champs_timestamp($table, $c, $desc, $serveur); |
| 1003 | 1003 | |
| 1004 | - $cles = '(' . join(',', array_keys($les_cles)) . ')'; |
|
| 1004 | + $cles = '('.join(',', array_keys($les_cles)).')'; |
|
| 1005 | 1005 | $valeurs = []; |
| 1006 | 1006 | foreach ($tab_couples as $couples) { |
| 1007 | 1007 | foreach ($couples as $champ => $val) { |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci |
| 1011 | 1011 | $couples = spip_pg_ajouter_champs_timestamp($table, $couples, $desc, $serveur); |
| 1012 | 1012 | |
| 1013 | - $valeurs[] = '(' . join(',', $couples) . ')'; |
|
| 1013 | + $valeurs[] = '('.join(',', $couples).')'; |
|
| 1014 | 1014 | } |
| 1015 | 1015 | $valeurs = implode(', ', $valeurs); |
| 1016 | 1016 | |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | |
| 1032 | 1032 | $set = []; |
| 1033 | 1033 | foreach ($couples as $champ => $val) { |
| 1034 | - $set[] = $champ . '=' . $val; |
|
| 1034 | + $set[] = $champ.'='.$val; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | $query = calculer_pg_expression('UPDATE', $table, ',') |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | |
| 1067 | 1067 | function spip_pg_replace($table, $values, $desc, $serveur = '', $requeter = true) { |
| 1068 | 1068 | if (!$values) { |
| 1069 | - spip_log("replace vide $table", 'pg.' . _LOG_AVERTISSEMENT); |
|
| 1069 | + spip_log("replace vide $table", 'pg.'._LOG_AVERTISSEMENT); |
|
| 1070 | 1070 | |
| 1071 | 1071 | return 0; |
| 1072 | 1072 | } |
@@ -1100,8 +1100,8 @@ discard block |
||
| 1100 | 1100 | if (!$where) { |
| 1101 | 1101 | return spip_pg_insert( |
| 1102 | 1102 | $table, |
| 1103 | - '(' . join(',', array_keys($values)) . ')', |
|
| 1104 | - '(' . join(',', $values) . ')', |
|
| 1103 | + '('.join(',', array_keys($values)).')', |
|
| 1104 | + '('.join(',', $values).')', |
|
| 1105 | 1105 | $desc, |
| 1106 | 1106 | $serveur |
| 1107 | 1107 | ); |
@@ -1122,12 +1122,11 @@ discard block |
||
| 1122 | 1122 | $couples = pg_affected_rows($couples); |
| 1123 | 1123 | } |
| 1124 | 1124 | if (!$couples) { |
| 1125 | - $ret = !$seq ? '' : |
|
| 1126 | - (" RETURNING nextval('$seq') < $prim"); |
|
| 1127 | - $connexion['last'] = $q = "INSERT INTO $table (" . join(',', array_keys($values)) . ') VALUES (' . join( |
|
| 1125 | + $ret = !$seq ? '' : (" RETURNING nextval('$seq') < $prim"); |
|
| 1126 | + $connexion['last'] = $q = "INSERT INTO $table (".join(',', array_keys($values)).') VALUES ('.join( |
|
| 1128 | 1127 | ',', |
| 1129 | 1128 | $values |
| 1130 | - ) . ")$ret"; |
|
| 1129 | + ).")$ret"; |
|
| 1131 | 1130 | $couples = spip_pg_query_simple($link, $q); |
| 1132 | 1131 | if (!$couples) { |
| 1133 | 1132 | return false; |
@@ -1175,7 +1174,7 @@ discard block |
||
| 1175 | 1174 | ) { |
| 1176 | 1175 | return ''; |
| 1177 | 1176 | } else { |
| 1178 | - return $raw ? $prim : $table . '_' . $prim . '_seq'; |
|
| 1177 | + return $raw ? $prim : $table.'_'.$prim.'_seq'; |
|
| 1179 | 1178 | } |
| 1180 | 1179 | } |
| 1181 | 1180 | |
@@ -1192,29 +1191,29 @@ discard block |
||
| 1192 | 1191 | return spip_pg_frommysql($v); |
| 1193 | 1192 | } else { |
| 1194 | 1193 | if (strncmp($v, '0000', 4) == 0) { |
| 1195 | - $v = '0001' . substr($v, 4); |
|
| 1194 | + $v = '0001'.substr($v, 4); |
|
| 1196 | 1195 | } |
| 1197 | 1196 | if (strpos($v, '-00-00') === 4) { |
| 1198 | - $v = substr($v, 0, 4) . '-01-01' . substr($v, 10); |
|
| 1197 | + $v = substr($v, 0, 4).'-01-01'.substr($v, 10); |
|
| 1199 | 1198 | } |
| 1200 | 1199 | |
| 1201 | 1200 | return "timestamp '$v'"; |
| 1202 | 1201 | } |
| 1203 | 1202 | } elseif (!sql_test_int($t)) { |
| 1204 | - return ("'" . pg_escape_string($v) . "'"); |
|
| 1203 | + return ("'".pg_escape_string($v)."'"); |
|
| 1205 | 1204 | } elseif (is_numeric($v) or (strpos($v, 'CAST(') === 0)) { |
| 1206 | 1205 | return $v; |
| 1207 | 1206 | } elseif ($v[0] == '0' and $v[1] !== 'x' and ctype_xdigit(substr($v, 1))) { |
| 1208 | 1207 | return substr($v, 1); |
| 1209 | 1208 | } else { |
| 1210 | - spip_log("Warning: '$v' n'est pas de type $t", 'pg.' . _LOG_AVERTISSEMENT); |
|
| 1209 | + spip_log("Warning: '$v' n'est pas de type $t", 'pg.'._LOG_AVERTISSEMENT); |
|
| 1211 | 1210 | |
| 1212 | 1211 | return intval($v); |
| 1213 | 1212 | } |
| 1214 | 1213 | } |
| 1215 | 1214 | |
| 1216 | 1215 | function spip_pg_hex($v) { |
| 1217 | - return "CAST(x'" . $v . "' as bigint)"; |
|
| 1216 | + return "CAST(x'".$v."' as bigint)"; |
|
| 1218 | 1217 | } |
| 1219 | 1218 | |
| 1220 | 1219 | function spip_pg_quote($v, $type = '') { |
@@ -1252,15 +1251,15 @@ discard block |
||
| 1252 | 1251 | return $not ? '0=0' : '0=1'; |
| 1253 | 1252 | } |
| 1254 | 1253 | if (strpos($valeurs, "CAST(x'") !== false) { |
| 1255 | - return "($val=" . join("OR $val=", explode(',', $valeurs)) . ')'; |
|
| 1254 | + return "($val=".join("OR $val=", explode(',', $valeurs)).')'; |
|
| 1256 | 1255 | } |
| 1257 | 1256 | $n = $i = 0; |
| 1258 | 1257 | $in_sql = ''; |
| 1259 | 1258 | while ($n = strpos($valeurs, ',', $n + 1)) { |
| 1260 | 1259 | if ((++$i) >= 255) { |
| 1261 | - $in_sql .= "($val $not IN (" . |
|
| 1262 | - substr($valeurs, 0, $n) . |
|
| 1263 | - "))\n" . |
|
| 1260 | + $in_sql .= "($val $not IN (". |
|
| 1261 | + substr($valeurs, 0, $n). |
|
| 1262 | + "))\n". |
|
| 1264 | 1263 | ($not ? "AND\t" : "OR\t"); |
| 1265 | 1264 | $valeurs = substr($valeurs, $n + 1); |
| 1266 | 1265 | $i = $n = 0; |
@@ -1276,7 +1275,7 @@ discard block |
||
| 1276 | 1275 | $s = $link ? pg_last_error($link) : pg_last_error(); |
| 1277 | 1276 | if ($s) { |
| 1278 | 1277 | $s = str_replace('ERROR', 'errcode: 1000 ', $s); |
| 1279 | - spip_log("$s - $query", 'pg.' . _LOG_ERREUR); |
|
| 1278 | + spip_log("$s - $query", 'pg.'._LOG_ERREUR); |
|
| 1280 | 1279 | } |
| 1281 | 1280 | |
| 1282 | 1281 | return $s; |
@@ -1324,7 +1323,7 @@ discard block |
||
| 1324 | 1323 | function spip_pg_showbase($match, $serveur = '', $requeter = true) { |
| 1325 | 1324 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 1326 | 1325 | $link = $connexion['link']; |
| 1327 | - $connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE ' . _q($match); |
|
| 1326 | + $connexion['last'] = $q = 'SELECT tablename FROM pg_tables WHERE tablename ILIKE '._q($match); |
|
| 1328 | 1327 | |
| 1329 | 1328 | return spip_pg_query_simple($link, $q); |
| 1330 | 1329 | } |
@@ -1332,7 +1331,7 @@ discard block |
||
| 1332 | 1331 | function spip_pg_showtable($nom_table, $serveur = '', $requeter = true) { |
| 1333 | 1332 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 1334 | 1333 | $link = $connexion['link']; |
| 1335 | - $connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE ' . _q($nom_table); |
|
| 1334 | + $connexion['last'] = $q = 'SELECT column_name, column_default, data_type FROM information_schema.columns WHERE table_name ILIKE '._q($nom_table); |
|
| 1336 | 1335 | |
| 1337 | 1336 | $res = spip_pg_query_simple($link, $q); |
| 1338 | 1337 | if (!$res) { |
@@ -1343,15 +1342,15 @@ discard block |
||
| 1343 | 1342 | // il faut en tenir compte dans le return |
| 1344 | 1343 | $fields = []; |
| 1345 | 1344 | while ($field = pg_fetch_array($res, null, PGSQL_NUM)) { |
| 1346 | - $fields[$field[0]] = $field[2] . (!$field[1] ? '' : (' DEFAULT ' . $field[1])); |
|
| 1345 | + $fields[$field[0]] = $field[2].(!$field[1] ? '' : (' DEFAULT '.$field[1])); |
|
| 1347 | 1346 | } |
| 1348 | - $connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE ' . _q($nom_table); |
|
| 1347 | + $connexion['last'] = $q = 'SELECT indexdef FROM pg_indexes WHERE tablename ILIKE '._q($nom_table); |
|
| 1349 | 1348 | $res = spip_pg_query_simple($link, $q); |
| 1350 | 1349 | $keys = []; |
| 1351 | 1350 | while ($index = pg_fetch_array($res, null, PGSQL_NUM)) { |
| 1352 | 1351 | if (preg_match('/CREATE\s+(UNIQUE\s+)?INDEX\s([^\s]+).*\((.*)\)$/', $index[0], $r)) { |
| 1353 | - $nom = str_replace($nom_table . '_', '', $r[2]); |
|
| 1354 | - $keys[($r[1] ? 'PRIMARY KEY' : ('KEY ' . $nom))] = $r[3]; |
|
| 1352 | + $nom = str_replace($nom_table.'_', '', $r[2]); |
|
| 1353 | + $keys[($r[1] ? 'PRIMARY KEY' : ('KEY '.$nom))] = $r[3]; |
|
| 1355 | 1354 | } |
| 1356 | 1355 | } |
| 1357 | 1356 | |
@@ -1383,16 +1382,16 @@ discard block |
||
| 1383 | 1382 | if (strpos($k, 'KEY ') === 0) { |
| 1384 | 1383 | $n = str_replace('`', '', $k); |
| 1385 | 1384 | $v = str_replace('`', '"', $v); |
| 1386 | - $i = $nom . preg_replace('/KEY +/', '_', $n); |
|
| 1385 | + $i = $nom.preg_replace('/KEY +/', '_', $n); |
|
| 1387 | 1386 | if ($k != $n) { |
| 1388 | 1387 | $i = "\"$i\""; |
| 1389 | 1388 | } |
| 1390 | 1389 | $keys[] = "CREATE INDEX $i ON $nom ($v);"; |
| 1391 | 1390 | } elseif (strpos($k, 'UNIQUE ') === 0) { |
| 1392 | 1391 | $k = preg_replace('/^UNIQUE +/', '', $k); |
| 1393 | - $prim .= "$s\n\t\tCONSTRAINT " . str_replace('`', '"', $k) . " UNIQUE ($v)"; |
|
| 1392 | + $prim .= "$s\n\t\tCONSTRAINT ".str_replace('`', '"', $k)." UNIQUE ($v)"; |
|
| 1394 | 1393 | } else { |
| 1395 | - $prim .= "$s\n\t\t" . str_replace('`', '"', $k) . " ($v)"; |
|
| 1394 | + $prim .= "$s\n\t\t".str_replace('`', '"', $k)." ($v)"; |
|
| 1396 | 1395 | } |
| 1397 | 1396 | if ($k == 'PRIMARY KEY') { |
| 1398 | 1397 | $prim_name = $v; |
@@ -1403,17 +1402,17 @@ discard block |
||
| 1403 | 1402 | |
| 1404 | 1403 | $character_set = ''; |
| 1405 | 1404 | if (@$GLOBALS['meta']['charset_sql_base']) { |
| 1406 | - $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base']; |
|
| 1405 | + $character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base']; |
|
| 1407 | 1406 | } |
| 1408 | 1407 | if (@$GLOBALS['meta']['charset_collation_sql_base']) { |
| 1409 | - $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base']; |
|
| 1408 | + $character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base']; |
|
| 1410 | 1409 | } |
| 1411 | 1410 | |
| 1412 | 1411 | foreach ($champs as $k => $v) { |
| 1413 | 1412 | $k = str_replace('`', '"', $k); |
| 1414 | 1413 | if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) { |
| 1415 | 1414 | if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) { |
| 1416 | - $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1])); |
|
| 1415 | + $v = $defs[1].$character_set.' '.substr($v, strlen($defs[1])); |
|
| 1417 | 1416 | } |
| 1418 | 1417 | } |
| 1419 | 1418 | |
@@ -1428,7 +1427,7 @@ discard block |
||
| 1428 | 1427 | |
| 1429 | 1428 | // En l'absence de "if not exists" en PG, on neutralise les erreurs |
| 1430 | 1429 | |
| 1431 | - $q = "CREATE $temporary TABLE $nom ($query" . ($prim ? ",$prim" : '') . ')' . |
|
| 1430 | + $q = "CREATE $temporary TABLE $nom ($query".($prim ? ",$prim" : '').')'. |
|
| 1432 | 1431 | ($character_set ? " DEFAULT $character_set" : '') |
| 1433 | 1432 | . "\n"; |
| 1434 | 1433 | |
@@ -1439,7 +1438,7 @@ discard block |
||
| 1439 | 1438 | $r = @pg_query($link, $q); |
| 1440 | 1439 | |
| 1441 | 1440 | if (!$r) { |
| 1442 | - spip_log("Impossible de creer cette table: $q", 'pg.' . _LOG_ERREUR); |
|
| 1441 | + spip_log("Impossible de creer cette table: $q", 'pg.'._LOG_ERREUR); |
|
| 1443 | 1442 | } else { |
| 1444 | 1443 | foreach ($keys as $index) { |
| 1445 | 1444 | pg_query($link, $index); |
@@ -1462,20 +1461,20 @@ discard block |
||
| 1462 | 1461 | // vue deja presente |
| 1463 | 1462 | if (sql_showtable($nom, false, $serveur)) { |
| 1464 | 1463 | if ($requeter) { |
| 1465 | - spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.' . _LOG_ERREUR); |
|
| 1464 | + spip_log("Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", 'pg.'._LOG_ERREUR); |
|
| 1466 | 1465 | } |
| 1467 | 1466 | |
| 1468 | 1467 | return false; |
| 1469 | 1468 | } |
| 1470 | 1469 | |
| 1471 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 1470 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 1472 | 1471 | |
| 1473 | 1472 | return spip_pg_query($query, $serveur, $requeter); |
| 1474 | 1473 | } |
| 1475 | 1474 | |
| 1476 | 1475 | |
| 1477 | 1476 | function spip_pg_set_connect_charset($charset, $serveur = '', $requeter = true) { |
| 1478 | - spip_log('changement de charset sql a ecrire en PG', 'pg.' . _LOG_ERREUR); |
|
| 1477 | + spip_log('changement de charset sql a ecrire en PG', 'pg.'._LOG_ERREUR); |
|
| 1479 | 1478 | } |
| 1480 | 1479 | |
| 1481 | 1480 | |
@@ -1488,7 +1487,7 @@ discard block |
||
| 1488 | 1487 | * @return bool|string true / false / requete |
| 1489 | 1488 | **/ |
| 1490 | 1489 | function spip_pg_optimize($table, $serveur = '', $requeter = true) { |
| 1491 | - return spip_pg_query('VACUUM ' . $table, $serveur, $requeter); |
|
| 1490 | + return spip_pg_query('VACUUM '.$table, $serveur, $requeter); |
|
| 1492 | 1491 | } |
| 1493 | 1492 | |
| 1494 | 1493 | // Selectionner la sous-chaine dans $objet |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | include_spip('base/abstract_sql'); |
| 64 | - $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email'])); |
|
| 64 | + $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email='.sql_quote($desc['email'])); |
|
| 65 | 65 | // erreur ? |
| 66 | 66 | if (!$res) { |
| 67 | 67 | return _T('titre_probleme_technique'); |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | $login = $login_base; |
| 219 | 219 | |
| 220 | - for ($i = 1;; $i++) { |
|
| 220 | + for ($i = 1; ; $i++) { |
|
| 221 | 221 | if (!sql_countsel('spip_auteurs', "login='$login'")) { |
| 222 | 222 | return $login; |
| 223 | 223 | } |
| 224 | - $login = $login_base . $i; |
|
| 224 | + $login = $login_base.$i; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
@@ -361,11 +361,11 @@ discard block |
||
| 361 | 361 | do { |
| 362 | 362 | // Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer |
| 363 | 363 | // tous les jetons connus pour vérifier le jeton d’un auteur. |
| 364 | - $public = substr(creer_uniqid(), 0, 7) . '.'; |
|
| 365 | - $jeton = $public . creer_uniqid(); |
|
| 366 | - $jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | - sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur)); |
|
| 368 | - } while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 364 | + $public = substr(creer_uniqid(), 0, 7).'.'; |
|
| 365 | + $jeton = $public.creer_uniqid(); |
|
| 366 | + $jeton_chiffre_prefixe = $public.Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | + sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur='.intval($id_auteur)); |
|
| 368 | + } while (sql_countsel('spip_auteurs', 'cookie_oubli='.sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 369 | 369 | |
| 370 | 370 | return $jeton; |
| 371 | 371 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | function auteur_lire_jeton(int $id_auteur, bool $autoInit = false): ?string { |
| 384 | 384 | include_spip('base/abstract_sql'); |
| 385 | - $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur); |
|
| 385 | + $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur='.$id_auteur); |
|
| 386 | 386 | if ($jeton_chiffre_prefixe) { |
| 387 | 387 | $jeton_chiffre = substr($jeton_chiffre_prefixe, 8); |
| 388 | 388 | $jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | $public = substr($jeton, 0, 8); |
| 413 | 413 | |
| 414 | 414 | // Les auteurs qui ont un jetons ressemblant |
| 415 | - $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%')); |
|
| 415 | + $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE '.sql_quote($public.'%')); |
|
| 416 | 416 | foreach ($auteurs as $auteur) { |
| 417 | 417 | $jeton_chiffre = substr($auteur['cookie_oubli'], 8); |
| 418 | 418 | $_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
@@ -431,5 +431,5 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | function auteur_effacer_jeton($id_auteur) { |
| 433 | 433 | include_spip('base/abstract_sql'); |
| 434 | - return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur)); |
|
| 434 | + return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur='.intval($id_auteur)); |
|
| 435 | 435 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | return $this->iter->{$nom}(); |
| 151 | 151 | } catch (Exception $e) { |
| 152 | 152 | // #GETCHILDREN sur un fichier de DirectoryIterator ... |
| 153 | - spip_log("Methode {$nom} en echec sur " . get_class($this->iter)); |
|
| 153 | + spip_log("Methode {$nom} en echec sur ".get_class($this->iter)); |
|
| 154 | 154 | spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode"); |
| 155 | 155 | |
| 156 | 156 | return ''; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | return null; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | - return '(' . implode(") {$operateur} (", $filtres_string) . ')'; |
|
| 377 | + return '('.implode(") {$operateur} (", $filtres_string).')'; |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | return $this->composer_filtre($v[1], $v[0], $v[2]); |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | - return null; // sera ignore |
|
| 460 | + return null; // sera ignore |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | /** |
@@ -485,28 +485,28 @@ discard block |
||
| 485 | 485 | // if (!in_array($cle, array('cle', 'valeur'))) |
| 486 | 486 | // return; |
| 487 | 487 | |
| 488 | - $a = '$this->get_select(\'' . $cle . '\')'; |
|
| 488 | + $a = '$this->get_select(\''.$cle.'\')'; |
|
| 489 | 489 | |
| 490 | 490 | $filtre = ''; |
| 491 | 491 | |
| 492 | 492 | if ('REGEXP' == $op) { |
| 493 | - $filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', $valeur) . ')'; |
|
| 493 | + $filtre = 'filtrer("match", '.$a.', '.str_replace('\"', '"', $valeur).')'; |
|
| 494 | 494 | $op = ''; |
| 495 | 495 | } else { |
| 496 | 496 | if ('LIKE' == $op) { |
| 497 | 497 | $valeur = str_replace(['\"', '_', '%'], ['"', '.', '.*'], preg_quote($valeur)); |
| 498 | - $filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')'; |
|
| 498 | + $filtre = 'filtrer("match", '.$a.', '.$valeur.')'; |
|
| 499 | 499 | $op = ''; |
| 500 | 500 | } else { |
| 501 | 501 | if ('=' == $op) { |
| 502 | 502 | $op = '=='; |
| 503 | 503 | } else { |
| 504 | 504 | if ('IN' == $op) { |
| 505 | - $filtre = 'in_array(' . $a . ', array' . $valeur . ')'; |
|
| 505 | + $filtre = 'in_array('.$a.', array'.$valeur.')'; |
|
| 506 | 506 | $op = ''; |
| 507 | 507 | } else { |
| 508 | 508 | if (!in_array($op, ['<', '<=', '>', '>='])) { |
| 509 | - spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette |
|
| 509 | + spip_log('operateur non reconnu '.$op); // [todo] mettre une erreur de squelette |
|
| 510 | 510 | $op = ''; |
| 511 | 511 | } |
| 512 | 512 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | if ($op) { |
| 518 | - $filtre = $a . $op . str_replace('\"', '"', $valeur); |
|
| 518 | + $filtre = $a.$op.str_replace('\"', '"', $valeur); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | if ($not) { |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | // Creer la fonction de filtrage sur $this |
| 565 | 565 | if ($this->filtre) { |
| 566 | 566 | if ($filtres = $this->assembler_filtres($this->filtre)) { |
| 567 | - $filtres = 'return ' . $filtres . ';'; |
|
| 567 | + $filtres = 'return '.$filtres.';'; |
|
| 568 | 568 | $this->func_filtre = fn () => eval($filtres); |
| 569 | 569 | } else { |
| 570 | 570 | $this->func_filtre = null; |