@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | // celle du texte) et public (spip_lang est la langue du texte) |
| 45 | 45 | $dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']); |
| 46 | 46 | |
| 47 | - $p = 'puce' . (test_espace_prive() ? '_prive' : ''); |
|
| 47 | + $p = 'puce'.(test_espace_prive() ? '_prive' : ''); |
|
| 48 | 48 | if ($dir == 'rtl') { |
| 49 | 49 | $p .= '_rtl'; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (!isset($GLOBALS[$p])) { |
| 53 | - $GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>'; |
|
| 53 | + $GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $GLOBALS[$p]; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (!defined('_BALISES_BLOCS_REGEXP')) { |
| 71 | - define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS'); |
|
| 71 | + define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Tester si on echappe en span ou en div |
| 87 | 87 | if (is_null($mode) or !in_array($mode, ['div', 'span'])) { |
| 88 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 88 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Decouper en morceaux, base64 a des probleme selon la taille de la pile |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ) { |
| 121 | 121 | foreach ($matches as $m) { |
| 122 | 122 | if ($m[1] === 'code') { |
| 123 | - $code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>'; |
|
| 123 | + $code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>'; |
|
| 124 | 124 | $pre = str_replace($m[0], $code, $pre); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // Echapper les <code>...</ code> |
| 132 | 132 | function traiter_echap_code_dist($regs, $options = []) { |
| 133 | - [, , $att, $corps] = $regs; |
|
| 133 | + [,, $att, $corps] = $regs; |
|
| 134 | 134 | $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! |
| 135 | 135 | |
| 136 | 136 | // ne pas mettre le <div...> s'il n'y a qu'une ligne |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | $echap = nl2br($echap); |
| 142 | 142 | $echap = "<div style='text-align: left;' " |
| 143 | 143 | . "class='spip_code' dir='ltr'><code$att>" |
| 144 | - . $echap . '</code></div>'; |
|
| 144 | + . $echap.'</code></div>'; |
|
| 145 | 145 | } else { |
| 146 | - $echap = "<code$att class='spip_code' dir='ltr'>" . $echap . '</code>'; |
|
| 146 | + $echap = "<code$att class='spip_code' dir='ltr'>".$echap.'</code>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $echap = str_replace("\t", ' ', $echap); |
@@ -220,11 +220,11 @@ discard block |
||
| 220 | 220 | else { |
| 221 | 221 | $callback_secure_prefix = ($callback_options['secure_prefix'] ?? ''); |
| 222 | 222 | if ( |
| 223 | - function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 224 | - or function_exists($f = $f . '_dist') |
|
| 223 | + function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 224 | + or function_exists($f = $f.'_dist') |
|
| 225 | 225 | or ($callback_secure_prefix and ( |
| 226 | - function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 227 | - or function_exists($f = $f . '_dist') |
|
| 226 | + function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 227 | + or function_exists($f = $f.'_dist') |
|
| 228 | 228 | )) |
| 229 | 229 | ) { |
| 230 | 230 | $echap = $f($regs, $callback_options); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | // dans une callback autonommee |
| 247 | 247 | if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) { |
| 248 | 248 | if ( |
| 249 | - strpos($letexte, '<' . '?') !== false and preg_match_all( |
|
| 249 | + strpos($letexte, '<'.'?') !== false and preg_match_all( |
|
| 250 | 250 | ',<[?].*($|[?]>),UisS', |
| 251 | 251 | $letexte, |
| 252 | 252 | $matches, |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | strpos($letexte, '<') !== false |
| 279 | 279 | and |
| 280 | 280 | preg_match_all( |
| 281 | - ',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 281 | + ',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 282 | 282 | $letexte, |
| 283 | 283 | $regs, |
| 284 | 284 | PREG_SET_ORDER |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | if ($at) { |
| 298 | - $rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>'; |
|
| 298 | + $rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>'; |
|
| 299 | 299 | foreach ($at as $attr => $a) { |
| 300 | 300 | $rempl = inserer_attribut($rempl, $attr, $a); |
| 301 | 301 | } |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | $texte = nettoyer_raccourcis_typo($texte); |
| 377 | 377 | |
| 378 | 378 | // balises de sauts de ligne et paragraphe |
| 379 | - $texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte); |
|
| 380 | - $texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte); |
|
| 379 | + $texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte); |
|
| 380 | + $texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte); |
|
| 381 | 381 | |
| 382 | 382 | // on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier |
| 383 | 383 | $texte = str_replace("\n\n", "\r", $texte); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | // supprimer les tags |
| 386 | 386 | $texte = supprimer_tags($texte); |
| 387 | 387 | $texte = trim(str_replace("\n", ' ', $texte)); |
| 388 | - $texte .= "\n"; // marquer la fin |
|
| 388 | + $texte .= "\n"; // marquer la fin |
|
| 389 | 389 | |
| 390 | 390 | // corriger la longueur de coupe |
| 391 | 391 | // en fonction de la presence de caracteres utf |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // couper au mot precedent |
| 401 | 401 | $long = spip_substr($texte, 0, max($taille - 4, 1)); |
| 402 | 402 | $u = $GLOBALS['meta']['pcre_u']; |
| 403 | - $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 403 | + $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 404 | 404 | if (is_null($suite)) { |
| 405 | 405 | $suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : ' (...)'); |
| 406 | 406 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | if (spip_strlen($court) < max(0.75 * $taille, 2)) { |
| 411 | 411 | $points = ''; |
| 412 | 412 | $long = spip_substr($texte, 0, $taille); |
| 413 | - $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 413 | + $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 414 | 414 | // encore trop court ? couper au caractere |
| 415 | 415 | if (spip_strlen($texte) < 0.75 * $taille) { |
| 416 | 416 | $texte = $long; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | // supprimer l'eventuelle entite finale mal coupee |
| 430 | 430 | $texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte); |
| 431 | 431 | |
| 432 | - return quote_amp(trim($texte)) . $points; |
|
| 432 | + return quote_amp(trim($texte)).$points; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
@@ -441,16 +441,16 @@ discard block |
||
| 441 | 441 | define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 442 | 442 | } |
| 443 | 443 | foreach ($r as $regs) { |
| 444 | - $t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
|
| 444 | + $t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t); |
|
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | - if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 447 | + if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 448 | 448 | if (!defined('_PROTEGE_PHP_MODELES')) { |
| 449 | 449 | include_spip('inc/acces'); |
| 450 | 450 | define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 451 | 451 | } |
| 452 | 452 | foreach ($r as $regs) { |
| 453 | - $t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
|
| 453 | + $t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t); |
|
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | } |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | if (!empty($options['wrap_suspect'])) { |
| 566 | 566 | $texte = wrap($texte, $options['wrap_suspect']); |
| 567 | 567 | } |
| 568 | - $texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte; |
|
| 568 | + $texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte; |
|
| 569 | 569 | } |
| 570 | 570 | $texte = modele_retablir_raccourcis_echappes($texte, $markidmodeles); |
| 571 | 571 | } |
@@ -677,11 +677,11 @@ discard block |
||
| 677 | 677 | **/ |
| 678 | 678 | function supprime_img($letexte, $message = null) { |
| 679 | 679 | if ($message === null) { |
| 680 | - $message = '(' . _T('img_indisponible') . ')'; |
|
| 680 | + $message = '('._T('img_indisponible').')'; |
|
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | return preg_replace( |
| 684 | - ',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i', |
|
| 684 | + ',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i', |
|
| 685 | 685 | $message, |
| 686 | 686 | $letexte |
| 687 | 687 | ); |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | |
| 122 | 122 | $offset_pos = 0; |
| 123 | 123 | foreach ($liens as $l) { |
| 124 | - $rempl = $markid . base64_encode($l['lien']) . '|@'; |
|
| 124 | + $rempl = $markid.base64_encode($l['lien']).'|@'; |
|
| 125 | 125 | $texte = substr_replace($texte, $rempl, $l['pos'] + $offset_pos, $l['length']); |
| 126 | 126 | $offset_pos += strlen($rempl) - $l['length']; |
| 127 | 127 | } |
@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | protected $_lcount = 19; |
| 74 | 74 | protected $_vcount = 21; |
| 75 | 75 | protected $_tcount = 28; |
| 76 | - protected $_ncount = 588; // _vcount * _tcount |
|
| 76 | + protected $_ncount = 588; // _vcount * _tcount |
|
| 77 | 77 | protected $_scount = 11172; // _lcount * _tcount * _vcount |
| 78 | 78 | protected $_error = false; |
| 79 | 79 | protected static $_mb_string_overload = null; |
| 80 | 80 | // See {@link set_paramter()} for details of how to change the following |
| 81 | 81 | // settings from within your script / application |
| 82 | - protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | - protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | - protected $_strict_mode = false; // Behave strict or not |
|
| 85 | - protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 82 | + protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | + protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | + protected $_strict_mode = false; // Behave strict or not |
|
| 85 | + protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 86 | 86 | |
| 87 | 87 | protected $slast; |
| 88 | 88 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->_api_encoding = $v; |
| 143 | 143 | break; |
| 144 | 144 | default: |
| 145 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 145 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 146 | 146 | return false; |
| 147 | 147 | } |
| 148 | 148 | break; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if (in_array($v, array('2003', '2008'))) { |
| 157 | 157 | $this->_idn_version = $v; |
| 158 | 158 | } else { |
| 159 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 159 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 | case 'encode_german_sz': // Deprecated |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | break; |
| 169 | 169 | default: |
| 170 | - $this->_error('Set Parameter: Unknown option ' . $k); |
|
| 170 | + $this->_error('Set Parameter: Unknown option '.$k); |
|
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | case 'ucs4_array': |
| 191 | 191 | break; |
| 192 | 192 | default: |
| 193 | - $this->_error('Unknown encoding ' . $one_time_encoding); |
|
| 193 | + $this->_error('Unknown encoding '.$one_time_encoding); |
|
| 194 | 194 | return false; |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | [$email_pref, $input] = explode('@', $input, 2); |
| 209 | 209 | $arr = explode('.', $input); |
| 210 | 210 | foreach ($arr as $k => $v) { |
| 211 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 211 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 212 | 212 | $conv = $this->_decode($v); |
| 213 | 213 | if ($conv) { |
| 214 | 214 | $arr[$k] = $conv; |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $input = join('.', $arr); |
| 219 | 219 | $arr = explode('.', $email_pref); |
| 220 | 220 | foreach ($arr as $k => $v) { |
| 221 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 221 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 222 | 222 | $conv = $this->_decode($v); |
| 223 | 223 | if ($conv) { |
| 224 | 224 | $arr[$k] = $conv; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | $email_pref = join('.', $arr); |
| 229 | - $return = $email_pref . '@' . $input; |
|
| 229 | + $return = $email_pref.'@'.$input; |
|
| 230 | 230 | } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) |
| 231 | 231 | // No no in strict mode |
| 232 | 232 | if ($this->_strict_mode) { |
@@ -243,13 +243,13 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | $parsed['host'] = join('.', $arr); |
| 246 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 247 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 246 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 247 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 248 | 248 | $parsed['host']. |
| 249 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 249 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 250 | 250 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 251 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 252 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 251 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 252 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 253 | 253 | } else { // parse_url seems to have failed, try without it |
| 254 | 254 | $arr = explode('.', $input); |
| 255 | 255 | foreach ($arr as $k => $v) { |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | // The output is UTF-8 by default, other output formats need conversion here |
| 268 | 268 | // If one time encoding is given, use this, else the objects property |
| 269 | 269 | switch ($one_time_encoding ?: $this->_api_encoding) { |
| 270 | - case 'utf8': return $return; // break; |
|
| 271 | - case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 270 | + case 'utf8' : return $return; // break; |
|
| 271 | + case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 272 | 272 | case 'ucs4_array': return $this->_utf8_to_ucs4($return); // break; |
| 273 | 273 | default: $this->_error('Unsupported output format'); return false; |
| 274 | 274 | } |
@@ -285,15 +285,14 @@ discard block |
||
| 285 | 285 | // Forcing conversion of input to UCS4 array |
| 286 | 286 | // If one time encoding is given, use this, else the objects property |
| 287 | 287 | switch ($one_time_encoding ?: $this->_api_encoding) { |
| 288 | - case 'utf8': |
|
| 289 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 288 | + case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 290 | 289 | break; |
| 291 | 290 | case 'ucs4_string': |
| 292 | 291 | $decoded = $this->_ucs4_string_to_ucs4($decoded); |
| 293 | 292 | case 'ucs4_array': |
| 294 | 293 | break; |
| 295 | 294 | default: |
| 296 | - $this->_error('Unsupported input format: ' . ($one_time_encoding ?: $this->_api_encoding)); |
|
| 295 | + $this->_error('Unsupported input format: '.($one_time_encoding ?: $this->_api_encoding)); |
|
| 297 | 296 | return false; |
| 298 | 297 | } |
| 299 | 298 | |
@@ -382,13 +381,13 @@ discard block |
||
| 382 | 381 | } |
| 383 | 382 | } |
| 384 | 383 | $parsed['host'] = join('.', $arr); |
| 385 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 386 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 384 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 385 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 387 | 386 | $parsed['host']. |
| 388 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 387 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 389 | 388 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 390 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 391 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 389 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 390 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 392 | 391 | return $return; |
| 393 | 392 | } |
| 394 | 393 | |
@@ -411,11 +410,11 @@ discard block |
||
| 411 | 410 | { |
| 412 | 411 | $decoded = array(); |
| 413 | 412 | // find the Punycode prefix |
| 414 | - if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) { |
|
| 413 | + if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) { |
|
| 415 | 414 | $this->_error('This is not a punycode string'); |
| 416 | 415 | return false; |
| 417 | 416 | } |
| 418 | - $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded); |
|
| 417 | + $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded); |
|
| 419 | 418 | // If nothing left after removing the prefix, it is hopeless |
| 420 | 419 | if (!$encode_test) { |
| 421 | 420 | $this->_error('The given encoded string was empty'); |
@@ -441,8 +440,7 @@ discard block |
||
| 441 | 440 | for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) { |
| 442 | 441 | $digit = $this->_decode_digit($encoded[$enco_idx++]); |
| 443 | 442 | $idx += $digit * $w; |
| 444 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 445 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 443 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 446 | 444 | if ($digit < $t) { |
| 447 | 445 | break; |
| 448 | 446 | } |
@@ -515,7 +513,7 @@ discard block |
||
| 515 | 513 | return $encoded; // All codepoints were basic ones |
| 516 | 514 | } |
| 517 | 515 | // Start with the prefix; copy it to output |
| 518 | - $encoded = $this->_punycode_prefix . $encoded; |
|
| 516 | + $encoded = $this->_punycode_prefix.$encoded; |
|
| 519 | 517 | // If we have basic code points in output, add an hyphen to the end |
| 520 | 518 | if ($codecount) { |
| 521 | 519 | $encoded .= '-'; |
@@ -542,8 +540,7 @@ discard block |
||
| 542 | 540 | $delta++; |
| 543 | 541 | } elseif ($decoded[$i] == $cur_code) { |
| 544 | 542 | for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { |
| 545 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 546 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 543 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 547 | 544 | if ($q < $t) { |
| 548 | 545 | break; |
| 549 | 546 | } |
@@ -630,12 +627,12 @@ discard block |
||
| 630 | 627 | } |
| 631 | 628 | // Try to find prohibited input |
| 632 | 629 | if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) { |
| 633 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 630 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 634 | 631 | return false; |
| 635 | 632 | } |
| 636 | 633 | foreach (self::$NP['prohibit_ranges'] as $range) { |
| 637 | 634 | if ($range[0] <= $v && $v <= $range[1]) { |
| 638 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 635 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 639 | 636 | return false; |
| 640 | 637 | } |
| 641 | 638 | } |
@@ -873,7 +870,7 @@ discard block |
||
| 873 | 870 | $output[$out_len] = $v; |
| 874 | 871 | ++$out_len; |
| 875 | 872 | if ('add' == $mode) { |
| 876 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 873 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 877 | 874 | return false; |
| 878 | 875 | } |
| 879 | 876 | continue; |
@@ -898,7 +895,7 @@ discard block |
||
| 898 | 895 | $next_byte = 4; |
| 899 | 896 | $v = ($v - 252) << 30; |
| 900 | 897 | } else { |
| 901 | - $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
| 898 | + $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
| 902 | 899 | return false; |
| 903 | 900 | } |
| 904 | 901 | if ('add' == $mode) { |
@@ -911,7 +908,7 @@ discard block |
||
| 911 | 908 | if (!$this->_allow_overlong && $test == 'range') { |
| 912 | 909 | $test = 'none'; |
| 913 | 910 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
| 914 | - $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
| 911 | + $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
| 915 | 912 | return false; |
| 916 | 913 | } |
| 917 | 914 | } |
@@ -920,7 +917,7 @@ discard block |
||
| 920 | 917 | $output[($out_len - 1)] += $v; |
| 921 | 918 | --$next_byte; |
| 922 | 919 | } else { |
| 923 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 920 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 924 | 921 | return false; |
| 925 | 922 | } |
| 926 | 923 | if ($next_byte < 0) { |
@@ -944,13 +941,13 @@ discard block |
||
| 944 | 941 | if ($v < 128) { // 7bit are transferred literally |
| 945 | 942 | $output .= chr($v); |
| 946 | 943 | } elseif ($v < (1 << 11)) { // 2 bytes |
| 947 | - $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
| 944 | + $output .= chr(192 + ($v >> 6)).chr(128 + ($v & 63)); |
|
| 948 | 945 | } elseif ($v < (1 << 16)) { // 3 bytes |
| 949 | - $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 946 | + $output .= chr(224 + ($v >> 12)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 950 | 947 | } elseif ($v < (1 << 21)) { // 4 bytes |
| 951 | - $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 948 | + $output .= chr(240 + ($v >> 18)).chr(128 + (($v >> 12) & 63)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 952 | 949 | } else { |
| 953 | - $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
| 950 | + $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |
|
| 954 | 951 | return false; |
| 955 | 952 | } |
| 956 | 953 | } |
@@ -969,7 +966,7 @@ discard block |
||
| 969 | 966 | // Take array values and split output to 4 bytes per value |
| 970 | 967 | // The bit mask is 255, which reads &11111111 |
| 971 | 968 | foreach ($input as $v) { |
| 972 | - $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255); |
|
| 969 | + $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); |
|
| 973 | 970 | } |
| 974 | 971 | return $output; |
| 975 | 972 | } |
@@ -999,7 +996,7 @@ discard block |
||
| 999 | 996 | $out_len++; |
| 1000 | 997 | $output[$out_len] = 0; |
| 1001 | 998 | } |
| 1002 | - $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); |
|
| 999 | + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4))); |
|
| 1003 | 1000 | } |
| 1004 | 1001 | return $output; |
| 1005 | 1002 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $GLOBALS['contexte'] = calculer_contexte(); |
| 41 | 41 | $page = ['contexte_implicite' => calculer_contexte_implicite()]; |
| 42 | - $page['contexte_implicite']['cache'] = $fond . preg_replace( |
|
| 42 | + $page['contexte_implicite']['cache'] = $fond.preg_replace( |
|
| 43 | 43 | ',\.[a-zA-Z0-9]*$,', |
| 44 | 44 | '', |
| 45 | 45 | preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI']) |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if ($page === '') { |
| 141 | 141 | $erreur = _T( |
| 142 | 142 | 'info_erreur_squelette2', |
| 143 | - ['fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES] |
|
| 143 | + ['fichier' => spip_htmlspecialchars($fond).'.'._EXTENSION_SQUELETTES] |
|
| 144 | 144 | ); |
| 145 | 145 | erreur_squelette($erreur); |
| 146 | 146 | // eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4 |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | and !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) |
| 184 | 184 | and !isset($page['entetes']['Last-Modified']) |
| 185 | 185 | ) { |
| 186 | - $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT'; |
|
| 186 | + $page['entetes']['Last-Modified'] = gmdate('D, d M Y H:i:s', $lastmodified).' GMT'; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | // fermer la connexion apres les headers si requete HEAD |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | 'spip_version_code' => $GLOBALS['spip_version_code'], |
| 247 | 247 | ]; |
| 248 | 248 | if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { |
| 249 | - $contexte_implicite['host'] .= '|' . $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 249 | + $contexte_implicite['host'] .= '|'.$_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | return $contexte_implicite; |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | if (is_null($id)) { |
| 581 | - $msg = "modeles/$modele : " . _T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 581 | + $msg = "modeles/$modele : "._T('zbug_parametres_inclus_incorrects', ['param' => "id/$primary"]); |
|
| 582 | 582 | erreur_squelette($msg); |
| 583 | 583 | // on passe id=0 au routeur pour tomber sur le modele par defaut et eviter une seconde erreur sur un modele inexistant |
| 584 | 584 | $id = 0; |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | if (preg_match(',^[a-z0-9_]+$,', $soustype)) { |
| 626 | - if (!trouve_modele($fond = ($type . '_' . $soustype))) { |
|
| 626 | + if (!trouve_modele($fond = ($type.'_'.$soustype))) { |
|
| 627 | 627 | $fond = ''; |
| 628 | 628 | $class = $soustype; |
| 629 | 629 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | |
| 639 | 639 | return false; |
| 640 | 640 | } |
| 641 | - $fond = 'modeles/' . $fond; |
|
| 641 | + $fond = 'modeles/'.$fond; |
|
| 642 | 642 | // Creer le contexte |
| 643 | 643 | $contexte = $env; |
| 644 | 644 | $contexte['dir_racine'] = _DIR_RACINE; # eviter de mixer un cache racine et un cache ecrire (meme si pour l'instant les modeles ne sont pas caches, le resultat etant different il faut que le contexte en tienne compte |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | // sinon, s'il y a un lien, on l'ajoute classiquement |
| 680 | 680 | if ( |
| 681 | 681 | strstr( |
| 682 | - ' ' . ($classes = extraire_attribut($retour, 'class')) . ' ', |
|
| 682 | + ' '.($classes = extraire_attribut($retour, 'class')).' ', |
|
| 683 | 683 | 'spip_lien_ok' |
| 684 | 684 | ) |
| 685 | 685 | ) { |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | ); |
| 691 | 691 | } else { |
| 692 | 692 | if ($lien) { |
| 693 | - $retour = "<a href=\"" . $lien['href'] . "\" class=\"" . $lien['class'] . "\">" . $retour . '</a>'; |
|
| 693 | + $retour = "<a href=\"".$lien['href']."\" class=\"".$lien['class']."\">".$retour.'</a>'; |
|
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | return $page; |
| 714 | 714 | } |
| 715 | 715 | // eval $page et affecte $res |
| 716 | - include _ROOT_RESTREINT . 'public/evaluer_page.php'; |
|
| 716 | + include _ROOT_RESTREINT.'public/evaluer_page.php'; |
|
| 717 | 717 | |
| 718 | 718 | // Lever un drapeau (global) si le fond utilise #SESSION |
| 719 | 719 | // a destination de public/parametrer |
@@ -780,16 +780,16 @@ discard block |
||
| 780 | 780 | if (($pos = strpos($head, '<head>')) !== false) { |
| 781 | 781 | $head = substr_replace($head, $base, $pos + 6, 0); |
| 782 | 782 | } elseif (preg_match(',<head[^>]*>,i', $head, $r)) { |
| 783 | - $head = str_replace($r[0], $r[0] . $base, $head); |
|
| 783 | + $head = str_replace($r[0], $r[0].$base, $head); |
|
| 784 | 784 | } |
| 785 | - $texte = $head . substr($texte, $poshead); |
|
| 785 | + $texte = $head.substr($texte, $poshead); |
|
| 786 | 786 | } |
| 787 | 787 | if ($href_base) { |
| 788 | 788 | // gerer les ancres |
| 789 | 789 | $base = $_SERVER['REQUEST_URI']; |
| 790 | 790 | // pas de guillemets ni < dans l'URL qu'on insere dans le HTML |
| 791 | 791 | if (strpos($base, "'") or strpos($base, '"') or strpos($base, '<')) { |
| 792 | - $base = str_replace(["'",'"','<'], ['%27','%22','%3C'], $base); |
|
| 792 | + $base = str_replace(["'", '"', '<'], ['%27', '%22', '%3C'], $base); |
|
| 793 | 793 | } |
| 794 | 794 | if (strpos($texte, "href='#") !== false) { |
| 795 | 795 | $texte = str_replace("href='#", "href='$base#", $texte); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | if (is_callable($f)) { |
| 102 | 102 | return $f; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // affichage "GIT [master: abcdef]" |
| 235 | 235 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 236 | 236 | if ($desc['branch']) { |
| 237 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 237 | + $commit = $desc['branch'].': '.$commit; |
|
| 238 | 238 | } |
| 239 | 239 | return "{$desc['vcs']} [$commit]"; |
| 240 | 240 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // version installee par GIT |
| 256 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 256 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 257 | 257 | $currentHead = trim(substr($c, 4)); |
| 258 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 258 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 259 | 259 | return [ |
| 260 | 260 | 'vcs' => 'GIT', |
| 261 | 261 | 'branch' => basename($currentHead), |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | $dir = '.'; |
| 283 | 283 | } |
| 284 | 284 | // version installee par SVN |
| 285 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 285 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 287 | 287 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 288 | 288 | if ($result) { |
| 289 | 289 | $row = $result->fetchArray(); |
@@ -301,12 +301,12 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 303 | 303 | // et laisser passer les fonctions personnelles baptisees image_... |
| 304 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 305 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 306 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 307 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 308 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 304 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 305 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 306 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 307 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 308 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | 310 | |
| 311 | 311 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 312 | 312 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function filtre_debug($val, $key = null) { |
| 467 | 467 | $debug = ( |
| 468 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 469 | - ) . var_export($val, true); |
|
| 468 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 469 | + ).var_export($val, true); |
|
| 470 | 470 | |
| 471 | 471 | include_spip('inc/autoriser'); |
| 472 | 472 | if (autoriser('webmestre')) { |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $is_file = false; |
| 523 | 523 | } |
| 524 | 524 | if ($is_file) { |
| 525 | - $is_local_file = function ($path) { |
|
| 525 | + $is_local_file = function($path) { |
|
| 526 | 526 | if (strpos($path, '?') !== false) { |
| 527 | 527 | $path = supprimer_timestamp($path); |
| 528 | 528 | // remove ?24px added by find_in_theme on .svg files |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 572 | 572 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 573 | 573 | $srcover = $match[1]; |
| 574 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 574 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 575 | 575 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 576 | 576 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 577 | 577 | } |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | // " -> " et tout ce genre de choses |
| 974 | 974 | $u = $GLOBALS['meta']['pcre_u']; |
| 975 | 975 | $texte = str_replace(' ', ' ', $texte); |
| 976 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 976 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 977 | 977 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 978 | 978 | $texte = entites_html($texte, false, false); |
| 979 | 979 | // mais bien echapper les double quotes ! |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | **/ |
| 1034 | 1034 | function supprimer_numero($texte) { |
| 1035 | 1035 | return preg_replace( |
| 1036 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1036 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1037 | 1037 | '', |
| 1038 | 1038 | $texte |
| 1039 | 1039 | ); |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | if ( |
| 1063 | 1063 | $texte and |
| 1064 | 1064 | preg_match( |
| 1065 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1065 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1066 | 1066 | $texte, |
| 1067 | 1067 | $regs |
| 1068 | 1068 | ) |
@@ -1153,8 +1153,8 @@ discard block |
||
| 1153 | 1153 | **/ |
| 1154 | 1154 | function textebrut($texte) { |
| 1155 | 1155 | $u = $GLOBALS['meta']['pcre_u']; |
| 1156 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1157 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1156 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1157 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1158 | 1158 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1159 | 1159 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1160 | 1160 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | ) |
| 1189 | 1189 | ) { |
| 1190 | 1190 | foreach ($liens[0] as $a) { |
| 1191 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1191 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1192 | 1192 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1193 | 1193 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1194 | 1194 | $texte = str_replace($a, $ablank, $texte); |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | foreach ($regs[0] as $a) { |
| 1214 | 1214 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1215 | 1215 | if (strpos($rel, 'nofollow') === false) { |
| 1216 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1216 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1217 | 1217 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1218 | 1218 | $texte = str_replace($a, $anofollow, $texte); |
| 1219 | 1219 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | $u = $GLOBALS['meta']['pcre_u']; |
| 1243 | 1243 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1244 | 1244 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1245 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1245 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1246 | 1246 | |
| 1247 | 1247 | return $texte; |
| 1248 | 1248 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | return $texte; |
| 1274 | 1274 | } |
| 1275 | 1275 | include_spip('inc/texte'); |
| 1276 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1276 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1277 | 1277 | 'div' : 'span'; |
| 1278 | 1278 | |
| 1279 | 1279 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | } |
| 1386 | 1386 | $u = $GLOBALS['meta']['pcre_u']; |
| 1387 | 1387 | if ($textebrut) { |
| 1388 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1388 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1389 | 1389 | } |
| 1390 | 1390 | $texte = texte_backend($texte); |
| 1391 | 1391 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1420,7 +1420,7 @@ discard block |
||
| 1420 | 1420 | # un message pour abs_url |
| 1421 | 1421 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1422 | 1422 | $url = trim($url); |
| 1423 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1423 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1424 | 1424 | |
| 1425 | 1425 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1426 | 1426 | } |
@@ -1620,14 +1620,14 @@ discard block |
||
| 1620 | 1620 | if (strpos($texte, '<') !== false) { |
| 1621 | 1621 | include_spip('inc/lien'); |
| 1622 | 1622 | if (defined('_PREG_MODELE')) { |
| 1623 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1623 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1624 | 1624 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1625 | 1625 | } |
| 1626 | 1626 | } |
| 1627 | 1627 | |
| 1628 | 1628 | $debut = ''; |
| 1629 | 1629 | $suite = $texte; |
| 1630 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1630 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1631 | 1631 | $debut .= substr($suite, 0, $t - 1); |
| 1632 | 1632 | $suite = substr($suite, $t); |
| 1633 | 1633 | $car = substr($suite, 0, 1); |
@@ -1645,11 +1645,11 @@ discard block |
||
| 1645 | 1645 | $suite = substr($suite, strlen($regs[0])); |
| 1646 | 1646 | } |
| 1647 | 1647 | } |
| 1648 | - $texte = $debut . $suite; |
|
| 1648 | + $texte = $debut.$suite; |
|
| 1649 | 1649 | |
| 1650 | 1650 | $texte = echappe_retour($texte); |
| 1651 | 1651 | |
| 1652 | - return $texte . $fin; |
|
| 1652 | + return $texte.$fin; |
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | foreach ($regs as $reg) { |
| 1714 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1714 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1715 | 1715 | $desc = $traduire($cle, $lang, true); |
| 1716 | 1716 | $l = $desc->langue; |
| 1717 | 1717 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1825,9 +1825,9 @@ discard block |
||
| 1825 | 1825 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1826 | 1826 | include_spip('inc/texte'); |
| 1827 | 1827 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1828 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1828 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1829 | 1829 | if ($mode === 'div') { |
| 1830 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1830 | + $trad = rtrim($trad)."\n\n"; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1833 | 1833 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2027,7 +2027,7 @@ discard block |
||
| 2027 | 2027 | if (is_array($balise)) { |
| 2028 | 2028 | array_walk( |
| 2029 | 2029 | $balise, |
| 2030 | - function (&$a, $key, $t) { |
|
| 2030 | + function(&$a, $key, $t) { |
|
| 2031 | 2031 | $a = extraire_attribut($a, $t); |
| 2032 | 2032 | }, |
| 2033 | 2033 | $attribut |
@@ -2124,14 +2124,14 @@ discard block |
||
| 2124 | 2124 | |
| 2125 | 2125 | if ($old !== null) { |
| 2126 | 2126 | // Remplacer l'ancien attribut du meme nom |
| 2127 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2127 | + $balise = $r[1].$insert.$r[5]; |
|
| 2128 | 2128 | } else { |
| 2129 | 2129 | // preferer une balise " />" (comme <img />) |
| 2130 | 2130 | if (preg_match(',/>,', $balise)) { |
| 2131 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2131 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2132 | 2132 | } // sinon une balise <a ...> ... </a> |
| 2133 | 2133 | else { |
| 2134 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2134 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2135 | 2135 | } |
| 2136 | 2136 | } |
| 2137 | 2137 | |
@@ -2186,7 +2186,7 @@ discard block |
||
| 2186 | 2186 | if ( |
| 2187 | 2187 | $class_courante |
| 2188 | 2188 | and strpos($class_courante, (string) $c) !== false |
| 2189 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2189 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2190 | 2190 | ) { |
| 2191 | 2191 | $is_class_presente = true; |
| 2192 | 2192 | } |
@@ -2194,12 +2194,12 @@ discard block |
||
| 2194 | 2194 | in_array($operation, ['ajouter', 'commuter']) |
| 2195 | 2195 | and !$is_class_presente |
| 2196 | 2196 | ) { |
| 2197 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2197 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2198 | 2198 | } elseif ( |
| 2199 | 2199 | in_array($operation, ['supprimer', 'commuter']) |
| 2200 | 2200 | and $is_class_presente |
| 2201 | 2201 | ) { |
| 2202 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2202 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2203 | 2203 | } |
| 2204 | 2204 | } |
| 2205 | 2205 | |
@@ -2262,7 +2262,7 @@ discard block |
||
| 2262 | 2262 | // Quelques fonctions de calcul arithmetique |
| 2263 | 2263 | // |
| 2264 | 2264 | function floatstr($a) { |
| 2265 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2265 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2266 | 2266 | } |
| 2267 | 2267 | function strize($f, $a, $b) { |
| 2268 | 2268 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2398,13 +2398,13 @@ discard block |
||
| 2398 | 2398 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2399 | 2399 | define('_TAGS_NOM_AUTEUR', ''); |
| 2400 | 2400 | } |
| 2401 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2401 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2402 | 2402 | foreach ($tags_acceptes as $tag) { |
| 2403 | 2403 | if (strlen($tag)) { |
| 2404 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2405 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2406 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2407 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2404 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2405 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2406 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2407 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2408 | 2408 | } |
| 2409 | 2409 | } |
| 2410 | 2410 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2524,10 +2524,10 @@ discard block |
||
| 2524 | 2524 | $fichier = basename($url); |
| 2525 | 2525 | |
| 2526 | 2526 | return '<a rel="enclosure"' |
| 2527 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2528 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2529 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2530 | - . '>' . $fichier . '</a>'; |
|
| 2527 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2528 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2529 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2530 | + . '>'.$fichier.'</a>'; |
|
| 2531 | 2531 | } |
| 2532 | 2532 | |
| 2533 | 2533 | /** |
@@ -2555,9 +2555,9 @@ discard block |
||
| 2555 | 2555 | } # vieux data |
| 2556 | 2556 | $fichier = basename($url); |
| 2557 | 2557 | $enclosures[] = '<enclosure' |
| 2558 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2559 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2560 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2558 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2559 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2560 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2561 | 2561 | . ' />'; |
| 2562 | 2562 | } |
| 2563 | 2563 | } |
@@ -2583,7 +2583,7 @@ discard block |
||
| 2583 | 2583 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2584 | 2584 | $subjects .= '<dc:subject>' |
| 2585 | 2585 | . texte_backend(textebrut($e)) |
| 2586 | - . '</dc:subject>' . "\n"; |
|
| 2586 | + . '</dc:subject>'."\n"; |
|
| 2587 | 2587 | } |
| 2588 | 2588 | } |
| 2589 | 2589 | |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | if (is_array($texte)) { |
| 2620 | 2620 | array_walk( |
| 2621 | 2621 | $texte, |
| 2622 | - function (&$a, $key, $t) { |
|
| 2622 | + function(&$a, $key, $t) { |
|
| 2623 | 2623 | $a = extraire_balise($a, $t); |
| 2624 | 2624 | }, |
| 2625 | 2625 | $tag |
@@ -2667,7 +2667,7 @@ discard block |
||
| 2667 | 2667 | if (is_array($texte)) { |
| 2668 | 2668 | array_walk( |
| 2669 | 2669 | $texte, |
| 2670 | - function (&$a, $key, $t) { |
|
| 2670 | + function(&$a, $key, $t) { |
|
| 2671 | 2671 | $a = extraire_balises($a, $t); |
| 2672 | 2672 | }, |
| 2673 | 2673 | $tag |
@@ -2800,7 +2800,7 @@ discard block |
||
| 2800 | 2800 | if ($fond != '404') { |
| 2801 | 2801 | $contexte = array_shift($p); |
| 2802 | 2802 | $contexte['page'] = $fond; |
| 2803 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2803 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2804 | 2804 | } |
| 2805 | 2805 | } |
| 2806 | 2806 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2855,9 +2855,9 @@ discard block |
||
| 2855 | 2855 | . '"' |
| 2856 | 2856 | . (is_null($val) |
| 2857 | 2857 | ? '' |
| 2858 | - : ' value="' . entites_html($val) . '"' |
|
| 2858 | + : ' value="'.entites_html($val).'"' |
|
| 2859 | 2859 | ) |
| 2860 | - . ' type="hidden"' . "\n/>"; |
|
| 2860 | + . ' type="hidden"'."\n/>"; |
|
| 2861 | 2861 | } |
| 2862 | 2862 | |
| 2863 | 2863 | return join('', $hidden); |
@@ -2967,7 +2967,7 @@ discard block |
||
| 2967 | 2967 | |
| 2968 | 2968 | return preg_replace_callback( |
| 2969 | 2969 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2970 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2970 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2971 | 2971 | $contenu |
| 2972 | 2972 | ); |
| 2973 | 2973 | } |
@@ -3028,14 +3028,14 @@ discard block |
||
| 3028 | 3028 | ) { |
| 3029 | 3029 | $distant = true; |
| 3030 | 3030 | $cssf = parse_url($css); |
| 3031 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3031 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3032 | 3032 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3033 | 3033 | } else { |
| 3034 | 3034 | $distant = false; |
| 3035 | 3035 | $cssf = $css; |
| 3036 | 3036 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3037 | 3037 | //propose (rien a faire dans ce cas) |
| 3038 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3038 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3039 | 3039 | if (@file_exists($f)) { |
| 3040 | 3040 | return $f; |
| 3041 | 3041 | } |
@@ -3045,7 +3045,7 @@ discard block |
||
| 3045 | 3045 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3046 | 3046 | $f = $dir_var |
| 3047 | 3047 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3048 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3048 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3049 | 3049 | |
| 3050 | 3050 | // la css peut etre distante (url absolue !) |
| 3051 | 3051 | if ($distant) { |
@@ -3091,8 +3091,8 @@ discard block |
||
| 3091 | 3091 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3092 | 3092 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3093 | 3093 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3094 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3095 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3094 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3095 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3096 | 3096 | } |
| 3097 | 3097 | $src[] = $regs[0][$k]; |
| 3098 | 3098 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3141,7 +3141,7 @@ discard block |
||
| 3141 | 3141 | |
| 3142 | 3142 | $f = basename($css, '.css'); |
| 3143 | 3143 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3144 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3144 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3145 | 3145 | . '.css'; |
| 3146 | 3146 | |
| 3147 | 3147 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3151,7 +3151,7 @@ discard block |
||
| 3151 | 3151 | if ($url_absolue_css == $css) { |
| 3152 | 3152 | if ( |
| 3153 | 3153 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3154 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3154 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3155 | 3155 | ) { |
| 3156 | 3156 | include_spip('inc/distant'); |
| 3157 | 3157 | $contenu = recuperer_url($css); |
@@ -3263,7 +3263,7 @@ discard block |
||
| 3263 | 3263 | $expression = str_replace('\/', '/', $expression); |
| 3264 | 3264 | $expression = str_replace('/', '\/', $expression); |
| 3265 | 3265 | |
| 3266 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3266 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3267 | 3267 | if (isset($r[$capte])) { |
| 3268 | 3268 | return $r[$capte]; |
| 3269 | 3269 | } else { |
@@ -3301,7 +3301,7 @@ discard block |
||
| 3301 | 3301 | $expression = str_replace('\/', '/', $expression); |
| 3302 | 3302 | $expression = str_replace('/', '\/', $expression); |
| 3303 | 3303 | |
| 3304 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3304 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3305 | 3305 | } |
| 3306 | 3306 | |
| 3307 | 3307 | |
@@ -3320,7 +3320,7 @@ discard block |
||
| 3320 | 3320 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3321 | 3321 | |
| 3322 | 3322 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3323 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3323 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3324 | 3324 | |
| 3325 | 3325 | if ( |
| 3326 | 3326 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3334,7 +3334,7 @@ discard block |
||
| 3334 | 3334 | if (!isset($doublons['documents'])) { |
| 3335 | 3335 | $doublons['documents'] = ''; |
| 3336 | 3336 | } |
| 3337 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3337 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3338 | 3338 | } |
| 3339 | 3339 | |
| 3340 | 3340 | return $letexte; |
@@ -3391,7 +3391,7 @@ discard block |
||
| 3391 | 3391 | if ($env) { |
| 3392 | 3392 | foreach ($env as $i => $j) { |
| 3393 | 3393 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3394 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3394 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3395 | 3395 | } |
| 3396 | 3396 | } |
| 3397 | 3397 | } |
@@ -3430,7 +3430,7 @@ discard block |
||
| 3430 | 3430 | if ($env) { |
| 3431 | 3431 | foreach ($env as $i => $j) { |
| 3432 | 3432 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3433 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3433 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3434 | 3434 | } |
| 3435 | 3435 | } |
| 3436 | 3436 | } |
@@ -3504,10 +3504,10 @@ discard block |
||
| 3504 | 3504 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3505 | 3505 | if ( |
| 3506 | 3506 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3507 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3507 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3508 | 3508 | and file_exists($variante_svg_generique) |
| 3509 | 3509 | ) { |
| 3510 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3510 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3511 | 3511 | $img_file = $variante_svg_size; |
| 3512 | 3512 | } |
| 3513 | 3513 | else { |
@@ -3565,7 +3565,7 @@ discard block |
||
| 3565 | 3565 | return ''; |
| 3566 | 3566 | } |
| 3567 | 3567 | } |
| 3568 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3568 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3569 | 3569 | } |
| 3570 | 3570 | |
| 3571 | 3571 | if (file_exists($img_file)) { |
@@ -3575,14 +3575,14 @@ discard block |
||
| 3575 | 3575 | $alt = ''; |
| 3576 | 3576 | } |
| 3577 | 3577 | elseif ($alt or $alt === '') { |
| 3578 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3578 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3579 | 3579 | } |
| 3580 | 3580 | else { |
| 3581 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3581 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3582 | 3582 | } |
| 3583 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3584 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3585 | - . ' ' . ltrim($atts) |
|
| 3583 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3584 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3585 | + . ' '.ltrim($atts) |
|
| 3586 | 3586 | . ' />'; |
| 3587 | 3587 | } |
| 3588 | 3588 | |
@@ -3596,10 +3596,10 @@ discard block |
||
| 3596 | 3596 | */ |
| 3597 | 3597 | function http_style_background($img, $att = '', $size = null) { |
| 3598 | 3598 | if ($size and is_numeric($size)) { |
| 3599 | - $size = trim($size) . 'px'; |
|
| 3599 | + $size = trim($size).'px'; |
|
| 3600 | 3600 | } |
| 3601 | - return " style='background" . |
|
| 3602 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3601 | + return " style='background". |
|
| 3602 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3603 | 3603 | . ($size ? "background-size:{$size};" : '') |
| 3604 | 3604 | . "'"; |
| 3605 | 3605 | } |
@@ -3714,7 +3714,7 @@ discard block |
||
| 3714 | 3714 | $img = http_img_pack( |
| 3715 | 3715 | $img, |
| 3716 | 3716 | $alt, |
| 3717 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3717 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3718 | 3718 | '', |
| 3719 | 3719 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3720 | 3720 | ); |
@@ -3799,7 +3799,7 @@ discard block |
||
| 3799 | 3799 | $balise_svg_source = $balise_svg; |
| 3800 | 3800 | |
| 3801 | 3801 | // entete XML à supprimer |
| 3802 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3802 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3803 | 3803 | |
| 3804 | 3804 | // IE est toujours mon ami |
| 3805 | 3805 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3817,9 +3817,9 @@ discard block |
||
| 3817 | 3817 | // regler le alt |
| 3818 | 3818 | if ($alt) { |
| 3819 | 3819 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3820 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3820 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3821 | 3821 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3822 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3822 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3823 | 3823 | $balise_svg .= $title; |
| 3824 | 3824 | } |
| 3825 | 3825 | else { |
@@ -3867,7 +3867,7 @@ discard block |
||
| 3867 | 3867 | if (is_array($tableau)) { |
| 3868 | 3868 | foreach ($tableau as $k => $v) { |
| 3869 | 3869 | $res = recuperer_fond( |
| 3870 | - 'modeles/' . $modele, |
|
| 3870 | + 'modeles/'.$modele, |
|
| 3871 | 3871 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3872 | 3872 | ); |
| 3873 | 3873 | $texte .= $res; |
@@ -4052,7 +4052,7 @@ discard block |
||
| 4052 | 4052 | } |
| 4053 | 4053 | |
| 4054 | 4054 | $c = serialize($c); |
| 4055 | - $cle = calculer_cle_action($form . $c); |
|
| 4055 | + $cle = calculer_cle_action($form.$c); |
|
| 4056 | 4056 | $c = "$cle:$c"; |
| 4057 | 4057 | |
| 4058 | 4058 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4110,15 +4110,15 @@ discard block |
||
| 4110 | 4110 | } |
| 4111 | 4111 | // toujours encoder l'url source dans le bloc ajax |
| 4112 | 4112 | $r = self(); |
| 4113 | - $r = ' data-origin="' . $r . '"'; |
|
| 4113 | + $r = ' data-origin="'.$r.'"'; |
|
| 4114 | 4114 | $class = 'ajaxbloc'; |
| 4115 | 4115 | if ($ajaxid and is_string($ajaxid)) { |
| 4116 | 4116 | // ajaxid est normalement conforme a un nom de classe css |
| 4117 | 4117 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4118 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4118 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4119 | 4119 | } |
| 4120 | 4120 | |
| 4121 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4121 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4122 | 4122 | } |
| 4123 | 4123 | |
| 4124 | 4124 | /** |
@@ -4162,7 +4162,7 @@ discard block |
||
| 4162 | 4162 | $cle = substr($c, 0, $p); |
| 4163 | 4163 | $c = substr($c, $p + 1); |
| 4164 | 4164 | |
| 4165 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4165 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4166 | 4166 | $env = @unserialize($c); |
| 4167 | 4167 | return $env; |
| 4168 | 4168 | } |
@@ -4283,13 +4283,13 @@ discard block |
||
| 4283 | 4283 | } |
| 4284 | 4284 | } |
| 4285 | 4285 | } |
| 4286 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4286 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4287 | 4287 | } else { |
| 4288 | 4288 | $bal = 'a'; |
| 4289 | 4289 | $att = "href='$url'" |
| 4290 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4291 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4292 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4290 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4291 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4292 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4293 | 4293 | . $evt; |
| 4294 | 4294 | } |
| 4295 | 4295 | if ($libelle === null) { |
@@ -4428,7 +4428,7 @@ discard block |
||
| 4428 | 4428 | |
| 4429 | 4429 | // Icône |
| 4430 | 4430 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4431 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4431 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4432 | 4432 | |
| 4433 | 4433 | // Markup final |
| 4434 | 4434 | if ($type == 'lien') { |
@@ -4703,20 +4703,20 @@ discard block |
||
| 4703 | 4703 | $class_form = 'ajax'; |
| 4704 | 4704 | $class = str_replace('ajax', '', $class); |
| 4705 | 4705 | } |
| 4706 | - $class_btn = 'submit ' . trim($class); |
|
| 4706 | + $class_btn = 'submit '.trim($class); |
|
| 4707 | 4707 | |
| 4708 | 4708 | if ($confirm) { |
| 4709 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4709 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4710 | 4710 | if ($callback) { |
| 4711 | 4711 | $callback = "$confirm?($callback):false"; |
| 4712 | 4712 | } else { |
| 4713 | 4713 | $callback = $confirm; |
| 4714 | 4714 | } |
| 4715 | 4715 | } |
| 4716 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4716 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4717 | 4717 | $title = $title ? " title='$title'" : ''; |
| 4718 | 4718 | |
| 4719 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4719 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4720 | 4720 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4721 | 4721 | } |
| 4722 | 4722 | |
@@ -4781,14 +4781,14 @@ discard block |
||
| 4781 | 4781 | $champ_titre = ''; |
| 4782 | 4782 | if ($demande_titre) { |
| 4783 | 4783 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4784 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4784 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4785 | 4785 | } |
| 4786 | 4786 | include_spip('base/abstract_sql'); |
| 4787 | 4787 | include_spip('base/connect_sql'); |
| 4788 | 4788 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4789 | - '*' . $champ_titre, |
|
| 4789 | + '*'.$champ_titre, |
|
| 4790 | 4790 | $desc['table_sql'], |
| 4791 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4791 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4792 | 4792 | ); |
| 4793 | 4793 | |
| 4794 | 4794 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4881,8 +4881,7 @@ discard block |
||
| 4881 | 4881 | if (isset($ligne_sql['chapo'])) { |
| 4882 | 4882 | $chapo = $ligne_sql['chapo']; |
| 4883 | 4883 | $texte = strlen($descriptif) ? |
| 4884 | - '' : |
|
| 4885 | - "$chapo \n\n $texte"; |
|
| 4884 | + '' : "$chapo \n\n $texte"; |
|
| 4886 | 4885 | } |
| 4887 | 4886 | |
| 4888 | 4887 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4957,7 +4956,7 @@ discard block |
||
| 4957 | 4956 | return $texte; |
| 4958 | 4957 | } |
| 4959 | 4958 | |
| 4960 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4959 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4961 | 4960 | |
| 4962 | 4961 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4963 | 4962 | if (test_espace_prive()) { |
@@ -4996,7 +4995,7 @@ discard block |
||
| 4996 | 4995 | } |
| 4997 | 4996 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4998 | 4997 | |
| 4999 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4998 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 5000 | 4999 | } |
| 5001 | 5000 | |
| 5002 | 5001 | /** |
@@ -5022,10 +5021,10 @@ discard block |
||
| 5022 | 5021 | function wrap($texte, $wrap) { |
| 5023 | 5022 | $balises = extraire_balises($wrap); |
| 5024 | 5023 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5025 | - $texte = $wrap . $texte; |
|
| 5024 | + $texte = $wrap.$texte; |
|
| 5026 | 5025 | $regs = array_reverse($regs[1]); |
| 5027 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5028 | - $texte = $texte . $wrap; |
|
| 5026 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5027 | + $texte = $texte.$wrap; |
|
| 5029 | 5028 | } |
| 5030 | 5029 | |
| 5031 | 5030 | return $texte; |
@@ -5056,7 +5055,7 @@ discard block |
||
| 5056 | 5055 | |
| 5057 | 5056 | // caster $u en array si besoin |
| 5058 | 5057 | if (is_object($u)) { |
| 5059 | - $u = (array)$u; |
|
| 5058 | + $u = (array) $u; |
|
| 5060 | 5059 | } |
| 5061 | 5060 | |
| 5062 | 5061 | if (is_array($u)) { |
@@ -5078,7 +5077,7 @@ discard block |
||
| 5078 | 5077 | // sinon on passe a la ligne et on indente |
| 5079 | 5078 | $i_str = str_pad('', $indent, ' '); |
| 5080 | 5079 | foreach ($u as $k => $v) { |
| 5081 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5080 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5082 | 5081 | } |
| 5083 | 5082 | |
| 5084 | 5083 | return $out; |
@@ -5132,7 +5131,7 @@ discard block |
||
| 5132 | 5131 | * @return string |
| 5133 | 5132 | */ |
| 5134 | 5133 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5135 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5134 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5136 | 5135 | $icone = chemin_image($icone); |
| 5137 | 5136 | $balise_img = charger_filtre('balise_img'); |
| 5138 | 5137 | |
@@ -5158,7 +5157,7 @@ discard block |
||
| 5158 | 5157 | */ |
| 5159 | 5158 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5160 | 5159 | $chaine = explode(':', $chaine); |
| 5161 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5160 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5162 | 5161 | return $t; |
| 5163 | 5162 | } |
| 5164 | 5163 | $chaine = implode(':', $chaine); |
@@ -5224,7 +5223,7 @@ discard block |
||
| 5224 | 5223 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5225 | 5224 | |
| 5226 | 5225 | // calculer le nom de la css |
| 5227 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5226 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5228 | 5227 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5229 | 5228 | $contexte_implicite = calculer_contexte_implicite(); |
| 5230 | 5229 | |
@@ -5232,14 +5231,14 @@ discard block |
||
| 5232 | 5231 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5233 | 5232 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5234 | 5233 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5235 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5234 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5236 | 5235 | } |
| 5237 | 5236 | else { |
| 5238 | 5237 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5239 | 5238 | ksort($contexte); |
| 5240 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5239 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5241 | 5240 | } |
| 5242 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5241 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5243 | 5242 | |
| 5244 | 5243 | // mettre a jour le fichier si il n'existe pas |
| 5245 | 5244 | // ou trop ancien |
@@ -5247,8 +5246,8 @@ discard block |
||
| 5247 | 5246 | // et recopie sur le fichier cible uniquement si il change |
| 5248 | 5247 | if ( |
| 5249 | 5248 | !file_exists($filename) |
| 5250 | - or !file_exists($filename . '.last') |
|
| 5251 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5249 | + or !file_exists($filename.'.last') |
|
| 5250 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5252 | 5251 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5253 | 5252 | ) { |
| 5254 | 5253 | $contenu = $cache['texte']; |
@@ -5272,10 +5271,10 @@ discard block |
||
| 5272 | 5271 | } |
| 5273 | 5272 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5274 | 5273 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5275 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5274 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5276 | 5275 | } |
| 5277 | 5276 | // et ecrire le fichier si il change |
| 5278 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5277 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5279 | 5278 | } |
| 5280 | 5279 | |
| 5281 | 5280 | return timestamp($filename); |
@@ -5508,7 +5507,7 @@ discard block |
||
| 5508 | 5507 | if ($e > 0 and strlen($mid) > 8) { |
| 5509 | 5508 | $mid = '***...***'; |
| 5510 | 5509 | } |
| 5511 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5510 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5512 | 5511 | } |
| 5513 | 5512 | |
| 5514 | 5513 | |
@@ -5570,7 +5569,7 @@ discard block |
||
| 5570 | 5569 | case 'id': |
| 5571 | 5570 | case 'anchor': |
| 5572 | 5571 | if (preg_match(',^\d,', $texte)) { |
| 5573 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5572 | + $texte = substr($type, 0, 1).$texte; |
|
| 5574 | 5573 | } |
| 5575 | 5574 | } |
| 5576 | 5575 | |
@@ -5580,9 +5579,9 @@ discard block |
||
| 5580 | 5579 | |
| 5581 | 5580 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5582 | 5581 | if (preg_match(',^\d,', $texte)) { |
| 5583 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5582 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5584 | 5583 | } |
| 5585 | - $texte .= $separateur . md5($original); |
|
| 5584 | + $texte .= $separateur.md5($original); |
|
| 5586 | 5585 | $texte = substr($texte, 0, $longueur_mini); |
| 5587 | 5586 | } |
| 5588 | 5587 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $n = intval(sql_errno()); |
| 62 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 62 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 63 | 63 | |
| 64 | 64 | return $n ?: 1; |
| 65 | 65 | } |
@@ -110,19 +110,19 @@ discard block |
||
| 110 | 110 | // erreur SQL a afficher |
| 111 | 111 | $raison = minipres( |
| 112 | 112 | _T('info_travaux_titre'), |
| 113 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 113 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 114 | 114 | ); |
| 115 | 115 | } elseif (@$raison['statut']) { |
| 116 | 116 | // un simple visiteur n'a pas acces a l'espace prive |
| 117 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 117 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 118 | 118 | $est_connecte = (!empty($GLOBALS['visiteur_session']['login']) and !empty($GLOBALS['visiteur_session']['statut'])); // idem test balise #URL_LOGOUT |
| 119 | 119 | $raison = minipres( |
| 120 | 120 | _T('avis_erreur_connexion'), |
| 121 | 121 | _T('avis_erreur_visiteur') |
| 122 | 122 | // Lien vers le site public |
| 123 | - . '<br /><a href="' . url_de_base() . '">' . _T('login_retour_public') . '</a>' |
|
| 123 | + . '<br /><a href="'.url_de_base().'">'._T('login_retour_public').'</a>' |
|
| 124 | 124 | // Si la personne est connectée, lien de déconnexion ramenant vers la page de login |
| 125 | - . ($est_connecte ? ' | <a href="' . generer_url_public('', 'action=logout&logout=prive') . '">' . _T('icone_deconnecter') . '</a>' : '') |
|
| 125 | + . ($est_connecte ? ' | <a href="'.generer_url_public('', 'action=logout&logout=prive').'">'._T('icone_deconnecter').'</a>' : '') |
|
| 126 | 126 | ); |
| 127 | 127 | } else { |
| 128 | 128 | // auteur en fin de droits ... |
@@ -212,8 +212,7 @@ discard block |
||
| 212 | 212 | $where = (is_numeric($id_auteur) |
| 213 | 213 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 214 | 214 | ) ? |
| 215 | - "id_auteur=$id_auteur" : |
|
| 216 | - (!strlen($GLOBALS['connect_login']) ? '' : 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 215 | + "id_auteur=$id_auteur" : (!strlen($GLOBALS['connect_login']) ? '' : 'login='.sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 217 | 216 | |
| 218 | 217 | if (!$where) { |
| 219 | 218 | return ''; |
@@ -255,7 +254,7 @@ discard block |
||
| 255 | 254 | $GLOBALS['connect_login'] = $row['login']; |
| 256 | 255 | $GLOBALS['connect_statut'] = $row['statut']; |
| 257 | 256 | |
| 258 | - $GLOBALS['visiteur_session'] = array_merge((array)$GLOBALS['visiteur_session'], $row); |
|
| 257 | + $GLOBALS['visiteur_session'] = array_merge((array) $GLOBALS['visiteur_session'], $row); |
|
| 259 | 258 | |
| 260 | 259 | // au cas ou : ne pas memoriser les champs sensibles |
| 261 | 260 | unset($GLOBALS['visiteur_session']['pass']); |
@@ -327,7 +326,7 @@ discard block |
||
| 327 | 326 | * @return string |
| 328 | 327 | */ |
| 329 | 328 | function auth_a_loger() { |
| 330 | - $redirect = generer_url_public('login', 'url=' . rawurlencode(self('&', true)), true); |
|
| 329 | + $redirect = generer_url_public('login', 'url='.rawurlencode(self('&', true)), true); |
|
| 331 | 330 | |
| 332 | 331 | // un echec au "bonjour" (login initial) quand le statut est |
| 333 | 332 | // inconnu signale sans doute un probleme de cookies |
@@ -363,7 +362,7 @@ discard block |
||
| 363 | 362 | $date ??= date('Y-m-d H:i:s'); |
| 364 | 363 | |
| 365 | 364 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 366 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 365 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.intval($row['id_auteur'])); |
|
| 367 | 366 | $row['en_ligne'] = $date; |
| 368 | 367 | } |
| 369 | 368 | |
@@ -472,7 +471,7 @@ discard block |
||
| 472 | 471 | if ( |
| 473 | 472 | !$login |
| 474 | 473 | or !$login_base = auth_retrouver_login($login, $serveur) |
| 475 | - or !$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 474 | + or !$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 476 | 475 | ) { |
| 477 | 476 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 478 | 477 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
@@ -582,7 +581,7 @@ discard block |
||
| 582 | 581 | sql_updateq( |
| 583 | 582 | 'spip_auteurs', |
| 584 | 583 | ['prefs' => serialize($p)], |
| 585 | - 'id_auteur=' . intval($auteur['id_auteur']) |
|
| 584 | + 'id_auteur='.intval($auteur['id_auteur']) |
|
| 586 | 585 | ); |
| 587 | 586 | |
| 588 | 587 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -746,7 +745,7 @@ discard block |
||
| 746 | 745 | return false; |
| 747 | 746 | } |
| 748 | 747 | |
| 749 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 748 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 750 | 749 | |
| 751 | 750 | if (!$row) { |
| 752 | 751 | if ( |
@@ -801,11 +800,11 @@ discard block |
||
| 801 | 800 | $retour = $retour ?: _T('icone_retour'); |
| 802 | 801 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 803 | 802 | if ($url) { |
| 804 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 803 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 805 | 804 | } |
| 806 | 805 | |
| 807 | 806 | if ($lien) { |
| 808 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 807 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 809 | 808 | } |
| 810 | 809 | include_spip('inc/minipres'); |
| 811 | 810 | echo minipres($pb, $corps); |