@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 192 | + return $rejouer.(defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | // |
| 236 | 236 | if ($vcs = version_vcs_courante(_DIR_RACINE, true)) { |
| 237 | 237 | if ($vcs['vcs'] === 'GIT') { |
| 238 | - $url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit']; |
|
| 238 | + $url = 'https://git.spip.net/spip/spip/commit/'.$vcs['commit']; |
|
| 239 | 239 | } elseif ($vcs['vcs'] === 'SVN') { |
| 240 | - $url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit']; |
|
| 240 | + $url = 'https://core.spip.net/projects/spip/repository/revisions/'.$vcs['commit']; |
|
| 241 | 241 | } else { |
| 242 | 242 | $url = ''; |
| 243 | 243 | } |
@@ -247,21 +247,21 @@ discard block |
||
| 247 | 247 | $commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>"; |
| 248 | 248 | } |
| 249 | 249 | if ($vcs['branch']) { |
| 250 | - $commit = $vcs['branch'] . ': ' . $commit; |
|
| 250 | + $commit = $vcs['branch'].': '.$commit; |
|
| 251 | 251 | } |
| 252 | 252 | $version .= " {$vcs['vcs']} [$commit]"; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // et la version de l'ecran de securite |
| 256 | 256 | $secu = defined('_ECRAN_SECURITE') |
| 257 | - ? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 257 | + ? '<br />'._T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 258 | 258 | : ''; |
| 259 | 259 | |
| 260 | 260 | return _T( |
| 261 | 261 | 'info_copyright', |
| 262 | 262 | [ |
| 263 | 263 | 'spip' => "<b>SPIP $version</b> ", |
| 264 | - 'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html" class="aide popin">' . _T('info_copyright_gpl') . '</a>' |
|
| 264 | + 'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html" class="aide popin">'._T('info_copyright_gpl').'</a>' |
|
| 265 | 265 | ] |
| 266 | 266 | ) |
| 267 | 267 | . $secu; |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | $onfocus = ''; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; |
|
| 292 | - $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />"; |
|
| 291 | + $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"'.$onfocus.' />'; |
|
| 292 | + $form .= "<input type='image' src='".chemin_image('rechercher-20.png')."' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; |
|
| 293 | 293 | |
| 294 | - return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>'; |
|
| 294 | + return "<div class='spip_recherche'>".generer_form_ecrire($page, $form.$complement, " method='get'").'</div>'; |
|
| 295 | 295 | } |
@@ -118,13 +118,13 @@ |
||
| 118 | 118 | // generer un marqueur qui n'existe pas dans le texte |
| 119 | 119 | do { |
| 120 | 120 | $this->markId = substr(md5(uniqid(static::class, 1)), 0, 7); |
| 121 | - $this->markId = "@|".static::$markPrefix . $this->markId . "|"; |
|
| 121 | + $this->markId = "@|".static::$markPrefix.$this->markId."|"; |
|
| 122 | 122 | } while (strpos($texte, $this->markId) !== false); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $offset_pos = 0; |
| 126 | 126 | foreach ($collection as $c) { |
| 127 | - $rempl = $this->markId . base64_encode($c['raw']) . '|@'; |
|
| 127 | + $rempl = $this->markId.base64_encode($c['raw']).'|@'; |
|
| 128 | 128 | $texte = substr_replace($texte, $rempl, $c['pos'] + $offset_pos, $c['length']); |
| 129 | 129 | $offset_pos += strlen($rempl) - $c['length']; |
| 130 | 130 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | $offset_pos = 0; |
| 108 | 108 | foreach ($idiomes as $idiome) { |
| 109 | 109 | |
| 110 | - $cle = ($idiome['module'] ? $idiome['module'] . ':' : '') . $idiome['chaine']; |
|
| 110 | + $cle = ($idiome['module'] ? $idiome['module'].':' : '').$idiome['chaine']; |
|
| 111 | 111 | $desc = $traduire($cle, $lang, true); |
| 112 | 112 | $l = $desc->langue; |
| 113 | 113 | |
@@ -32,11 +32,10 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function __construct(?string $preg = null) { |
| 34 | 34 | |
| 35 | - $this->preg_modele = ($preg ?: |
|
| 36 | - '@<([a-z_-]{3,})' # <modele |
|
| 35 | + $this->preg_modele = ($preg ?: '@<([a-z_-]{3,})' # <modele |
|
| 37 | 36 | . '\s*([0-9]*)\s*' # id |
| 38 | 37 | . '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>) |
| 39 | - . '\s*/?' . '>@isS' # fin du modele > |
|
| 38 | + . '\s*/?'.'>@isS' # fin du modele > |
|
| 40 | 39 | ); |
| 41 | 40 | } |
| 42 | 41 | |
@@ -209,9 +209,9 @@ |
||
| 209 | 209 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 210 | 210 | include_spip('inc/texte'); |
| 211 | 211 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 212 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 212 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 213 | 213 | if ($mode === 'div') { |
| 214 | - $trad = rtrim($trad) . "\n\n"; |
|
| 214 | + $trad = rtrim($trad)."\n\n"; |
|
| 215 | 215 | } |
| 216 | 216 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 217 | 217 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -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,12 +68,12 @@ discard block |
||
| 68 | 68 | function spip_balisage_code(string $corps, bool $bloc = false, string $attributs = '', string $langage = '') { |
| 69 | 69 | |
| 70 | 70 | $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! |
| 71 | - $class = "spip_code " . ($bloc ? 'spip_code_block' : 'spip_code_inline'); |
|
| 71 | + $class = "spip_code ".($bloc ? 'spip_code_block' : 'spip_code_inline'); |
|
| 72 | 72 | if ($langage) { |
| 73 | 73 | $class .= " language-$langage"; |
| 74 | 74 | } |
| 75 | 75 | if ($attributs) { |
| 76 | - $attributs = " " . trim($attributs); |
|
| 76 | + $attributs = " ".trim($attributs); |
|
| 77 | 77 | } |
| 78 | 78 | if ($bloc) { |
| 79 | 79 | $html = "<div class=\"precode\">" |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | else { |
| 88 | 88 | $echap = str_replace("\t", " ", $echap); |
| 89 | 89 | $echap = str_replace(" ", " ", $echap); |
| 90 | - $html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>'; |
|
| 90 | + $html = "<code class=\"$class\" dir=\"ltr\"$attributs>".$echap.'</code>'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $html; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (!defined('_BALISES_BLOCS_REGEXP')) { |
| 108 | - define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS'); |
|
| 108 | + define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // Tester si on echappe en span ou en div |
| 124 | 124 | if (is_null($mode) or !in_array($mode, ['div', 'span'])) { |
| 125 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 125 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // Decouper en morceaux, base64 a des probleme selon la taille de la pile |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ) { |
| 158 | 158 | foreach ($matches as $m) { |
| 159 | 159 | if ($m[1] === 'code') { |
| 160 | - $code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>'; |
|
| 160 | + $code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>'; |
|
| 161 | 161 | $pre = str_replace($m[0], $code, $pre); |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // Echapper les <code>...</ code> |
| 169 | 169 | function traiter_echap_code_dist($regs, $options = []) { |
| 170 | - [, , $att, $corps] = $regs; |
|
| 170 | + [,, $att, $corps] = $regs; |
|
| 171 | 171 | |
| 172 | 172 | // ne pas mettre le <div...> s'il n'y a qu'une ligne |
| 173 | 173 | if (strpos($corps, "\n") !== false) { |
@@ -251,11 +251,11 @@ discard block |
||
| 251 | 251 | else { |
| 252 | 252 | $callback_secure_prefix = ($callback_options['secure_prefix'] ?? ''); |
| 253 | 253 | if ( |
| 254 | - function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 255 | - or function_exists($f = $f . '_dist') |
|
| 254 | + function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 255 | + or function_exists($f = $f.'_dist') |
|
| 256 | 256 | or ($callback_secure_prefix and ( |
| 257 | - function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 258 | - or function_exists($f = $f . '_dist') |
|
| 257 | + function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 258 | + or function_exists($f = $f.'_dist') |
|
| 259 | 259 | )) |
| 260 | 260 | ) { |
| 261 | 261 | $echap = $f($regs, $callback_options); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // dans une callback autonommee |
| 278 | 278 | if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) { |
| 279 | 279 | if ( |
| 280 | - strpos($letexte, '<' . '?') !== false and preg_match_all( |
|
| 280 | + strpos($letexte, '<'.'?') !== false and preg_match_all( |
|
| 281 | 281 | ',<[?].*($|[?]>),UisS', |
| 282 | 282 | $letexte, |
| 283 | 283 | $matches, |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | strpos($letexte, '<') !== false |
| 310 | 310 | and |
| 311 | 311 | preg_match_all( |
| 312 | - ',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 312 | + ',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 313 | 313 | $letexte, |
| 314 | 314 | $regs, |
| 315 | 315 | PREG_SET_ORDER |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | if ($at) { |
| 329 | - $rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>'; |
|
| 329 | + $rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>'; |
|
| 330 | 330 | foreach ($at as $attr => $a) { |
| 331 | 331 | $rempl = inserer_attribut($rempl, $attr, $a); |
| 332 | 332 | } |
@@ -407,8 +407,8 @@ discard block |
||
| 407 | 407 | $texte = nettoyer_raccourcis_typo($texte); |
| 408 | 408 | |
| 409 | 409 | // balises de sauts de ligne et paragraphe |
| 410 | - $texte = preg_replace('/<p( [^>]*)?' . '>/', "\r", $texte); |
|
| 411 | - $texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte); |
|
| 410 | + $texte = preg_replace('/<p( [^>]*)?'.'>/', "\r", $texte); |
|
| 411 | + $texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte); |
|
| 412 | 412 | |
| 413 | 413 | // on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier |
| 414 | 414 | $texte = str_replace("\n\n", "\r", $texte); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | // supprimer les tags |
| 417 | 417 | $texte = supprimer_tags($texte); |
| 418 | 418 | $texte = trim(str_replace("\n", ' ', $texte)); |
| 419 | - $texte .= "\n"; // marquer la fin |
|
| 419 | + $texte .= "\n"; // marquer la fin |
|
| 420 | 420 | |
| 421 | 421 | // corriger la longueur de coupe |
| 422 | 422 | // en fonction de la presence de caracteres utf |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | // couper au mot precedent |
| 432 | 432 | $long = spip_substr($texte, 0, max($taille - 4, 1)); |
| 433 | 433 | $u = $GLOBALS['meta']['pcre_u']; |
| 434 | - $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 434 | + $court = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 435 | 435 | if (is_null($suite)) { |
| 436 | 436 | $suite = (defined('_COUPER_SUITE') ? _COUPER_SUITE : ' (...)'); |
| 437 | 437 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | if (spip_strlen($court) < max(0.75 * $taille, 2)) { |
| 442 | 442 | $points = ''; |
| 443 | 443 | $long = spip_substr($texte, 0, $taille); |
| 444 | - $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/" . $u, "\\1", $long); |
|
| 444 | + $texte = preg_replace("/([^\s][\s]+)[^\s]*\n?$/".$u, "\\1", $long); |
|
| 445 | 445 | // encore trop court ? couper au caractere |
| 446 | 446 | if (spip_strlen($texte) < 0.75 * $taille) { |
| 447 | 447 | $texte = $long; |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | // supprimer l'eventuelle entite finale mal coupee |
| 461 | 461 | $texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte); |
| 462 | 462 | |
| 463 | - return quote_amp(trim($texte)) . $points; |
|
| 463 | + return quote_amp(trim($texte)).$points; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | |
@@ -472,16 +472,16 @@ discard block |
||
| 472 | 472 | define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 473 | 473 | } |
| 474 | 474 | foreach ($r as $regs) { |
| 475 | - $t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
|
| 475 | + $t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t); |
|
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | - if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 478 | + if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 479 | 479 | if (!defined('_PROTEGE_PHP_MODELES')) { |
| 480 | 480 | include_spip('inc/acces'); |
| 481 | 481 | define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 482 | 482 | } |
| 483 | 483 | foreach ($r as $regs) { |
| 484 | - $t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
|
| 484 | + $t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t); |
|
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | } |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | if (!empty($options['wrap_suspect'])) { |
| 600 | 600 | $texte = wrap($texte, $options['wrap_suspect']); |
| 601 | 601 | } |
| 602 | - $texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte; |
|
| 602 | + $texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | $texte = $collecteurModeles->retablir($texte); |
@@ -746,11 +746,11 @@ discard block |
||
| 746 | 746 | **/ |
| 747 | 747 | function supprime_img($letexte, $message = null) { |
| 748 | 748 | if ($message === null) { |
| 749 | - $message = '(' . _T('img_indisponible') . ')'; |
|
| 749 | + $message = '('._T('img_indisponible').')'; |
|
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | return preg_replace( |
| 753 | - ',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i', |
|
| 753 | + ',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i', |
|
| 754 | 754 | $message, |
| 755 | 755 | $letexte |
| 756 | 756 | ); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * Pour plus de détails voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | # ou est l'espace prive ? |
| 16 | 16 | if (!defined('_DIR_RESTREINT_ABS')) { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 125 | 125 | if ($var !== 1) { |
| 126 | 126 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 127 | - . $val . ($echap ? ") . '" : ' '); |
|
| 127 | + . $val.($echap ? ") . '" : ' '); |
|
| 128 | 128 | } else { |
| 129 | 129 | $val = $echap ? "'.$val.'" : $val; |
| 130 | 130 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if (!$lang) { |
| 146 | 146 | $lang = '$GLOBALS["spip_lang"]'; |
| 147 | 147 | } |
| 148 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 148 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 149 | 149 | |
| 150 | 150 | return $l; |
| 151 | 151 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 176 | 176 | if (is_string($p->texte)) { |
| 177 | 177 | $fichier = $p->texte; |
| 178 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 178 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 179 | 179 | } else { |
| 180 | 180 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 181 | 181 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return false; |
| 225 | 225 | } // j'aurais voulu toucher le fond ... |
| 226 | 226 | |
| 227 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 227 | + $contexte = 'array('.$_contexte.')'; |
|
| 228 | 228 | |
| 229 | 229 | if ($env) { |
| 230 | 230 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -239,16 +239,16 @@ discard block |
||
| 239 | 239 | $_options[] = $ajax; |
| 240 | 240 | } |
| 241 | 241 | $code = " ' . argumenter_squelette($code) . '"; |
| 242 | - $code = 'echo ' . sprintf( |
|
| 242 | + $code = 'echo '.sprintf( |
|
| 243 | 243 | CODE_RECUPERER_FOND, |
| 244 | 244 | $code, |
| 245 | 245 | $contexte, |
| 246 | 246 | implode(',', $_options), |
| 247 | 247 | "_request(\\'connect\\') ?? \\'\\'" |
| 248 | - ) . ';'; |
|
| 248 | + ).';'; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 251 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $id = $id_table; |
| 329 | 329 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 330 | 330 | } |
| 331 | - $mstatut = $id . '.' . $statut; |
|
| 331 | + $mstatut = $id.'.'.$statut; |
|
| 332 | 332 | |
| 333 | 333 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 334 | 334 | include_spip('public/quete'); |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | isset($s['post_date']) and $s['post_date'] |
| 337 | 337 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 338 | 338 | ) { |
| 339 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 339 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 340 | 340 | array_unshift( |
| 341 | 341 | $boucle->where, |
| 342 | 342 | $echapper ? |
| 343 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 343 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 344 | 344 | : |
| 345 | 345 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 346 | 346 | ); |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | $boucle->where, |
| 350 | 350 | $echapper ? |
| 351 | 351 | "\nquete_condition_statut('$mstatut'," |
| 352 | - . _q($s['previsu']) . ',' |
|
| 353 | - . _q($s['publie']) . ',' |
|
| 354 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 352 | + . _q($s['previsu']).',' |
|
| 353 | + . _q($s['publie']).',' |
|
| 354 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 355 | 355 | : |
| 356 | 356 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 357 | 357 | ); |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | if (_request('var_mode_affiche') != 'resultat') { |
| 386 | 386 | $trace = ''; |
| 387 | 387 | } else { |
| 388 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 388 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 389 | 389 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 390 | 390 | $trace = " |
| 391 | 391 | if (empty($_trace)) { |
| 392 | 392 | $_trace = []; |
| 393 | 393 | } |
| 394 | 394 | if (count($_trace) < 3) { |
| 395 | - $_trace" . '[] = $t0; |
|
| 395 | + $_trace".'[] = $t0; |
|
| 396 | 396 | }'; |
| 397 | 397 | } |
| 398 | 398 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | return |
| 427 | 427 | // Numrows[$nom] peut ne pas être encore defini |
| 428 | 428 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 429 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 429 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 430 | 430 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 431 | 431 | . $trace |
| 432 | 432 | . "\n\treturn \$t0;"; |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 495 | 495 | // et puis faire un [] plutot qu'un "','." |
| 496 | 496 | if ($boucle->doublons) { |
| 497 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 497 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 498 | 498 | index_pile($id_boucle, $primary, $boucles) |
| 499 | 499 | . "; // doublons\n"; |
| 500 | 500 | } |
@@ -522,13 +522,13 @@ discard block |
||
| 522 | 522 | $corps .= |
| 523 | 523 | "\n\t\tlang_select_public(" |
| 524 | 524 | . index_pile($id_boucle, 'lang', $boucles) |
| 525 | - . ", '" . $boucle->lang_select . "'" |
|
| 525 | + . ", '".$boucle->lang_select."'" |
|
| 526 | 526 | . (in_array($type_boucle, [ |
| 527 | 527 | 'articles', |
| 528 | 528 | 'rubriques', |
| 529 | 529 | 'hierarchie', |
| 530 | 530 | 'breves' |
| 531 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 531 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 532 | 532 | . ');'; |
| 533 | 533 | } else { |
| 534 | 534 | $init_lang = ''; |
@@ -550,20 +550,16 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // gestion optimale des separateurs et des boucles constantes |
| 552 | 552 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 553 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 553 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | $corps .= |
| 557 | 557 | ((!$boucle->separateur) ? |
| 558 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 559 | - (($return === "''") ? '' : |
|
| 560 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 561 | - ("\n\t\t\$t1 " . |
|
| 558 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 562 | 559 | ((strpos($return, '$t1.') === 0) ? |
| 563 | - ('.=' . substr($return, 4)) : |
|
| 564 | - ('= ' . $return)) . |
|
| 565 | - ";\n\t\t" . |
|
| 566 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 560 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 561 | + ";\n\t\t". |
|
| 562 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 567 | 563 | |
| 568 | 564 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 569 | 565 | // souhaite invalider ces elements |
@@ -645,7 +641,7 @@ discard block |
||
| 645 | 641 | $corps, |
| 646 | 642 | $fin_lang, |
| 647 | 643 | $trace, |
| 648 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 644 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 649 | 645 | ); |
| 650 | 646 | |
| 651 | 647 | return $a; |
@@ -665,25 +661,24 @@ discard block |
||
| 665 | 661 | **/ |
| 666 | 662 | function calculer_requete_sql($boucle) { |
| 667 | 663 | $init = []; |
| 668 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 669 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 664 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 665 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 670 | 666 | # En absence de champ c'est un decompte : |
| 671 | 667 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 672 | 668 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 673 | 669 | $init[] = calculer_dec( |
| 674 | 670 | 'groupby', |
| 675 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 671 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 676 | 672 | ); |
| 677 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 678 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 673 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 674 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 679 | 675 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 680 | 676 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 681 | 677 | $init[] = calculer_dec( |
| 682 | 678 | 'limit', |
| 683 | 679 | ( |
| 684 | 680 | strpos($boucle->limit, 'intval') === false ? |
| 685 | - "'" . ($boucle->limit) . "'" : |
|
| 686 | - $boucle->limit |
|
| 681 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 687 | 682 | ) |
| 688 | 683 | ); |
| 689 | 684 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -692,17 +687,17 @@ discard block |
||
| 692 | 687 | // ou recalculée à chaque passage (vide) |
| 693 | 688 | foreach ($init as $i) { |
| 694 | 689 | if (reset($i)) { |
| 695 | - $s .= "\n\t\t" . end($i); |
|
| 690 | + $s .= "\n\t\t".end($i); |
|
| 696 | 691 | } # statique |
| 697 | 692 | else { |
| 698 | - $d .= "\n\t" . end($i); |
|
| 693 | + $d .= "\n\t".end($i); |
|
| 699 | 694 | } # dynamique |
| 700 | 695 | } |
| 701 | 696 | |
| 702 | 697 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 703 | 698 | . $boucle->in |
| 704 | 699 | . $boucle->hash |
| 705 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 700 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 706 | 701 | . $s |
| 707 | 702 | . "\n\t}" |
| 708 | 703 | . $d; |
@@ -757,7 +752,7 @@ discard block |
||
| 757 | 752 | ]; |
| 758 | 753 | |
| 759 | 754 | $p->id_boucle = $context_compil[2] ?? ''; |
| 760 | - $p->ligne = (int)($context_compil[3] ?? 0); |
|
| 755 | + $p->ligne = (int) ($context_compil[3] ?? 0); |
|
| 761 | 756 | $p->lang = $context_compil[4] ?? ''; |
| 762 | 757 | |
| 763 | 758 | return $p; |
@@ -786,7 +781,7 @@ discard block |
||
| 786 | 781 | * - index 1 : Code de l'affectation |
| 787 | 782 | **/ |
| 788 | 783 | function calculer_dec($nom, $val) { |
| 789 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 784 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 790 | 785 | // si une variable apparait dans le calcul de la clause |
| 791 | 786 | // il faut la re-evaluer a chaque passage |
| 792 | 787 | if ( |
@@ -803,7 +798,7 @@ discard block |
||
| 803 | 798 | $static = ''; |
| 804 | 799 | } |
| 805 | 800 | |
| 806 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 801 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 807 | 802 | } |
| 808 | 803 | |
| 809 | 804 | /** |
@@ -828,27 +823,27 @@ discard block |
||
| 828 | 823 | } |
| 829 | 824 | $res = ''; |
| 830 | 825 | if ($a and $a[0] == "'?'") { |
| 831 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 832 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 833 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 826 | + return ('('.calculer_dump_array($a[1]). |
|
| 827 | + ' ? '.calculer_dump_array($a[2]). |
|
| 828 | + ' : '.calculer_dump_array($a[3]). |
|
| 834 | 829 | ')'); |
| 835 | 830 | } else { |
| 836 | 831 | foreach ($a as $k => $v) { |
| 837 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 838 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 832 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 833 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 839 | 834 | } |
| 840 | 835 | |
| 841 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 836 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 842 | 837 | } |
| 843 | 838 | } |
| 844 | 839 | |
| 845 | 840 | function calculer_dump_join($a) { |
| 846 | 841 | $res = ''; |
| 847 | 842 | foreach ($a as $k => $v) { |
| 848 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 843 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 849 | 844 | } |
| 850 | 845 | |
| 851 | - return 'array(' . substr($res, 2) . ')'; |
|
| 846 | + return 'array('.substr($res, 2).')'; |
|
| 852 | 847 | } |
| 853 | 848 | |
| 854 | 849 | /** |
@@ -865,7 +860,7 @@ discard block |
||
| 865 | 860 | $res .= ",'$k' => '$v'"; |
| 866 | 861 | } |
| 867 | 862 | |
| 868 | - return 'array(' . substr($res, 1) . ')'; |
|
| 863 | + return 'array('.substr($res, 1).')'; |
|
| 869 | 864 | } |
| 870 | 865 | |
| 871 | 866 | /** |
@@ -883,7 +878,7 @@ discard block |
||
| 883 | 878 | $res .= ",'$k' => '$v'"; |
| 884 | 879 | } |
| 885 | 880 | |
| 886 | - return 'array(' . substr($res, 1) . ')'; |
|
| 881 | + return 'array('.substr($res, 1).')'; |
|
| 887 | 882 | } |
| 888 | 883 | |
| 889 | 884 | function calculer_order(&$boucle) { |
@@ -952,19 +947,19 @@ discard block |
||
| 952 | 947 | ) { |
| 953 | 948 | $res .= " .\n$tab$code"; |
| 954 | 949 | } else { |
| 955 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 950 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 956 | 951 | } |
| 957 | 952 | } |
| 958 | 953 | |
| 959 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 954 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 960 | 955 | } |
| 961 | 956 | } else { |
| 962 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 957 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 963 | 958 | |
| 964 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 959 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 965 | 960 | " ,\n$tab", |
| 966 | 961 | $codes |
| 967 | - ) . ')))'; |
|
| 962 | + ).')))'; |
|
| 968 | 963 | } |
| 969 | 964 | } |
| 970 | 965 | |
@@ -1000,7 +995,7 @@ discard block |
||
| 1000 | 995 | // texte seul |
| 1001 | 996 | case 'texte': |
| 1002 | 997 | $code = sandbox_composer_texte($p->texte, $p); |
| 1003 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 998 | + $commentaire = strlen($p->texte).' signes'; |
|
| 1004 | 999 | $avant = ''; |
| 1005 | 1000 | $apres = ''; |
| 1006 | 1001 | $altern = "''"; |
@@ -1009,14 +1004,14 @@ discard block |
||
| 1009 | 1004 | case 'polyglotte': |
| 1010 | 1005 | $code = ''; |
| 1011 | 1006 | foreach ($p->traductions as $k => $v) { |
| 1012 | - $code .= ",'" . |
|
| 1013 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1014 | - "' => '" . |
|
| 1015 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 1007 | + $code .= ",'". |
|
| 1008 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 1009 | + "' => '". |
|
| 1010 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1016 | 1011 | "'"; |
| 1017 | 1012 | } |
| 1018 | - $code = 'choisir_traduction(array(' . |
|
| 1019 | - substr($code, 1) . |
|
| 1013 | + $code = 'choisir_traduction(array('. |
|
| 1014 | + substr($code, 1). |
|
| 1020 | 1015 | '))'; |
| 1021 | 1016 | $commentaire = '&'; |
| 1022 | 1017 | $avant = ''; |
@@ -1032,7 +1027,7 @@ discard block |
||
| 1032 | 1027 | $err_e_c = true; |
| 1033 | 1028 | $code = "''"; |
| 1034 | 1029 | } else { |
| 1035 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1030 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1036 | 1031 | $avant = ''; |
| 1037 | 1032 | $apres = ''; |
| 1038 | 1033 | $altern = "''"; |
@@ -1061,8 +1056,8 @@ discard block |
||
| 1061 | 1056 | $err_e_c = true; |
| 1062 | 1057 | $code = "''"; |
| 1063 | 1058 | } else { |
| 1064 | - $code = 'BOUCLE' . |
|
| 1065 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1059 | + $code = 'BOUCLE'. |
|
| 1060 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1066 | 1061 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1067 | 1062 | $commentaire = "?$nom"; |
| 1068 | 1063 | if ( |
@@ -1104,24 +1099,22 @@ discard block |
||
| 1104 | 1099 | foreach ($p->arg as $k => $v) { |
| 1105 | 1100 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1106 | 1101 | if ($k) { |
| 1107 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1102 | + $l[] = _q($k).' => '.$_v; |
|
| 1108 | 1103 | } else { |
| 1109 | 1104 | $code = $_v; |
| 1110 | 1105 | } |
| 1111 | 1106 | } |
| 1112 | 1107 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1113 | 1108 | if ($p->module) { |
| 1114 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1109 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1115 | 1110 | } elseif ($p->nom_champ) { |
| 1116 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1111 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1117 | 1112 | } else { |
| 1118 | 1113 | $m = ''; |
| 1119 | 1114 | } |
| 1120 | 1115 | |
| 1121 | - $code = (!$code ? "'$m'" : |
|
| 1122 | - ($m ? "'$m' . $code" : |
|
| 1123 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1124 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1116 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1117 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1125 | 1118 | $code = "_T($code)"; |
| 1126 | 1119 | if ($p->param) { |
| 1127 | 1120 | $p->id_boucle = $id_boucle; |
@@ -1143,7 +1136,7 @@ discard block |
||
| 1143 | 1136 | $p->type_requete = $type; |
| 1144 | 1137 | |
| 1145 | 1138 | $code = calculer_champ($p); |
| 1146 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1139 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1147 | 1140 | $avant = calculer_liste( |
| 1148 | 1141 | $p->avant, |
| 1149 | 1142 | $descr, |
@@ -1183,10 +1176,9 @@ discard block |
||
| 1183 | 1176 | if ($code != "''") { |
| 1184 | 1177 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1185 | 1178 | $codes[] = (($mode == 'validation') ? |
| 1186 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1179 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1187 | 1180 | : (($mode == 'code') ? |
| 1188 | - "\n// $commentaire\n$code" : |
|
| 1189 | - $code)); |
|
| 1181 | + "\n// $commentaire\n$code" : $code)); |
|
| 1190 | 1182 | } |
| 1191 | 1183 | } // foreach |
| 1192 | 1184 | |
@@ -1242,19 +1234,19 @@ discard block |
||
| 1242 | 1234 | $cond = ''; |
| 1243 | 1235 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1244 | 1236 | $t = $r[2]; |
| 1245 | - $cond = '!' . $r[1]; |
|
| 1237 | + $cond = '!'.$r[1]; |
|
| 1246 | 1238 | } else { |
| 1247 | 1239 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1248 | 1240 | $t = $r[2]; |
| 1249 | 1241 | $cond = $r[1]; |
| 1250 | 1242 | } else { |
| 1251 | - $t = '$t' . $n; |
|
| 1243 | + $t = '$t'.$n; |
|
| 1252 | 1244 | $cond = "($t = $code)!==''"; |
| 1253 | 1245 | } |
| 1254 | 1246 | } |
| 1255 | 1247 | |
| 1256 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1257 | - $t . |
|
| 1248 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1249 | + $t. |
|
| 1258 | 1250 | (!$apres ? '' : " . $apres"); |
| 1259 | 1251 | |
| 1260 | 1252 | if ($res !== $t) { |
@@ -1305,12 +1297,12 @@ discard block |
||
| 1305 | 1297 | |
| 1306 | 1298 | // rendre inertes les echappements de #[](){}<> |
| 1307 | 1299 | $i = 0; |
| 1308 | - while (str_contains($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1300 | + while (str_contains($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1309 | 1301 | $i++; |
| 1310 | 1302 | } |
| 1311 | 1303 | $squelette = preg_replace_callback( |
| 1312 | 1304 | ',\\\\([#[()\]{}<>]),', |
| 1313 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1305 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1314 | 1306 | $squelette, |
| 1315 | 1307 | -1, |
| 1316 | 1308 | $esc |
@@ -1326,7 +1318,7 @@ discard block |
||
| 1326 | 1318 | // Phraser le squelette, selon sa grammaire |
| 1327 | 1319 | |
| 1328 | 1320 | $boucles = []; |
| 1329 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1321 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1330 | 1322 | |
| 1331 | 1323 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1332 | 1324 | |
@@ -1342,7 +1334,7 @@ discard block |
||
| 1342 | 1334 | ); |
| 1343 | 1335 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1344 | 1336 | ",$inerte-(\d+)-,", |
| 1345 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1337 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1346 | 1338 | $boucle->descr['squelette'] |
| 1347 | 1339 | ); |
| 1348 | 1340 | } |
@@ -1353,19 +1345,19 @@ discard block |
||
| 1353 | 1345 | include_spip('public/decompiler'); |
| 1354 | 1346 | foreach ($boucles as $id => $boucle) { |
| 1355 | 1347 | if ($id) { |
| 1356 | - $decomp = "\n/* BOUCLE " . |
|
| 1357 | - $boucle->type_requete . |
|
| 1358 | - ' ' . |
|
| 1359 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1360 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1348 | + $decomp = "\n/* BOUCLE ". |
|
| 1349 | + $boucle->type_requete. |
|
| 1350 | + ' '. |
|
| 1351 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1352 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1361 | 1353 | " */\n"; |
| 1362 | 1354 | } else { |
| 1363 | - $decomp = ("\n/*\n" . |
|
| 1355 | + $decomp = ("\n/*\n". |
|
| 1364 | 1356 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1365 | 1357 | . "\n*/"); |
| 1366 | 1358 | } |
| 1367 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1368 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1359 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1360 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1369 | 1361 | } |
| 1370 | 1362 | } |
| 1371 | 1363 | |
@@ -1388,7 +1380,7 @@ discard block |
||
| 1388 | 1380 | } |
| 1389 | 1381 | } |
| 1390 | 1382 | foreach ($boucles as $id => $boucle) { |
| 1391 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1383 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1392 | 1384 | } |
| 1393 | 1385 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1394 | 1386 | |
@@ -1479,8 +1471,7 @@ discard block |
||
| 1479 | 1471 | } else { |
| 1480 | 1472 | $boucles[$id]->type_requete = false; |
| 1481 | 1473 | $boucle = $boucles[$id]; |
| 1482 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1483 | - ($boucle->sql_serveur . ':')) . |
|
| 1474 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1484 | 1475 | $type; |
| 1485 | 1476 | $msg = [ |
| 1486 | 1477 | 'zbug_table_inconnue', |
@@ -1570,13 +1561,13 @@ discard block |
||
| 1570 | 1561 | if ( |
| 1571 | 1562 | // fonction de boucle avec serveur & table |
| 1572 | 1563 | (!$serveur or |
| 1573 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1574 | - and (!function_exists($f = $f . '_dist')) |
|
| 1564 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1565 | + and (!function_exists($f = $f.'_dist')) |
|
| 1575 | 1566 | ) |
| 1576 | 1567 | ) |
| 1577 | 1568 | // fonction de boucle avec table |
| 1578 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1579 | - and (!function_exists($f = $f . '_dist')) |
|
| 1569 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1570 | + and (!function_exists($f = $f.'_dist')) |
|
| 1580 | 1571 | ) { |
| 1581 | 1572 | // fonction de boucle standard |
| 1582 | 1573 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1584,20 +1575,20 @@ discard block |
||
| 1584 | 1575 | } |
| 1585 | 1576 | } |
| 1586 | 1577 | |
| 1587 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1588 | - "static \$connect;\n\t" . |
|
| 1589 | - "\$command['connect'] = \$connect = " . |
|
| 1590 | - _q($boucle->sql_serveur) . |
|
| 1591 | - ';' . |
|
| 1578 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1579 | + "static \$connect;\n\t". |
|
| 1580 | + "\$command['connect'] = \$connect = ". |
|
| 1581 | + _q($boucle->sql_serveur). |
|
| 1582 | + ';'. |
|
| 1592 | 1583 | $f($id, $boucles); |
| 1593 | 1584 | } else { |
| 1594 | 1585 | $req = ("\n\treturn '';"); |
| 1595 | 1586 | } |
| 1596 | 1587 | |
| 1597 | 1588 | $boucles[$id]->return = |
| 1598 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1599 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1600 | - $req . |
|
| 1589 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1590 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1591 | + $req. |
|
| 1601 | 1592 | "\n}\n"; |
| 1602 | 1593 | } |
| 1603 | 1594 | |
@@ -1607,7 +1598,7 @@ discard block |
||
| 1607 | 1598 | return false; |
| 1608 | 1599 | } |
| 1609 | 1600 | |
| 1610 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1601 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1611 | 1602 | ' |
| 1612 | 1603 | // reporter de maniere securisee les doublons inclus |
| 1613 | 1604 | . ' |
@@ -1615,15 +1606,15 @@ discard block |
||
| 1615 | 1606 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1616 | 1607 | |
| 1617 | 1608 | $connect = ' . |
| 1618 | - _q($connect) . '; |
|
| 1609 | + _q($connect).'; |
|
| 1619 | 1610 | $page = ' . |
| 1620 | 1611 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1621 | 1612 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1622 | 1613 | // avant de referencer $Cache |
| 1623 | - $corps . '; |
|
| 1614 | + $corps.'; |
|
| 1624 | 1615 | |
| 1625 | 1616 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1626 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1617 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1627 | 1618 | }'; |
| 1628 | 1619 | |
| 1629 | 1620 | $secondes = spip_timer('calcul_skel'); |
@@ -1637,10 +1628,10 @@ discard block |
||
| 1637 | 1628 | $code->return = ' |
| 1638 | 1629 | // |
| 1639 | 1630 | // Fonction principale du squelette ' . |
| 1640 | - $sourcefile . |
|
| 1641 | - ($connect ? " pour $connect" : '') . |
|
| 1642 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1643 | - "\n//\n" . |
|
| 1631 | + $sourcefile. |
|
| 1632 | + ($connect ? " pour $connect" : ''). |
|
| 1633 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1634 | + "\n//\n". |
|
| 1644 | 1635 | $principal; |
| 1645 | 1636 | |
| 1646 | 1637 | $boucles[''] = $code; |
@@ -1692,7 +1683,7 @@ discard block |
||
| 1692 | 1683 | **/ |
| 1693 | 1684 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1694 | 1685 | include_spip('iterateur/data'); |
| 1695 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1686 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1696 | 1687 | $g = charger_fonction('data', 'iterateur'); |
| 1697 | 1688 | $boucles[$id] = $g($boucle); |
| 1698 | 1689 | // from[0] stocke le type de data (rss, yql, ...) |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $select = true |
| 128 | 128 | ) { |
| 129 | 129 | if (!is_string($defaut)) { |
| 130 | - $defaut = '($Pile[0][\'' . strtolower($nom_champ) . '\'] ?? null)'; |
|
| 130 | + $defaut = '($Pile[0][\''.strtolower($nom_champ).'\'] ?? null)'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $idb_origine = $idb; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | // renseigner la boucle source de ce champ pour les traitements |
| 162 | 162 | $boucles[$idb_origine]->index_champ[$nom_champ_origine] = $idb; |
| 163 | - $champ = '$Pile[$SP' . ($i ? "-$i" : '') . '][\'' . $c . '\']'; |
|
| 163 | + $champ = '$Pile[$SP'.($i ? "-$i" : '').'][\''.$c.'\']'; |
|
| 164 | 164 | if (!$joker) { |
| 165 | 165 | return index_compose($conditionnel, $champ); |
| 166 | 166 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | function index_compose($conditionnel, $defaut) { |
| 202 | 202 | while ($c = array_pop($conditionnel)) { |
| 203 | 203 | // si on passe defaut = '', ne pas générer d'erreur de compilation. |
| 204 | - $defaut = "($c:(" . ($defaut ?: "''") . '))'; |
|
| 204 | + $defaut = "($c:(".($defaut ?: "''").'))'; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $defaut; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | if (!$r) { |
| 249 | 249 | $joker = false; // indiquer a l'appelant |
| 250 | 250 | # continuer pour chercher l'erreur suivante |
| 251 | - return ["'#" . $r . ':' . $nom_champ . "'", '']; |
|
| 251 | + return ["'#".$r.':'.$nom_champ."'", '']; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $desc = $boucles[$idb]->show; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if (preg_match('/^(.*)\.(.*)$/', $nom_champ, $r)) { |
| 292 | 292 | [, $_table, $_nom_champ] = $r; |
| 293 | 293 | if ($cle = trouver_jointure_champ($_nom_champ, $boucles[$idb], [$_table])) { |
| 294 | - $_alias = $cle . '_' . $_nom_champ; |
|
| 294 | + $_alias = $cle.'_'.$_nom_champ; |
|
| 295 | 295 | return index_exception( |
| 296 | 296 | $boucles[$idb], |
| 297 | 297 | $desc, |
@@ -371,8 +371,8 @@ discard block |
||
| 371 | 371 | $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep); |
| 372 | 372 | } |
| 373 | 373 | if ($t == null) { |
| 374 | - [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | - $excep = $x; #PHP5 de droite a gauche ! |
|
| 374 | + [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | + $excep = $x; #PHP5 de droite a gauche ! |
|
| 376 | 376 | $j = $trouver_table($e, $boucle->sql_serveur); |
| 377 | 377 | if (!$j) { |
| 378 | 378 | return ['', '']; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $l = (preg_split('/\s*,\s*/', $k)); |
| 385 | 385 | $k = $desc['key']['PRIMARY KEY']; |
| 386 | 386 | if (!in_array($k, $l)) { |
| 387 | - spip_log("jointure impossible $e " . join(',', $l)); |
|
| 387 | + spip_log("jointure impossible $e ".join(',', $l)); |
|
| 388 | 388 | |
| 389 | 389 | return ['', '']; |
| 390 | 390 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // demander a SQL de gerer le synonyme |
| 401 | 401 | // ca permet que excep soit dynamique (Cedric, 2/3/06) |
| 402 | 402 | if ($excep != $nom_champ) { |
| 403 | - $excep .= ' AS ' . $nom_champ; |
|
| 403 | + $excep .= ' AS '.$nom_champ; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | return ["$t.$excep", $nom_champ]; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | join(',', $collecte), |
| 655 | 655 | ($collecte ? $param : substr($param, 1)), # virer la virgule |
| 656 | 656 | memoriser_contexte_compil($p), |
| 657 | - (!$supp ? '' : (', ' . join(',', $supp))) |
|
| 657 | + (!$supp ? '' : (', '.join(',', $supp))) |
|
| 658 | 658 | ); |
| 659 | 659 | |
| 660 | 660 | $p->interdire_scripts = false; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | * @return array |
| 689 | 689 | * Liste des codes PHP d'éxecution des balises collectées |
| 690 | 690 | **/ |
| 691 | -function collecter_balise_dynamique(array $l, Champ &$p, string $nom): array { |
|
| 691 | +function collecter_balise_dynamique(array $l, Champ & $p, string $nom): array { |
|
| 692 | 692 | $args = []; |
| 693 | 693 | foreach ($l as $c) { |
| 694 | 694 | if ($c === null) { |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $nom = $p->id_boucle; |
| 757 | 757 | |
| 758 | 758 | if ($nom and trouver_nom_serveur_distant($p)) { |
| 759 | - spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit')); |
|
| 759 | + spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit')); |
|
| 760 | 760 | |
| 761 | 761 | return false; |
| 762 | 762 | } |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | (strpos($ps, 'typo') !== false) |
| 842 | 842 | ) |
| 843 | 843 | ) { |
| 844 | - $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')'; |
|
| 844 | + $ps = 'traiter_doublons_documents($doublons, '.$ps.')'; |
|
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | // La protection des champs par |safehtml est assuree par les extensions |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | function compose_filtres_args($p, $args, $sep) { |
| 960 | 960 | $arglist = ''; |
| 961 | 961 | foreach ($args as $arg) { |
| 962 | - $arglist .= $sep . |
|
| 962 | + $arglist .= $sep. |
|
| 963 | 963 | calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle); |
| 964 | 964 | } |
| 965 | 965 | |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | while ($b != '') { |
| 1010 | 1010 | foreach ($p->boucles[$b]->criteres as $critere) { |
| 1011 | 1011 | if ($critere->op == $motif) { |
| 1012 | - $p->code = '$Pile[$SP' . (($n == 0) ? '' : "-$n") . |
|
| 1012 | + $p->code = '$Pile[$SP'.(($n == 0) ? '' : "-$n"). |
|
| 1013 | 1013 | "]['$champ']"; |
| 1014 | 1014 | $b = ''; |
| 1015 | 1015 | break 2; |
@@ -1037,6 +1037,6 @@ discard block |
||
| 1037 | 1037 | */ |
| 1038 | 1038 | function zbug_presenter_champ($p, $champ = '') { |
| 1039 | 1039 | $balise = $champ ?: $p->nom_champ; |
| 1040 | - $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : ''; |
|
| 1040 | + $explicite = $p->nom_boucle ? $p->nom_boucle.':' : ''; |
|
| 1041 | 1041 | return "#{$explicite}{$balise}"; |
| 1042 | 1042 | } |