@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $dir = "images/"; |
| 48 | 48 | $f = "$type-$size.png"; |
| 49 | - if ($icone = find_in_theme($dir . $f)) { |
|
| 49 | + if ($icone = find_in_theme($dir.$f)) { |
|
| 50 | 50 | $dir = dirname($icone); |
| 51 | 51 | $fond = $icone; |
| 52 | 52 | |
| 53 | 53 | if ($rtl |
| 54 | - and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone)) |
|
| 54 | + and $fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone)) |
|
| 55 | 55 | and file_exists($fr) |
| 56 | 56 | ) { |
| 57 | 57 | $fond = $fr; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $fonction = ""; |
| 70 | - if (in_array($action, array('add','del', 'new', 'edit', 'config'))) { |
|
| 70 | + if (in_array($action, array('add', 'del', 'new', 'edit', 'config'))) { |
|
| 71 | 71 | $fonction = $action; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -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 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | - if (!$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 81 | + if (!$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 82 | 82 | // si le fichier truc/machin/nom.php n'existe pas, |
| 83 | 83 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 84 | 84 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | // Echec : message d'erreur |
| 100 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 100 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 101 | 101 | ($inc ? "" : " (fichier $d absent de $dossier)")); |
| 102 | 102 | |
| 103 | 103 | include_spip('inc/minipres'); |
| 104 | 104 | echo minipres(_T('forum_titre_erreur'), |
| 105 | - _T('fichier_introuvable', array('fichier' => '<b>' . spip_htmlentities($d) . '</b>')), |
|
| 106 | - array('all_inline'=>true,'status'=>404)); |
|
| 105 | + _T('fichier_introuvable', array('fichier' => '<b>'.spip_htmlentities($d).'</b>')), |
|
| 106 | + array('all_inline'=>true, 'status'=>404)); |
|
| 107 | 107 | exit; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * - string : chemin du fichier trouvé |
| 149 | 149 | **/ |
| 150 | 150 | function include_spip($f, $include = true) { |
| 151 | - return find_in_path($f . '.php', '', $include); |
|
| 151 | + return find_in_path($f.'.php', '', $include); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * - string : chemin du fichier trouvé |
| 169 | 169 | **/ |
| 170 | 170 | function require_spip($f) { |
| 171 | - return find_in_path($f . '.php', '', 'required'); |
|
| 171 | + return find_in_path($f.'.php', '', 'required'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // appliquer notre fonction si elle existe |
| 263 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 263 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 264 | 264 | if (function_exists($fonc)) { |
| 265 | 265 | $val = $fonc($val); |
| 266 | 266 | } // plantage ? |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | function spip_log($message = null, $name = null) { |
| 325 | 325 | static $pre = array(); |
| 326 | 326 | static $log; |
| 327 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 327 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 328 | 328 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 329 | 329 | $logname = null; |
| 330 | 330 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | if (!is_string($message)) { |
| 350 | 350 | $message = print_r($message, true); |
| 351 | 351 | } |
| 352 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 352 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $a = './'; |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 515 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 516 | 516 | $ajouts = array_flip(explode('|', $c)); |
| 517 | 517 | $u = is_array($v) ? $v : rawurlencode($v); |
| 518 | 518 | $testv = (is_array($v) ? count($v) : strlen($v)); |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 540 | 540 | // pour un tableau ce sera fait dans la prochaine boucle |
| 541 | 541 | elseif (substr($r[1], -2) != '[]') { |
| 542 | - $url[$n] = $r[1] . '=' . $u; |
|
| 542 | + $url[$n] = $r[1].'='.$u; |
|
| 543 | 543 | unset($ajouts[$r[1]]); |
| 544 | 544 | } |
| 545 | 545 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -559,11 +559,11 @@ discard block |
||
| 559 | 559 | } elseif ($testv) { |
| 560 | 560 | foreach ($ajouts as $k => $n) { |
| 561 | 561 | if (!is_array($v)) { |
| 562 | - $url[] = $k . '=' . $u; |
|
| 562 | + $url[] = $k.'='.$u; |
|
| 563 | 563 | } else { |
| 564 | - $id = (substr($k, -2) == '[]') ? $k : ($k . "[]"); |
|
| 564 | + $id = (substr($k, -2) == '[]') ? $k : ($k."[]"); |
|
| 565 | 565 | foreach ($v as $w) { |
| 566 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : $w); |
|
| 566 | + $url[] = $id.'='.(is_array($w) ? 'Array' : $w); |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | } |
@@ -574,10 +574,10 @@ discard block |
||
| 574 | 574 | |
| 575 | 575 | // recomposer l'adresse |
| 576 | 576 | if ($url) { |
| 577 | - $a .= '?' . join($sep, $url); |
|
| 577 | + $a .= '?'.join($sep, $url); |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | - return $a . $ancre; |
|
| 580 | + return $a.$ancre; |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | /** |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | translitteration($ancre) |
| 610 | 610 | ); |
| 611 | 611 | } |
| 612 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 612 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | /** |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | * @return bool |
| 722 | 722 | */ |
| 723 | 723 | function test_plugin_actif($plugin) { |
| 724 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 724 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | /** |
@@ -789,8 +789,7 @@ discard block |
||
| 789 | 789 | // pour les chaines non traduites, assurer un service minimum |
| 790 | 790 | if (!$GLOBALS['test_i18n'] and (_request('var_mode') != 'traduction')) { |
| 791 | 791 | $text = str_replace('_', ' ', |
| 792 | - (($n = strpos($text, ':')) === false ? $texte : |
|
| 793 | - substr($texte, $n + 1))); |
|
| 792 | + (($n = strpos($text, ':')) === false ? $texte : substr($texte, $n + 1))); |
|
| 794 | 793 | } |
| 795 | 794 | $o['class'] = null; |
| 796 | 795 | |
@@ -862,7 +861,7 @@ discard block |
||
| 862 | 861 | // Si des variables n'ont pas ete inserees, le signaler |
| 863 | 862 | // (chaines de langues pas a jour) |
| 864 | 863 | if ($args) { |
| 865 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 864 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 866 | 865 | } |
| 867 | 866 | } |
| 868 | 867 | |
@@ -886,7 +885,7 @@ discard block |
||
| 886 | 885 | function joli_repertoire($rep) { |
| 887 | 886 | $a = substr($rep, 0, 1); |
| 888 | 887 | if ($a <> '.' and $a <> '/') { |
| 889 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 888 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 890 | 889 | } |
| 891 | 890 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 892 | 891 | |
@@ -940,7 +939,7 @@ discard block |
||
| 940 | 939 | $p -= ($x * 1000); |
| 941 | 940 | } |
| 942 | 941 | |
| 943 | - return $s . sprintf($s ? "%07.3f ms" : "%.3f ms", $p); |
|
| 942 | + return $s.sprintf($s ? "%07.3f ms" : "%.3f ms", $p); |
|
| 944 | 943 | } |
| 945 | 944 | } |
| 946 | 945 | |
@@ -1009,7 +1008,7 @@ discard block |
||
| 1009 | 1008 | if ($taches and count($taches) and !spip_connect()) { |
| 1010 | 1009 | return false; |
| 1011 | 1010 | } |
| 1012 | - spip_log("cron !", 'jq' . _LOG_DEBUG); |
|
| 1011 | + spip_log("cron !", 'jq'._LOG_DEBUG); |
|
| 1013 | 1012 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1014 | 1013 | return $genie($taches); |
| 1015 | 1014 | } |
@@ -1113,7 +1112,7 @@ discard block |
||
| 1113 | 1112 | |
| 1114 | 1113 | if ($queue_next_job_time == -1) { |
| 1115 | 1114 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1116 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . "job_queue_next.txt"); |
|
| 1115 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP."job_queue_next.txt"); |
|
| 1117 | 1116 | } |
| 1118 | 1117 | // utiliser un cache memoire si dispo |
| 1119 | 1118 | if (function_exists("cache_get") and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1180,8 +1179,8 @@ discard block |
||
| 1180 | 1179 | $src = ''; |
| 1181 | 1180 | } |
| 1182 | 1181 | if ($script) { |
| 1183 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1184 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1182 | + $script = ("/*<![CDATA[*/\n". |
|
| 1183 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1185 | 1184 | "/*]]>*/"); |
| 1186 | 1185 | } |
| 1187 | 1186 | if ($noscript) { |
@@ -1267,13 +1266,13 @@ discard block |
||
| 1267 | 1266 | if ($path_base == null) { |
| 1268 | 1267 | // Chemin standard depuis l'espace public |
| 1269 | 1268 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1270 | - _DIR_RACINE . ':' . |
|
| 1271 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1272 | - _DIR_RACINE . 'prive/:' . |
|
| 1269 | + _DIR_RACINE.':'. |
|
| 1270 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1271 | + _DIR_RACINE.'prive/:'. |
|
| 1273 | 1272 | _DIR_RESTREINT; |
| 1274 | 1273 | // Ajouter squelettes/ |
| 1275 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1276 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1274 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1275 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1277 | 1276 | } |
| 1278 | 1277 | foreach (explode(':', $path) as $dir) { |
| 1279 | 1278 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1285,7 +1284,7 @@ discard block |
||
| 1285 | 1284 | // Et le(s) dossier(s) des squelettes nommes |
| 1286 | 1285 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1287 | 1286 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1288 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1287 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1289 | 1288 | } |
| 1290 | 1289 | } |
| 1291 | 1290 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1296,7 +1295,7 @@ discard block |
||
| 1296 | 1295 | |
| 1297 | 1296 | if (strlen($dir_path)) { |
| 1298 | 1297 | $tete = ""; |
| 1299 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1298 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1300 | 1299 | $tete = array_shift($path_base); |
| 1301 | 1300 | } |
| 1302 | 1301 | $dirs = array_reverse(explode(':', $dir_path)); |
@@ -1318,7 +1317,7 @@ discard block |
||
| 1318 | 1317 | // Et le(s) dossier(s) des squelettes nommes |
| 1319 | 1318 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1320 | 1319 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1321 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1320 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1322 | 1321 | } |
| 1323 | 1322 | } |
| 1324 | 1323 | |
@@ -1388,9 +1387,9 @@ discard block |
||
| 1388 | 1387 | // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
| 1389 | 1388 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1390 | 1389 | if (preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1391 | - and $file_svg_generique = substr($file,0, -strlen($m[0])) . "-xx.svg" |
|
| 1390 | + and $file_svg_generique = substr($file, 0, -strlen($m[0]))."-xx.svg" |
|
| 1392 | 1391 | and $f = find_in_theme("$file_svg_generique")) { |
| 1393 | - if ($fsize = substr($f,0,-6) . $m[1] . ".svg" and file_exists($fsize)) { |
|
| 1392 | + if ($fsize = substr($f, 0, -6).$m[1].".svg" and file_exists($fsize)) { |
|
| 1394 | 1393 | return $themefiles["$subdir$file"] = $fsize; |
| 1395 | 1394 | } |
| 1396 | 1395 | else { |
@@ -1404,7 +1403,7 @@ discard block |
||
| 1404 | 1403 | return $themefiles["$subdir$file"] = $f; |
| 1405 | 1404 | } |
| 1406 | 1405 | } |
| 1407 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1406 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1408 | 1407 | |
| 1409 | 1408 | return $themefiles["$subdir$file"] = ""; |
| 1410 | 1409 | } |
@@ -1432,7 +1431,7 @@ discard block |
||
| 1432 | 1431 | function chemin_image($icone) { |
| 1433 | 1432 | static $icone_renommer; |
| 1434 | 1433 | if ($p = strpos($icone, '?')) { |
| 1435 | - $icone = substr($icone,0, $p); |
|
| 1434 | + $icone = substr($icone, 0, $p); |
|
| 1436 | 1435 | } |
| 1437 | 1436 | // gerer le cas d'un double appel en evitant de refaire le travail inutilement |
| 1438 | 1437 | if (strpos($icone, "/") !== false and file_exists($icone)) { |
@@ -1508,8 +1507,8 @@ discard block |
||
| 1508 | 1507 | return false; |
| 1509 | 1508 | } |
| 1510 | 1509 | if ($include and !isset($inc[$dirname][$file])) { |
| 1511 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1512 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1510 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1511 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1513 | 1512 | } |
| 1514 | 1513 | |
| 1515 | 1514 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1522,14 +1521,14 @@ discard block |
||
| 1522 | 1521 | } |
| 1523 | 1522 | |
| 1524 | 1523 | foreach (creer_chemin() as $dir) { |
| 1525 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1526 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1524 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1525 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1527 | 1526 | } |
| 1528 | 1527 | if ($dirs[$a]) { |
| 1529 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1528 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1530 | 1529 | if ($include and !isset($inc[$dirname][$file])) { |
| 1531 | - include_once _ROOT_CWD . $a; |
|
| 1532 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1530 | + include_once _ROOT_CWD.$a; |
|
| 1531 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1533 | 1532 | } |
| 1534 | 1533 | if (!defined('_SAUVER_CHEMIN')) { |
| 1535 | 1534 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1539,7 +1538,7 @@ discard block |
||
| 1539 | 1538 | define('_SAUVER_CHEMIN', true); |
| 1540 | 1539 | } |
| 1541 | 1540 | |
| 1542 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1541 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1543 | 1542 | } |
| 1544 | 1543 | } |
| 1545 | 1544 | } |
@@ -1565,7 +1564,7 @@ discard block |
||
| 1565 | 1564 | define('_SAUVER_CHEMIN', true); |
| 1566 | 1565 | } |
| 1567 | 1566 | |
| 1568 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1567 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1569 | 1568 | } |
| 1570 | 1569 | |
| 1571 | 1570 | function clear_path_cache() { |
@@ -1634,12 +1633,12 @@ discard block |
||
| 1634 | 1633 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1635 | 1634 | // on a pas encore inclus flock.php |
| 1636 | 1635 | if (!function_exists('preg_files')) { |
| 1637 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1636 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1638 | 1637 | } |
| 1639 | 1638 | |
| 1640 | 1639 | // Parcourir le chemin |
| 1641 | 1640 | foreach (creer_chemin() as $d) { |
| 1642 | - $f = $d . $dir; |
|
| 1641 | + $f = $d.$dir; |
|
| 1643 | 1642 | if (@is_dir($f)) { |
| 1644 | 1643 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? array() : $recurs); |
| 1645 | 1644 | foreach ($liste as $chemin) { |
@@ -1669,9 +1668,9 @@ discard block |
||
| 1669 | 1668 | static $autsanscookie = array('install', 'base_repair'); |
| 1670 | 1669 | |
| 1671 | 1670 | if (in_array($nom, $autsanscookie)) { |
| 1672 | - if (test_espace_prive()){ |
|
| 1671 | + if (test_espace_prive()) { |
|
| 1673 | 1672 | include_spip('base/connect_sql'); |
| 1674 | - if (!$strict or !spip_connect()){ |
|
| 1673 | + if (!$strict or !spip_connect()) { |
|
| 1675 | 1674 | return true; |
| 1676 | 1675 | } |
| 1677 | 1676 | } |
@@ -1750,7 +1749,7 @@ discard block |
||
| 1750 | 1749 | return $res; |
| 1751 | 1750 | } |
| 1752 | 1751 | // Sinon c'est un raccourci ou compat SPIP < 2 |
| 1753 | - if (!function_exists($f = 'generer_url_' . $entite)) { |
|
| 1752 | + if (!function_exists($f = 'generer_url_'.$entite)) { |
|
| 1754 | 1753 | if (!function_exists($f .= '_dist')) { |
| 1755 | 1754 | $f = ''; |
| 1756 | 1755 | } |
@@ -1759,8 +1758,8 @@ discard block |
||
| 1759 | 1758 | $url = $f($id, $args, $ancre); |
| 1760 | 1759 | if (strlen($args)) { |
| 1761 | 1760 | $url .= strstr($url, '?') |
| 1762 | - ? '&' . $args |
|
| 1763 | - : '?' . $args; |
|
| 1761 | + ? '&'.$args |
|
| 1762 | + : '?'.$args; |
|
| 1764 | 1763 | } |
| 1765 | 1764 | |
| 1766 | 1765 | return $url; |
@@ -1791,8 +1790,8 @@ discard block |
||
| 1791 | 1790 | include_spip('base/connect_sql'); |
| 1792 | 1791 | $id_type = id_table_objet($entite, $public); |
| 1793 | 1792 | |
| 1794 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1795 | - . "?" . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1793 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1794 | + . "?"._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1796 | 1795 | . (!$args ? '' : "&$args") |
| 1797 | 1796 | . (!$ancre ? '' : "#$ancre"); |
| 1798 | 1797 | } |
@@ -1944,7 +1943,7 @@ discard block |
||
| 1944 | 1943 | if (!empty($_SERVER['QUERY_STRING']) |
| 1945 | 1944 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 1946 | 1945 | ) { |
| 1947 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 1946 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 1948 | 1947 | } |
| 1949 | 1948 | } |
| 1950 | 1949 | } |
@@ -1971,17 +1970,17 @@ discard block |
||
| 1971 | 1970 | list($myself) = explode('?', $myself); |
| 1972 | 1971 | // vieux mode HTTP qui envoie après le nom de la methode l'URL compléte |
| 1973 | 1972 | // protocole, "://", nom du serveur avant le path dans _SERVER["REQUEST_URI"] |
| 1974 | - if (strpos($myself,'://') !== false) { |
|
| 1975 | - $myself = explode('://',$myself); |
|
| 1973 | + if (strpos($myself, '://') !== false) { |
|
| 1974 | + $myself = explode('://', $myself); |
|
| 1976 | 1975 | array_shift($myself); |
| 1977 | - $myself = implode('://',$myself); |
|
| 1978 | - $myself = explode('/',$myself); |
|
| 1976 | + $myself = implode('://', $myself); |
|
| 1977 | + $myself = explode('/', $myself); |
|
| 1979 | 1978 | array_shift($myself); |
| 1980 | - $myself = implode('/',$myself); |
|
| 1979 | + $myself = implode('/', $myself); |
|
| 1981 | 1980 | } |
| 1982 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 1981 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 1983 | 1982 | |
| 1984 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 1983 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 1985 | 1984 | |
| 1986 | 1985 | return $url; |
| 1987 | 1986 | } |
@@ -2019,17 +2018,17 @@ discard block |
||
| 2019 | 2018 | **/ |
| 2020 | 2019 | function generer_url_ecrire($script = '', $args = "", $no_entities = false, $rel = false) { |
| 2021 | 2020 | if (!$rel) { |
| 2022 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2021 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2023 | 2022 | } else { |
| 2024 | 2023 | if (!is_string($rel)) { |
| 2025 | 2024 | $rel = _DIR_RESTREINT ? _DIR_RESTREINT : |
| 2026 | - ('./' . _SPIP_ECRIRE_SCRIPT); |
|
| 2025 | + ('./'._SPIP_ECRIRE_SCRIPT); |
|
| 2027 | 2026 | } |
| 2028 | 2027 | } |
| 2029 | 2028 | |
| 2030 | 2029 | list($script, $ancre) = array_pad(explode('#', $script), 2, null); |
| 2031 | 2030 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2032 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2031 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2033 | 2032 | } elseif ($args) { |
| 2034 | 2033 | $args = "?$args"; |
| 2035 | 2034 | } |
@@ -2037,7 +2036,7 @@ discard block |
||
| 2037 | 2036 | $args .= "#$ancre"; |
| 2038 | 2037 | } |
| 2039 | 2038 | |
| 2040 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2039 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2041 | 2040 | } |
| 2042 | 2041 | |
| 2043 | 2042 | // |
@@ -2107,25 +2106,25 @@ discard block |
||
| 2107 | 2106 | if (is_array($args)) { |
| 2108 | 2107 | $r = ''; |
| 2109 | 2108 | foreach ($args as $k => $v) { |
| 2110 | - $r .= '&' . $k . '=' . $v; |
|
| 2109 | + $r .= '&'.$k.'='.$v; |
|
| 2111 | 2110 | } |
| 2112 | 2111 | $args = substr($r, 1); |
| 2113 | 2112 | } |
| 2114 | 2113 | $action .= |
| 2115 | - (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2114 | + (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2116 | 2115 | } |
| 2117 | 2116 | if (!$no_entities) { |
| 2118 | 2117 | $action = quote_amp($action); |
| 2119 | 2118 | } |
| 2120 | 2119 | |
| 2121 | 2120 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2122 | - return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(",^/[.]/,", "/", "/$action")); |
|
| 2121 | + return ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(",^/[.]/,", "/", "/$action")); |
|
| 2123 | 2122 | } |
| 2124 | 2123 | |
| 2125 | 2124 | // http://code.spip.net/@generer_url_prive |
| 2126 | 2125 | function generer_url_prive($script, $args = "", $no_entities = false) { |
| 2127 | 2126 | |
| 2128 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2127 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2129 | 2128 | } |
| 2130 | 2129 | |
| 2131 | 2130 | // Pour les formulaires en methode POST, |
@@ -2160,8 +2159,7 @@ discard block |
||
| 2160 | 2159 | . "><div>\n" |
| 2161 | 2160 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2162 | 2161 | . $corps |
| 2163 | - . (!$submit ? '' : |
|
| 2164 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo' type='submit' value=\"" . entites_html($submit) . "\" /></div>")) |
|
| 2162 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo' type='submit' value=\"".entites_html($submit)."\" /></div>")) |
|
| 2165 | 2163 | . "</div></form>\n"; |
| 2166 | 2164 | } |
| 2167 | 2165 | |
@@ -2186,14 +2184,14 @@ discard block |
||
| 2186 | 2184 | ? generer_url_ecrire(_request('exec')) |
| 2187 | 2185 | : generer_url_public(); |
| 2188 | 2186 | |
| 2189 | - return "\n<form action='" . |
|
| 2190 | - $h . |
|
| 2191 | - "'" . |
|
| 2192 | - $atts . |
|
| 2193 | - ">\n" . |
|
| 2194 | - "<div>" . |
|
| 2195 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2196 | - $corps . |
|
| 2187 | + return "\n<form action='". |
|
| 2188 | + $h. |
|
| 2189 | + "'". |
|
| 2190 | + $atts. |
|
| 2191 | + ">\n". |
|
| 2192 | + "<div>". |
|
| 2193 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2194 | + $corps. |
|
| 2197 | 2195 | "</div></form>"; |
| 2198 | 2196 | } |
| 2199 | 2197 | |
@@ -2221,7 +2219,7 @@ discard block |
||
| 2221 | 2219 | : generer_url_public('', '', false, false); |
| 2222 | 2220 | $url = parametre_url($url, 'action', $script); |
| 2223 | 2221 | if ($args) { |
| 2224 | - $url .= quote_amp('&' . $args); |
|
| 2222 | + $url .= quote_amp('&'.$args); |
|
| 2225 | 2223 | } |
| 2226 | 2224 | |
| 2227 | 2225 | if ($no_entities) { |
@@ -2271,17 +2269,17 @@ discard block |
||
| 2271 | 2269 | |
| 2272 | 2270 | // le nom du repertoire plugins/ activables/desactivables |
| 2273 | 2271 | if (!defined('_DIR_PLUGINS')) { |
| 2274 | - define('_DIR_PLUGINS', _DIR_RACINE . "plugins/"); |
|
| 2272 | + define('_DIR_PLUGINS', _DIR_RACINE."plugins/"); |
|
| 2275 | 2273 | } |
| 2276 | 2274 | |
| 2277 | 2275 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2278 | 2276 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2279 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . "plugins-dist/"); |
|
| 2277 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE."plugins-dist/"); |
|
| 2280 | 2278 | } |
| 2281 | 2279 | |
| 2282 | 2280 | // le nom du repertoire des librairies |
| 2283 | 2281 | if (!defined('_DIR_LIB')) { |
| 2284 | - define('_DIR_LIB', _DIR_RACINE . "lib/"); |
|
| 2282 | + define('_DIR_LIB', _DIR_RACINE."lib/"); |
|
| 2285 | 2283 | } |
| 2286 | 2284 | |
| 2287 | 2285 | if (!defined('_DIR_IMG')) { |
@@ -2291,29 +2289,29 @@ discard block |
||
| 2291 | 2289 | define('_DIR_LOGOS', $pa); |
| 2292 | 2290 | } |
| 2293 | 2291 | if (!defined('_DIR_IMG_ICONES')) { |
| 2294 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . "icones/"); |
|
| 2292 | + define('_DIR_IMG_ICONES', _DIR_LOGOS."icones/"); |
|
| 2295 | 2293 | } |
| 2296 | 2294 | |
| 2297 | 2295 | if (!defined('_DIR_DUMP')) { |
| 2298 | - define('_DIR_DUMP', $ti . "dump/"); |
|
| 2296 | + define('_DIR_DUMP', $ti."dump/"); |
|
| 2299 | 2297 | } |
| 2300 | 2298 | if (!defined('_DIR_SESSIONS')) { |
| 2301 | - define('_DIR_SESSIONS', $ti . "sessions/"); |
|
| 2299 | + define('_DIR_SESSIONS', $ti."sessions/"); |
|
| 2302 | 2300 | } |
| 2303 | 2301 | if (!defined('_DIR_TRANSFERT')) { |
| 2304 | - define('_DIR_TRANSFERT', $ti . "upload/"); |
|
| 2302 | + define('_DIR_TRANSFERT', $ti."upload/"); |
|
| 2305 | 2303 | } |
| 2306 | 2304 | if (!defined('_DIR_CACHE')) { |
| 2307 | - define('_DIR_CACHE', $ti . "cache/"); |
|
| 2305 | + define('_DIR_CACHE', $ti."cache/"); |
|
| 2308 | 2306 | } |
| 2309 | 2307 | if (!defined('_DIR_CACHE_XML')) { |
| 2310 | - define('_DIR_CACHE_XML', _DIR_CACHE . "xml/"); |
|
| 2308 | + define('_DIR_CACHE_XML', _DIR_CACHE."xml/"); |
|
| 2311 | 2309 | } |
| 2312 | 2310 | if (!defined('_DIR_SKELS')) { |
| 2313 | - define('_DIR_SKELS', _DIR_CACHE . "skel/"); |
|
| 2311 | + define('_DIR_SKELS', _DIR_CACHE."skel/"); |
|
| 2314 | 2312 | } |
| 2315 | 2313 | if (!defined('_DIR_AIDE')) { |
| 2316 | - define('_DIR_AIDE', _DIR_CACHE . "aide/"); |
|
| 2314 | + define('_DIR_AIDE', _DIR_CACHE."aide/"); |
|
| 2317 | 2315 | } |
| 2318 | 2316 | if (!defined('_DIR_TMP')) { |
| 2319 | 2317 | define('_DIR_TMP', $ti); |
@@ -2343,27 +2341,27 @@ discard block |
||
| 2343 | 2341 | // Declaration des fichiers |
| 2344 | 2342 | |
| 2345 | 2343 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2346 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . "charger_plugins_chemins.php"); |
|
| 2344 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE."charger_plugins_chemins.php"); |
|
| 2347 | 2345 | } |
| 2348 | 2346 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2349 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . "charger_plugins_options.php"); |
|
| 2347 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE."charger_plugins_options.php"); |
|
| 2350 | 2348 | } |
| 2351 | 2349 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2352 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . "charger_plugins_fonctions.php"); |
|
| 2350 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE."charger_plugins_fonctions.php"); |
|
| 2353 | 2351 | } |
| 2354 | 2352 | if (!defined('_CACHE_PIPELINES')) { |
| 2355 | - define('_CACHE_PIPELINES', _DIR_CACHE . "charger_pipelines.php"); |
|
| 2353 | + define('_CACHE_PIPELINES', _DIR_CACHE."charger_pipelines.php"); |
|
| 2356 | 2354 | } |
| 2357 | 2355 | if (!defined('_CACHE_CHEMIN')) { |
| 2358 | - define('_CACHE_CHEMIN', _DIR_CACHE . "chemin.txt"); |
|
| 2356 | + define('_CACHE_CHEMIN', _DIR_CACHE."chemin.txt"); |
|
| 2359 | 2357 | } |
| 2360 | 2358 | |
| 2361 | 2359 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2362 | 2360 | if (!defined('_FILE_META')) { |
| 2363 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2361 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2364 | 2362 | } |
| 2365 | 2363 | if (!defined('_DIR_LOG')) { |
| 2366 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2364 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2367 | 2365 | } |
| 2368 | 2366 | if (!defined('_FILE_LOG')) { |
| 2369 | 2367 | define('_FILE_LOG', 'spip'); |
@@ -2379,8 +2377,8 @@ discard block |
||
| 2379 | 2377 | } |
| 2380 | 2378 | if (!defined('_FILE_CONNECT')) { |
| 2381 | 2379 | define('_FILE_CONNECT', |
| 2382 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2383 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2380 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2381 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2384 | 2382 | : false))); |
| 2385 | 2383 | } |
| 2386 | 2384 | |
@@ -2390,7 +2388,7 @@ discard block |
||
| 2390 | 2388 | } |
| 2391 | 2389 | if (!defined('_FILE_CHMOD')) { |
| 2392 | 2390 | define('_FILE_CHMOD', |
| 2393 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2391 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2394 | 2392 | : false)); |
| 2395 | 2393 | } |
| 2396 | 2394 | |
@@ -2402,10 +2400,10 @@ discard block |
||
| 2402 | 2400 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2403 | 2401 | } |
| 2404 | 2402 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2405 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2403 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2406 | 2404 | } |
| 2407 | 2405 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2408 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2406 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2409 | 2407 | } |
| 2410 | 2408 | |
| 2411 | 2409 | // Definition des droits d'acces en ecriture |
@@ -2423,13 +2421,13 @@ discard block |
||
| 2423 | 2421 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2424 | 2422 | } |
| 2425 | 2423 | if (!defined('_ROOT_PLUGINS')) { |
| 2426 | - define('_ROOT_PLUGINS', _ROOT_RACINE . "plugins/"); |
|
| 2424 | + define('_ROOT_PLUGINS', _ROOT_RACINE."plugins/"); |
|
| 2427 | 2425 | } |
| 2428 | 2426 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2429 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . "plugins-dist/"); |
|
| 2427 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE."plugins-dist/"); |
|
| 2430 | 2428 | } |
| 2431 | 2429 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2432 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2430 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2433 | 2431 | } |
| 2434 | 2432 | |
| 2435 | 2433 | // La taille des Log |
@@ -2466,7 +2464,7 @@ discard block |
||
| 2466 | 2464 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2467 | 2465 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2468 | 2466 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2469 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2467 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2470 | 2468 | |
| 2471 | 2469 | // charger tout de suite le path et son cache |
| 2472 | 2470 | load_path_cache(); |
@@ -2513,7 +2511,7 @@ discard block |
||
| 2513 | 2511 | if (!empty($_SERVER['QUERY_STRING']) |
| 2514 | 2512 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2515 | 2513 | ) { |
| 2516 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2514 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2517 | 2515 | } |
| 2518 | 2516 | } |
| 2519 | 2517 | |
@@ -2549,7 +2547,7 @@ discard block |
||
| 2549 | 2547 | |
| 2550 | 2548 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2551 | 2549 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2552 | - $uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '') . '/'; |
|
| 2550 | + $uri_ref = (isset($uri_ref['path']) ? $uri_ref['path'] : '').'/'; |
|
| 2553 | 2551 | } else { |
| 2554 | 2552 | $uri_ref = ""; |
| 2555 | 2553 | } |
@@ -2637,7 +2635,7 @@ discard block |
||
| 2637 | 2635 | } |
| 2638 | 2636 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2639 | 2637 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2640 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2638 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2641 | 2639 | } |
| 2642 | 2640 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2643 | 2641 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -2729,7 +2727,7 @@ discard block |
||
| 2729 | 2727 | $memory *= 1024; |
| 2730 | 2728 | } |
| 2731 | 2729 | if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) { |
| 2732 | - @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M'); |
|
| 2730 | + @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M'); |
|
| 2733 | 2731 | if (trim(ini_get('memory_limit')) != $m) { |
| 2734 | 2732 | if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) { |
| 2735 | 2733 | define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true); |
@@ -2879,7 +2877,7 @@ discard block |
||
| 2879 | 2877 | } |
| 2880 | 2878 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 2881 | 2879 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 2882 | - . " " . _VAR_MODE); |
|
| 2880 | + . " "._VAR_MODE); |
|
| 2883 | 2881 | } |
| 2884 | 2882 | } // pas autorise ? |
| 2885 | 2883 | else { |
@@ -2887,7 +2885,7 @@ discard block |
||
| 2887 | 2885 | if (!$GLOBALS['visiteur_session']) { |
| 2888 | 2886 | include_spip('inc/headers'); |
| 2889 | 2887 | redirige_par_entete(generer_url_public('login', |
| 2890 | - 'url=' . rawurlencode( |
|
| 2888 | + 'url='.rawurlencode( |
|
| 2891 | 2889 | parametre_url(self(), 'var_mode', $_GET['var_mode'], '&') |
| 2892 | 2890 | ), true)); |
| 2893 | 2891 | } |
@@ -2940,10 +2938,10 @@ discard block |
||
| 2940 | 2938 | // mais on risque de perturber des plugins en initialisant trop tot |
| 2941 | 2939 | // certaines constantes |
| 2942 | 2940 | @spip_initialisation_core( |
| 2943 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 2944 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 2945 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 2946 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 2941 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 2942 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 2943 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 2944 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 2947 | 2945 | ); |
| 2948 | 2946 | |
| 2949 | 2947 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -2976,7 +2974,7 @@ discard block |
||
| 2976 | 2974 | } |
| 2977 | 2975 | |
| 2978 | 2976 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 2979 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 2977 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 2980 | 2978 | |
| 2981 | 2979 | $session = charger_fonction('session', 'inc'); |
| 2982 | 2980 | if ($session()) { |
@@ -3056,7 +3054,7 @@ discard block |
||
| 3056 | 3054 | $s = pipeline('definir_session', |
| 3057 | 3055 | $GLOBALS['visiteur_session'] |
| 3058 | 3056 | ? serialize($GLOBALS['visiteur_session']) |
| 3059 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3057 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3060 | 3058 | : '' |
| 3061 | 3059 | ); |
| 3062 | 3060 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3201,12 +3199,12 @@ discard block |
||
| 3201 | 3199 | $GLOBALS['_INC_PUBLIC']++; |
| 3202 | 3200 | |
| 3203 | 3201 | // fix #4235 |
| 3204 | - $cache_utilise_session_appelant = (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null); |
|
| 3202 | + $cache_utilise_session_appelant = (isset($GLOBALS['cache_utilise_session']) ? $GLOBALS['cache_utilise_session'] : null); |
|
| 3205 | 3203 | |
| 3206 | 3204 | |
| 3207 | 3205 | foreach (is_array($fond) ? $fond : array($fond) as $f) { |
| 3208 | 3206 | |
| 3209 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3207 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3210 | 3208 | |
| 3211 | 3209 | $page = evaluer_fond($f, $contexte, $connect); |
| 3212 | 3210 | if ($page === '') { |
@@ -3245,7 +3243,7 @@ discard block |
||
| 3245 | 3243 | } |
| 3246 | 3244 | |
| 3247 | 3245 | // contamination de la session appelante, pour les inclusions statiques |
| 3248 | - if (isset($page['invalideurs']['session'])){ |
|
| 3246 | + if (isset($page['invalideurs']['session'])) { |
|
| 3249 | 3247 | $cache_utilise_session_appelant = $page['invalideurs']['session']; |
| 3250 | 3248 | } |
| 3251 | 3249 | } |
@@ -3291,7 +3289,7 @@ discard block |
||
| 3291 | 3289 | * @return array|string |
| 3292 | 3290 | */ |
| 3293 | 3291 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3294 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3292 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3295 | 3293 | if (!$pathinfo) { |
| 3296 | 3294 | return $f; |
| 3297 | 3295 | } |
@@ -3531,7 +3529,7 @@ discard block |
||
| 3531 | 3529 | |
| 3532 | 3530 | if (!is_array($params[0])) { |
| 3533 | 3531 | trigger_error( |
| 3534 | - 'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given', |
|
| 3532 | + 'array_column() expects parameter 1 to be array, '.gettype($params[0]).' given', |
|
| 3535 | 3533 | E_USER_WARNING |
| 3536 | 3534 | ); |
| 3537 | 3535 | return null; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return $f; |
| 94 | 94 | } |
| 95 | - foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) { |
|
| 95 | + foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) { |
|
| 96 | 96 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 97 | 97 | // fonction ou name\space\fonction |
| 98 | 98 | if (is_callable($f)) { |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | function spip_version() { |
| 160 | 160 | $version = $GLOBALS['spip_version_affichee']; |
| 161 | 161 | if ($svn_revision = version_svn_courante(_DIR_RACINE)) { |
| 162 | - $version .= ($svn_revision < 0 ? ' SVN' : '') . ' [' . abs($svn_revision) . ']'; |
|
| 162 | + $version .= ($svn_revision < 0 ? ' SVN' : '').' ['.abs($svn_revision).']'; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return $version; |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // version installee par paquet ZIP |
| 189 | - if (lire_fichier($dir . '/svn.revision', $c) |
|
| 189 | + if (lire_fichier($dir.'/svn.revision', $c) |
|
| 190 | 190 | and preg_match(',Revision: (\d+),', $c, $d) |
| 191 | 191 | ) { |
| 192 | 192 | return intval($d[1]); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // version installee par SVN |
| 196 | - if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 197 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 196 | + if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 197 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 198 | 198 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 199 | 199 | if ($result) { |
| 200 | 200 | $row = $result->fetchArray(); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | return -$row['changed_revision']; |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | - } else if (lire_fichier($dir . '/.svn/entries', $c) |
|
| 205 | + } else if (lire_fichier($dir.'/.svn/entries', $c) |
|
| 206 | 206 | and ( |
| 207 | 207 | (preg_match_all( |
| 208 | 208 | ',committed-rev="([0-9]+)",', $c, $r1, PREG_PATTERN_ORDER) |
@@ -222,11 +222,11 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 224 | 224 | // et laisser passer les fonctions personnelles baptisees image_... |
| 225 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 226 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 227 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 228 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 229 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 225 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 226 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 227 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 228 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 229 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 230 | 230 | |
| 231 | 231 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 232 | 232 | $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php'; |
@@ -372,8 +372,8 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | function filtre_debug($val, $key = null) { |
| 374 | 374 | $debug = ( |
| 375 | - is_null($key) ? '' : (var_export($key, true) . " = ") |
|
| 376 | - ) . var_export($val, true); |
|
| 375 | + is_null($key) ? '' : (var_export($key, true)." = ") |
|
| 376 | + ).var_export($val, true); |
|
| 377 | 377 | |
| 378 | 378 | include_spip('inc/autoriser'); |
| 379 | 379 | if (autoriser('webmestre')) { |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 462 | 462 | $srcover = $match[1]; |
| 463 | 463 | array_shift($args); |
| 464 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 464 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 465 | 465 | $srcover_filter = call_user_func_array($filtre, $args); |
| 466 | 466 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 467 | 467 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | // " -> " et tout ce genre de choses |
| 812 | 812 | $u = $GLOBALS['meta']['pcre_u']; |
| 813 | 813 | $texte = str_replace(" ", " ", $texte); |
| 814 | - $texte = preg_replace('/\s{2,}/S' . $u, " ", $texte); |
|
| 814 | + $texte = preg_replace('/\s{2,}/S'.$u, " ", $texte); |
|
| 815 | 815 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 816 | 816 | $texte = entites_html($texte, false, false); |
| 817 | 817 | // mais bien echapper les double quotes ! |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | **/ |
| 872 | 872 | function supprimer_numero($texte) { |
| 873 | 873 | return preg_replace( |
| 874 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 874 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 875 | 875 | "", $texte); |
| 876 | 876 | } |
| 877 | 877 | |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | **/ |
| 897 | 897 | function recuperer_numero($texte) { |
| 898 | 898 | if (preg_match( |
| 899 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 899 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 900 | 900 | $texte, $regs)) { |
| 901 | 901 | return strval($regs[1]); |
| 902 | 902 | } else { |
@@ -981,8 +981,8 @@ discard block |
||
| 981 | 981 | **/ |
| 982 | 982 | function textebrut($texte) { |
| 983 | 983 | $u = $GLOBALS['meta']['pcre_u']; |
| 984 | - $texte = preg_replace('/\s+/S' . $u, " ", $texte); |
|
| 985 | - $texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte); |
|
| 984 | + $texte = preg_replace('/\s+/S'.$u, " ", $texte); |
|
| 985 | + $texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte); |
|
| 986 | 986 | $texte = preg_replace("/^\n+/", "", $texte); |
| 987 | 987 | $texte = preg_replace("/\n+$/", "", $texte); |
| 988 | 988 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
| 1011 | 1011 | $texte, $liens, PREG_PATTERN_ORDER)) { |
| 1012 | 1012 | foreach ($liens[0] as $a) { |
| 1013 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1013 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1014 | 1014 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1015 | 1015 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1016 | 1016 | $texte = str_replace($a, $ablank, $texte); |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | foreach ($regs[0] as $a) { |
| 1036 | 1036 | $rel = extraire_attribut($a, "rel"); |
| 1037 | 1037 | if (strpos($rel, "nofollow") === false) { |
| 1038 | - $rel = "nofollow" . ($rel ? " $rel" : ""); |
|
| 1038 | + $rel = "nofollow".($rel ? " $rel" : ""); |
|
| 1039 | 1039 | $anofollow = inserer_attribut($a, "rel", $rel); |
| 1040 | 1040 | $texte = str_replace($a, $anofollow, $texte); |
| 1041 | 1041 | } |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | $u = $GLOBALS['meta']['pcre_u']; |
| 1065 | 1065 | $texte = preg_replace("@</p>@iS", "\n", $texte); |
| 1066 | 1066 | $texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte); |
| 1067 | - $texte = preg_replace("@^\s*<br />@S" . $u, "", $texte); |
|
| 1067 | + $texte = preg_replace("@^\s*<br />@S".$u, "", $texte); |
|
| 1068 | 1068 | |
| 1069 | 1069 | return $texte; |
| 1070 | 1070 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | return $texte; |
| 1095 | 1095 | } |
| 1096 | 1096 | include_spip('inc/texte'); |
| 1097 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1097 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1098 | 1098 | 'div' : 'span'; |
| 1099 | 1099 | |
| 1100 | 1100 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | function attribut_html($texte, $textebrut = true) { |
| 1204 | 1204 | $u = $GLOBALS['meta']['pcre_u']; |
| 1205 | 1205 | if ($textebrut) { |
| 1206 | - $texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte)); |
|
| 1206 | + $texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte)); |
|
| 1207 | 1207 | } |
| 1208 | 1208 | $texte = texte_backend($texte); |
| 1209 | 1209 | $texte = str_replace(array("'", '"'), array(''', '"'), $texte); |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | # un message pour abs_url |
| 1233 | 1233 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1234 | 1234 | $url = trim($url); |
| 1235 | - $r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1235 | + $r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1236 | 1236 | |
| 1237 | 1237 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1238 | 1238 | } |
@@ -1434,14 +1434,14 @@ discard block |
||
| 1434 | 1434 | if (strpos($texte, "<") !== false) { |
| 1435 | 1435 | include_spip('inc/lien'); |
| 1436 | 1436 | if (defined('_PREG_MODELE')) { |
| 1437 | - $preg_modeles = "@" . _PREG_MODELE . "@imsS"; |
|
| 1437 | + $preg_modeles = "@"._PREG_MODELE."@imsS"; |
|
| 1438 | 1438 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1439 | 1439 | } |
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | 1442 | $debut = ''; |
| 1443 | 1443 | $suite = $texte; |
| 1444 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1444 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1445 | 1445 | $debut .= substr($suite, 0, $t - 1); |
| 1446 | 1446 | $suite = substr($suite, $t); |
| 1447 | 1447 | $car = substr($suite, 0, 1); |
@@ -1458,11 +1458,11 @@ discard block |
||
| 1458 | 1458 | $suite = substr($suite, strlen($regs[0])); |
| 1459 | 1459 | } |
| 1460 | 1460 | } |
| 1461 | - $texte = $debut . $suite; |
|
| 1461 | + $texte = $debut.$suite; |
|
| 1462 | 1462 | |
| 1463 | 1463 | $texte = echappe_retour($texte); |
| 1464 | 1464 | |
| 1465 | - return $texte . $fin; |
|
| 1465 | + return $texte.$fin; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | foreach ($regs as $reg) { |
| 1526 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1526 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1527 | 1527 | $desc = $traduire($cle, $lang, true); |
| 1528 | 1528 | $l = $desc->langue; |
| 1529 | 1529 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1636,7 +1636,7 @@ discard block |
||
| 1636 | 1636 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1637 | 1637 | include_spip('inc/texte'); |
| 1638 | 1638 | $trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad)); |
| 1639 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1639 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1640 | 1640 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1641 | 1641 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
| 1642 | 1642 | if (lang_dir($l) !== lang_dir($lang)) { |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | if (is_array($balise)) { |
| 1830 | 1830 | array_walk( |
| 1831 | 1831 | $balise, |
| 1832 | - function(&$a, $key, $t){ |
|
| 1832 | + function(&$a, $key, $t) { |
|
| 1833 | 1833 | $a = extraire_attribut($a, $t); |
| 1834 | 1834 | }, |
| 1835 | 1835 | $attribut |
@@ -1916,14 +1916,14 @@ discard block |
||
| 1916 | 1916 | |
| 1917 | 1917 | if ($old !== null) { |
| 1918 | 1918 | // Remplacer l'ancien attribut du meme nom |
| 1919 | - $balise = $r[1] . $insert . $r[5]; |
|
| 1919 | + $balise = $r[1].$insert.$r[5]; |
|
| 1920 | 1920 | } else { |
| 1921 | 1921 | // preferer une balise " />" (comme <img />) |
| 1922 | 1922 | if (preg_match(',/>,', $balise)) { |
| 1923 | - $balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1); |
|
| 1923 | + $balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1); |
|
| 1924 | 1924 | } // sinon une balise <a ...> ... </a> |
| 1925 | 1925 | else { |
| 1926 | - $balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1); |
|
| 1926 | + $balise = preg_replace(",\s?>,S", $insert.">", $balise, 1); |
|
| 1927 | 1927 | } |
| 1928 | 1928 | } |
| 1929 | 1929 | |
@@ -1965,8 +1965,8 @@ discard block |
||
| 1965 | 1965 | // |
| 1966 | 1966 | // Quelques fonctions de calcul arithmetique |
| 1967 | 1967 | // |
| 1968 | -function floatstr($a) { return str_replace(',','.',(string)floatval($a)); } |
|
| 1969 | -function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); } |
|
| 1968 | +function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); } |
|
| 1969 | +function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); } |
|
| 1970 | 1970 | |
| 1971 | 1971 | /** |
| 1972 | 1972 | * Additionne 2 nombres |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | function plus($a, $b) { |
| 1987 | 1987 | return $a + $b; |
| 1988 | 1988 | } |
| 1989 | -function strplus($a, $b) {return strize('plus', $a, $b);} |
|
| 1989 | +function strplus($a, $b) {return strize('plus', $a, $b); } |
|
| 1990 | 1990 | /** |
| 1991 | 1991 | * Soustrait 2 nombres |
| 1992 | 1992 | * |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | function moins($a, $b) { |
| 2006 | 2006 | return $a - $b; |
| 2007 | 2007 | } |
| 2008 | -function strmoins($a, $b) {return strize('moins', $a, $b);} |
|
| 2008 | +function strmoins($a, $b) {return strize('moins', $a, $b); } |
|
| 2009 | 2009 | |
| 2010 | 2010 | /** |
| 2011 | 2011 | * Multiplie 2 nombres |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | function mult($a, $b) { |
| 2027 | 2027 | return $a * $b; |
| 2028 | 2028 | } |
| 2029 | -function strmult($a, $b) {return strize('mult', $a, $b);} |
|
| 2029 | +function strmult($a, $b) {return strize('mult', $a, $b); } |
|
| 2030 | 2030 | |
| 2031 | 2031 | /** |
| 2032 | 2032 | * Divise 2 nombres |
@@ -2047,7 +2047,7 @@ discard block |
||
| 2047 | 2047 | function div($a, $b) { |
| 2048 | 2048 | return $b ? $a / $b : 0; |
| 2049 | 2049 | } |
| 2050 | -function strdiv($a, $b) {return strize('div', $a, $b);} |
|
| 2050 | +function strdiv($a, $b) {return strize('div', $a, $b); } |
|
| 2051 | 2051 | |
| 2052 | 2052 | /** |
| 2053 | 2053 | * Retourne le modulo 2 nombres |
@@ -2088,13 +2088,13 @@ discard block |
||
| 2088 | 2088 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2089 | 2089 | define('_TAGS_NOM_AUTEUR', ''); |
| 2090 | 2090 | } |
| 2091 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2091 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2092 | 2092 | foreach ($tags_acceptes as $tag) { |
| 2093 | 2093 | if (strlen($tag)) { |
| 2094 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2095 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2096 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2097 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2094 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2095 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2096 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2097 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2098 | 2098 | } |
| 2099 | 2099 | } |
| 2100 | 2100 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2157,7 +2157,7 @@ discard block |
||
| 2157 | 2157 | $s[] = preg_replace(',>[^<]+</a>,S', |
| 2158 | 2158 | '>' |
| 2159 | 2159 | . http_img_pack('attachment-16.png', $t, |
| 2160 | - 'title="' . attribut_html($t) . '"') |
|
| 2160 | + 'title="'.attribut_html($t).'"') |
|
| 2161 | 2161 | . '</a>', $tag); |
| 2162 | 2162 | } |
| 2163 | 2163 | } |
@@ -2218,10 +2218,10 @@ discard block |
||
| 2218 | 2218 | $fichier = basename($url); |
| 2219 | 2219 | |
| 2220 | 2220 | return '<a rel="enclosure"' |
| 2221 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2222 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2223 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2224 | - . '>' . $fichier . '</a>'; |
|
| 2221 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2222 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2223 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2224 | + . '>'.$fichier.'</a>'; |
|
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | 2227 | /** |
@@ -2249,9 +2249,9 @@ discard block |
||
| 2249 | 2249 | } # vieux data |
| 2250 | 2250 | $fichier = basename($url); |
| 2251 | 2251 | $enclosures[] = '<enclosure' |
| 2252 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2253 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2254 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2252 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2253 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2254 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2255 | 2255 | . ' />'; |
| 2256 | 2256 | } |
| 2257 | 2257 | } |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | if (extraire_attribut($e, rel) == 'tag') { |
| 2278 | 2278 | $subjects .= '<dc:subject>' |
| 2279 | 2279 | . texte_backend(textebrut($e)) |
| 2280 | - . '</dc:subject>' . "\n"; |
|
| 2280 | + . '</dc:subject>'."\n"; |
|
| 2281 | 2281 | } |
| 2282 | 2282 | } |
| 2283 | 2283 | |
@@ -2313,7 +2313,7 @@ discard block |
||
| 2313 | 2313 | if (is_array($texte)) { |
| 2314 | 2314 | array_walk( |
| 2315 | 2315 | $texte, |
| 2316 | - function(&$a, $key, $t){ |
|
| 2316 | + function(&$a, $key, $t) { |
|
| 2317 | 2317 | $a = extraire_balise($a, $t); |
| 2318 | 2318 | }, |
| 2319 | 2319 | $tag |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | if (is_array($texte)) { |
| 2358 | 2358 | array_walk( |
| 2359 | 2359 | $texte, |
| 2360 | - function(&$a, $key, $t){ |
|
| 2360 | + function(&$a, $key, $t) { |
|
| 2361 | 2361 | $a = extraire_balises($a, $t); |
| 2362 | 2362 | }, |
| 2363 | 2363 | $tag |
@@ -2483,7 +2483,7 @@ discard block |
||
| 2483 | 2483 | if ($fond != '404') { |
| 2484 | 2484 | $contexte = array_shift($p); |
| 2485 | 2485 | $contexte['page'] = $fond; |
| 2486 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2486 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2487 | 2487 | } |
| 2488 | 2488 | } |
| 2489 | 2489 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2538,9 +2538,9 @@ discard block |
||
| 2538 | 2538 | . '"' |
| 2539 | 2539 | . (is_null($val) |
| 2540 | 2540 | ? '' |
| 2541 | - : ' value="' . entites_html($val) . '"' |
|
| 2541 | + : ' value="'.entites_html($val).'"' |
|
| 2542 | 2542 | ) |
| 2543 | - . ' type="hidden"' . "\n/>"; |
|
| 2543 | + . ' type="hidden"'."\n/>"; |
|
| 2544 | 2544 | } |
| 2545 | 2545 | |
| 2546 | 2546 | return join("", $hidden); |
@@ -2703,12 +2703,12 @@ discard block |
||
| 2703 | 2703 | if ($pas < 1) { |
| 2704 | 2704 | return ''; |
| 2705 | 2705 | } |
| 2706 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 2707 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 2706 | + $ancre = 'pagination'.$nom; // #pagination_articles |
|
| 2707 | + $debut = 'debut'.$nom; // 'debut_articles' |
|
| 2708 | 2708 | |
| 2709 | 2709 | // n'afficher l'ancre qu'une fois |
| 2710 | 2710 | if (!isset($ancres[$ancre])) { |
| 2711 | - $bloc_ancre = $ancres[$ancre] = "<a name='" . $ancre . "' id='" . $ancre . "'></a>"; |
|
| 2711 | + $bloc_ancre = $ancres[$ancre] = "<a name='".$ancre."' id='".$ancre."'></a>"; |
|
| 2712 | 2712 | } else { |
| 2713 | 2713 | $bloc_ancre = ''; |
| 2714 | 2714 | } |
@@ -2738,7 +2738,7 @@ discard block |
||
| 2738 | 2738 | } |
| 2739 | 2739 | |
| 2740 | 2740 | if ($modele) { |
| 2741 | - $modele = '_' . $modele; |
|
| 2741 | + $modele = '_'.$modele; |
|
| 2742 | 2742 | } |
| 2743 | 2743 | |
| 2744 | 2744 | return recuperer_fond("modeles/pagination$modele", $pagination, array('trim' => true), $connect); |
@@ -2763,7 +2763,7 @@ discard block |
||
| 2763 | 2763 | return preg_replace_callback( |
| 2764 | 2764 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2765 | 2765 | function($x) use ($path) { |
| 2766 | - return "url('" . suivre_lien($path, $x[1]) . "')"; |
|
| 2766 | + return "url('".suivre_lien($path, $x[1])."')"; |
|
| 2767 | 2767 | }, |
| 2768 | 2768 | $contenu |
| 2769 | 2769 | ); |
@@ -2825,14 +2825,14 @@ discard block |
||
| 2825 | 2825 | ) { |
| 2826 | 2826 | $distant = true; |
| 2827 | 2827 | $cssf = parse_url($css); |
| 2828 | - $cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : ""); |
|
| 2828 | + $cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : ""); |
|
| 2829 | 2829 | $cssf = preg_replace(',[?:&=],', "_", $cssf); |
| 2830 | 2830 | } else { |
| 2831 | 2831 | $distant = false; |
| 2832 | 2832 | $cssf = $css; |
| 2833 | 2833 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2834 | 2834 | //propose (rien a faire dans ce cas) |
| 2835 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2835 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2836 | 2836 | if (@file_exists($f)) { |
| 2837 | 2837 | return $f; |
| 2838 | 2838 | } |
@@ -2842,7 +2842,7 @@ discard block |
||
| 2842 | 2842 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2843 | 2843 | $f = $dir_var |
| 2844 | 2844 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2845 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2845 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2846 | 2846 | |
| 2847 | 2847 | // la css peut etre distante (url absolue !) |
| 2848 | 2848 | if ($distant) { |
@@ -2887,8 +2887,8 @@ discard block |
||
| 2887 | 2887 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2888 | 2888 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2889 | 2889 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2890 | - $src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction; |
|
| 2891 | - $css_direction = "/@@@@@@/" . $css_direction; |
|
| 2890 | + $src_faux_abs["/@@@@@@/".$css_direction] = $css_direction; |
|
| 2891 | + $css_direction = "/@@@@@@/".$css_direction; |
|
| 2892 | 2892 | } |
| 2893 | 2893 | $src[] = $regs[0][$k]; |
| 2894 | 2894 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -2937,7 +2937,7 @@ discard block |
||
| 2937 | 2937 | |
| 2938 | 2938 | $f = basename($css, '.css'); |
| 2939 | 2939 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 2940 | - . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 2940 | + . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 2941 | 2941 | . '.css'; |
| 2942 | 2942 | |
| 2943 | 2943 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -2946,7 +2946,7 @@ discard block |
||
| 2946 | 2946 | |
| 2947 | 2947 | if ($url_absolue_css == $css) { |
| 2948 | 2948 | if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 2949 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 2949 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 2950 | 2950 | ) { |
| 2951 | 2951 | include_spip('inc/distant'); |
| 2952 | 2952 | if (!$contenu = recuperer_page($css)) { |
@@ -3056,7 +3056,7 @@ discard block |
||
| 3056 | 3056 | $expression = str_replace("\/", "/", $expression); |
| 3057 | 3057 | $expression = str_replace("/", "\/", $expression); |
| 3058 | 3058 | |
| 3059 | - if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) { |
|
| 3059 | + if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) { |
|
| 3060 | 3060 | if (isset($r[$capte])) { |
| 3061 | 3061 | return $r[$capte]; |
| 3062 | 3062 | } else { |
@@ -3094,7 +3094,7 @@ discard block |
||
| 3094 | 3094 | $expression = str_replace("\/", "/", $expression); |
| 3095 | 3095 | $expression = str_replace("/", "\/", $expression); |
| 3096 | 3096 | |
| 3097 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3097 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3098 | 3098 | } |
| 3099 | 3099 | |
| 3100 | 3100 | |
@@ -3113,7 +3113,7 @@ discard block |
||
| 3113 | 3113 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3114 | 3114 | |
| 3115 | 3115 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3116 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3116 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3117 | 3117 | |
| 3118 | 3118 | if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
| 3119 | 3119 | and preg_match_all( |
@@ -3123,7 +3123,7 @@ discard block |
||
| 3123 | 3123 | if (!isset($doublons['documents'])) { |
| 3124 | 3124 | $doublons['documents'] = ""; |
| 3125 | 3125 | } |
| 3126 | - $doublons['documents'] .= "," . join(',', $matches[1]); |
|
| 3126 | + $doublons['documents'] .= ",".join(',', $matches[1]); |
|
| 3127 | 3127 | } |
| 3128 | 3128 | |
| 3129 | 3129 | return $letexte; |
@@ -3180,7 +3180,7 @@ discard block |
||
| 3180 | 3180 | if ($env) { |
| 3181 | 3181 | foreach ($env as $i => $j) { |
| 3182 | 3182 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3183 | - $texte .= "<param name='" . $i . "'\n\tvalue='" . $j . "' />"; |
|
| 3183 | + $texte .= "<param name='".$i."'\n\tvalue='".$j."' />"; |
|
| 3184 | 3184 | } |
| 3185 | 3185 | } |
| 3186 | 3186 | } |
@@ -3219,7 +3219,7 @@ discard block |
||
| 3219 | 3219 | if ($env) { |
| 3220 | 3220 | foreach ($env as $i => $j) { |
| 3221 | 3221 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3222 | - $texte .= $i . "='" . $j . "' "; |
|
| 3222 | + $texte .= $i."='".$j."' "; |
|
| 3223 | 3223 | } |
| 3224 | 3224 | } |
| 3225 | 3225 | } |
@@ -3303,19 +3303,19 @@ discard block |
||
| 3303 | 3303 | |
| 3304 | 3304 | $img_file = $img; |
| 3305 | 3305 | if ($p = strpos($img_file, '?')) { |
| 3306 | - $img_file = substr($img_file,0, $p); |
|
| 3306 | + $img_file = substr($img_file, 0, $p); |
|
| 3307 | 3307 | } |
| 3308 | 3308 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3309 | 3309 | $img_file = chemin_image($img); |
| 3310 | 3310 | } |
| 3311 | 3311 | else { |
| 3312 | - if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){ |
|
| 3312 | + if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3313 | 3313 | // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
| 3314 | 3314 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3315 | 3315 | if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3316 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg" |
|
| 3316 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg" |
|
| 3317 | 3317 | and file_exists($variante_svg_generique)) { |
| 3318 | - if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) { |
|
| 3318 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) { |
|
| 3319 | 3319 | $img_file = $variante_svg_size; |
| 3320 | 3320 | } |
| 3321 | 3321 | else { |
@@ -3340,15 +3340,15 @@ discard block |
||
| 3340 | 3340 | return ""; |
| 3341 | 3341 | } |
| 3342 | 3342 | } |
| 3343 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3343 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3344 | 3344 | } |
| 3345 | 3345 | |
| 3346 | 3346 | if (file_exists($img_file)) { |
| 3347 | 3347 | $img_file = timestamp($img_file); |
| 3348 | 3348 | } |
| 3349 | - return "<img src='$img_file' alt='" . attribut_html($alt ? $alt : $title) . "'" |
|
| 3350 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3351 | - . " " . ltrim($atts) |
|
| 3349 | + return "<img src='$img_file' alt='".attribut_html($alt ? $alt : $title)."'" |
|
| 3350 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3351 | + . " ".ltrim($atts) |
|
| 3352 | 3352 | . " />"; |
| 3353 | 3353 | } |
| 3354 | 3354 | |
@@ -3360,12 +3360,12 @@ discard block |
||
| 3360 | 3360 | * @param string $size |
| 3361 | 3361 | * @return string |
| 3362 | 3362 | */ |
| 3363 | -function http_style_background($img, $att = '', $size=null) { |
|
| 3364 | - if ($size and is_numeric($size)){ |
|
| 3365 | - $size = trim($size) . "px"; |
|
| 3363 | +function http_style_background($img, $att = '', $size = null) { |
|
| 3364 | + if ($size and is_numeric($size)) { |
|
| 3365 | + $size = trim($size)."px"; |
|
| 3366 | 3366 | } |
| 3367 | - return " style='background" . |
|
| 3368 | - ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";" |
|
| 3367 | + return " style='background". |
|
| 3368 | + ($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";" |
|
| 3369 | 3369 | . ($size ? "background-size:{$size};" : '') |
| 3370 | 3370 | . "'"; |
| 3371 | 3371 | } |
@@ -3382,8 +3382,8 @@ discard block |
||
| 3382 | 3382 | * @return string |
| 3383 | 3383 | * Code HTML de la balise IMG |
| 3384 | 3384 | */ |
| 3385 | -function filtre_balise_img_dist($img, $alt = "", $class = "", $width=null) { |
|
| 3386 | - $atts = $class ? " class='" . attribut_html($class) . "'" : ''; |
|
| 3385 | +function filtre_balise_img_dist($img, $alt = "", $class = "", $width = null) { |
|
| 3386 | + $atts = $class ? " class='".attribut_html($class)."'" : ''; |
|
| 3387 | 3387 | // ecriture courte : on donne le width en 2e arg |
| 3388 | 3388 | if (empty($width) and is_numeric($alt)) { |
| 3389 | 3389 | $width = $alt; |
@@ -3424,11 +3424,11 @@ discard block |
||
| 3424 | 3424 | if ($class) { |
| 3425 | 3425 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3426 | 3426 | } |
| 3427 | - if ($alt){ |
|
| 3427 | + if ($alt) { |
|
| 3428 | 3428 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3429 | - $id = "img-svg-title-" . substr(md5("$file:$svg:$alt"),0,4); |
|
| 3429 | + $id = "img-svg-title-".substr(md5("$file:$svg:$alt"), 0, 4); |
|
| 3430 | 3430 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3431 | - $title = "<title id=\"$id\">" . entites_html($alt)."</title>\n"; |
|
| 3431 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3432 | 3432 | $balise_svg .= $title; |
| 3433 | 3433 | } |
| 3434 | 3434 | else { |
@@ -3462,7 +3462,7 @@ discard block |
||
| 3462 | 3462 | $texte = ''; |
| 3463 | 3463 | if (is_array($tableau)) { |
| 3464 | 3464 | foreach ($tableau as $k => $v) { |
| 3465 | - $res = recuperer_fond('modeles/' . $modele, |
|
| 3465 | + $res = recuperer_fond('modeles/'.$modele, |
|
| 3466 | 3466 | array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v))) |
| 3467 | 3467 | ); |
| 3468 | 3468 | $texte .= $res; |
@@ -3639,7 +3639,7 @@ discard block |
||
| 3639 | 3639 | } |
| 3640 | 3640 | |
| 3641 | 3641 | $c = serialize($c); |
| 3642 | - $cle = calculer_cle_action($form . $c); |
|
| 3642 | + $cle = calculer_cle_action($form.$c); |
|
| 3643 | 3643 | $c = "$cle:$c"; |
| 3644 | 3644 | |
| 3645 | 3645 | // on ne stocke pas les contextes dans des fichiers caches |
@@ -3689,15 +3689,15 @@ discard block |
||
| 3689 | 3689 | } |
| 3690 | 3690 | // toujours encoder l'url source dans le bloc ajax |
| 3691 | 3691 | $r = self(); |
| 3692 | - $r = ' data-origin="' . $r . '"'; |
|
| 3692 | + $r = ' data-origin="'.$r.'"'; |
|
| 3693 | 3693 | $class = 'ajaxbloc'; |
| 3694 | 3694 | if ($ajaxid and is_string($ajaxid)) { |
| 3695 | 3695 | // ajaxid est normalement conforme a un nom de classe css |
| 3696 | 3696 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3697 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3697 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3698 | 3698 | } |
| 3699 | 3699 | |
| 3700 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3700 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3701 | 3701 | } |
| 3702 | 3702 | |
| 3703 | 3703 | /** |
@@ -3736,11 +3736,11 @@ discard block |
||
| 3736 | 3736 | // extraire la signature en debut de contexte |
| 3737 | 3737 | // et la verifier avant de deserializer |
| 3738 | 3738 | // format : signature:donneesserializees |
| 3739 | - if ($p = strpos($c,":")){ |
|
| 3740 | - $cle = substr($c,0,$p); |
|
| 3741 | - $c = substr($c,$p+1); |
|
| 3739 | + if ($p = strpos($c, ":")) { |
|
| 3740 | + $cle = substr($c, 0, $p); |
|
| 3741 | + $c = substr($c, $p + 1); |
|
| 3742 | 3742 | |
| 3743 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 3743 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 3744 | 3744 | $env = @unserialize($c); |
| 3745 | 3745 | return $env; |
| 3746 | 3746 | } |
@@ -3841,9 +3841,9 @@ discard block |
||
| 3841 | 3841 | } else { |
| 3842 | 3842 | $bal = 'a'; |
| 3843 | 3843 | $att = "href='$url'" |
| 3844 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 3845 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 3846 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 3844 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 3845 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 3846 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 3847 | 3847 | . $evt; |
| 3848 | 3848 | } |
| 3849 | 3849 | if ($libelle === null) { |
@@ -3918,7 +3918,7 @@ discard block |
||
| 3918 | 3918 | } |
| 3919 | 3919 | |
| 3920 | 3920 | // ajouter le type d'objet dans la class de l'icone |
| 3921 | - $class .= " " . substr(basename($fond), 0, -4); |
|
| 3921 | + $class .= " ".substr(basename($fond), 0, -4); |
|
| 3922 | 3922 | |
| 3923 | 3923 | $alt = attribut_html($texte); |
| 3924 | 3924 | $title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ? |
@@ -3942,7 +3942,7 @@ discard block |
||
| 3942 | 3942 | } |
| 3943 | 3943 | |
| 3944 | 3944 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 3945 | - $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>"; |
|
| 3945 | + $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>"; |
|
| 3946 | 3946 | |
| 3947 | 3947 | if ($type == 'lien') { |
| 3948 | 3948 | return "<span class='icone s$size $class'>" |
@@ -4172,13 +4172,13 @@ discard block |
||
| 4172 | 4172 | $res = ""; |
| 4173 | 4173 | foreach ($boutons as $page => $detail) { |
| 4174 | 4174 | if ($detail->icone and strlen(trim($detail->icone))) { |
| 4175 | - $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}"; |
|
| 4175 | + $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}"; |
|
| 4176 | 4176 | } |
| 4177 | 4177 | $selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones "); |
| 4178 | 4178 | if (is_array($detail->sousmenu)) { |
| 4179 | 4179 | foreach ($detail->sousmenu as $souspage => $sousdetail) { |
| 4180 | 4180 | if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
| 4181 | - $res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}"; |
|
| 4181 | + $res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}"; |
|
| 4182 | 4182 | } |
| 4183 | 4183 | } |
| 4184 | 4184 | } |
@@ -4204,17 +4204,17 @@ discard block |
||
| 4204 | 4204 | */ |
| 4205 | 4205 | function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") { |
| 4206 | 4206 | if ($confirm) { |
| 4207 | - $confirm = "confirm(\"" . attribut_html($confirm) . "\")"; |
|
| 4207 | + $confirm = "confirm(\"".attribut_html($confirm)."\")"; |
|
| 4208 | 4208 | if ($callback) { |
| 4209 | 4209 | $callback = "$confirm?($callback):false"; |
| 4210 | 4210 | } else { |
| 4211 | 4211 | $callback = $confirm; |
| 4212 | 4212 | } |
| 4213 | 4213 | } |
| 4214 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ""; |
|
| 4214 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ""; |
|
| 4215 | 4215 | $title = $title ? " title='$title'" : ""; |
| 4216 | 4216 | |
| 4217 | - return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4217 | + return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url) |
|
| 4218 | 4218 | . "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>"; |
| 4219 | 4219 | } |
| 4220 | 4220 | |
@@ -4353,14 +4353,14 @@ discard block |
||
| 4353 | 4353 | $champ_titre = ""; |
| 4354 | 4354 | if ($demande_titre) { |
| 4355 | 4355 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4356 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4356 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4357 | 4357 | } |
| 4358 | 4358 | include_spip('base/abstract_sql'); |
| 4359 | 4359 | include_spip('base/connect_sql'); |
| 4360 | 4360 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4361 | - '*' . $champ_titre, |
|
| 4361 | + '*'.$champ_titre, |
|
| 4362 | 4362 | $desc['table_sql'], |
| 4363 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4363 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4364 | 4364 | ); |
| 4365 | 4365 | } |
| 4366 | 4366 | |
@@ -4430,7 +4430,7 @@ discard block |
||
| 4430 | 4430 | return $texte; |
| 4431 | 4431 | } |
| 4432 | 4432 | |
| 4433 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4433 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4434 | 4434 | |
| 4435 | 4435 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4436 | 4436 | $Pile = array(0 => $env); |
@@ -4464,7 +4464,7 @@ discard block |
||
| 4464 | 4464 | } |
| 4465 | 4465 | $url = generer_url_entite($id_objet, $objet, '', '', $connect); |
| 4466 | 4466 | |
| 4467 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>"; |
|
| 4467 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>"; |
|
| 4468 | 4468 | } |
| 4469 | 4469 | |
| 4470 | 4470 | |
@@ -4483,10 +4483,10 @@ discard block |
||
| 4483 | 4483 | function wrap($texte, $wrap) { |
| 4484 | 4484 | $balises = extraire_balises($wrap); |
| 4485 | 4485 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4486 | - $texte = $wrap . $texte; |
|
| 4486 | + $texte = $wrap.$texte; |
|
| 4487 | 4487 | $regs = array_reverse($regs[1]); |
| 4488 | - $wrap = "</" . implode("></", $regs) . ">"; |
|
| 4489 | - $texte = $texte . $wrap; |
|
| 4488 | + $wrap = "</".implode("></", $regs).">"; |
|
| 4489 | + $texte = $texte.$wrap; |
|
| 4490 | 4490 | } |
| 4491 | 4491 | |
| 4492 | 4492 | return $texte; |
@@ -4517,7 +4517,7 @@ discard block |
||
| 4517 | 4517 | |
| 4518 | 4518 | // caster $u en array si besoin |
| 4519 | 4519 | if (is_object($u)) { |
| 4520 | - $u = (array)$u; |
|
| 4520 | + $u = (array) $u; |
|
| 4521 | 4521 | } |
| 4522 | 4522 | |
| 4523 | 4523 | if (is_array($u)) { |
@@ -4538,7 +4538,7 @@ discard block |
||
| 4538 | 4538 | // sinon on passe a la ligne et on indente |
| 4539 | 4539 | $i_str = str_pad("", $indent, " "); |
| 4540 | 4540 | foreach ($u as $k => $v) { |
| 4541 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4541 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4542 | 4542 | } |
| 4543 | 4543 | |
| 4544 | 4544 | return $out; |
@@ -4591,8 +4591,8 @@ discard block |
||
| 4591 | 4591 | * @param string $class |
| 4592 | 4592 | * @return string |
| 4593 | 4593 | */ |
| 4594 | -function objet_icone($objet, $taille = 24, $class='') { |
|
| 4595 | - $icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png"; |
|
| 4594 | +function objet_icone($objet, $taille = 24, $class = '') { |
|
| 4595 | + $icone = objet_info($objet, 'icone_objet')."-".$taille.".png"; |
|
| 4596 | 4596 | $icone = chemin_image($icone); |
| 4597 | 4597 | $balise_img = charger_filtre('balise_img'); |
| 4598 | 4598 | |
@@ -4616,12 +4616,12 @@ discard block |
||
| 4616 | 4616 | * @param array $options |
| 4617 | 4617 | * @return string |
| 4618 | 4618 | */ |
| 4619 | -function objet_T($objet, $chaine, $args = array(), $options = array()){ |
|
| 4620 | - $chaine = explode(':',$chaine); |
|
| 4621 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4619 | +function objet_T($objet, $chaine, $args = array(), $options = array()) { |
|
| 4620 | + $chaine = explode(':', $chaine); |
|
| 4621 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4622 | 4622 | return $t; |
| 4623 | 4623 | } |
| 4624 | - $chaine = implode(':',$chaine); |
|
| 4624 | + $chaine = implode(':', $chaine); |
|
| 4625 | 4625 | return _T($chaine, $args, $options); |
| 4626 | 4626 | } |
| 4627 | 4627 | |
@@ -4681,11 +4681,11 @@ discard block |
||
| 4681 | 4681 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 4682 | 4682 | |
| 4683 | 4683 | // calculer le nom de la css |
| 4684 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 4684 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 4685 | 4685 | $nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond)); |
| 4686 | 4686 | $contexte_implicite = calculer_contexte_implicite(); |
| 4687 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" |
|
| 4688 | - . substr(md5($fond . serialize($contexte_implicite) . serialize($contexte) . $connect), 0, 8) |
|
| 4687 | + $filename = $dir_var.$extension."dyn-$nom_safe-" |
|
| 4688 | + . substr(md5($fond.serialize($contexte_implicite).serialize($contexte).$connect), 0, 8) |
|
| 4689 | 4689 | . ".$extension"; |
| 4690 | 4690 | |
| 4691 | 4691 | // mettre a jour le fichier si il n'existe pas |
@@ -4693,8 +4693,8 @@ discard block |
||
| 4693 | 4693 | // le dernier fichier produit est toujours suffixe par .last |
| 4694 | 4694 | // et recopie sur le fichier cible uniquement si il change |
| 4695 | 4695 | if (!file_exists($filename) |
| 4696 | - or !file_exists($filename . ".last") |
|
| 4697 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified']) |
|
| 4696 | + or !file_exists($filename.".last") |
|
| 4697 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified']) |
|
| 4698 | 4698 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 4699 | 4699 | ) { |
| 4700 | 4700 | $contenu = $cache['texte']; |
@@ -4713,15 +4713,15 @@ discard block |
||
| 4713 | 4713 | } |
| 4714 | 4714 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 4715 | 4715 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 4716 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 4716 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 4717 | 4717 | } |
| 4718 | 4718 | // et ecrire le fichier |
| 4719 | - ecrire_fichier($filename . ".last", $comment . $contenu); |
|
| 4719 | + ecrire_fichier($filename.".last", $comment.$contenu); |
|
| 4720 | 4720 | // regarder si on recopie |
| 4721 | 4721 | if (!file_exists($filename) |
| 4722 | - or md5_file($filename) !== md5_file($filename . ".last") |
|
| 4722 | + or md5_file($filename) !== md5_file($filename.".last") |
|
| 4723 | 4723 | ) { |
| 4724 | - @copy($filename . ".last", $filename); |
|
| 4724 | + @copy($filename.".last", $filename); |
|
| 4725 | 4725 | clearstatcache(true, $filename); // eviter que PHP ne reserve le vieux timestamp |
| 4726 | 4726 | } |
| 4727 | 4727 | } |