@@ -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. |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ($dir) { |
| 374 | 374 | $dir .= '/'; |
| 375 | 375 | } |
| 376 | - $dir .= 'procure:' . $procure['nom']; |
|
| 376 | + $dir .= 'procure:'.$procure['nom']; |
|
| 377 | 377 | |
| 378 | 378 | $procure['etat'] = '?'; |
| 379 | 379 | $procure['dir_type'] = $resume['dir_type']; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $plug = $resume['dir']; |
| 558 | 558 | $k = $infos[$dir_type][$plug]; |
| 559 | 559 | |
| 560 | - $plug = constant($dir_type) . $plug; |
|
| 560 | + $plug = constant($dir_type).$plug; |
|
| 561 | 561 | if (!isset($msg[$p])) { |
| 562 | 562 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 563 | 563 | $msg[$p] = [$resume['erreur']]; |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 601 | 601 | } elseif (!$raw) { |
| 602 | 602 | foreach ($list as $plug => $msg) { |
| 603 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 603 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 605 | 605 | } |
| 606 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 606 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 607 | 607 | } |
| 608 | 608 | if ($raz) { |
| 609 | 609 | effacer_meta('plugin_erreur_activation'); |
@@ -717,13 +717,13 @@ discard block |
||
| 717 | 717 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 718 | 718 | return _T("plugin_${balise}_${type}", [ |
| 719 | 719 | 'plugin' => $nom, |
| 720 | - 'version' => ' ≥ ' . $minimum |
|
| 720 | + 'version' => ' ≥ '.$minimum |
|
| 721 | 721 | ]); |
| 722 | 722 | } |
| 723 | 723 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 724 | 724 | return _T("plugin_${balise}_${type}", [ |
| 725 | 725 | 'plugin' => $nom, |
| 726 | - 'version' => ' > ' . $minimum |
|
| 726 | + 'version' => ' > '.$minimum |
|
| 727 | 727 | ]); |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -732,13 +732,13 @@ discard block |
||
| 732 | 732 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 733 | 733 | return _T("plugin_${balise}_${type}", [ |
| 734 | 734 | 'plugin' => $nom, |
| 735 | - 'version' => ' ≤ ' . $maximum |
|
| 735 | + 'version' => ' ≤ '.$maximum |
|
| 736 | 736 | ]); |
| 737 | 737 | } |
| 738 | 738 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 739 | 739 | return _T("plugin_${balise}_plugin", [ |
| 740 | 740 | 'plugin' => $nom, |
| 741 | - 'version' => ' < ' . $maximum |
|
| 741 | + 'version' => ' < '.$maximum |
|
| 742 | 742 | ]); |
| 743 | 743 | } |
| 744 | 744 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | include_spip('inc/charger_plugin'); |
| 758 | 758 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 759 | 759 | }*/ |
| 760 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 760 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($plugin_valides as $p => $resume) { |
| 858 | 858 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 859 | 859 | if (0 !== strpos($p, 'PHP:') and $p !== 'PHP') { |
| 860 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 860 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 861 | 861 | } |
| 862 | 862 | if ($resume['dir']) { |
| 863 | 863 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $header = strtolower(implode(',', $header)); |
| 883 | 883 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 884 | 884 | ecrire_fichier( |
| 885 | - _DIR_VAR . 'config.txt', |
|
| 886 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 885 | + _DIR_VAR.'config.txt', |
|
| 886 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 887 | 887 | ); |
| 888 | 888 | } else { |
| 889 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 889 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 890 | 890 | } |
| 891 | 891 | // generer charger_plugins_chemin.php |
| 892 | 892 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | // definir le plugin, donc le path avant l'include du fichier options |
| 941 | 941 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 942 | 942 | |
| 943 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 943 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 944 | 944 | |
| 945 | 945 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 946 | 946 | if ( |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if (!$info['chemin']) { |
| 952 | 952 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 953 | 953 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 954 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 954 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 955 | 955 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 956 | } |
| 957 | 957 | } |
@@ -972,13 +972,13 @@ discard block |
||
| 972 | 972 | $dir = ''; |
| 973 | 973 | } |
| 974 | 974 | if (strlen($dir)) { |
| 975 | - $dir = rtrim($dir, '/') . '/'; |
|
| 975 | + $dir = rtrim($dir, '/').'/'; |
|
| 976 | 976 | } |
| 977 | 977 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 978 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 978 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | 979 | } |
| 980 | 980 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 981 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 981 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | 982 | } |
| 983 | 983 | } |
| 984 | 984 | } |
@@ -987,11 +987,11 @@ discard block |
||
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 990 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 990 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 991 | 991 | ',', |
| 992 | 992 | array_reverse($chemins['public']) |
| 993 | - ) . "]);\n" |
|
| 994 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 993 | + )."]);\n" |
|
| 994 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | and strpos($dir, ':') === false // exclure le cas des procure: |
| 1041 | 1041 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1042 | 1042 | ) { |
| 1043 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1043 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1044 | 1044 | $info[$charge] = [$file]; |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | ) { |
| 1058 | 1058 | unset($info[$charge][$k]); |
| 1059 | 1059 | } else { |
| 1060 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1060 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1061 | 1061 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | } |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1070 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1071 | 1071 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1072 | 1072 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1073 | 1073 | |
@@ -1102,12 +1102,12 @@ discard block |
||
| 1102 | 1102 | define("_UPDATED_$nom", $val); |
| 1103 | 1103 | define("_UPDATED_md5_$nom", $md5); |
| 1104 | 1104 | } |
| 1105 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1105 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1106 | 1106 | |
| 1107 | 1107 | return |
| 1108 | 1108 | "if (!function_exists('$nom')) {\n" |
| 1109 | 1109 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1110 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1110 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1111 | 1111 | . "}\n"; |
| 1112 | 1112 | } |
| 1113 | 1113 | |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1131 | 1131 | include_once(_CACHE_PLUGINS_OPT); |
| 1132 | 1132 | } else { |
| 1133 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1133 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } |
| 1136 | 1136 | |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1168 | 1168 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1169 | 1169 | $plug = $plugin_valides[$p]['dir']; |
| 1170 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1170 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1171 | 1171 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1172 | 1172 | foreach ($info['pipeline'] as $pipe) { |
| 1173 | 1173 | $nom = $pipe['nom']; |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | } |
| 1202 | 1202 | if (isset($pipe['inclure'])) { |
| 1203 | 1203 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1204 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1204 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | $prepend_code['taches_generales_cron'] = ''; |
| 1212 | 1212 | } |
| 1213 | 1213 | foreach ($info['genie'] as $genie) { |
| 1214 | - $nom = $prefix . $genie['nom']; |
|
| 1214 | + $nom = $prefix.$genie['nom']; |
|
| 1215 | 1215 | $periode = max(60, intval($genie['periode'])); |
| 1216 | 1216 | if (charger_fonction($nom, 'genie', true)) { |
| 1217 | 1217 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1229,13 +1229,13 @@ discard block |
||
| 1229 | 1229 | } |
| 1230 | 1230 | foreach ($info['style'] as $style) { |
| 1231 | 1231 | if (isset($style['path']) and $style['path']) { |
| 1232 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1232 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1233 | 1233 | } else { |
| 1234 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1234 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1237 | 1237 | if (isset($style['media']) and strlen($style['media'])) { |
| 1238 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1238 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1239 | 1239 | } |
| 1240 | 1240 | $code .= "/>';\n"; |
| 1241 | 1241 | if ($style['type'] != 'prive') { |
@@ -1255,9 +1255,9 @@ discard block |
||
| 1255 | 1255 | if (isset($info['script']) and count($info['script'])) { |
| 1256 | 1256 | foreach ($info['script'] as $script) { |
| 1257 | 1257 | if (isset($script['path']) and $script['path']) { |
| 1258 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1258 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1259 | 1259 | } else { |
| 1260 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1260 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1261 | 1261 | } |
| 1262 | 1262 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1263 | 1263 | if ($script['type'] != 'prive') { |
@@ -1320,10 +1320,10 @@ discard block |
||
| 1320 | 1320 | unset($GLOBALS['spip_pipeline']['all']); |
| 1321 | 1321 | $all_pipes = trim(array_shift($a)); |
| 1322 | 1322 | if ($all_pipes) { |
| 1323 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1323 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1324 | 1324 | } |
| 1325 | 1325 | if (count($a)) { |
| 1326 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1326 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | $content = ''; |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1341 | 1341 | foreach ($pipe as $fonc) { |
| 1342 | 1342 | $fonc = trim($fonc); |
| 1343 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1343 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1344 | 1344 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1345 | 1345 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1346 | 1346 | $file = "'$file'"; |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | if (defined($root_dir)) { |
| 1352 | 1352 | $dir = $root_dir; |
| 1353 | 1353 | } |
| 1354 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1354 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1355 | 1355 | $file = str_replace("''.", '', $file); |
| 1356 | 1356 | $file = str_replace(constant($dir), '', $file); |
| 1357 | 1357 | } |
@@ -1364,7 +1364,7 @@ discard block |
||
| 1364 | 1364 | $content .= "// Pipeline $action \n" |
| 1365 | 1365 | . "function execute_pipeline_$action(&\$val){\n" |
| 1366 | 1366 | . $s_inc |
| 1367 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1367 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1368 | 1368 | . $s_call |
| 1369 | 1369 | . "return \$val;\n}\n"; |
| 1370 | 1370 | } |
@@ -1420,9 +1420,9 @@ discard block |
||
| 1420 | 1420 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1421 | 1421 | if (_IS_CLI) { |
| 1422 | 1422 | include_spip('inc/filtres'); |
| 1423 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1424 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1425 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1423 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1424 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1425 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1426 | 1426 | $trace, |
| 1427 | 1427 | "\n"; |
| 1428 | 1428 | } |
@@ -1457,15 +1457,15 @@ discard block |
||
| 1457 | 1457 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1460 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1461 | 1461 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1462 | 1462 | // si pas de modif on ne touche pas au fichier initial |
| 1463 | 1463 | if (file_exists($nom)) { |
| 1464 | 1464 | if (substr($nom, -4) == '.php') { |
| 1465 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1465 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | else { |
| 1468 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1468 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1469 | 1469 | } |
| 1470 | 1470 | file_put_contents($fichier_tmp, $contenu); |
| 1471 | 1471 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $hsl = _couleur_hex_to_hsl($couleur); |
| 205 | 205 | $hsl = [ |
| 206 | 206 | 'h' => round($hsl['h'] * 360), |
| 207 | - 's' => round($hsl['s'] * 100) . '%', |
|
| 208 | - 'l' => round($hsl['l'] * 100) . '%' |
|
| 207 | + 's' => round($hsl['s'] * 100).'%', |
|
| 208 | + 'l' => round($hsl['l'] * 100).'%' |
|
| 209 | 209 | ]; |
| 210 | 210 | if ($format === null) { |
| 211 | 211 | return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})"; |
@@ -384,11 +384,11 @@ discard block |
||
| 384 | 384 | $process = 'AUTO' |
| 385 | 385 | ) { |
| 386 | 386 | // PHP 7+ type hint |
| 387 | - $img = (string)$img; |
|
| 388 | - $taille_x = (int)$taille_x; |
|
| 389 | - $taille_y = (int)$taille_y; |
|
| 390 | - $force = (bool)$force; |
|
| 391 | - $process = (string)$process; |
|
| 387 | + $img = (string) $img; |
|
| 388 | + $taille_x = (int) $taille_x; |
|
| 389 | + $taille_y = (int) $taille_y; |
|
| 390 | + $force = (bool) $force; |
|
| 391 | + $process = (string) $process; |
|
| 392 | 392 | |
| 393 | 393 | if (!$img) { |
| 394 | 394 | return ''; |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $process = 'AUTO' |
| 466 | 466 | ) { |
| 467 | 467 | // PHP 7+ type hint |
| 468 | - $img = (string)$img; |
|
| 469 | - $taille = (int)$taille; |
|
| 470 | - $taille_y = (int)$taille_y; |
|
| 471 | - $force = (bool)$force; |
|
| 472 | - $process = (string)$process; |
|
| 468 | + $img = (string) $img; |
|
| 469 | + $taille = (int) $taille; |
|
| 470 | + $taille_y = (int) $taille_y; |
|
| 471 | + $force = (bool) $force; |
|
| 472 | + $process = (string) $process; |
|
| 473 | 473 | |
| 474 | 474 | // Determiner la taille x,y maxi |
| 475 | 475 | // prendre le reglage de previsu par defaut |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $background_color = 'white' |
| 513 | 513 | ) { |
| 514 | 514 | if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') { |
| 515 | - return image_reduire(image_recadre($im, $width . ':' . $height, '-', $position, $background_color), $width, $height); |
|
| 515 | + return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | 516 | } else { return image_passe_partout($im, $width, $height); |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | **/ |
| 534 | 534 | function image_reduire_par($img, $val = 1, $force = false) { |
| 535 | 535 | // PHP 7+ type hint |
| 536 | - $img = (string)$img; |
|
| 537 | - $val = (int)$val; |
|
| 538 | - $force = (bool)$force; |
|
| 536 | + $img = (string) $img; |
|
| 537 | + $val = (int) $val; |
|
| 538 | + $force = (bool) $force; |
|
| 539 | 539 | |
| 540 | 540 | list($hauteur, $largeur) = taille_image($img); |
| 541 | 541 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | static $t1 = ['&', '<', '>']; |
| 121 | 121 | static $t2 = ['&', '<', '>']; |
| 122 | 122 | |
| 123 | - return '<pre>' . str_replace($t1, $t2, $t) . '</pre>'; |
|
| 123 | + return '<pre>'.str_replace($t1, $t2, $t).'</pre>'; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | foreach ($lignes as &$l) { |
| 141 | 141 | $l = join('|', $l); |
| 142 | 142 | } |
| 143 | - $corps = join("\n", $lignes) . "\n"; |
|
| 144 | - $corps = $caption . |
|
| 145 | - "\n|{{" . |
|
| 146 | - join('}}|{{', $entete) . |
|
| 147 | - '}}|' . |
|
| 148 | - "\n|" . |
|
| 143 | + $corps = join("\n", $lignes)."\n"; |
|
| 144 | + $corps = $caption. |
|
| 145 | + "\n|{{". |
|
| 146 | + join('}}|{{', $entete). |
|
| 147 | + '}}|'. |
|
| 148 | + "\n|". |
|
| 149 | 149 | str_replace("\n", "|\n|", $corps); |
| 150 | 150 | include_spip('inc/texte'); |
| 151 | 151 | |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 190 | - $t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t)); |
|
| 190 | + $t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t)); |
|
| 191 | 191 | |
| 192 | - return (!$style ? '' : "\n<style>" . $style . '</style>') . $t; |
|
| 192 | + return (!$style ? '' : "\n<style>".$style.'</style>').$t; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2097152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode == 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . $res['status'], 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".$res['status'], 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | if (!$res['length']) { |
| 121 | 121 | // si $t c'est sans doute juste un not-modified-since |
| 122 | 122 | return $t ? $local : false; |
| 123 | 123 | } |
| 124 | - spip_log("copie_locale : recuperation $source sur $localrac taille " . $res['length'] . ' OK', 'distant'); |
|
| 124 | + spip_log("copie_locale : recuperation $source sur $localrac taille ".$res['length'].' OK', 'distant'); |
|
| 125 | 125 | |
| 126 | 126 | // pour une eventuelle indexation |
| 127 | 127 | pipeline( |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | $parts = array_map('intval', explode('.', $ip)); |
| 209 | 209 | if ( |
| 210 | 210 | 127 === $parts[0] or 10 === $parts[0] or 0 === $parts[0] |
| 211 | - or ( 172 === $parts[0] and 16 <= $parts[1] and 31 >= $parts[1] ) |
|
| 212 | - or ( 192 === $parts[0] && 168 === $parts[1] ) |
|
| 211 | + or (172 === $parts[0] and 16 <= $parts[1] and 31 >= $parts[1]) |
|
| 212 | + or (192 === $parts[0] && 168 === $parts[1]) |
|
| 213 | 213 | ) { |
| 214 | 214 | return false; |
| 215 | 215 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | $port = $parsed_url['port']; |
| 224 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 224 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 225 | 225 | return $url; |
| 226 | 226 | } |
| 227 | 227 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | if ($taille > 500) { |
| 294 | - $boundary = substr(md5(rand() . 'spip'), 0, 8); |
|
| 294 | + $boundary = substr(md5(rand().'spip'), 0, 8); |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |
@@ -319,16 +319,16 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | } else { |
| 321 | 321 | // fabrique une chaine HTTP simple pour un POST |
| 322 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 322 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 323 | 323 | $chaine = []; |
| 324 | 324 | if (is_array($donnees)) { |
| 325 | 325 | foreach ($donnees as $cle => $valeur) { |
| 326 | 326 | if (is_array($valeur)) { |
| 327 | 327 | foreach ($valeur as $val2) { |
| 328 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 328 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 329 | 329 | } |
| 330 | 330 | } else { |
| 331 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 331 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | $chaine = implode('&', $chaine); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $url_idn = implode($host_ascii, $url_idn); |
| 363 | 363 | } |
| 364 | 364 | // et on urlencode les char utf si besoin dans le path |
| 365 | - $url_idn = preg_replace_callback('/[^\x20-\x7f]/', function ($match) { |
|
| 365 | + $url_idn = preg_replace_callback('/[^\x20-\x7f]/', function($match) { |
|
| 366 | 366 | return urlencode($match[0]); |
| 367 | 367 | }, $url_idn); |
| 368 | 368 | } |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $head_add = ''; |
| 441 | 441 | if (!empty($options['headers'])) { |
| 442 | 442 | foreach ($options['headers'] as $champ => $valeur) { |
| 443 | - $head_add .= $champ . ': ' . $valeur . "\r\n"; |
|
| 443 | + $head_add .= $champ.': '.$valeur."\r\n"; |
|
| 444 | 444 | } |
| 445 | 445 | // ne pas le repasser a recuperer_url si on follow un location, car ils seront dans datas |
| 446 | 446 | unset($options['entetes']); |
@@ -450,9 +450,9 @@ discard block |
||
| 450 | 450 | list($head, $postdata) = prepare_donnees_post($options['datas'], $options['boundary']); |
| 451 | 451 | $head .= $head_add; |
| 452 | 452 | if (stripos($head, 'Content-Length:') === false) { |
| 453 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 453 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 454 | 454 | } |
| 455 | - $options['datas'] = $head . "\r\n" . $postdata; |
|
| 455 | + $options['datas'] = $head."\r\n".$postdata; |
|
| 456 | 456 | if ( |
| 457 | 457 | strlen($postdata) |
| 458 | 458 | and !$methode_demandee |
@@ -460,15 +460,15 @@ discard block |
||
| 460 | 460 | $options['methode'] = 'POST'; |
| 461 | 461 | } |
| 462 | 462 | } elseif ($head_add) { |
| 463 | - $options['datas'] = $head_add . "\r\n"; |
|
| 463 | + $options['datas'] = $head_add."\r\n"; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 467 | 467 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 468 | 468 | if (!tester_url_absolue($url)) { |
| 469 | - $url = 'http://' . $url; |
|
| 469 | + $url = 'http://'.$url; |
|
| 470 | 470 | } elseif (strncmp($url, '//', 2) == 0) { |
| 471 | - $url = 'http:' . $url; |
|
| 471 | + $url = 'http:'.$url; |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | $url = url_to_ascii($url); |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $options['if_modified_since'] |
| 498 | 498 | ); |
| 499 | 499 | if (!$handle) { |
| 500 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 500 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 501 | 501 | |
| 502 | 502 | return false; |
| 503 | 503 | } |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | 'status' => 200, |
| 528 | 528 | ]; |
| 529 | 529 | } else { |
| 530 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 530 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 531 | 531 | return false; |
| 532 | 532 | } |
| 533 | 533 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | |
| 540 | 540 | return recuperer_url($url, $options); |
| 541 | 541 | } elseif ($res['status'] !== 200) { |
| 542 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 542 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 543 | 543 | } |
| 544 | 544 | $result['status'] = $res['status']; |
| 545 | 545 | if (isset($res['headers'])) { |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | |
| 565 | 565 | $gz = false; |
| 566 | 566 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 567 | - $gz = (_DIR_TMP . md5(uniqid(mt_rand())) . '.tmp.gz'); |
|
| 567 | + $gz = (_DIR_TMP.md5(uniqid(mt_rand())).'.tmp.gz'); |
|
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | $sig['url'] = $url; |
| 651 | 651 | |
| 652 | 652 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 653 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 653 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 654 | 654 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 655 | 655 | $cache = "$sub$cache"; |
| 656 | 656 | |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | $fp = false; |
| 704 | 704 | if ($fichier) { |
| 705 | 705 | include_spip('inc/acces'); |
| 706 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 706 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 707 | 707 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 708 | 708 | if (!$fp and file_exists($fichier)) { |
| 709 | 709 | return filesize($fichier); |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | } |
| 763 | 763 | $result['status'] = intval($r[1]); |
| 764 | 764 | while ($s = trim(fgets($handle, 16384))) { |
| 765 | - $result['headers'][] = $s . "\n"; |
|
| 765 | + $result['headers'][] = $s."\n"; |
|
| 766 | 766 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 767 | 767 | list(, $d, $v) = $r; |
| 768 | 768 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -811,13 +811,13 @@ discard block |
||
| 811 | 811 | |
| 812 | 812 | // on se place tout le temps comme si on etait a la racine |
| 813 | 813 | if (_DIR_RACINE) { |
| 814 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 814 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | $m = md5($source); |
| 818 | 818 | |
| 819 | 819 | return $d |
| 820 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 820 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 821 | 821 | . substr($m, 0, 4) |
| 822 | 822 | . ".$extension"; |
| 823 | 823 | } |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | // Si c'est deja local pas de souci |
| 841 | 841 | if (!tester_url_absolue($source)) { |
| 842 | 842 | if (_DIR_RACINE) { |
| 843 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 843 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | return $source; |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | $ext |
| 859 | 859 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 860 | 860 | and $f = nom_fichier_copie_locale($source, $ext) |
| 861 | - and file_exists(_DIR_RACINE . $f) |
|
| 861 | + and file_exists(_DIR_RACINE.$f) |
|
| 862 | 862 | ) { |
| 863 | 863 | return $f; |
| 864 | 864 | } |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | |
| 867 | 867 | // Si c'est deja dans la table des documents, |
| 868 | 868 | // ramener le nom de sa copie potentielle |
| 869 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 869 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 870 | 870 | |
| 871 | 871 | if ($ext) { |
| 872 | 872 | return nom_fichier_copie_locale($source, $ext); |
@@ -877,9 +877,9 @@ discard block |
||
| 877 | 877 | |
| 878 | 878 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 879 | 879 | |
| 880 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 880 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 881 | 881 | $f = nom_fichier_copie_locale($source, $ext); |
| 882 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 882 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 883 | 883 | return $f; |
| 884 | 884 | } |
| 885 | 885 | } |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | // Ping pour voir si son extension est connue et autorisee |
| 888 | 888 | // avec mise en cache du resultat du ping |
| 889 | 889 | |
| 890 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 890 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 891 | 891 | if ( |
| 892 | 892 | !@file_exists($cache) |
| 893 | 893 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -897,10 +897,10 @@ discard block |
||
| 897 | 897 | ecrire_fichier($cache, serialize($path_parts)); |
| 898 | 898 | } |
| 899 | 899 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 900 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 900 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 901 | 901 | return nom_fichier_copie_locale($source, $ext); |
| 902 | 902 | } |
| 903 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 903 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | |
@@ -967,20 +967,20 @@ discard block |
||
| 967 | 967 | !$t |
| 968 | 968 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 969 | 969 | ) { |
| 970 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 970 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 971 | 971 | } |
| 972 | 972 | if ( |
| 973 | 973 | !$t |
| 974 | 974 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 975 | 975 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 976 | 976 | ) { |
| 977 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 977 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 978 | 978 | } |
| 979 | 979 | } |
| 980 | 980 | |
| 981 | 981 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 982 | 982 | if (!$t) { |
| 983 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 983 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -991,11 +991,11 @@ discard block |
||
| 991 | 991 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 992 | 992 | ) { |
| 993 | 993 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 994 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 994 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | if ($t) { |
| 998 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 998 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 999 | 999 | $a['extension'] = $t['extension']; |
| 1000 | 1000 | } else { |
| 1001 | 1001 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | } else { |
| 1041 | 1041 | if ($a['body']) { |
| 1042 | 1042 | $a['extension'] = $extension; |
| 1043 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1043 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1044 | 1044 | ecrire_fichier($a['fichier'], $a['body']); |
| 1045 | 1045 | $size_image = @spip_getimagesize($a['fichier']); |
| 1046 | 1046 | $a['largeur'] = intval($size_image[0]); |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | } |
| 1169 | 1169 | } else { |
| 1170 | 1170 | $scheme = $t['scheme']; |
| 1171 | - $noproxy = $scheme . '://'; |
|
| 1171 | + $noproxy = $scheme.'://'; |
|
| 1172 | 1172 | } |
| 1173 | 1173 | if (isset($t['user'])) { |
| 1174 | 1174 | $user = [$t['user'], $t['pass']]; |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | if (!empty($t['query'])) { |
| 1185 | - $path .= '?' . $t['query']; |
|
| 1185 | + $path .= '?'.$t['query']; |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1256,20 +1256,20 @@ discard block |
||
| 1256 | 1256 | $proxy_user = ''; |
| 1257 | 1257 | $http_proxy = need_proxy($host); |
| 1258 | 1258 | if ($user) { |
| 1259 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1259 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | 1262 | $connect = ''; |
| 1263 | 1263 | if ($http_proxy) { |
| 1264 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1265 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1266 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1264 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1265 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1266 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1267 | 1267 | . "Host: $path_host\r\n" |
| 1268 | 1268 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1269 | 1269 | } else { |
| 1270 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1270 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1271 | 1271 | . (!$user ? '' : "$user@") |
| 1272 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1272 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1273 | 1273 | } |
| 1274 | 1274 | $t2 = @parse_url($http_proxy); |
| 1275 | 1275 | $first_host = $t2['host']; |
@@ -1277,10 +1277,10 @@ discard block |
||
| 1277 | 1277 | $port = 80; |
| 1278 | 1278 | } |
| 1279 | 1279 | if ($t2['user']) { |
| 1280 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1280 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1281 | 1281 | } |
| 1282 | 1282 | } else { |
| 1283 | - $first_host = $noproxy . $host; |
|
| 1283 | + $first_host = $noproxy.$host; |
|
| 1284 | 1284 | } |
| 1285 | 1285 | |
| 1286 | 1286 | if ($connect) { |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | ); |
| 1303 | 1303 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1304 | 1304 | if (!$f) { |
| 1305 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1305 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1306 | 1306 | return $errno; |
| 1307 | 1307 | } |
| 1308 | 1308 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | or !count($res = explode(' ', $res)) |
| 1316 | 1316 | or $res[1] !== '200' |
| 1317 | 1317 | ) { |
| 1318 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1318 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1319 | 1319 | fclose($f); |
| 1320 | 1320 | |
| 1321 | 1321 | return false; |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1333 | 1333 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1334 | 1334 | if (!$f) { |
| 1335 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1335 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1336 | 1336 | |
| 1337 | 1337 | return $errno; |
| 1338 | 1338 | } |
@@ -1342,16 +1342,16 @@ discard block |
||
| 1342 | 1342 | $site = isset($GLOBALS['meta']['adresse_site']) ? $GLOBALS['meta']['adresse_site'] : ''; |
| 1343 | 1343 | |
| 1344 | 1344 | $host_port = $host; |
| 1345 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1345 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1346 | 1346 | $host_port .= ":$port"; |
| 1347 | 1347 | } |
| 1348 | 1348 | $req = "$method $path $vers\r\n" |
| 1349 | 1349 | . "Host: $host_port\r\n" |
| 1350 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1351 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1350 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1351 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1352 | 1352 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1353 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1354 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1353 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1354 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1355 | 1355 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1356 | 1356 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1357 | 1357 | |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | $res = sql_select( |
| 36 | 36 | 'rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant', |
| 37 | 37 | 'spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)', |
| 38 | - 'rub1.id_parent = ' . sql_quote($id_rubrique) . ' |
|
| 39 | - AND rub1.id_rubrique!=' . sql_quote($exclu) . ' |
|
| 40 | - AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu) . ')', |
|
| 38 | + 'rub1.id_parent = '.sql_quote($id_rubrique).' |
|
| 39 | + AND rub1.id_rubrique!=' . sql_quote($exclu).' |
|
| 40 | + AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu).')', |
|
| 41 | 41 | '', |
| 42 | 42 | '0+rub1.titre,rub1.titre' |
| 43 | 43 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if ($row['langue_choisie'] != 'oui') { |
| 51 | 51 | $t .= ' <small title="' |
| 52 | 52 | . traduire_nom_langue($row['lang']) |
| 53 | - . '">[' . $row['lang'] . ']</small>'; |
|
| 53 | + . '">['.$row['lang'].']</small>'; |
|
| 54 | 54 | } |
| 55 | 55 | $ordre[$row['id_rubrique']] = $t; |
| 56 | 56 | } |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $next = isset($list[$col]) ? $list[$col] : 0; |
| 60 | 60 | if ($ordre) { |
| 61 | - $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1)); |
|
| 61 | + $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=".($col + 1)); |
|
| 62 | 62 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id="); |
| 63 | - $args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event"; |
|
| 63 | + $args = "'$idom',this,$col,'".$GLOBALS['spip_lang_left']."','$info',event"; |
|
| 64 | 64 | |
| 65 | 65 | foreach ($ordre as $id => $titrebrut) { |
| 66 | 66 | $titre = supprimer_numero($titrebrut); |
| 67 | 67 | |
| 68 | - $classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 68 | + $classe1 = 'petit-item '.($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 69 | 69 | if (isset($rub[$id]['enfants'])) { |
| 70 | 70 | $classe2 = " class='rub-ouverte'"; |
| 71 | 71 | $url = "\nhref='$rec&id=$id'"; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $url = "\nhref='javascript:void(0)'"; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $js_func = $do . '_selection_titre'; |
|
| 77 | + $js_func = $do.'_selection_titre'; |
|
| 78 | 78 | $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn " |
| 79 | 79 | . (!is_array($list) ? ' false' |
| 80 | 80 | : "aff_selection_provisoire($id,$args)") |
@@ -101,17 +101,17 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $idom2 = $idom . '_col_' . ($col + 1); |
|
| 104 | + $idom2 = $idom.'_col_'.($col + 1); |
|
| 105 | 105 | $left = ($col * 250); |
| 106 | 106 | |
| 107 | 107 | return http_img_pack( |
| 108 | 108 | 'loader.svg', |
| 109 | 109 | '', |
| 110 | - "class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 110 | + "class='loader' style='visibility: hidden; position: absolute; ".$GLOBALS['spip_lang_left'].': ' |
|
| 111 | 111 | . ($left - 30) |
| 112 | 112 | . "px; top: 2px; z-index: 2;' id='img_$idom2'" |
| 113 | 113 | ) |
| 114 | - . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 114 | + . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; ".$GLOBALS['spip_lang_left'].': ' |
|
| 115 | 115 | . ($left - 250) |
| 116 | 116 | . "px;'>" |
| 117 | 117 | . $ret |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 118 | 118 | + [ |
| 119 | 119 | $id => new Bouton( |
| 120 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | - $infos['titre'], // titre |
|
| 120 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | + $infos['titre'], // titre |
|
| 122 | 122 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 123 | 123 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 124 | 124 | ) |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 136 | 136 | + [ |
| 137 | 137 | $id => new Bouton( |
| 138 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | - $infos['titre'], // titre |
|
| 138 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | + $infos['titre'], // titre |
|
| 140 | 140 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 141 | 141 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 142 | 142 | ) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $libelles = $isfavoris = $favoris = []; |
| 182 | 182 | foreach ($menu->sousmenu as $key => $item) { |
| 183 | 183 | $libelles[$key] = strtolower(translitteration(_T($item->libelle))); |
| 184 | - $isfavoris[$key] = (bool)$item->favori; |
|
| 184 | + $isfavoris[$key] = (bool) $item->favori; |
|
| 185 | 185 | $favoris[$key] = $item->favori; |
| 186 | 186 | } |
| 187 | 187 | if ($avec_favoris) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $url = str_replace('&', '&', $url); |
| 224 | 224 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 225 | 225 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 226 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 226 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 227 | 227 | } |
| 228 | 228 | $val = _request($matches[2], $contexte); |
| 229 | 229 | $url = parametre_url($url, $matches[1], $val ? $val : '', '&'); |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | function nettoyer_url_page($url, $contexte = []) { |
| 213 | 213 | $url_objets = urls_liste_objets(); |
| 214 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 215 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 216 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 214 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 215 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 216 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 217 | 217 | |
| 218 | 218 | if ( |
| 219 | 219 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | static $furls = []; |
| 252 | 252 | if (!isset($furls[$objet])) { |
| 253 | 253 | if ( |
| 254 | - function_exists($f = 'generer_url_ecrire_' . $objet) |
|
| 254 | + function_exists($f = 'generer_url_ecrire_'.$objet) |
|
| 255 | 255 | // ou definie par un plugin |
| 256 | 256 | or $f = charger_fonction($f, 'urls', true) |
| 257 | 257 | ) { |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | if ($public or $connect) { |
| 272 | 272 | return generer_url_entite_absolue($id, $objet, $args, $ancre, $connect); |
| 273 | 273 | } |
| 274 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 274 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 275 | 275 | if (!function_exists('objet_info')) { |
| 276 | 276 | include_spip('inc/filtres'); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 279 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 280 | 280 | } |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 40 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 40 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 41 | 41 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 42 | 42 | } |
| 43 | - $fichier = $dir_tex . md5(trim($tex)) . $ext; |
|
| 43 | + $fichier = $dir_tex.md5(trim($tex)).$ext; |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | if (!@file_exists($fichier)) { |
| 47 | 47 | // Aller chercher l'image sur le serveur |
| 48 | 48 | if ($server) { |
| 49 | - spip_log($url = $server . '?' . rawurlencode($tex)); |
|
| 49 | + spip_log($url = $server.'?'.rawurlencode($tex)); |
|
| 50 | 50 | include_spip('inc/distant'); |
| 51 | 51 | recuperer_url($url, ['file' => $fichier]); |
| 52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return implode('', file($fichier)); |
| 62 | 62 | } // TeX |
| 63 | 63 | else { |
| 64 | - list(, , , $size) = @spip_getimagesize($fichier); |
|
| 64 | + list(,,, $size) = @spip_getimagesize($fichier); |
|
| 65 | 65 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 66 | 66 | |
| 67 | 67 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | if ($defaire_amp) { |
| 129 | 129 | $expression = str_replace('&', '&', $expression); |
| 130 | 130 | } |
| 131 | - $echap = "\n<p class=\"spip\" style=\"text-align: center;\">" . produire_image_math($expression) . "</p>\n"; |
|
| 131 | + $echap = "\n<p class=\"spip\" style=\"text-align: center;\">".produire_image_math($expression)."</p>\n"; |
|
| 132 | 132 | $pos = strpos($texte_milieu, $regs[0]); |
| 133 | 133 | $texte_milieu = substr($texte_milieu, 0, $pos) |
| 134 | 134 | . code_echappement($echap, $source) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | . substr($texte_milieu, $pos + strlen($regs[0])); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $texte_a_voir = $texte_debut . $texte_milieu . $texte_fin; |
|
| 151 | + $texte_a_voir = $texte_debut.$texte_milieu.$texte_fin; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $texte_a_voir; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | function extraire_date($texte) { |
| 39 | 39 | // format = 2001-08 |
| 40 | 40 | if (preg_match(',([1-2][0-9]{3})[^0-9]*(1[0-2]|0?[1-9]),', $texte, $regs)) { |
| 41 | - return $regs[1] . '-' . sprintf('%02d', $regs[2]) . '-01'; |
|
| 41 | + return $regs[1].'-'.sprintf('%02d', $regs[2]).'-01'; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | if (preg_match('#^([12][0-9]{3})([-/]00)?( [-0-9:]+)?$#', $date, $regs)) { |
| 70 | 70 | $regs = array_pad($regs, 4, null); // eviter notice php |
| 71 | - $date = $regs[1] . '-00-00' . $regs[3]; |
|
| 71 | + $date = $regs[1].'-00-00'.$regs[3]; |
|
| 72 | 72 | } else { |
| 73 | 73 | if (preg_match('#^([12][0-9]{3}[-/][01]?[0-9])([-/]00)?( [-0-9:]+)?$#', $date, $regs)) { |
| 74 | 74 | $regs = array_pad($regs, 4, null); // eviter notice php |
| 75 | - $date = preg_replace('@/@', '-', $regs[1]) . '-00' . $regs[3]; |
|
| 75 | + $date = preg_replace('@/@', '-', $regs[1]).'-00'.$regs[3]; |
|
| 76 | 76 | } else { |
| 77 | 77 | $date = date('Y-m-d H:i:s', strtotime($date)); |
| 78 | 78 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | function vider_date($letexte, $verif_format_date = false) { |
| 99 | 99 | if ( |
| 100 | 100 | !$verif_format_date |
| 101 | - or (in_array(strlen($letexte), [10,19]) and |
|
| 101 | + or (in_array(strlen($letexte), [10, 19]) and |
|
| 102 | 102 | preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(\s[0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $letexte)) |
| 103 | 103 | ) { |
| 104 | 104 | if (strncmp('0000-00-00', $letexte, 10) == 0) { |
@@ -381,17 +381,17 @@ discard block |
||
| 381 | 381 | if ($decal > 3600 * 24 * 30) { |
| 382 | 382 | $mois = floor($decal / (3600 * 24 * 30)); |
| 383 | 383 | if ($mois < 2) { |
| 384 | - $delai = "$mois " . _T('date_un_mois'); |
|
| 384 | + $delai = "$mois "._T('date_un_mois'); |
|
| 385 | 385 | } else { |
| 386 | - $delai = "$mois " . _T('date_mois'); |
|
| 386 | + $delai = "$mois "._T('date_mois'); |
|
| 387 | 387 | } |
| 388 | 388 | } else { |
| 389 | 389 | if ($decal > 3600 * 24 * 7) { |
| 390 | 390 | $semaines = floor($decal / (3600 * 24 * 7)); |
| 391 | 391 | if ($semaines < 2) { |
| 392 | - $delai = "$semaines " . _T('date_une_semaine'); |
|
| 392 | + $delai = "$semaines "._T('date_une_semaine'); |
|
| 393 | 393 | } else { |
| 394 | - $delai = "$semaines " . _T('date_semaines'); |
|
| 394 | + $delai = "$semaines "._T('date_semaines'); |
|
| 395 | 395 | } |
| 396 | 396 | } else { |
| 397 | 397 | if ($decal > 3600 * 24) { |
@@ -399,30 +399,30 @@ discard block |
||
| 399 | 399 | if ($jours < 2) { |
| 400 | 400 | return $il_y_a == 'date_dans' ? _T('date_demain') : _T('date_hier'); |
| 401 | 401 | } else { |
| 402 | - $delai = "$jours " . _T('date_jours'); |
|
| 402 | + $delai = "$jours "._T('date_jours'); |
|
| 403 | 403 | } |
| 404 | 404 | } else { |
| 405 | 405 | if ($decal >= 3600) { |
| 406 | 406 | $heures = floor($decal / 3600); |
| 407 | 407 | if ($heures < 2) { |
| 408 | - $delai = "$heures " . _T('date_une_heure'); |
|
| 408 | + $delai = "$heures "._T('date_une_heure'); |
|
| 409 | 409 | } else { |
| 410 | - $delai = "$heures " . _T('date_heures'); |
|
| 410 | + $delai = "$heures "._T('date_heures'); |
|
| 411 | 411 | } |
| 412 | 412 | } else { |
| 413 | 413 | if ($decal >= 60) { |
| 414 | 414 | $minutes = floor($decal / 60); |
| 415 | 415 | if ($minutes < 2) { |
| 416 | - $delai = "$minutes " . _T('date_une_minute'); |
|
| 416 | + $delai = "$minutes "._T('date_une_minute'); |
|
| 417 | 417 | } else { |
| 418 | - $delai = "$minutes " . _T('date_minutes'); |
|
| 418 | + $delai = "$minutes "._T('date_minutes'); |
|
| 419 | 419 | } |
| 420 | 420 | } else { |
| 421 | 421 | $secondes = ceil($decal); |
| 422 | 422 | if ($secondes < 2) { |
| 423 | - $delai = "$secondes " . _T('date_une_seconde'); |
|
| 423 | + $delai = "$secondes "._T('date_une_seconde'); |
|
| 424 | 424 | } else { |
| 425 | - $delai = "$secondes " . _T('date_secondes'); |
|
| 425 | + $delai = "$secondes "._T('date_secondes'); |
|
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $njour = 0; |
| 518 | 518 | } else { |
| 519 | 519 | $njour = intval($jour); |
| 520 | - if ($jourth = _T('date_jnum' . $jour)) { |
|
| 520 | + if ($jourth = _T('date_jnum'.$jour)) { |
|
| 521 | 521 | $jour = $jourth; |
| 522 | 522 | } |
| 523 | 523 | } |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | $mois = intval($mois); |
| 526 | 526 | if ($mois > 0 and $mois < 13) { |
| 527 | 527 | /* Traiter le cas "abbr" pour les noms de mois */ |
| 528 | - $param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_' . $options['param'] : ''); |
|
| 529 | - $nommois = _T('date_mois_' . $mois . $param); |
|
| 528 | + $param = ((isset($options['param']) and $options['param'] === 'abbr') ? '_'.$options['param'] : ''); |
|
| 529 | + $nommois = _T('date_mois_'.$mois.$param); |
|
| 530 | 530 | if ($jour) { |
| 531 | - $jourmois = _T('date_de_mois_' . $mois, ['j' => $jour, 'nommois' => $nommois]); |
|
| 531 | + $jourmois = _T('date_de_mois_'.$mois, ['j' => $jour, 'nommois' => $nommois]); |
|
| 532 | 532 | } else { |
| 533 | 533 | $jourmois = $nommois; |
| 534 | 534 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | if ($annee < 0) { |
| 541 | - $annee = -$annee . ' ' . _T('date_avant_jc'); |
|
| 541 | + $annee = -$annee.' '._T('date_avant_jc'); |
|
| 542 | 542 | $avjc = true; |
| 543 | 543 | } else { |
| 544 | 544 | $avjc = false; |
@@ -564,11 +564,11 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | if ($vue == 'saison') { |
| 567 | - return $saison ? _T('date_saison_' . $saison) : ''; |
|
| 567 | + return $saison ? _T('date_saison_'.$saison) : ''; |
|
| 568 | 568 | } else { |
| 569 | 569 | return $saison ? trim(_T( |
| 570 | 570 | 'date_fmt_saison_annee', |
| 571 | - ['saison' => _T('date_saison_' . $saison), 'annee' => $annee] |
|
| 571 | + ['saison' => _T('date_saison_'.$saison), 'annee' => $annee] |
|
| 572 | 572 | )) : ''; |
| 573 | 573 | } |
| 574 | 574 | |
@@ -645,9 +645,9 @@ discard block |
||
| 645 | 645 | } |
| 646 | 646 | $nom = mktime(1, 1, 1, $mois, $njour, $annee); |
| 647 | 647 | $nom = 1 + date('w', $nom); |
| 648 | - $param = ((isset($options['param']) and $options['param']) ? '_' . $options['param'] : ''); |
|
| 648 | + $param = ((isset($options['param']) and $options['param']) ? '_'.$options['param'] : ''); |
|
| 649 | 649 | |
| 650 | - return _T('date_jour_' . $nom . $param); |
|
| 650 | + return _T('date_jour_'.$nom.$param); |
|
| 651 | 651 | |
| 652 | 652 | case 'mois_annee': |
| 653 | 653 | if ($avjc) { |
@@ -1042,8 +1042,8 @@ discard block |
||
| 1042 | 1042 | |
| 1043 | 1043 | $dtstart = $dtend = $dtabbr = ''; |
| 1044 | 1044 | if (strpos($forme, 'hcal') !== false) { |
| 1045 | - $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; |
|
| 1046 | - $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; |
|
| 1045 | + $dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>"; |
|
| 1046 | + $dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>"; |
|
| 1047 | 1047 | $dtabbr = '</abbr>'; |
| 1048 | 1048 | } |
| 1049 | 1049 | |
@@ -1091,7 +1091,7 @@ discard block |
||
| 1091 | 1091 | } |
| 1092 | 1092 | } else { |
| 1093 | 1093 | if ($dtabbr && $dtstart) { |
| 1094 | - $s = $dtstart . spip_ucfirst($s) . $dtabbr; |
|
| 1094 | + $s = $dtstart.spip_ucfirst($s).$dtabbr; |
|
| 1095 | 1095 | } else { |
| 1096 | 1096 | $s = spip_ucfirst($s); |
| 1097 | 1097 | } |
@@ -1114,8 +1114,8 @@ discard block |
||
| 1114 | 1114 | $date_debut = _T('date_fmt_jour_heure', ['jour' => $date_debut, 'heure' => $hd]); |
| 1115 | 1115 | $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]); |
| 1116 | 1116 | } |
| 1117 | - $date_debut = $dtstart . $date_debut . $dtabbr; |
|
| 1118 | - $date_fin = $dtend . $date_fin . $dtabbr; |
|
| 1117 | + $date_debut = $dtstart.$date_debut.$dtabbr; |
|
| 1118 | + $date_fin = $dtend.$date_fin.$dtabbr; |
|
| 1119 | 1119 | |
| 1120 | 1120 | $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]); |
| 1121 | 1121 | } else { |
@@ -1132,8 +1132,8 @@ discard block |
||
| 1132 | 1132 | $date_fin = _T('date_fmt_jour_heure', ['jour' => $date_fin, 'heure' => $hf]); |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | - $date_debut = $dtstart . $date_debut . $dtabbr; |
|
| 1136 | - $date_fin = $dtend . $date_fin . $dtabbr; |
|
| 1135 | + $date_debut = $dtstart.$date_debut.$dtabbr; |
|
| 1136 | + $date_fin = $dtend.$date_fin.$dtabbr; |
|
| 1137 | 1137 | $s = _T('date_fmt_periode', ['date_debut' => $date_debut, 'date_fin' => $date_fin]); |
| 1138 | 1138 | } |
| 1139 | 1139 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | $d = date('Y-m-d'); |
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | - return substr($d, 0, 4) . substr($d, 5, 2) . substr($d, 8, 2); |
|
| 1240 | + return substr($d, 0, 4).substr($d, 5, 2).substr($d, 8, 2); |
|
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | /** |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | $d = date('Y-m-d'); |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | - return substr($d, 0, 4) . substr($d, 5, 2); |
|
| 1260 | + return substr($d, 0, 4).substr($d, 5, 2); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | /** |