@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (!$fonc) { |
| 149 | 149 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 150 | 150 | } |
| 151 | - $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 151 | + $titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 152 | 152 | } |
| 153 | 153 | if ($message === false) { |
| 154 | 154 | lang_select(); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $fond = isset($GLOBALS['fond']) ? $GLOBALS['fond'] : ''; |
| 178 | 178 | // une erreur critique sort $message en array |
| 179 | 179 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 180 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 180 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 181 | 181 | |
| 182 | 182 | return $msg; |
| 183 | 183 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | function debusquer_bandeau($erreurs) { |
| 186 | 186 | |
| 187 | 187 | if (!empty($erreurs)) { |
| 188 | - $n = [count($erreurs) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 188 | + $n = [count($erreurs).' '._T('zbug_erreur_squelette')]; |
|
| 189 | 189 | |
| 190 | 190 | return debusquer_navigation($erreurs, $n); |
| 191 | 191 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -218,25 +218,25 @@ discard block |
||
| 218 | 218 | $valeur_simple = []; |
| 219 | 219 | foreach ($valeur as $v) { |
| 220 | 220 | if (is_array($v)) { |
| 221 | - $valeur_simple[] = 'array:' . count($v); |
|
| 221 | + $valeur_simple[] = 'array:'.count($v); |
|
| 222 | 222 | } elseif (is_object($v)) { |
| 223 | 223 | $valeur_simple[] = get_class($v); |
| 224 | 224 | } elseif (is_string($v)) { |
| 225 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 225 | + $valeur_simple[] = "'".$v."'"; |
|
| 226 | 226 | } else { |
| 227 | 227 | $valeur_simple[] = $v; |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | $n = count($valeur); |
| 231 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 232 | - $valeur .= '[' . join(', ', $valeur_simple) . ']'; |
|
| 231 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 232 | + $valeur .= '['.join(', ', $valeur_simple).']'; |
|
| 233 | 233 | } elseif (is_object($valeur)) { |
| 234 | 234 | $valeur = get_class($valeur); |
| 235 | 235 | } elseif (is_string($valeur)) { |
| 236 | - $valeur = "'" . $valeur . "'"; |
|
| 236 | + $valeur = "'".$valeur."'"; |
|
| 237 | 237 | } |
| 238 | - $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom)) |
|
| 239 | - . '</strong></td><td>: ' . nl2br(entites_html($valeur)) |
|
| 238 | + $res .= "\n<tr><td><strong>".nl2br(entites_html($nom)) |
|
| 239 | + . '</strong></td><td>: '.nl2br(entites_html($valeur)) |
|
| 240 | 240 | . "</td></tr>\n"; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -264,10 +264,10 @@ discard block |
||
| 264 | 264 | $nom_code = $lieu->descr['nom']; |
| 265 | 265 | $skel = $lieu->descr['sourcefile']; |
| 266 | 266 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 267 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 267 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 268 | 268 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 269 | 269 | if ($boucle) { |
| 270 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 270 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 271 | 271 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 272 | 272 | } |
| 273 | 273 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | // Requete erronee |
| 359 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 359 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 360 | 360 | . spip_htmlspecialchars($msg) |
| 361 | 361 | . "\n<br /><span style='color: red'><b>" |
| 362 | 362 | . spip_htmlspecialchars($query) |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | // https://code.spip.net/@trouve_boucle_debug |
| 372 | 372 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 373 | 373 | |
| 374 | - $id = $nom . $boucle; |
|
| 374 | + $id = $nom.$boucle; |
|
| 375 | 375 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 376 | 376 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 377 | 377 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 421 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 422 | 422 | |
| 423 | 423 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 424 | 424 | if (preg_match($incl, $v)) { |
@@ -434,16 +434,13 @@ discard block |
||
| 434 | 434 | list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom); |
| 435 | 435 | |
| 436 | 436 | if (!$boucle) { |
| 437 | - return !$ligne ? '' : |
|
| 438 | - (' (' . |
|
| 439 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 440 | - _T('squelette_ligne')) . |
|
| 437 | + return !$ligne ? '' : (' ('. |
|
| 438 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 441 | 439 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 442 | 440 | } else { |
| 443 | 441 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 444 | 442 | |
| 445 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 446 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 443 | + return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 447 | 444 | } |
| 448 | 445 | } |
| 449 | 446 | |
@@ -466,14 +463,14 @@ discard block |
||
| 466 | 463 | |
| 467 | 464 | $s = preg_replace( |
| 468 | 465 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 469 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 466 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 470 | 467 | $s |
| 471 | 468 | ); |
| 472 | 469 | |
| 473 | 470 | |
| 474 | 471 | $tableau = explode('<br />', $s); |
| 475 | 472 | |
| 476 | - $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n"; |
|
| 473 | + $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n"; |
|
| 477 | 474 | |
| 478 | 475 | $format10 = str_replace('white', 'lightgrey', $format); |
| 479 | 476 | $formaterr = 'color: red;'; |
@@ -517,7 +514,7 @@ discard block |
||
| 517 | 514 | . '" style="cursor: pointer;">' |
| 518 | 515 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 519 | 516 | . '</div> |
| 520 | - ' . $res . "</div>\n"; |
|
| 517 | + ' . $res."</div>\n"; |
|
| 521 | 518 | } |
| 522 | 519 | |
| 523 | 520 | // l'environnement graphique du debuggueur |
@@ -538,14 +535,14 @@ discard block |
||
| 538 | 535 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 539 | 536 | list($legend, $texte, $res2) = debusquer_source($fonc, $mode); |
| 540 | 537 | $texte .= $res2; |
| 541 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 542 | - $legend = _T('zbug_' . $mode); |
|
| 543 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 538 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 539 | + $legend = _T('zbug_'.$mode); |
|
| 540 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 544 | 541 | $texte = ancre_texte($texte, ['', '']); |
| 545 | 542 | } |
| 546 | 543 | } else { |
| 547 | 544 | if (strlen(trim($res))) { |
| 548 | - return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>"; |
|
| 545 | + return "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>"; |
|
| 549 | 546 | } else { |
| 550 | 547 | // cas de l'appel sur erreur: montre la page |
| 551 | 548 | return isset($GLOBALS['debug_objets']['resultat']['tout']) |
@@ -555,7 +552,7 @@ discard block |
||
| 555 | 552 | } |
| 556 | 553 | } else { |
| 557 | 554 | $valider = charger_fonction('valider', 'xml'); |
| 558 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 555 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 559 | 556 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 560 | 557 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 561 | 558 | list($texte, $err) = emboite_texte($val, $fonc, $self); |
@@ -566,14 +563,14 @@ discard block |
||
| 566 | 563 | } else { |
| 567 | 564 | $err = ": $err"; |
| 568 | 565 | } |
| 569 | - $legend = _T('validation') . ' ' . $err; |
|
| 566 | + $legend = _T('validation').' '.$err; |
|
| 570 | 567 | $res = $id = ''; |
| 571 | 568 | } |
| 572 | 569 | |
| 573 | 570 | return !trim($texte) ? '' : ( |
| 574 | - "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res" |
|
| 571 | + "<img src='".chemin_image('debug-xx.svg')."' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res" |
|
| 575 | 572 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 576 | - . "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> ↑ " |
|
| 573 | + . "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> ↑ " |
|
| 577 | 574 | . ($legend ? $legend : $mode) |
| 578 | 575 | . '</a></legend>' |
| 579 | 576 | . $texte |
@@ -585,7 +582,7 @@ discard block |
||
| 585 | 582 | // https://code.spip.net/@emboite_texte |
| 586 | 583 | function emboite_texte($res, $fonc = '', $self = '') { |
| 587 | 584 | $errs = $res->err; |
| 588 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 585 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 589 | 586 | |
| 590 | 587 | if (!$texte and !$errs) { |
| 591 | 588 | return [ancre_texte('', ['', '']), false]; |
@@ -641,7 +638,7 @@ discard block |
||
| 641 | 638 | $err = "<h2 style='text-align: center'>" |
| 642 | 639 | . $i |
| 643 | 640 | . "<a href='#fin_err'>" |
| 644 | - . ' ' . _T('erreur_texte') |
|
| 641 | + . ' '._T('erreur_texte') |
|
| 645 | 642 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 646 | 643 | . $err |
| 647 | 644 | . " </table><a id='fin_err'></a>"; |
@@ -651,9 +648,9 @@ discard block |
||
| 651 | 648 | list($msg, $fermant, $ouvrant) = $errs[0]; |
| 652 | 649 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 653 | 650 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 654 | - $err = $msg . |
|
| 655 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 656 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 651 | + $err = $msg. |
|
| 652 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 653 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 657 | 654 | |
| 658 | 655 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 659 | 656 | } |
@@ -687,7 +684,7 @@ discard block |
||
| 687 | 684 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 688 | 685 | ); |
| 689 | 686 | |
| 690 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 687 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 691 | 688 | . $t_skel |
| 692 | 689 | . ' ' |
| 693 | 690 | . $sourcefile |
@@ -702,7 +699,7 @@ discard block |
||
| 702 | 699 | . "'>" |
| 703 | 700 | . _T('zbug_calcul') |
| 704 | 701 | . '</a></legend>' |
| 705 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 702 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 706 | 703 | . debusquer_contexte($contexte[$sourcefile]) |
| 707 | 704 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 708 | 705 | . "</fieldset>\n"; |
@@ -723,33 +720,33 @@ discard block |
||
| 723 | 720 | $nom = $boucle->id_boucle; |
| 724 | 721 | $req = $boucle->type_requete; |
| 725 | 722 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 726 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 727 | - |
|
| 728 | - $res .= "\n<tr style='background-color: " . |
|
| 729 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 730 | - "'><td align='right'>$i</td><td>\n" . |
|
| 731 | - "<a class='debug_link_boucle' href='" . |
|
| 732 | - $self2 . |
|
| 733 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 734 | - _T('zbug_boucle') . |
|
| 735 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 736 | - $self2 . |
|
| 737 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 738 | - _T('zbug_resultat') . |
|
| 739 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 740 | - $self2 . |
|
| 741 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 742 | - _T('zbug_code') . |
|
| 743 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 744 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 745 | - "'>" . |
|
| 746 | - _T('zbug_calcul') . |
|
| 747 | - "</a></td><td>\n" . |
|
| 748 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 749 | - "</td><td>\n" . |
|
| 750 | - $req . |
|
| 751 | - "</td><td>\n" . |
|
| 752 | - spip_htmlspecialchars($crit) . |
|
| 723 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 724 | + |
|
| 725 | + $res .= "\n<tr style='background-color: ". |
|
| 726 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 727 | + "'><td align='right'>$i</td><td>\n". |
|
| 728 | + "<a class='debug_link_boucle' href='". |
|
| 729 | + $self2. |
|
| 730 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 731 | + _T('zbug_boucle'). |
|
| 732 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 733 | + $self2. |
|
| 734 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 735 | + _T('zbug_resultat'). |
|
| 736 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 737 | + $self2. |
|
| 738 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 739 | + _T('zbug_code'). |
|
| 740 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 741 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 742 | + "'>". |
|
| 743 | + _T('zbug_calcul'). |
|
| 744 | + "</a></td><td>\n". |
|
| 745 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 746 | + "</td><td>\n". |
|
| 747 | + $req. |
|
| 748 | + "</td><td>\n". |
|
| 749 | + spip_htmlspecialchars($crit). |
|
| 753 | 750 | '</td></tr>'; |
| 754 | 751 | } |
| 755 | 752 | } |
@@ -776,7 +773,7 @@ discard block |
||
| 776 | 773 | } |
| 777 | 774 | // permettre le copier/coller facile |
| 778 | 775 | // $res = ancre_texte($req, array(), true); |
| 779 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 776 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 780 | 777 | // formatage et affichage des resultats bruts de la requete |
| 781 | 778 | $ress_req = spip_query($req); |
| 782 | 779 | $brut_sql = ''; |
@@ -786,10 +783,10 @@ discard block |
||
| 786 | 783 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 787 | 784 | while ($retours_sql = sql_fetch($ress_req)) { |
| 788 | 785 | if ($num <= $max_aff) { |
| 789 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 786 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 790 | 787 | $brut_sql .= '<p>'; |
| 791 | 788 | foreach ($retours_sql as $key => $val) { |
| 792 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 789 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 793 | 790 | } |
| 794 | 791 | $brut_sql .= '</p>'; |
| 795 | 792 | } |
@@ -800,14 +797,14 @@ discard block |
||
| 800 | 797 | // ne pas afficher les $contexte_inclus |
| 801 | 798 | $view = preg_replace(',<\?php.+\?[>],Uims', '', $view); |
| 802 | 799 | if ($view) { |
| 803 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 800 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 804 | 801 | } |
| 805 | 802 | } |
| 806 | 803 | } elseif ($affiche == 'code') { |
| 807 | 804 | $legend = $nom; |
| 808 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 805 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 809 | 806 | } elseif ($affiche == 'boucle') { |
| 810 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 807 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 811 | 808 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 812 | 809 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 813 | 810 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -826,23 +823,23 @@ discard block |
||
| 826 | 823 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 827 | 824 | include_spip('inc/texte'); // pour corriger_typo |
| 828 | 825 | |
| 829 | - return _DOCTYPE_ECRIRE . |
|
| 830 | - html_lang_attributes() . |
|
| 831 | - "<head>\n<title>" . |
|
| 832 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 833 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 834 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 835 | - ")</title>\n" . |
|
| 836 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 837 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 838 | - "' />\n" . |
|
| 826 | + return _DOCTYPE_ECRIRE. |
|
| 827 | + html_lang_attributes(). |
|
| 828 | + "<head>\n<title>". |
|
| 829 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 830 | + _T('admin_debug').' '.$titre.' ('. |
|
| 831 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 832 | + ")</title>\n". |
|
| 833 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 834 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 835 | + "' />\n". |
|
| 839 | 836 | http_script('', 'jquery.js') |
| 840 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 841 | - . "' type='text/css' />" . |
|
| 842 | - "</head>\n" . |
|
| 843 | - "<body style='margin:0 10px;'>\n" . |
|
| 844 | - "<div id='spip-debug-header'>" . |
|
| 845 | - $corps . |
|
| 846 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 837 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 838 | + . "' type='text/css' />". |
|
| 839 | + "</head>\n". |
|
| 840 | + "<body style='margin:0 10px;'>\n". |
|
| 841 | + "<div id='spip-debug-header'>". |
|
| 842 | + $corps. |
|
| 843 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 847 | 844 | '</div></body></html>'; |
| 848 | 845 | } |
@@ -48,19 +48,19 @@ discard block |
||
| 48 | 48 | * Nom d'une balise #TOTO |
| 49 | 49 | * |
| 50 | 50 | * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */ |
| 51 | -define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 51 | +define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 52 | 52 | /** Balise complète [...(#TOTO) ... ] */ |
| 53 | -define('CHAMP_ETENDU', '/\[([^]\[]*)\(' . NOM_DE_CHAMP . '([^[)]*\)[^]\[]*)\]/S'); |
|
| 53 | +define('CHAMP_ETENDU', '/\[([^]\[]*)\('.NOM_DE_CHAMP.'([^[)]*\)[^]\[]*)\]/S'); |
|
| 54 | 54 | |
| 55 | 55 | define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S'); |
| 56 | 56 | define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims'); |
| 57 | 57 | define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS'); |
| 58 | -define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 58 | +define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 59 | 59 | |
| 60 | 60 | /** Champ sql dans parenthèse ex: (id_article) */ |
| 61 | 61 | define('SQL_ARGS', '(\([^)]*\))'); |
| 62 | 62 | /** Fonction SQL sur un champ ex: SUM(visites) */ |
| 63 | -define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?'); |
|
| 63 | +define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?'); |
|
| 64 | 64 | |
| 65 | 65 | // https://code.spip.net/@phraser_inclure |
| 66 | 66 | function phraser_inclure($texte, $ligne, $result) { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @return array |
| 218 | 218 | **/ |
| 219 | 219 | function phraser_champs($texte, $ligne, $result) { |
| 220 | - while (preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match)) { |
|
| 220 | + while (preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match)) { |
|
| 221 | 221 | $p = strpos($texte, $match[0]); |
| 222 | 222 | // texte après la balise |
| 223 | 223 | $suite = substr($texte, $p + strlen($match[0])); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $collecte[] = $champ; |
| 370 | 370 | $args = ltrim($regs[count($regs) - 1]); |
| 371 | 371 | } else { |
| 372 | - if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) { |
|
| 372 | + if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) { |
|
| 373 | 373 | // 0 est un aveu d'impuissance. A completer |
| 374 | 374 | $arg = phraser_champs_exterieurs($arg, 0, $sep, $result); |
| 375 | 375 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) { |
| 455 | 455 | $res = []; |
| 456 | 456 | while (($p = strpos($texte, "%$sep")) !== false) { |
| 457 | - if (!preg_match(',^%' . preg_quote($sep) . '([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 457 | + if (!preg_match(',^%'.preg_quote($sep).'([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 458 | 458 | break; |
| 459 | 459 | } |
| 460 | 460 | $debut = substr($texte, 0, $p); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $pos_apres = 0; |
| 496 | 496 | $result = phraser_args($match[7], ')', $sep, $result, $champ, $pos_apres); |
| 497 | 497 | phraser_vieux($champ); |
| 498 | - $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 498 | + $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 499 | 499 | $debut = substr($match[7], $pos_apres + 1); |
| 500 | 500 | if (!empty($debut)) { |
| 501 | 501 | $n += substr_count(substr($texte, 0, strpos($texte, $debut)), "\n"); |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | // une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"} |
| 627 | 627 | if (preg_match(',^(["\'])(.*)\1$,', $m[4])) { |
| 628 | 628 | $c = null; |
| 629 | - eval('$c = ' . $m[4] . ';'); |
|
| 629 | + eval('$c = '.$m[4].';'); |
|
| 630 | 630 | if (isset($c)) { |
| 631 | 631 | $m[4] = $c; |
| 632 | 632 | } |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', $param, $m)) { |
| 707 | 707 | $crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', ''); |
| 708 | 708 | } elseif ( |
| 709 | - preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC . |
|
| 709 | + preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC. |
|
| 710 | 710 | ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', $param, $m) |
| 711 | 711 | ) { |
| 712 | 712 | $a2 = trim($m[8]); |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | ); |
| 724 | 724 | $crit->exclus = $m[1]; |
| 725 | 725 | } elseif ( |
| 726 | - preg_match('/^([!]?)\s*(' . |
|
| 727 | - CHAMP_SQL_PLUS_FONC . |
|
| 726 | + preg_match('/^([!]?)\s*('. |
|
| 727 | + CHAMP_SQL_PLUS_FONC. |
|
| 728 | 728 | ')\s*(\??)(.*)$/is', $param, $m) |
| 729 | 729 | ) { |
| 730 | 730 | // contient aussi les comparaisons implicites ! |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | // trouver sa position de depart reelle : au <Bxx> ou au <BBxx> |
| 873 | - $precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>'; |
|
| 873 | + $precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>'; |
|
| 874 | 874 | $pos_precond = strpos($texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 875 | 875 | if ( |
| 876 | 876 | $pos_precond !== false |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | $boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle); |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | - $preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>'; |
|
| 884 | + $preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>'; |
|
| 885 | 885 | $pos_preaff = strpos($texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 886 | 886 | if ( |
| 887 | 887 | $pos_preaff !== false |
@@ -929,13 +929,13 @@ discard block |
||
| 929 | 929 | $pos_anonyme_next = null; |
| 930 | 930 | // si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme |
| 931 | 931 | if (!strlen($id_boucle)) { |
| 932 | - $pos_anonyme_next = strpos($texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 932 | + $pos_anonyme_next = strpos($texte, BALISE_BOUCLE.'(', $pos_courante); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | // |
| 936 | 936 | // 1. Recuperer la partie conditionnelle apres |
| 937 | 937 | // |
| 938 | - $apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>'; |
|
| 938 | + $apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>'; |
|
| 939 | 939 | $pos_apres = strpos($texte, $apres_boucle, $pos_courante); |
| 940 | 940 | if ( |
| 941 | 941 | $pos_apres !== false |
@@ -944,13 +944,13 @@ discard block |
||
| 944 | 944 | $boucle['pos_postcond'] = $pos_apres; |
| 945 | 945 | $pos_apres += strlen($apres_boucle); |
| 946 | 946 | $boucle['pos_postcond_inside'] = $pos_apres; |
| 947 | - $pos_courante = $pos_apres ; |
|
| 947 | + $pos_courante = $pos_apres; |
|
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | // |
| 951 | 951 | // 2. Récuperer la partie alternative apres |
| 952 | 952 | // |
| 953 | - $altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>'; |
|
| 953 | + $altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>'; |
|
| 954 | 954 | $pos_altern = strpos($texte, $altern_boucle, $pos_courante); |
| 955 | 955 | if ( |
| 956 | 956 | $pos_altern !== false |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | // |
| 966 | 966 | // 3. Recuperer la partie footer non alternative |
| 967 | 967 | // |
| 968 | - $postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>'; |
|
| 968 | + $postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>'; |
|
| 969 | 969 | $pos_postaff = strpos($texte, $postaff_boucle, $pos_courante); |
| 970 | 970 | if ( |
| 971 | 971 | $pos_postaff !== false |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | $boucle['pos_postaff'] = $pos_postaff; |
| 975 | 975 | $pos_postaff += strlen($postaff_boucle); |
| 976 | 976 | $boucle['pos_postaff_inside'] = $pos_postaff; |
| 977 | - $pos_courante = $pos_postaff ; |
|
| 977 | + $pos_courante = $pos_postaff; |
|
| 978 | 978 | } |
| 979 | 979 | |
| 980 | 980 | return $boucle; |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | * @return string |
| 1015 | 1015 | */ |
| 1016 | 1016 | function public_generer_boucle_placeholder($id_boucle, &$boucle, $boucle_placeholder, $nb_lignes) { |
| 1017 | - $placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']'; |
|
| 1017 | + $placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']'; |
|
| 1018 | 1018 | //memoriser la boucle a reinjecter |
| 1019 | 1019 | $id_boucle = "$id_boucle"; |
| 1020 | 1020 | phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle); |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | // definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette |
| 1028 | 1028 | if (is_null($boucle_placeholder)) { |
| 1029 | 1029 | do { |
| 1030 | - $boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid())); |
|
| 1030 | + $boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid())); |
|
| 1031 | 1031 | } while (strpos($texte, $boucle_placeholder) !== false); |
| 1032 | 1032 | } |
| 1033 | 1033 | |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | |
| 1048 | 1048 | // boucle anonyme ? |
| 1049 | 1049 | if (!strlen($id_boucle)) { |
| 1050 | - $id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle)), 0, 8); |
|
| 1050 | + $id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle)), 0, 8); |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | $pos_debut_boucle = $pos_courante; |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | |
| 1061 | 1061 | $pos_avant = $boucle['pos_precond_inside']; |
| 1062 | 1062 | $result->avant = substr($texte, $pos_avant, $pos_courante - $pos_avant); |
| 1063 | - $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1063 | + $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | // Regarder si on a une partie inconditionnelle avant <BB_xxx> |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | |
| 1070 | 1070 | $pos_preaff = $boucle['pos_preaff_inside']; |
| 1071 | 1071 | $result->preaff = substr($texte, $pos_preaff, $end_preaff - $pos_preaff); |
| 1072 | - $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1072 | + $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | $result->id_boucle = $id_boucle; |
@@ -1126,7 +1126,7 @@ discard block |
||
| 1126 | 1126 | } else { |
| 1127 | 1127 | $pos_milieu += 1; |
| 1128 | 1128 | |
| 1129 | - $fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>'; |
|
| 1129 | + $fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>'; |
|
| 1130 | 1130 | $pos_fin = strpos($texte, $fin_boucle, $pos_milieu); |
| 1131 | 1131 | if ($pos_fin === false) { |
| 1132 | 1132 | $err_b = [ |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | else { |
| 1140 | 1140 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1141 | 1141 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1142 | - $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
|
| 1142 | + $search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'('; |
|
| 1143 | 1143 | $search_from = $pos_milieu; |
| 1144 | 1144 | $nb_open = 1; |
| 1145 | 1145 | $nb_close = 1; |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | if ($boucle['pos_postcond']) { |
| 1180 | 1180 | $result->apres = substr($texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante); |
| 1181 | 1181 | $ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']); |
| 1182 | - $pos_courante = $boucle['pos_postcond_inside'] ; |
|
| 1182 | + $pos_courante = $boucle['pos_postcond_inside']; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | array_shift($p->param); |
| 53 | 53 | $p->etoile = '*'; |
| 54 | 54 | spip_log("filtre de logo obsolete $nom", 'vieilles_defs'); |
| 55 | - } elseif (preg_match('/^' . NOM_DE_CHAMP . '(.*)$/sS', $nom, $m)) { |
|
| 55 | + } elseif (preg_match('/^'.NOM_DE_CHAMP.'(.*)$/sS', $nom, $m)) { |
|
| 56 | 56 | $champ = new Champ(); |
| 57 | 57 | $champ->nom_boucle = $m[2]; |
| 58 | 58 | $champ->nom_champ = $m[3]; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $p->param[0][1] = [$c]; |
| 129 | 129 | $p->param[0][0] = ''; |
| 130 | 130 | $p->fonctions = []; |
| 131 | - spip_log('FORMULAIRE_RECHERCHE avec filtre ' . $c->texte, 'vieilles_defs'); |
|
| 131 | + spip_log('FORMULAIRE_RECHERCHE avec filtre '.$c->texte, 'vieilles_defs'); |
|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * Texte |
| 42 | 42 | */ |
| 43 | 43 | function sandbox_composer_texte($texte, &$p) { |
| 44 | - $code = "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], $texte) . "'"; |
|
| 44 | + $code = "'".str_replace(['\\', "'"], ['\\\\', "\\'"], $texte)."'"; |
|
| 45 | 45 | |
| 46 | 46 | return $code; |
| 47 | 47 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $min_f = $refl->getNumberOfRequiredParameters(); |
| 86 | 86 | if (($nb_args_f < $min_f)) { |
| 87 | 87 | $msg_args = ['filtre' => texte_script($fonc), 'nb' => $min_f - $nb_args_f]; |
| 88 | - erreur_squelette([ 'zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 88 | + erreur_squelette(['zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | // le filtre n'existe pas, |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | function sandbox_filtrer_squelette($skel, $corps, $filtres) { |
| 172 | 172 | $series_filtres = func_get_args(); |
| 173 | - array_shift($series_filtres);// skel |
|
| 174 | - array_shift($series_filtres);// corps |
|
| 173 | + array_shift($series_filtres); // skel |
|
| 174 | + array_shift($series_filtres); // corps |
|
| 175 | 175 | |
| 176 | 176 | // proteger les <INCLUDE> et tous les morceaux de php licites |
| 177 | 177 | if ($skel['process_ins'] == 'php') { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | if (is_array($r)) { |
| 220 | 220 | $dst[] = $r[0]; |
| 221 | 221 | |
| 222 | - return $src[] = '___' . md5($r[0]) . '___'; |
|
| 222 | + return $src[] = '___'.md5($r[0]).'___'; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | // si on recoit pas un tableau, on renvoit les couples de substitution |
@@ -31,36 +31,36 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | function format_inclure_html($file, $args, $prof) { |
| 33 | 33 | if (strpos($file, '#') === false) { |
| 34 | - $t = $file ? ('(' . $file . ')') : ''; |
|
| 34 | + $t = $file ? ('('.$file.')') : ''; |
|
| 35 | 35 | } else { |
| 36 | - $t = '{fond=' . $file . '}'; |
|
| 36 | + $t = '{fond='.$file.'}'; |
|
| 37 | 37 | } |
| 38 | - $args = !$args ? '' : ('{' . join(', ', $args) . '}'); |
|
| 38 | + $args = !$args ? '' : ('{'.join(', ', $args).'}'); |
|
| 39 | 39 | |
| 40 | - return ('<INCLURE' . $t . $args . '>'); |
|
| 40 | + return ('<INCLURE'.$t.$args.'>'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | function format_polyglotte_html($args, $prof) { |
| 44 | 44 | $contenu = []; |
| 45 | 45 | foreach ($args as $l => $t) { |
| 46 | - $contenu[] = ($l ? "[$l]" : '') . $t; |
|
| 46 | + $contenu[] = ($l ? "[$l]" : '').$t; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - return ('<multi>' . join(' ', $contenu) . '</multi>'); |
|
| 49 | + return ('<multi>'.join(' ', $contenu).'</multi>'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function format_idiome_html($nom, $module, $args, $filtres, $prof) { |
| 53 | 53 | foreach ($args as $k => $v) { |
| 54 | 54 | $args[$k] = "$k=$v"; |
| 55 | 55 | } |
| 56 | - $args = (!$args ? '' : ('{' . join(',', $args) . '}')); |
|
| 56 | + $args = (!$args ? '' : ('{'.join(',', $args).'}')); |
|
| 57 | 57 | |
| 58 | - return ('<:' . ($module ? "$module:" : '') . $nom . $args . $filtres . ':>'); |
|
| 58 | + return ('<:'.($module ? "$module:" : '').$nom.$args.$filtres.':>'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | function format_champ_html($nom, $boucle, $etoile, $avant, $apres, $args, $filtres, $prof) { |
| 62 | 62 | $nom = '#' |
| 63 | - . ($boucle ? ($boucle . ':') : '') |
|
| 63 | + . ($boucle ? ($boucle.':') : '') |
|
| 64 | 64 | . $nom |
| 65 | 65 | . $etoile |
| 66 | 66 | . $args |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | $critere[$k] = $crit_s; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return (!$critere ? '' : ('{' . join(',', $critere) . '}')); |
|
| 93 | + return (!$critere ? '' : ('{'.join(',', $critere).'}')); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | function format_liste_html($fonc, $args, $prof) { |
| 97 | 97 | return ((($fonc !== '') ? "|$fonc" : $fonc) |
| 98 | - . (!$args ? '' : ('{' . join(',', $args) . '}'))); |
|
| 98 | + . (!$args ? '' : ('{'.join(',', $args).'}'))); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Concatenation sans separateur: verifier qu'on ne cree pas de faux lexemes |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // si un texte se termine par ( et est suivi d'un champ |
| 112 | 112 | // ou assimiles, forcer la notation pleine |
| 113 | 113 | if ($c1 == '(' and substr($texte2, 0, 1) == '#') { |
| 114 | - $args[$i + 1][0] = '[(' . $texte2 . ')]'; |
|
| 114 | + $args[$i + 1][0] = '[('.$texte2.')]'; |
|
| 115 | 115 | } |
| 116 | 116 | } else { |
| 117 | 117 | if ($type == 'texte') { |
@@ -124,12 +124,12 @@ discard block |
||
| 124 | 124 | ($c1 == '}' and substr(ltrim($texte2), 0, 1) == '|') |
| 125 | 125 | or (preg_match('/[\w\d_*]/', $c1) and preg_match('/^[\w\d_*{|]/', $texte2)) |
| 126 | 126 | ) { |
| 127 | - $args[$i][0] = '[(' . $texte . ')]'; |
|
| 127 | + $args[$i][0] = '[('.$texte.')]'; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - return join('', array_map(function ($arg) { |
|
| 132 | + return join('', array_map(function($arg) { |
|
| 133 | 133 | return reset($arg); |
| 134 | 134 | }, $args)); |
| 135 | 135 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $apl_constant = '_Z_AJAX_PARALLEL_LOAD'; |
| 54 | 54 | $page = _SPIP_PAGE; |
| 55 | 55 | $echafauder = charger_fonction('echafauder', 'public', true); |
| 56 | - define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim( |
|
| 56 | + define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim( |
|
| 57 | 57 | _DIR_PLUGIN_DIST, |
| 58 | 58 | '/' |
| 59 | 59 | ) : '')); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | and in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z |
| 78 | 78 | and defined($apl_constant) |
| 79 | 79 | and in_array($dir, explode(',', constant($apl_constant))) // et dans un demande en APL |
| 80 | - and $pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL |
|
| 80 | + and $pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext) // et qui contient le squelette APL |
|
| 81 | 81 | ) { |
| 82 | 82 | $flux['data'] = $pipe; |
| 83 | 83 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $echafauder = ''; |
| 91 | 91 | } |
| 92 | 92 | if ($prepend) { |
| 93 | - $squelette = substr(find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext")); |
|
| 93 | + $squelette = substr(find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext")); |
|
| 94 | 94 | if ($squelette) { |
| 95 | 95 | $flux['data'] = $squelette; |
| 96 | 96 | } |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | // se brancher sur contenu/xx si il existe |
| 114 | 114 | // ou si c'est un objet spip, associe a une table, utiliser le fond homonyme |
| 115 | 115 | if (!isset($disponible[$fond])) { |
| 116 | - $disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 116 | + $disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if ($disponible[$fond]) { |
| 120 | - $flux['data'] = substr(find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext")); |
|
| 120 | + $flux['data'] = substr(find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext")); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $type = $flux['args']['contexte'][$page]; |
| 131 | 131 | } |
| 132 | 132 | if (!isset($disponible[$type])) { |
| 133 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 133 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 134 | 134 | } |
| 135 | 135 | if (is_string($disponible[$type])) { |
| 136 | 136 | $flux['data'] = $disponible[$type]; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext); |
| 146 | 146 | } else { |
| 147 | 147 | $flux['data'] = ($disponible['404'] = z_contenu_disponible( |
| 148 | - $prefix_path . $prepend, |
|
| 148 | + $prefix_path.$prepend, |
|
| 149 | 149 | $z_contenu, |
| 150 | 150 | '404', |
| 151 | 151 | $ext, |
@@ -169,10 +169,10 @@ discard block |
||
| 169 | 169 | $type = $flux['args']['contexte'][$page]; |
| 170 | 170 | } |
| 171 | 171 | if ($type !== 'page' and !isset($disponible[$type])) { |
| 172 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 172 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 173 | 173 | } |
| 174 | 174 | if ($type == 'page' or $disponible[$type]) { |
| 175 | - $flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext); |
|
| 175 | + $flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | isset($flux['args']['contexte']['type-page']) |
| 189 | 189 | and ( |
| 190 | 190 | (isset($flux['args']['contexte']['composition']) |
| 191 | - and file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext")) |
|
| 191 | + and file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext")) |
|
| 192 | 192 | or |
| 193 | - file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext") |
|
| 193 | + file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext") |
|
| 194 | 194 | ) |
| 195 | 195 | ) { |
| 196 | 196 | $flux['data'] = $f; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } elseif ( |
| 199 | 199 | $fond == 'structure' |
| 200 | 200 | and z_sanitize_var_zajax() |
| 201 | - and $f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext") |
|
| 201 | + and $f = find_in_path($prefix_path.$prepend.'ajax'.".$ext") |
|
| 202 | 202 | ) { |
| 203 | 203 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 204 | 204 | } // chercher le fond correspondant a la composition |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | and $dir = explode('/', $dir) |
| 210 | 210 | and $dir = reset($dir) |
| 211 | 211 | and in_array($dir, $z_blocs) |
| 212 | - and $f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext") |
|
| 212 | + and $f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext") |
|
| 213 | 213 | ) { |
| 214 | 214 | $flux['data'] = substr($f, 0, -strlen(".$ext")); |
| 215 | 215 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | function z_fond_valide($squelette) { |
| 272 | 272 | if ( |
| 273 | 273 | !_ZCORE_EXCLURE_PATH |
| 274 | - or !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette) |
|
| 274 | + or !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette) |
|
| 275 | 275 | ) { |
| 276 | 276 | return true; |
| 277 | 277 | } |
@@ -395,23 +395,23 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | $dir = z_blocs(test_espace_prive()); |
| 397 | 397 | $dir = reset($dir); |
| 398 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper($primary) . ',env}>'; |
|
| 398 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper($primary).',env}>'; |
|
| 399 | 399 | } // page objets |
| 400 | 400 | elseif ($type = $desc_exec and strpos($type, '/') === false) { |
| 401 | 401 | $dir = z_blocs(test_espace_prive()); |
| 402 | 402 | $dir = reset($dir); |
| 403 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />'; |
|
| 403 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />'; |
|
| 404 | 404 | } |
| 405 | 405 | // morceau d'objet : on fournit le fond de sibstitution dans $desc_exec |
| 406 | 406 | // et objet et tire de $table |
| 407 | 407 | elseif ($fond = $desc_exec) { |
| 408 | 408 | $dir = md5(dirname($fond)); |
| 409 | - $scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />'; |
|
| 409 | + $scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />'; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false); |
| 413 | 413 | $base_dir = sous_repertoire($base_dir, $dir, false); |
| 414 | - $f = $base_dir . "$exec"; |
|
| 414 | + $f = $base_dir."$exec"; |
|
| 415 | 415 | ecrire_fichier("$f.$ext", $scaffold); |
| 416 | 416 | |
| 417 | 417 | return $f; |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | ob_start(); |
| 46 | 46 | if (strpos($page['texte'], '?xml') !== false) { |
| 47 | - $page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']); |
|
| 47 | + $page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | try { |
| 51 | - $res = eval('?' . '>' . $page['texte']); |
|
| 51 | + $res = eval('?'.'>'.$page['texte']); |
|
| 52 | 52 | // error catching 5.2<=PHP<7 |
| 53 | 53 | if ( |
| 54 | 54 | $res === false |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | if (!function_exists('numerote_ligne_php')) { |
| 61 | 61 | function numerote_ligne_php($match) { |
| 62 | 62 | $GLOBALS['numero_ligne_php']++; |
| 63 | - return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 63 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 66 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 67 | 67 | $code = trim(highlight_string($code, true)); |
| 68 | - erreur_squelette('L' . $erreur['line'] . ': ' . $erreur['message'] . '<br />' . $code, [$page['source'],'',$erreur['file'],'',$GLOBALS['spip_lang']]); |
|
| 68 | + erreur_squelette('L'.$erreur['line'].': '.$erreur['message'].'<br />'.$code, [$page['source'], '', $erreur['file'], '', $GLOBALS['spip_lang']]); |
|
| 69 | 69 | $page['texte'] = '<!-- Erreur -->'; |
| 70 | 70 | } |
| 71 | 71 | else { |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | if (!function_exists('numerote_ligne_php')) { |
| 79 | 79 | function numerote_ligne_php($match) { |
| 80 | 80 | $GLOBALS['numero_ligne_php']++; |
| 81 | - return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 81 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 84 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 85 | 85 | $code = trim(highlight_string($code, true)); |
| 86 | - erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]); |
|
| 86 | + erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]); |
|
| 87 | 87 | $page['texte'] = '<!-- Erreur -->'; |
| 88 | 88 | } |
| 89 | 89 | ob_end_clean(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $page['process_ins'] = 'html'; |
| 92 | 92 | |
| 93 | 93 | if (strpos($page['texte'], '?xml') !== false) { |
| 94 | - $page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']); |
|
| 94 | + $page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | function balise_DOSSIER_SQUELETTE_dist($p) { |
| 366 | 366 | $code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE)); |
| 367 | - $p->code = "_DIR_RACINE . '$code'" . |
|
| 367 | + $p->code = "_DIR_RACINE . '$code'". |
|
| 368 | 368 | $p->interdire_scripts = false; |
| 369 | 369 | |
| 370 | 370 | return $p; |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | */ |
| 384 | 384 | function balise_SQUELETTE_dist($p) { |
| 385 | 385 | $code = addslashes($p->descr['sourcefile']); |
| 386 | - $p->code = "'$code'" . |
|
| 386 | + $p->code = "'$code'". |
|
| 387 | 387 | $p->interdire_scripts = false; |
| 388 | 388 | |
| 389 | 389 | return $p; |
@@ -435,9 +435,9 @@ discard block |
||
| 435 | 435 | **/ |
| 436 | 436 | function balise_NOM_SITE_dist($p) { |
| 437 | 437 | if (!$p->etoile) { |
| 438 | - $p->code = 'supprimer_numero(calculer_url(' . |
|
| 439 | - champ_sql('url_site', $p) . ',' . |
|
| 440 | - champ_sql('nom_site', $p) . |
|
| 438 | + $p->code = 'supprimer_numero(calculer_url('. |
|
| 439 | + champ_sql('url_site', $p).','. |
|
| 440 | + champ_sql('nom_site', $p). |
|
| 441 | 441 | ", 'titre', \$connect, false))"; |
| 442 | 442 | } else { |
| 443 | 443 | $p->code = champ_sql('nom_site', $p); |
@@ -588,8 +588,8 @@ discard block |
||
| 588 | 588 | * Pile complétée par le code à générer |
| 589 | 589 | **/ |
| 590 | 590 | function balise_POPULARITE_ABSOLUE_dist($p) { |
| 591 | - $p->code = 'ceil(' . |
|
| 592 | - champ_sql('popularite', $p) . |
|
| 591 | + $p->code = 'ceil('. |
|
| 592 | + champ_sql('popularite', $p). |
|
| 593 | 593 | ')'; |
| 594 | 594 | $p->interdire_scripts = false; |
| 595 | 595 | |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | $p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); |
| 671 | 671 | ; |
| 672 | 672 | if (($v = interprete_argument_balise(1, $p)) !== null) { |
| 673 | - $p->code = 'table_valeur(' . $p->code . ', ' . $v . ')'; |
|
| 673 | + $p->code = 'table_valeur('.$p->code.', '.$v.')'; |
|
| 674 | 674 | } |
| 675 | 675 | $p->interdire_scripts = true; |
| 676 | 676 | |
@@ -809,16 +809,16 @@ discard block |
||
| 809 | 809 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 810 | 810 | if ($desc = $trouver_table(table_objet_sql($type_objet))) { |
| 811 | 811 | if (isset($desc['field']['descriptif'])) { |
| 812 | - $_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ','; |
|
| 812 | + $_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).','; |
|
| 813 | 813 | } |
| 814 | 814 | if (isset($desc['field']['texte'])) { |
| 815 | - $_ligne .= "'texte' => " . champ_sql('texte', $p) . ','; |
|
| 815 | + $_ligne .= "'texte' => ".champ_sql('texte', $p).','; |
|
| 816 | 816 | } |
| 817 | 817 | if (isset($desc['field']['chapo'])) { |
| 818 | - $_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ','; |
|
| 818 | + $_ligne .= "'chapo' => ".champ_sql('chapo', $p).','; |
|
| 819 | 819 | } |
| 820 | 820 | if (isset($desc['introduction_longueur'])) { |
| 821 | - $_introduction_longueur = "'" . $desc['introduction_longueur'] . "'"; |
|
| 821 | + $_introduction_longueur = "'".$desc['introduction_longueur']."'"; |
|
| 822 | 822 | } |
| 823 | 823 | } |
| 824 | 824 | $_ligne .= ')'; |
@@ -917,10 +917,10 @@ discard block |
||
| 917 | 917 | $p->code = sprintf( |
| 918 | 918 | CODE_RECUPERER_FOND, |
| 919 | 919 | "'modeles/lesauteurs'", |
| 920 | - "array('objet'=>'" . $objet . |
|
| 921 | - "','id_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 922 | - ",'$id_table_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 923 | - ($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) . |
|
| 920 | + "array('objet'=>'".$objet. |
|
| 921 | + "','id_objet' => ".champ_sql($id_table_objet, $p). |
|
| 922 | + ",'$id_table_objet' => ".champ_sql($id_table_objet, $p). |
|
| 923 | + ($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)). |
|
| 924 | 924 | ')', |
| 925 | 925 | "'trim'=>true, 'compil'=>array($c)", |
| 926 | 926 | _q($connect) |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | $m = trim($m); |
| 990 | 990 | if ($m != "''") { |
| 991 | 991 | if (!preg_match(',\W,', $m)) { |
| 992 | - $m = $boucle->id_table . ".$m"; |
|
| 992 | + $m = $boucle->id_table.".$m"; |
|
| 993 | 993 | } |
| 994 | 994 | |
| 995 | 995 | $m .= ' AS titre_rang'; |
@@ -1150,7 +1150,7 @@ discard block |
||
| 1150 | 1150 | $f_pagination = chercher_filtre('pagination'); |
| 1151 | 1151 | $type = $p->boucles[$b]->modificateur['debut_nom']; |
| 1152 | 1152 | $modif = ($type[0] !== "'") ? "'debut'.$type" |
| 1153 | - : ("'debut" . substr($type, 1)); |
|
| 1153 | + : ("'debut".substr($type, 1)); |
|
| 1154 | 1154 | |
| 1155 | 1155 | $p->code = sprintf( |
| 1156 | 1156 | CODE_PAGINATION, |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']]; |
| 1295 | 1295 | erreur_squelette($msg, $p); |
| 1296 | 1296 | } else { |
| 1297 | - $p->code = 'find_in_path(' . $arg . ')'; |
|
| 1297 | + $p->code = 'find_in_path('.$arg.')'; |
|
| 1298 | 1298 | } |
| 1299 | 1299 | |
| 1300 | 1300 | $p->interdire_scripts = false; |
@@ -1329,7 +1329,7 @@ discard block |
||
| 1329 | 1329 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']]; |
| 1330 | 1330 | erreur_squelette($msg, $p); |
| 1331 | 1331 | } else { |
| 1332 | - $p->code = 'chemin_image(' . $arg . ')'; |
|
| 1332 | + $p->code = 'chemin_image('.$arg.')'; |
|
| 1333 | 1333 | } |
| 1334 | 1334 | |
| 1335 | 1335 | $p->interdire_scripts = false; |
@@ -1383,7 +1383,7 @@ discard block |
||
| 1383 | 1383 | // cas de #ENV sans argument : on retourne le serialize() du tableau |
| 1384 | 1384 | // une belle fonction [(#ENV|affiche_env)] serait pratique |
| 1385 | 1385 | if ($src) { |
| 1386 | - $p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")'; |
|
| 1386 | + $p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")'; |
|
| 1387 | 1387 | } else { |
| 1388 | 1388 | $p->code = 'serialize($Pile[0]??[])'; |
| 1389 | 1389 | } |
@@ -1436,8 +1436,8 @@ discard block |
||
| 1436 | 1436 | $_sinon = interprete_argument_balise(2, $p); |
| 1437 | 1437 | $_unserialize = sinon(interprete_argument_balise(3, $p), 'false'); |
| 1438 | 1438 | |
| 1439 | - $p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' . |
|
| 1440 | - ($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')"; |
|
| 1439 | + $p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','. |
|
| 1440 | + ($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')"; |
|
| 1441 | 1441 | |
| 1442 | 1442 | return $p; |
| 1443 | 1443 | } |
@@ -1530,7 +1530,7 @@ discard block |
||
| 1530 | 1530 | $err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']]; |
| 1531 | 1531 | erreur_squelette($err_b_s_a, $p); |
| 1532 | 1532 | } else { |
| 1533 | - $p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))'; |
|
| 1533 | + $p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))'; |
|
| 1534 | 1534 | } |
| 1535 | 1535 | |
| 1536 | 1536 | $p->interdire_scripts = false; |
@@ -1578,7 +1578,7 @@ discard block |
||
| 1578 | 1578 | ) |
| 1579 | 1579 | ) { |
| 1580 | 1580 | $p->code = /* $r[1]. */ |
| 1581 | - '(' . $r[2] . ')'; |
|
| 1581 | + '('.$r[2].')'; |
|
| 1582 | 1582 | } else { |
| 1583 | 1583 | $p->code = "eval('return '.$php.';')"; |
| 1584 | 1584 | } |
@@ -1822,9 +1822,9 @@ discard block |
||
| 1822 | 1822 | |
| 1823 | 1823 | // noter la duree du cache dans un entete proprietaire |
| 1824 | 1824 | |
| 1825 | - $code = "'<'.'" . '?php header("X-Spip-Cache: ' |
|
| 1825 | + $code = "'<'.'".'?php header("X-Spip-Cache: ' |
|
| 1826 | 1826 | . $duree |
| 1827 | - . '"); ?' . "'.'>'"; |
|
| 1827 | + . '"); ?'."'.'>'"; |
|
| 1828 | 1828 | |
| 1829 | 1829 | // Remplir le header Cache-Control |
| 1830 | 1830 | // cas #CACHE{0} |
@@ -1845,9 +1845,9 @@ discard block |
||
| 1845 | 1845 | $pa == 'cache-client' |
| 1846 | 1846 | and $duree > 0 |
| 1847 | 1847 | ) { |
| 1848 | - $code .= ".'<'.'" . '?php header("Cache-Control: max-age=' |
|
| 1848 | + $code .= ".'<'.'".'?php header("Cache-Control: max-age=' |
|
| 1849 | 1849 | . $duree |
| 1850 | - . '"); ?' . "'.'>'"; |
|
| 1850 | + . '"); ?'."'.'>'"; |
|
| 1851 | 1851 | // il semble logique, si on cache-client, de ne pas invalider |
| 1852 | 1852 | $pa = 'statique'; |
| 1853 | 1853 | } |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | $pa == 'statique' |
| 1857 | 1857 | and $duree > 0 |
| 1858 | 1858 | ) { |
| 1859 | - $code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'"; |
|
| 1859 | + $code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'"; |
|
| 1860 | 1860 | } |
| 1861 | 1861 | } |
| 1862 | 1862 | } else { |
@@ -2020,9 +2020,9 @@ discard block |
||
| 2020 | 2020 | if ($p->etoile) { |
| 2021 | 2021 | $_options[] = "'etoile'=>true"; |
| 2022 | 2022 | } |
| 2023 | - $_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')'; |
|
| 2023 | + $_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')'; |
|
| 2024 | 2024 | |
| 2025 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2025 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2026 | 2026 | if ($flag_env) { |
| 2027 | 2027 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2028 | 2028 | } |
@@ -2032,7 +2032,7 @@ discard block |
||
| 2032 | 2032 | $msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']]; |
| 2033 | 2033 | erreur_squelette($msg, $p); |
| 2034 | 2034 | } else { |
| 2035 | - $p->code = 'charge_scripts(' . $_contexte[1] . ',false)'; |
|
| 2035 | + $p->code = 'charge_scripts('.$_contexte[1].',false)'; |
|
| 2036 | 2036 | } |
| 2037 | 2037 | |
| 2038 | 2038 | $p->interdire_scripts = false; // la securite est assuree par recuperer_fond |
@@ -2080,7 +2080,7 @@ discard block |
||
| 2080 | 2080 | unset($_contexte[1]); |
| 2081 | 2081 | |
| 2082 | 2082 | if (preg_match("/^\s*'[^']*'/s", $nom)) { |
| 2083 | - $nom = "'modeles/" . substr($nom, 1); |
|
| 2083 | + $nom = "'modeles/".substr($nom, 1); |
|
| 2084 | 2084 | } else { |
| 2085 | 2085 | $nom = "'modeles/' . $nom"; |
| 2086 | 2086 | } |
@@ -2097,8 +2097,8 @@ discard block |
||
| 2097 | 2097 | $primary = $p->boucles[$p->id_boucle]->primary; |
| 2098 | 2098 | if (!strpos($primary, ',')) { |
| 2099 | 2099 | $id = champ_sql($primary, $p); |
| 2100 | - $_contexte[] = "'$primary'=>" . $id; |
|
| 2101 | - $_contexte[] = "'id'=>" . $id; |
|
| 2100 | + $_contexte[] = "'$primary'=>".$id; |
|
| 2101 | + $_contexte[] = "'id'=>".$id; |
|
| 2102 | 2102 | } |
| 2103 | 2103 | } |
| 2104 | 2104 | $_contexte[] = "'recurs'=>(++\$recurs)"; |
@@ -2110,11 +2110,11 @@ discard block |
||
| 2110 | 2110 | $_options = memoriser_contexte_compil($p); |
| 2111 | 2111 | $_options = "'compil'=>array($_options), 'trim'=>true"; |
| 2112 | 2112 | if (isset($_contexte['ajax'])) { |
| 2113 | - $_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2113 | + $_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2114 | 2114 | unset($_contexte['ajax']); |
| 2115 | 2115 | } |
| 2116 | 2116 | |
| 2117 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2117 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2118 | 2118 | if ($flag_env) { |
| 2119 | 2119 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2120 | 2120 | } |
@@ -2224,12 +2224,12 @@ discard block |
||
| 2224 | 2224 | function balise_DOUBLONS_dist($p) { |
| 2225 | 2225 | if ($type = interprete_argument_balise(1, $p)) { |
| 2226 | 2226 | if ($famille = interprete_argument_balise(2, $p)) { |
| 2227 | - $type .= '.' . $famille; |
|
| 2227 | + $type .= '.'.$famille; |
|
| 2228 | 2228 | } |
| 2229 | - $p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")'; |
|
| 2229 | + $p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")'; |
|
| 2230 | 2230 | if (!$p->etoile) { |
| 2231 | 2231 | $p->code = 'array_filter(array_map("intval",explode(",",' |
| 2232 | - . $p->code . ')))'; |
|
| 2232 | + . $p->code.')))'; |
|
| 2233 | 2233 | } |
| 2234 | 2234 | } else { |
| 2235 | 2235 | $p->code = '$doublons'; |
@@ -2358,7 +2358,7 @@ discard block |
||
| 2358 | 2358 | $_code[] = "$_key => $_val"; |
| 2359 | 2359 | } |
| 2360 | 2360 | } while ($_key && $_val); |
| 2361 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2361 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2362 | 2362 | $p->interdire_scripts = false; |
| 2363 | 2363 | |
| 2364 | 2364 | return $p; |
@@ -2385,7 +2385,7 @@ discard block |
||
| 2385 | 2385 | while ($_val = interprete_argument_balise($n++, $p)) { |
| 2386 | 2386 | $_code[] = $_val; |
| 2387 | 2387 | } |
| 2388 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2388 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2389 | 2389 | $p->interdire_scripts = false; |
| 2390 | 2390 | |
| 2391 | 2391 | return $p; |
@@ -2430,10 +2430,10 @@ discard block |
||
| 2430 | 2430 | $_code[] = $_v; |
| 2431 | 2431 | } |
| 2432 | 2432 | |
| 2433 | - $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join( |
|
| 2433 | + $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join( |
|
| 2434 | 2434 | ', ', |
| 2435 | 2435 | $_code |
| 2436 | - ) . ')?" ":"")'; |
|
| 2436 | + ).')?" ":"")'; |
|
| 2437 | 2437 | $p->interdire_scripts = false; |
| 2438 | 2438 | |
| 2439 | 2439 | return $p; |
@@ -2466,7 +2466,7 @@ discard block |
||
| 2466 | 2466 | $type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"'; |
| 2467 | 2467 | |
| 2468 | 2468 | $f = chercher_filtre('info_plugin'); |
| 2469 | - $p->code = $f . '(' . $plugin . ', ' . $type_info . ')'; |
|
| 2469 | + $p->code = $f.'('.$plugin.', '.$type_info.')'; |
|
| 2470 | 2470 | |
| 2471 | 2471 | return $p; |
| 2472 | 2472 | } |
@@ -2716,12 +2716,12 @@ discard block |
||
| 2716 | 2716 | $_issens = "in_array($_champ,array('>','<'))"; |
| 2717 | 2717 | $_sens = "(strpos('< >',$_champ)-1)"; |
| 2718 | 2718 | |
| 2719 | - $_variable = "((\$s=$_issens)?'sens':'tri')." . $boucle->modificateur['tri_nom']; |
|
| 2719 | + $_variable = "((\$s=$_issens)?'sens':'tri').".$boucle->modificateur['tri_nom']; |
|
| 2720 | 2720 | $_url = "parametre_url(self(),$_variable,\$s?$_sens:$_champ)"; |
| 2721 | - $_url = "parametre_url($_url,'var_memotri',strncmp(" . $boucle->modificateur['tri_nom'] . ",'session',7)==0?$_variable:'')"; |
|
| 2722 | - $_on = '$s?(' . $boucle->modificateur['tri_sens'] . "==$_sens" . '):(' . $boucle->modificateur['tri_champ'] . "==$_champ)"; |
|
| 2721 | + $_url = "parametre_url($_url,'var_memotri',strncmp(".$boucle->modificateur['tri_nom'].",'session',7)==0?$_variable:'')"; |
|
| 2722 | + $_on = '$s?('.$boucle->modificateur['tri_sens']."==$_sens".'):('.$boucle->modificateur['tri_champ']."==$_champ)"; |
|
| 2723 | 2723 | |
| 2724 | - $p->code = "lien_ou_expose($_url,$_libelle,$_on" . ($_class ? ",$_class" : '') . ')'; |
|
| 2724 | + $p->code = "lien_ou_expose($_url,$_libelle,$_on".($_class ? ",$_class" : '').')'; |
|
| 2725 | 2725 | //$p->code = "''"; |
| 2726 | 2726 | $p->interdire_scripts = false; |
| 2727 | 2727 | |
@@ -2795,7 +2795,7 @@ discard block |
||
| 2795 | 2795 | $connect = $p->boucles[$p->id_boucle]->sql_serveur; |
| 2796 | 2796 | } |
| 2797 | 2797 | |
| 2798 | - $p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')"; |
|
| 2798 | + $p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')"; |
|
| 2799 | 2799 | $p->interdire_scripts = false; |
| 2800 | 2800 | |
| 2801 | 2801 | return $p; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $texte = $intro; |
| 85 | 85 | } else { |
| 86 | 86 | if ( |
| 87 | - strpos("\n" . $texte, "\n|") === false |
|
| 87 | + strpos("\n".$texte, "\n|") === false |
|
| 88 | 88 | and strlen($texte) > 2.5 * $longueur |
| 89 | 89 | ) { |
| 90 | 90 | if (strpos($texte, '<multi') !== false) { |
@@ -168,12 +168,12 @@ discard block |
||
| 168 | 168 | if ($pas < 1) { |
| 169 | 169 | return ''; |
| 170 | 170 | } |
| 171 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 172 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 171 | + $ancre = 'pagination'.$nom; // #pagination_articles |
|
| 172 | + $debut = 'debut'.$nom; // 'debut_articles' |
|
| 173 | 173 | |
| 174 | 174 | // n'afficher l'ancre qu'une fois |
| 175 | 175 | if (!isset($ancres[$ancre])) { |
| 176 | - $bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>"; |
|
| 176 | + $bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>"; |
|
| 177 | 177 | } else { |
| 178 | 178 | $bloc_ancre = ''; |
| 179 | 179 | } |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | if ($modele) { |
| 207 | 207 | $pagination['type_pagination'] = $modele; |
| 208 | - if (trouver_fond('pagination_' . $modele, 'modeles')) { |
|
| 209 | - $modele = '_' . $modele; |
|
| 208 | + if (trouver_fond('pagination_'.$modele, 'modeles')) { |
|
| 209 | + $modele = '_'.$modele; |
|
| 210 | 210 | } |
| 211 | 211 | else { |
| 212 | 212 | $modele = ''; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | function lister_objets_avec_logos($type) { |
| 292 | 292 | |
| 293 | 293 | $objet = objet_type($type); |
| 294 | - $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet)); |
|
| 294 | + $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet)); |
|
| 295 | 295 | if ($ids) { |
| 296 | 296 | $ids = array_column($ids, 'id_objet'); |
| 297 | 297 | return implode(',', $ids); |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | case 'sinum ': |
| 466 | 466 | return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}"; |
| 467 | 467 | default: |
| 468 | - return $champ . $senstri; |
|
| 468 | + return $champ.$senstri; |
|
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |