@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | include_fichiers_fonctions(); |
| 97 | - foreach (array('filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc) as $f) { |
|
| 97 | + foreach (array('filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc) as $f) { |
|
| 98 | 98 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 99 | 99 | // fonction ou name\space\fonction |
| 100 | 100 | if (is_callable($f)) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | // affichage "GIT [master: abcdef]" |
| 188 | 188 | $commit = isset($desc['commit_short']) ? $desc['commit_short'] : $desc['commit']; |
| 189 | 189 | if ($desc['branch']) { |
| 190 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 190 | + $commit = $desc['branch'].': '.$commit; |
|
| 191 | 191 | } |
| 192 | 192 | return "{$desc['vcs']} [$commit]"; |
| 193 | 193 | } |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // version installee par GIT |
| 209 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 209 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 210 | 210 | $currentHead = trim(substr($c, 4)); |
| 211 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 211 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 212 | 212 | return [ |
| 213 | 213 | 'vcs' => 'GIT', |
| 214 | 214 | 'branch' => basename($currentHead), |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | $dir = '.'; |
| 236 | 236 | } |
| 237 | 237 | // version installee par SVN |
| 238 | - if (file_exists($dir . '/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 239 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 238 | + if (file_exists($dir.'/.svn/wc.db') && class_exists('SQLite3')) { |
|
| 239 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 240 | 240 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 241 | 241 | if ($result) { |
| 242 | 242 | $row = $result->fetchArray(); |
@@ -275,11 +275,11 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 277 | 277 | // et laisser passer les fonctions personnelles baptisees image_... |
| 278 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 279 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 280 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 281 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 282 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 278 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 279 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 280 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 281 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 282 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 283 | 283 | |
| 284 | 284 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 285 | 285 | $GLOBALS['spip_matrice']['couleur_foncer'] = 'inc/filtres_images_mini.php'; |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | function filtre_debug($val, $key = null) { |
| 438 | 438 | $debug = ( |
| 439 | - is_null($key) ? '' : (var_export($key, true) . " = ") |
|
| 440 | - ) . var_export($val, true); |
|
| 439 | + is_null($key) ? '' : (var_export($key, true)." = ") |
|
| 440 | + ).var_export($val, true); |
|
| 441 | 441 | |
| 442 | 442 | include_spip('inc/autoriser'); |
| 443 | 443 | if (autoriser('webmestre')) { |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 537 | 537 | $srcover = $match[1]; |
| 538 | 538 | array_shift($args); |
| 539 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 539 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 540 | 540 | $srcover_filter = call_user_func_array($filtre, $args); |
| 541 | 541 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 542 | 542 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | // " -> " et tout ce genre de choses |
| 887 | 887 | $u = $GLOBALS['meta']['pcre_u']; |
| 888 | 888 | $texte = str_replace(" ", " ", $texte); |
| 889 | - $texte = preg_replace('/\s{2,}/S' . $u, " ", $texte); |
|
| 889 | + $texte = preg_replace('/\s{2,}/S'.$u, " ", $texte); |
|
| 890 | 890 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 891 | 891 | $texte = entites_html($texte, false, false); |
| 892 | 892 | // mais bien echapper les double quotes ! |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | **/ |
| 947 | 947 | function supprimer_numero($texte) { |
| 948 | 948 | return preg_replace( |
| 949 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 949 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 950 | 950 | "", $texte); |
| 951 | 951 | } |
| 952 | 952 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | **/ |
| 972 | 972 | function recuperer_numero($texte) { |
| 973 | 973 | if (preg_match( |
| 974 | - ",^[[:space:]]*([0-9]+)([.)]|" . chr(194) . '?' . chr(176) . ")[[:space:]]+,S", |
|
| 974 | + ",^[[:space:]]*([0-9]+)([.)]|".chr(194).'?'.chr(176).")[[:space:]]+,S", |
|
| 975 | 975 | $texte, $regs)) { |
| 976 | 976 | return strval($regs[1]); |
| 977 | 977 | } else { |
@@ -1056,8 +1056,8 @@ discard block |
||
| 1056 | 1056 | **/ |
| 1057 | 1057 | function textebrut($texte) { |
| 1058 | 1058 | $u = $GLOBALS['meta']['pcre_u']; |
| 1059 | - $texte = preg_replace('/\s+/S' . $u, " ", $texte); |
|
| 1060 | - $texte = preg_replace("/<(p|br)( [^>]*)?" . ">/iS", "\n\n", $texte); |
|
| 1059 | + $texte = preg_replace('/\s+/S'.$u, " ", $texte); |
|
| 1060 | + $texte = preg_replace("/<(p|br)( [^>]*)?".">/iS", "\n\n", $texte); |
|
| 1061 | 1061 | $texte = preg_replace("/^\n+/", "", $texte); |
| 1062 | 1062 | $texte = preg_replace("/\n+$/", "", $texte); |
| 1063 | 1063 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | if (preg_match_all(",(<a\s+[^>]*https?://[^>]*class=[\"']spip_(out|url)\b[^>]+>),imsS", |
| 1086 | 1086 | $texte, $liens, PREG_PATTERN_ORDER)) { |
| 1087 | 1087 | foreach ($liens[0] as $a) { |
| 1088 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1088 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1089 | 1089 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1090 | 1090 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1091 | 1091 | $texte = str_replace($a, $ablank, $texte); |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | foreach ($regs[0] as $a) { |
| 1111 | 1111 | $rel = extraire_attribut($a, "rel"); |
| 1112 | 1112 | if (strpos($rel, "nofollow") === false) { |
| 1113 | - $rel = "nofollow" . ($rel ? " $rel" : ""); |
|
| 1113 | + $rel = "nofollow".($rel ? " $rel" : ""); |
|
| 1114 | 1114 | $anofollow = inserer_attribut($a, "rel", $rel); |
| 1115 | 1115 | $texte = str_replace($a, $anofollow, $texte); |
| 1116 | 1116 | } |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | $u = $GLOBALS['meta']['pcre_u']; |
| 1140 | 1140 | $texte = preg_replace("@</p>@iS", "\n", $texte); |
| 1141 | 1141 | $texte = preg_replace("@<p\b.*>@UiS", "<br />", $texte); |
| 1142 | - $texte = preg_replace("@^\s*<br />@S" . $u, "", $texte); |
|
| 1142 | + $texte = preg_replace("@^\s*<br />@S".$u, "", $texte); |
|
| 1143 | 1143 | |
| 1144 | 1144 | return $texte; |
| 1145 | 1145 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | return $texte; |
| 1170 | 1170 | } |
| 1171 | 1171 | include_spip('inc/texte'); |
| 1172 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1172 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1173 | 1173 | 'div' : 'span'; |
| 1174 | 1174 | |
| 1175 | 1175 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | function attribut_html($texte, $textebrut = true) { |
| 1279 | 1279 | $u = $GLOBALS['meta']['pcre_u']; |
| 1280 | 1280 | if ($textebrut) { |
| 1281 | - $texte = preg_replace(array(",\n,", ",\s(?=\s),msS" . $u), array(" ", ""), textebrut($texte)); |
|
| 1281 | + $texte = preg_replace(array(",\n,", ",\s(?=\s),msS".$u), array(" ", ""), textebrut($texte)); |
|
| 1282 | 1282 | } |
| 1283 | 1283 | $texte = texte_backend($texte); |
| 1284 | 1284 | $texte = str_replace(array("'", '"'), array(''', '"'), $texte); |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | # un message pour abs_url |
| 1308 | 1308 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1309 | 1309 | $url = trim($url); |
| 1310 | - $r = ",^(?:" . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1310 | + $r = ",^(?:"._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1311 | 1311 | |
| 1312 | 1312 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1313 | 1313 | } |
@@ -1509,14 +1509,14 @@ discard block |
||
| 1509 | 1509 | if (strpos($texte, "<") !== false) { |
| 1510 | 1510 | include_spip('inc/lien'); |
| 1511 | 1511 | if (defined('_PREG_MODELE')) { |
| 1512 | - $preg_modeles = "@" . _PREG_MODELE . "@imsS"; |
|
| 1512 | + $preg_modeles = "@"._PREG_MODELE."@imsS"; |
|
| 1513 | 1513 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1514 | 1514 | } |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | 1517 | $debut = ''; |
| 1518 | 1518 | $suite = $texte; |
| 1519 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1519 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1520 | 1520 | $debut .= substr($suite, 0, $t - 1); |
| 1521 | 1521 | $suite = substr($suite, $t); |
| 1522 | 1522 | $car = substr($suite, 0, 1); |
@@ -1533,11 +1533,11 @@ discard block |
||
| 1533 | 1533 | $suite = substr($suite, strlen($regs[0])); |
| 1534 | 1534 | } |
| 1535 | 1535 | } |
| 1536 | - $texte = $debut . $suite; |
|
| 1536 | + $texte = $debut.$suite; |
|
| 1537 | 1537 | |
| 1538 | 1538 | $texte = echappe_retour($texte); |
| 1539 | 1539 | |
| 1540 | - return $texte . $fin; |
|
| 1540 | + return $texte.$fin; |
|
| 1541 | 1541 | } |
| 1542 | 1542 | |
| 1543 | 1543 | |
@@ -1598,7 +1598,7 @@ discard block |
||
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | foreach ($regs as $reg) { |
| 1601 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1601 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1602 | 1602 | $desc = $traduire($cle, $lang, true); |
| 1603 | 1603 | $l = $desc->langue; |
| 1604 | 1604 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1712 | 1712 | include_spip('inc/texte'); |
| 1713 | 1713 | $trad_propre = preg_replace(",(^<p[^>]*>|</p>$),Uims", "", propre($trad)); |
| 1714 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1714 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1715 | 1715 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1716 | 1716 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
| 1717 | 1717 | if (lang_dir($l) !== lang_dir($lang)) { |
@@ -1904,7 +1904,7 @@ discard block |
||
| 1904 | 1904 | if (is_array($balise)) { |
| 1905 | 1905 | array_walk( |
| 1906 | 1906 | $balise, |
| 1907 | - function(&$a, $key, $t){ |
|
| 1907 | + function(&$a, $key, $t) { |
|
| 1908 | 1908 | $a = extraire_attribut($a, $t); |
| 1909 | 1909 | }, |
| 1910 | 1910 | $attribut |
@@ -1991,14 +1991,14 @@ discard block |
||
| 1991 | 1991 | |
| 1992 | 1992 | if ($old !== null) { |
| 1993 | 1993 | // Remplacer l'ancien attribut du meme nom |
| 1994 | - $balise = $r[1] . $insert . $r[5]; |
|
| 1994 | + $balise = $r[1].$insert.$r[5]; |
|
| 1995 | 1995 | } else { |
| 1996 | 1996 | // preferer une balise " />" (comme <img />) |
| 1997 | 1997 | if (preg_match(',/>,', $balise)) { |
| 1998 | - $balise = preg_replace(",\s?/>,S", $insert . " />", $balise, 1); |
|
| 1998 | + $balise = preg_replace(",\s?/>,S", $insert." />", $balise, 1); |
|
| 1999 | 1999 | } // sinon une balise <a ...> ... </a> |
| 2000 | 2000 | else { |
| 2001 | - $balise = preg_replace(",\s?>,S", $insert . ">", $balise, 1); |
|
| 2001 | + $balise = preg_replace(",\s?>,S", $insert.">", $balise, 1); |
|
| 2002 | 2002 | } |
| 2003 | 2003 | } |
| 2004 | 2004 | |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | * @param string $operation |
| 2032 | 2032 | * @return string |
| 2033 | 2033 | */ |
| 2034 | -function modifier_class($balise, $class, $operation='ajouter') { |
|
| 2034 | +function modifier_class($balise, $class, $operation = 'ajouter') { |
|
| 2035 | 2035 | if (is_string($class)) { |
| 2036 | 2036 | $class = explode(' ', trim($class)); |
| 2037 | 2037 | } |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | } |
| 2057 | 2057 | if (in_array($operation, ['ajouter', 'commuter']) |
| 2058 | 2058 | and !$is_class_presente) { |
| 2059 | - $class_new = rtrim($class_new) . " " . $c; |
|
| 2059 | + $class_new = rtrim($class_new)." ".$c; |
|
| 2060 | 2060 | } |
| 2061 | 2061 | elseif (in_array($operation, ['supprimer', 'commuter']) |
| 2062 | 2062 | and $is_class_presente) { |
@@ -2084,7 +2084,7 @@ discard block |
||
| 2084 | 2084 | * @param string|array $class |
| 2085 | 2085 | * @return string |
| 2086 | 2086 | */ |
| 2087 | -function ajouter_class($balise, $class){ |
|
| 2087 | +function ajouter_class($balise, $class) { |
|
| 2088 | 2088 | return modifier_class($balise, $class, 'ajouter'); |
| 2089 | 2089 | } |
| 2090 | 2090 | |
@@ -2094,7 +2094,7 @@ discard block |
||
| 2094 | 2094 | * @param string|array $class |
| 2095 | 2095 | * @return string |
| 2096 | 2096 | */ |
| 2097 | -function supprimer_class($balise, $class){ |
|
| 2097 | +function supprimer_class($balise, $class) { |
|
| 2098 | 2098 | return modifier_class($balise, $class, 'supprimer'); |
| 2099 | 2099 | } |
| 2100 | 2100 | |
@@ -2105,7 +2105,7 @@ discard block |
||
| 2105 | 2105 | * @param string|array $class |
| 2106 | 2106 | * @return string |
| 2107 | 2107 | */ |
| 2108 | -function commuter_class($balise, $class){ |
|
| 2108 | +function commuter_class($balise, $class) { |
|
| 2109 | 2109 | return modifier_class($balise, $class, 'commuter'); |
| 2110 | 2110 | } |
| 2111 | 2111 | |
@@ -2125,8 +2125,8 @@ discard block |
||
| 2125 | 2125 | // |
| 2126 | 2126 | // Quelques fonctions de calcul arithmetique |
| 2127 | 2127 | // |
| 2128 | -function floatstr($a) { return str_replace(',','.',(string)floatval($a)); } |
|
| 2129 | -function strize($f, $a, $b) { return floatstr($f(floatstr($a),floatstr($b))); } |
|
| 2128 | +function floatstr($a) { return str_replace(',', '.', (string) floatval($a)); } |
|
| 2129 | +function strize($f, $a, $b) { return floatstr($f(floatstr($a), floatstr($b))); } |
|
| 2130 | 2130 | |
| 2131 | 2131 | /** |
| 2132 | 2132 | * Additionne 2 nombres |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | function plus($a, $b) { |
| 2147 | 2147 | return $a + $b; |
| 2148 | 2148 | } |
| 2149 | -function strplus($a, $b) {return strize('plus', $a, $b);} |
|
| 2149 | +function strplus($a, $b) {return strize('plus', $a, $b); } |
|
| 2150 | 2150 | /** |
| 2151 | 2151 | * Soustrait 2 nombres |
| 2152 | 2152 | * |
@@ -2165,7 +2165,7 @@ discard block |
||
| 2165 | 2165 | function moins($a, $b) { |
| 2166 | 2166 | return $a - $b; |
| 2167 | 2167 | } |
| 2168 | -function strmoins($a, $b) {return strize('moins', $a, $b);} |
|
| 2168 | +function strmoins($a, $b) {return strize('moins', $a, $b); } |
|
| 2169 | 2169 | |
| 2170 | 2170 | /** |
| 2171 | 2171 | * Multiplie 2 nombres |
@@ -2186,7 +2186,7 @@ discard block |
||
| 2186 | 2186 | function mult($a, $b) { |
| 2187 | 2187 | return $a * $b; |
| 2188 | 2188 | } |
| 2189 | -function strmult($a, $b) {return strize('mult', $a, $b);} |
|
| 2189 | +function strmult($a, $b) {return strize('mult', $a, $b); } |
|
| 2190 | 2190 | |
| 2191 | 2191 | /** |
| 2192 | 2192 | * Divise 2 nombres |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | function div($a, $b) { |
| 2208 | 2208 | return $b ? $a / $b : 0; |
| 2209 | 2209 | } |
| 2210 | -function strdiv($a, $b) {return strize('div', $a, $b);} |
|
| 2210 | +function strdiv($a, $b) {return strize('div', $a, $b); } |
|
| 2211 | 2211 | |
| 2212 | 2212 | /** |
| 2213 | 2213 | * Retourne le modulo 2 nombres |
@@ -2248,13 +2248,13 @@ discard block |
||
| 2248 | 2248 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2249 | 2249 | define('_TAGS_NOM_AUTEUR', ''); |
| 2250 | 2250 | } |
| 2251 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2251 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2252 | 2252 | foreach ($tags_acceptes as $tag) { |
| 2253 | 2253 | if (strlen($tag)) { |
| 2254 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2255 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2256 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2257 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2254 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2255 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2256 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2257 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2258 | 2258 | } |
| 2259 | 2259 | } |
| 2260 | 2260 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2304,7 +2304,7 @@ discard block |
||
| 2304 | 2304 | $s[] = preg_replace(',>[^<]+</a>,S', |
| 2305 | 2305 | '>' |
| 2306 | 2306 | . http_img_pack('attachment-16.png', $t, |
| 2307 | - 'title="' . attribut_html($t) . '"') |
|
| 2307 | + 'title="'.attribut_html($t).'"') |
|
| 2308 | 2308 | . '</a>', $tag); |
| 2309 | 2309 | } |
| 2310 | 2310 | } |
@@ -2365,10 +2365,10 @@ discard block |
||
| 2365 | 2365 | $fichier = basename($url); |
| 2366 | 2366 | |
| 2367 | 2367 | return '<a rel="enclosure"' |
| 2368 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2369 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2370 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2371 | - . '>' . $fichier . '</a>'; |
|
| 2368 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2369 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2370 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2371 | + . '>'.$fichier.'</a>'; |
|
| 2372 | 2372 | } |
| 2373 | 2373 | |
| 2374 | 2374 | /** |
@@ -2396,9 +2396,9 @@ discard block |
||
| 2396 | 2396 | } # vieux data |
| 2397 | 2397 | $fichier = basename($url); |
| 2398 | 2398 | $enclosures[] = '<enclosure' |
| 2399 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2400 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2401 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2399 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2400 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2401 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2402 | 2402 | . ' />'; |
| 2403 | 2403 | } |
| 2404 | 2404 | } |
@@ -2424,7 +2424,7 @@ discard block |
||
| 2424 | 2424 | if (extraire_attribut($e, rel) == 'tag') { |
| 2425 | 2425 | $subjects .= '<dc:subject>' |
| 2426 | 2426 | . texte_backend(textebrut($e)) |
| 2427 | - . '</dc:subject>' . "\n"; |
|
| 2427 | + . '</dc:subject>'."\n"; |
|
| 2428 | 2428 | } |
| 2429 | 2429 | } |
| 2430 | 2430 | |
@@ -2460,7 +2460,7 @@ discard block |
||
| 2460 | 2460 | if (is_array($texte)) { |
| 2461 | 2461 | array_walk( |
| 2462 | 2462 | $texte, |
| 2463 | - function(&$a, $key, $t){ |
|
| 2463 | + function(&$a, $key, $t) { |
|
| 2464 | 2464 | $a = extraire_balise($a, $t); |
| 2465 | 2465 | }, |
| 2466 | 2466 | $tag |
@@ -2504,7 +2504,7 @@ discard block |
||
| 2504 | 2504 | if (is_array($texte)) { |
| 2505 | 2505 | array_walk( |
| 2506 | 2506 | $texte, |
| 2507 | - function(&$a, $key, $t){ |
|
| 2507 | + function(&$a, $key, $t) { |
|
| 2508 | 2508 | $a = extraire_balises($a, $t); |
| 2509 | 2509 | }, |
| 2510 | 2510 | $tag |
@@ -2630,7 +2630,7 @@ discard block |
||
| 2630 | 2630 | if ($fond != '404') { |
| 2631 | 2631 | $contexte = array_shift($p); |
| 2632 | 2632 | $contexte['page'] = $fond; |
| 2633 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2633 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2634 | 2634 | } |
| 2635 | 2635 | } |
| 2636 | 2636 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2685,9 +2685,9 @@ discard block |
||
| 2685 | 2685 | . '"' |
| 2686 | 2686 | . (is_null($val) |
| 2687 | 2687 | ? '' |
| 2688 | - : ' value="' . entites_html($val) . '"' |
|
| 2688 | + : ' value="'.entites_html($val).'"' |
|
| 2689 | 2689 | ) |
| 2690 | - . ' type="hidden"' . "\n/>"; |
|
| 2690 | + . ' type="hidden"'."\n/>"; |
|
| 2691 | 2691 | } |
| 2692 | 2692 | |
| 2693 | 2693 | return join("", $hidden); |
@@ -2824,7 +2824,7 @@ discard block |
||
| 2824 | 2824 | return preg_replace_callback( |
| 2825 | 2825 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2826 | 2826 | function($x) use ($path) { |
| 2827 | - return "url('" . suivre_lien($path, $x[1]) . "')"; |
|
| 2827 | + return "url('".suivre_lien($path, $x[1])."')"; |
|
| 2828 | 2828 | }, |
| 2829 | 2829 | $contenu |
| 2830 | 2830 | ); |
@@ -2886,14 +2886,14 @@ discard block |
||
| 2886 | 2886 | ) { |
| 2887 | 2887 | $distant = true; |
| 2888 | 2888 | $cssf = parse_url($css); |
| 2889 | - $cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : ""); |
|
| 2889 | + $cssf = $cssf['path'].($cssf['query'] ? "?".$cssf['query'] : ""); |
|
| 2890 | 2890 | $cssf = preg_replace(',[?:&=],', "_", $cssf); |
| 2891 | 2891 | } else { |
| 2892 | 2892 | $distant = false; |
| 2893 | 2893 | $cssf = $css; |
| 2894 | 2894 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 2895 | 2895 | //propose (rien a faire dans ce cas) |
| 2896 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 2896 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 2897 | 2897 | if (@file_exists($f)) { |
| 2898 | 2898 | return $f; |
| 2899 | 2899 | } |
@@ -2903,7 +2903,7 @@ discard block |
||
| 2903 | 2903 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 2904 | 2904 | $f = $dir_var |
| 2905 | 2905 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 2906 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 2906 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 2907 | 2907 | |
| 2908 | 2908 | // la css peut etre distante (url absolue !) |
| 2909 | 2909 | if ($distant) { |
@@ -2948,8 +2948,8 @@ discard block |
||
| 2948 | 2948 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 2949 | 2949 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 2950 | 2950 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 2951 | - $src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction; |
|
| 2952 | - $css_direction = "/@@@@@@/" . $css_direction; |
|
| 2951 | + $src_faux_abs["/@@@@@@/".$css_direction] = $css_direction; |
|
| 2952 | + $css_direction = "/@@@@@@/".$css_direction; |
|
| 2953 | 2953 | } |
| 2954 | 2954 | $src[] = $regs[0][$k]; |
| 2955 | 2955 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -2998,7 +2998,7 @@ discard block |
||
| 2998 | 2998 | |
| 2999 | 2999 | $f = basename($css, '.css'); |
| 3000 | 3000 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3001 | - . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3001 | + . preg_replace(",(.*?)(_rtl|_ltr)?$,", "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3002 | 3002 | . '.css'; |
| 3003 | 3003 | |
| 3004 | 3004 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3007,7 +3007,7 @@ discard block |
||
| 3007 | 3007 | |
| 3008 | 3008 | if ($url_absolue_css == $css) { |
| 3009 | 3009 | if (strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3010 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3010 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3011 | 3011 | ) { |
| 3012 | 3012 | include_spip('inc/distant'); |
| 3013 | 3013 | if (!$contenu = recuperer_page($css)) { |
@@ -3117,7 +3117,7 @@ discard block |
||
| 3117 | 3117 | $expression = str_replace("\/", "/", $expression); |
| 3118 | 3118 | $expression = str_replace("/", "\/", $expression); |
| 3119 | 3119 | |
| 3120 | - if (preg_match('/' . $expression . '/' . $modif, $texte, $r)) { |
|
| 3120 | + if (preg_match('/'.$expression.'/'.$modif, $texte, $r)) { |
|
| 3121 | 3121 | if (isset($r[$capte])) { |
| 3122 | 3122 | return $r[$capte]; |
| 3123 | 3123 | } else { |
@@ -3155,7 +3155,7 @@ discard block |
||
| 3155 | 3155 | $expression = str_replace("\/", "/", $expression); |
| 3156 | 3156 | $expression = str_replace("/", "\/", $expression); |
| 3157 | 3157 | |
| 3158 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3158 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3159 | 3159 | } |
| 3160 | 3160 | |
| 3161 | 3161 | |
@@ -3174,7 +3174,7 @@ discard block |
||
| 3174 | 3174 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3175 | 3175 | |
| 3176 | 3176 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3177 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3177 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3178 | 3178 | |
| 3179 | 3179 | if (strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
| 3180 | 3180 | and preg_match_all( |
@@ -3184,7 +3184,7 @@ discard block |
||
| 3184 | 3184 | if (!isset($doublons['documents'])) { |
| 3185 | 3185 | $doublons['documents'] = ""; |
| 3186 | 3186 | } |
| 3187 | - $doublons['documents'] .= "," . join(',', $matches[1]); |
|
| 3187 | + $doublons['documents'] .= ",".join(',', $matches[1]); |
|
| 3188 | 3188 | } |
| 3189 | 3189 | |
| 3190 | 3190 | return $letexte; |
@@ -3241,7 +3241,7 @@ discard block |
||
| 3241 | 3241 | if ($env) { |
| 3242 | 3242 | foreach ($env as $i => $j) { |
| 3243 | 3243 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3244 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3244 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3245 | 3245 | } |
| 3246 | 3246 | } |
| 3247 | 3247 | } |
@@ -3280,7 +3280,7 @@ discard block |
||
| 3280 | 3280 | if ($env) { |
| 3281 | 3281 | foreach ($env as $i => $j) { |
| 3282 | 3282 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3283 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3283 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3284 | 3284 | } |
| 3285 | 3285 | } |
| 3286 | 3286 | } |
@@ -3364,19 +3364,19 @@ discard block |
||
| 3364 | 3364 | |
| 3365 | 3365 | $img_file = $img; |
| 3366 | 3366 | if ($p = strpos($img_file, '?')) { |
| 3367 | - $img_file = substr($img_file,0, $p); |
|
| 3367 | + $img_file = substr($img_file, 0, $p); |
|
| 3368 | 3368 | } |
| 3369 | 3369 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3370 | 3370 | $img_file = chemin_image($img); |
| 3371 | 3371 | } |
| 3372 | 3372 | else { |
| 3373 | - if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){ |
|
| 3373 | + if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
|
| 3374 | 3374 | // on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png |
| 3375 | 3375 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3376 | 3376 | if (preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3377 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . "-xx.svg" |
|
| 3377 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0]))."-xx.svg" |
|
| 3378 | 3378 | and file_exists($variante_svg_generique)) { |
| 3379 | - if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) { |
|
| 3379 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].".svg" and file_exists($variante_svg_size)) { |
|
| 3380 | 3380 | $img_file = $variante_svg_size; |
| 3381 | 3381 | } |
| 3382 | 3382 | else { |
@@ -3401,7 +3401,7 @@ discard block |
||
| 3401 | 3401 | return ""; |
| 3402 | 3402 | } |
| 3403 | 3403 | } |
| 3404 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3404 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3405 | 3405 | } |
| 3406 | 3406 | |
| 3407 | 3407 | if (file_exists($img_file)) { |
@@ -3410,15 +3410,15 @@ discard block |
||
| 3410 | 3410 | if ($alt === false) { |
| 3411 | 3411 | $alt = ''; |
| 3412 | 3412 | } |
| 3413 | - elseif($alt or $alt==='') { |
|
| 3413 | + elseif ($alt or $alt === '') { |
|
| 3414 | 3414 | $alt = " alt='".attribut_html($alt)."'"; |
| 3415 | 3415 | } |
| 3416 | 3416 | else { |
| 3417 | 3417 | $alt = " alt='".attribut_html($title)."'"; |
| 3418 | 3418 | } |
| 3419 | 3419 | return "<img src='$img_file'$alt" |
| 3420 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3421 | - . " " . ltrim($atts) |
|
| 3420 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3421 | + . " ".ltrim($atts) |
|
| 3422 | 3422 | . " />"; |
| 3423 | 3423 | } |
| 3424 | 3424 | |
@@ -3430,12 +3430,12 @@ discard block |
||
| 3430 | 3430 | * @param string $size |
| 3431 | 3431 | * @return string |
| 3432 | 3432 | */ |
| 3433 | -function http_style_background($img, $att = '', $size=null) { |
|
| 3434 | - if ($size and is_numeric($size)){ |
|
| 3435 | - $size = trim($size) . "px"; |
|
| 3433 | +function http_style_background($img, $att = '', $size = null) { |
|
| 3434 | + if ($size and is_numeric($size)) { |
|
| 3435 | + $size = trim($size)."px"; |
|
| 3436 | 3436 | } |
| 3437 | - return " style='background" . |
|
| 3438 | - ($att ? "" : "-image") . ": url(\"" . chemin_image($img) . "\")" . ($att ? (' ' . $att) : '') . ";" |
|
| 3437 | + return " style='background". |
|
| 3438 | + ($att ? "" : "-image").": url(\"".chemin_image($img)."\")".($att ? (' '.$att) : '').";" |
|
| 3439 | 3439 | . ($size ? "background-size:{$size};" : '') |
| 3440 | 3440 | . "'"; |
| 3441 | 3441 | } |
@@ -3452,8 +3452,8 @@ discard block |
||
| 3452 | 3452 | * @return string |
| 3453 | 3453 | * Code HTML de la balise IMG |
| 3454 | 3454 | */ |
| 3455 | -function filtre_balise_img_dist($img, $alt = "", $class = "", $width=null) { |
|
| 3456 | - $atts = $class ? " class='" . attribut_html($class) . "'" : ''; |
|
| 3455 | +function filtre_balise_img_dist($img, $alt = "", $class = "", $width = null) { |
|
| 3456 | + $atts = $class ? " class='".attribut_html($class)."'" : ''; |
|
| 3457 | 3457 | // ecriture courte : on donne le width en 2e arg |
| 3458 | 3458 | if (empty($width) and is_numeric($alt)) { |
| 3459 | 3459 | $width = $alt; |
@@ -3481,7 +3481,7 @@ discard block |
||
| 3481 | 3481 | function filtre_balise_svg_dist($img, $alt = "", $class = "") { |
| 3482 | 3482 | $img_file = $img; |
| 3483 | 3483 | if ($p = strpos($img_file, '?')) { |
| 3484 | - $img_file = substr($img_file,0, $p); |
|
| 3484 | + $img_file = substr($img_file, 0, $p); |
|
| 3485 | 3485 | } |
| 3486 | 3486 | |
| 3487 | 3487 | if (!$img_file or !$svg = file_get_contents($img_file)) { |
@@ -3495,18 +3495,18 @@ discard block |
||
| 3495 | 3495 | $balise_svg_source = $balise_svg; |
| 3496 | 3496 | |
| 3497 | 3497 | // entete XML à supprimer |
| 3498 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3498 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3499 | 3499 | |
| 3500 | 3500 | // IE est toujours mon ami |
| 3501 | 3501 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
| 3502 | 3502 | if ($class) { |
| 3503 | 3503 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3504 | 3504 | } |
| 3505 | - if ($alt){ |
|
| 3505 | + if ($alt) { |
|
| 3506 | 3506 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3507 | - $id = "img-svg-title-" . substr(md5("$img_file:$svg:$alt"),0,4); |
|
| 3507 | + $id = "img-svg-title-".substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3508 | 3508 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3509 | - $title = "<title id=\"$id\">" . entites_html($alt)."</title>\n"; |
|
| 3509 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3510 | 3510 | $balise_svg .= $title; |
| 3511 | 3511 | } |
| 3512 | 3512 | else { |
@@ -3540,7 +3540,7 @@ discard block |
||
| 3540 | 3540 | $texte = ''; |
| 3541 | 3541 | if (is_array($tableau)) { |
| 3542 | 3542 | foreach ($tableau as $k => $v) { |
| 3543 | - $res = recuperer_fond('modeles/' . $modele, |
|
| 3543 | + $res = recuperer_fond('modeles/'.$modele, |
|
| 3544 | 3544 | array_merge(array('cle' => $k), (is_array($v) ? $v : array('valeur' => $v))) |
| 3545 | 3545 | ); |
| 3546 | 3546 | $texte .= $res; |
@@ -3717,7 +3717,7 @@ discard block |
||
| 3717 | 3717 | } |
| 3718 | 3718 | |
| 3719 | 3719 | $c = serialize($c); |
| 3720 | - $cle = calculer_cle_action($form . $c); |
|
| 3720 | + $cle = calculer_cle_action($form.$c); |
|
| 3721 | 3721 | $c = "$cle:$c"; |
| 3722 | 3722 | |
| 3723 | 3723 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -3779,15 +3779,15 @@ discard block |
||
| 3779 | 3779 | } |
| 3780 | 3780 | // toujours encoder l'url source dans le bloc ajax |
| 3781 | 3781 | $r = self(); |
| 3782 | - $r = ' data-origin="' . $r . '"'; |
|
| 3782 | + $r = ' data-origin="'.$r.'"'; |
|
| 3783 | 3783 | $class = 'ajaxbloc'; |
| 3784 | 3784 | if ($ajaxid and is_string($ajaxid)) { |
| 3785 | 3785 | // ajaxid est normalement conforme a un nom de classe css |
| 3786 | 3786 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 3787 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 3787 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 3788 | 3788 | } |
| 3789 | 3789 | |
| 3790 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3790 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 3791 | 3791 | } |
| 3792 | 3792 | |
| 3793 | 3793 | /** |
@@ -3826,11 +3826,11 @@ discard block |
||
| 3826 | 3826 | // extraire la signature en debut de contexte |
| 3827 | 3827 | // et la verifier avant de deserializer |
| 3828 | 3828 | // format : signature:donneesserializees |
| 3829 | - if ($p = strpos($c,":")){ |
|
| 3830 | - $cle = substr($c,0,$p); |
|
| 3831 | - $c = substr($c,$p+1); |
|
| 3829 | + if ($p = strpos($c, ":")) { |
|
| 3830 | + $cle = substr($c, 0, $p); |
|
| 3831 | + $c = substr($c, $p + 1); |
|
| 3832 | 3832 | |
| 3833 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 3833 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 3834 | 3834 | $env = @unserialize($c); |
| 3835 | 3835 | return $env; |
| 3836 | 3836 | } |
@@ -3931,9 +3931,9 @@ discard block |
||
| 3931 | 3931 | } else { |
| 3932 | 3932 | $bal = 'a'; |
| 3933 | 3933 | $att = "href='$url'" |
| 3934 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 3935 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 3936 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 3934 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 3935 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 3936 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 3937 | 3937 | . $evt; |
| 3938 | 3938 | } |
| 3939 | 3939 | if ($libelle === null) { |
@@ -4027,7 +4027,7 @@ discard block |
||
| 4027 | 4027 | } |
| 4028 | 4028 | |
| 4029 | 4029 | // ajouter le type d'objet dans la class de l'icone |
| 4030 | - $class .= " " . substr(basename($fond), 0, -4); |
|
| 4030 | + $class .= " ".substr(basename($fond), 0, -4); |
|
| 4031 | 4031 | |
| 4032 | 4032 | $alt = attribut_html($texte); |
| 4033 | 4033 | $title = " title=\"$alt\""; // est-ce pertinent de doubler le alt par un title ? |
@@ -4051,7 +4051,7 @@ discard block |
||
| 4051 | 4051 | } |
| 4052 | 4052 | |
| 4053 | 4053 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4054 | - $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "") . "\">$icone</span>"; |
|
| 4054 | + $icone = "<span class=\"icone-image".($fonction ? " icone-fonction icone-fonction-$fonction" : "")."\">$icone</span>"; |
|
| 4055 | 4055 | |
| 4056 | 4056 | if ($type == 'lien') { |
| 4057 | 4057 | return "<span class='icone s$size $class'>" |
@@ -4281,13 +4281,13 @@ discard block |
||
| 4281 | 4281 | $res = ""; |
| 4282 | 4282 | foreach ($boutons as $page => $detail) { |
| 4283 | 4283 | if ($detail->icone and strlen(trim($detail->icone))) { |
| 4284 | - $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(" . $detail->icone . ");}"; |
|
| 4284 | + $res .= "\n.navigation_avec_icones #bando1_$page {background-image:url(".$detail->icone.");}"; |
|
| 4285 | 4285 | } |
| 4286 | 4286 | $selecteur = (in_array($page, array('outils_rapides', 'outils_collaboratifs')) ? "" : ".navigation_avec_icones "); |
| 4287 | 4287 | if (is_array($detail->sousmenu)) { |
| 4288 | 4288 | foreach ($detail->sousmenu as $souspage => $sousdetail) { |
| 4289 | 4289 | if ($sousdetail->icone and strlen(trim($sousdetail->icone))) { |
| 4290 | - $res .= "\n$selecteur.bando2_$souspage {background-image:url(" . $sousdetail->icone . ");}"; |
|
| 4290 | + $res .= "\n$selecteur.bando2_$souspage {background-image:url(".$sousdetail->icone.");}"; |
|
| 4291 | 4291 | } |
| 4292 | 4292 | } |
| 4293 | 4293 | } |
@@ -4313,17 +4313,17 @@ discard block |
||
| 4313 | 4313 | */ |
| 4314 | 4314 | function bouton_action($libelle, $url, $class = "", $confirm = "", $title = "", $callback = "") { |
| 4315 | 4315 | if ($confirm) { |
| 4316 | - $confirm = "confirm(\"" . attribut_html($confirm) . "\")"; |
|
| 4316 | + $confirm = "confirm(\"".attribut_html($confirm)."\")"; |
|
| 4317 | 4317 | if ($callback) { |
| 4318 | 4318 | $callback = "$confirm?($callback):false"; |
| 4319 | 4319 | } else { |
| 4320 | 4320 | $callback = $confirm; |
| 4321 | 4321 | } |
| 4322 | 4322 | } |
| 4323 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ""; |
|
| 4323 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ""; |
|
| 4324 | 4324 | $title = $title ? " title='$title'" : ""; |
| 4325 | 4325 | |
| 4326 | - return "<form class='bouton_action_post $class' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4326 | + return "<form class='bouton_action_post $class' method='post' action='$url'><div>".form_hidden($url) |
|
| 4327 | 4327 | . "<button type='submit' class='submit'$title$onclick>$libelle</button></div></form>"; |
| 4328 | 4328 | } |
| 4329 | 4329 | |
@@ -4384,14 +4384,14 @@ discard block |
||
| 4384 | 4384 | $champ_titre = ""; |
| 4385 | 4385 | if ($demande_titre) { |
| 4386 | 4386 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4387 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4387 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4388 | 4388 | } |
| 4389 | 4389 | include_spip('base/abstract_sql'); |
| 4390 | 4390 | include_spip('base/connect_sql'); |
| 4391 | 4391 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4392 | - '*' . $champ_titre, |
|
| 4392 | + '*'.$champ_titre, |
|
| 4393 | 4393 | $desc['table_sql'], |
| 4394 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4394 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4395 | 4395 | ); |
| 4396 | 4396 | } |
| 4397 | 4397 | |
@@ -4461,7 +4461,7 @@ discard block |
||
| 4461 | 4461 | return $texte; |
| 4462 | 4462 | } |
| 4463 | 4463 | |
| 4464 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4464 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4465 | 4465 | |
| 4466 | 4466 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4467 | 4467 | $Pile = array(0 => $env); |
@@ -4495,7 +4495,7 @@ discard block |
||
| 4495 | 4495 | } |
| 4496 | 4496 | $url = generer_url_entite($id_objet, $objet, '', '', $connect); |
| 4497 | 4497 | |
| 4498 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . "</a>"; |
|
| 4498 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur)."</a>"; |
|
| 4499 | 4499 | } |
| 4500 | 4500 | |
| 4501 | 4501 | |
@@ -4514,10 +4514,10 @@ discard block |
||
| 4514 | 4514 | function wrap($texte, $wrap) { |
| 4515 | 4515 | $balises = extraire_balises($wrap); |
| 4516 | 4516 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 4517 | - $texte = $wrap . $texte; |
|
| 4517 | + $texte = $wrap.$texte; |
|
| 4518 | 4518 | $regs = array_reverse($regs[1]); |
| 4519 | - $wrap = "</" . implode("></", $regs) . ">"; |
|
| 4520 | - $texte = $texte . $wrap; |
|
| 4519 | + $wrap = "</".implode("></", $regs).">"; |
|
| 4520 | + $texte = $texte.$wrap; |
|
| 4521 | 4521 | } |
| 4522 | 4522 | |
| 4523 | 4523 | return $texte; |
@@ -4548,7 +4548,7 @@ discard block |
||
| 4548 | 4548 | |
| 4549 | 4549 | // caster $u en array si besoin |
| 4550 | 4550 | if (is_object($u)) { |
| 4551 | - $u = (array)$u; |
|
| 4551 | + $u = (array) $u; |
|
| 4552 | 4552 | } |
| 4553 | 4553 | |
| 4554 | 4554 | if (is_array($u)) { |
@@ -4569,7 +4569,7 @@ discard block |
||
| 4569 | 4569 | // sinon on passe a la ligne et on indente |
| 4570 | 4570 | $i_str = str_pad("", $indent, " "); |
| 4571 | 4571 | foreach ($u as $k => $v) { |
| 4572 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 4572 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 4573 | 4573 | } |
| 4574 | 4574 | |
| 4575 | 4575 | return $out; |
@@ -4622,8 +4622,8 @@ discard block |
||
| 4622 | 4622 | * @param string $class |
| 4623 | 4623 | * @return string |
| 4624 | 4624 | */ |
| 4625 | -function objet_icone($objet, $taille = 24, $class='') { |
|
| 4626 | - $icone = objet_info($objet, 'icone_objet') . "-" . $taille . ".png"; |
|
| 4625 | +function objet_icone($objet, $taille = 24, $class = '') { |
|
| 4626 | + $icone = objet_info($objet, 'icone_objet')."-".$taille.".png"; |
|
| 4627 | 4627 | $icone = chemin_image($icone); |
| 4628 | 4628 | $balise_img = charger_filtre('balise_img'); |
| 4629 | 4629 | |
@@ -4647,12 +4647,12 @@ discard block |
||
| 4647 | 4647 | * @param array $options |
| 4648 | 4648 | * @return string |
| 4649 | 4649 | */ |
| 4650 | -function objet_T($objet, $chaine, $args = array(), $options = array()){ |
|
| 4651 | - $chaine = explode(':',$chaine); |
|
| 4652 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4650 | +function objet_T($objet, $chaine, $args = array(), $options = array()) { |
|
| 4651 | + $chaine = explode(':', $chaine); |
|
| 4652 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, array('force'=>false)))) { |
|
| 4653 | 4653 | return $t; |
| 4654 | 4654 | } |
| 4655 | - $chaine = implode(':',$chaine); |
|
| 4655 | + $chaine = implode(':', $chaine); |
|
| 4656 | 4656 | return _T($chaine, $args, $options); |
| 4657 | 4657 | } |
| 4658 | 4658 | |
@@ -4712,7 +4712,7 @@ discard block |
||
| 4712 | 4712 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 4713 | 4713 | |
| 4714 | 4714 | // calculer le nom de la css |
| 4715 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 4715 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 4716 | 4716 | $nom_safe = preg_replace(",\W,", '_', str_replace('.', '_', $fond)); |
| 4717 | 4717 | $contexte_implicite = calculer_contexte_implicite(); |
| 4718 | 4718 | |
@@ -4720,22 +4720,22 @@ discard block |
||
| 4720 | 4720 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 4721 | 4721 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 4722 | 4722 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 4723 | - $hash = md5($contexte_implicite['host'] . '::'. $cache); |
|
| 4723 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 4724 | 4724 | } |
| 4725 | 4725 | else { |
| 4726 | 4726 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 4727 | 4727 | ksort($contexte); |
| 4728 | - $hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect); |
|
| 4728 | + $hash = md5($fond.json_encode($contexte_implicite).json_encode($contexte).$connect); |
|
| 4729 | 4729 | } |
| 4730 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 4730 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 4731 | 4731 | |
| 4732 | 4732 | // mettre a jour le fichier si il n'existe pas |
| 4733 | 4733 | // ou trop ancien |
| 4734 | 4734 | // le dernier fichier produit est toujours suffixe par .last |
| 4735 | 4735 | // et recopie sur le fichier cible uniquement si il change |
| 4736 | 4736 | if (!file_exists($filename) |
| 4737 | - or !file_exists($filename . ".last") |
|
| 4738 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . ".last") < $cache['lastmodified']) |
|
| 4737 | + or !file_exists($filename.".last") |
|
| 4738 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.".last") < $cache['lastmodified']) |
|
| 4739 | 4739 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 4740 | 4740 | ) { |
| 4741 | 4741 | $contenu = $cache['texte']; |
@@ -4754,10 +4754,10 @@ discard block |
||
| 4754 | 4754 | } |
| 4755 | 4755 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 4756 | 4756 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 4757 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 4757 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 4758 | 4758 | } |
| 4759 | 4759 | // et ecrire le fichier si il change |
| 4760 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 4760 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 4761 | 4761 | } |
| 4762 | 4762 | |
| 4763 | 4763 | return timestamp($filename); |
@@ -4952,11 +4952,11 @@ discard block |
||
| 4952 | 4952 | function spip_affiche_mot_de_passe_masque($passe, $afficher_partiellement = false, $portion_pourcent = null) { |
| 4953 | 4953 | $l = strlen($passe); |
| 4954 | 4954 | |
| 4955 | - if ($l<=8 or !$afficher_partiellement){ |
|
| 4955 | + if ($l <= 8 or !$afficher_partiellement) { |
|
| 4956 | 4956 | if (!$l) { |
| 4957 | 4957 | return ''; // montrer qu'il y a pas de mot de passe si il y en a pas |
| 4958 | 4958 | } |
| 4959 | - return str_pad('',$afficher_partiellement ? $l : 16,'*'); |
|
| 4959 | + return str_pad('', $afficher_partiellement ? $l : 16, '*'); |
|
| 4960 | 4960 | } |
| 4961 | 4961 | |
| 4962 | 4962 | if (is_null($portion_pourcent)) { |
@@ -4970,9 +4970,9 @@ discard block |
||
| 4970 | 4970 | } |
| 4971 | 4971 | $e = intval(ceil($l * $portion_pourcent / 100 / 2)); |
| 4972 | 4972 | $e = max($e, 0); |
| 4973 | - $mid = str_pad('',$l-2*$e,'*'); |
|
| 4974 | - if ($e>0 and strlen($mid)>8){ |
|
| 4973 | + $mid = str_pad('', $l - 2 * $e, '*'); |
|
| 4974 | + if ($e > 0 and strlen($mid) > 8) { |
|
| 4975 | 4975 | $mid = '***...***'; |
| 4976 | 4976 | } |
| 4977 | - return substr($passe,0,$e) . $mid . ($e > 0 ? substr($passe,-$e) : ''); |
|
| 4977 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 4978 | 4978 | } |
| 4979 | 4979 | \ No newline at end of file |