@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (!$fonc) { |
| 147 | 147 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 148 | 148 | } |
| 149 | - $titre = $mode ? $mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc); |
|
| 149 | + $titre = $mode ? $mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '') : ($fonc); |
|
| 150 | 150 | } |
| 151 | 151 | if ($message === false) { |
| 152 | 152 | lang_select(); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $fond = $GLOBALS['fond'] ?? ''; |
| 170 | 170 | // une erreur critique sort $message en array |
| 171 | 171 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 172 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 172 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 173 | 173 | |
| 174 | 174 | return $msg; |
| 175 | 175 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | function debusquer_bandeau($erreurs) { |
| 178 | 178 | |
| 179 | 179 | if (!empty($erreurs)) { |
| 180 | - $n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 180 | + $n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')]; |
|
| 181 | 181 | |
| 182 | 182 | return debusquer_navigation($erreurs, $n); |
| 183 | 183 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -210,25 +210,25 @@ discard block |
||
| 210 | 210 | $valeur_simple = []; |
| 211 | 211 | foreach ($valeur as $v) { |
| 212 | 212 | if (is_array($v)) { |
| 213 | - $valeur_simple[] = 'array:' . count($v); |
|
| 213 | + $valeur_simple[] = 'array:'.count($v); |
|
| 214 | 214 | } elseif (is_object($v)) { |
| 215 | 215 | $valeur_simple[] = $v::class; |
| 216 | 216 | } elseif (is_string($v)) { |
| 217 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 217 | + $valeur_simple[] = "'".$v."'"; |
|
| 218 | 218 | } else { |
| 219 | 219 | $valeur_simple[] = $v; |
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | $n = count($valeur); |
| 223 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 224 | - $valeur .= '[' . implode(', ', $valeur_simple) . ']'; |
|
| 223 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 224 | + $valeur .= '['.implode(', ', $valeur_simple).']'; |
|
| 225 | 225 | } elseif (is_object($valeur)) { |
| 226 | 226 | $valeur = $valeur::class; |
| 227 | 227 | } elseif (is_string($valeur)) { |
| 228 | - $valeur = "'" . $valeur . "'"; |
|
| 228 | + $valeur = "'".$valeur."'"; |
|
| 229 | 229 | } |
| 230 | - $res .= "\n<tr><td><strong>" . nl2br((string) entites_html($nom)) |
|
| 231 | - . '</strong></td><td>: ' . nl2br((string) entites_html($valeur)) |
|
| 230 | + $res .= "\n<tr><td><strong>".nl2br((string) entites_html($nom)) |
|
| 231 | + . '</strong></td><td>: '.nl2br((string) entites_html($valeur)) |
|
| 232 | 232 | . "</td></tr>\n"; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | if ($ligne) { |
| 254 | 254 | $msg .= " L$ligne"; |
| 255 | 255 | } |
| 256 | - spip_log($msg, 'debusquer' . _LOG_ERREUR); |
|
| 256 | + spip_log($msg, 'debusquer'._LOG_ERREUR); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | $nom_code = $lieu->descr['nom']; |
| 279 | 279 | $skel = $lieu->descr['sourcefile']; |
| 280 | 280 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 281 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 281 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 282 | 282 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 283 | 283 | if ($boucle) { |
| 284 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 284 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 285 | 285 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | // Requete erronee |
| 373 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 373 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 374 | 374 | . spip_htmlspecialchars($msg) |
| 375 | 375 | . "\n<br /><span style='color: red'><b>" |
| 376 | 376 | . spip_htmlspecialchars($query) |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 386 | 386 | |
| 387 | - $id = $nom . $boucle; |
|
| 387 | + $id = $nom.$boucle; |
|
| 388 | 388 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 389 | 389 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 390 | 390 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', (string) $v[0], $r)) { |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | ) { |
| 433 | 433 | $reg[1] = 'inconnu'; |
| 434 | 434 | } |
| 435 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 435 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 436 | 436 | |
| 437 | 437 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 438 | 438 | if (preg_match($incl, (string) $v)) { |
@@ -448,16 +448,14 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | if (!$boucle) { |
| 450 | 450 | return $ligne |
| 451 | - ? ' (' . |
|
| 452 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 453 | - _T('squelette_ligne')) . |
|
| 451 | + ? ' ('. |
|
| 452 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 454 | 453 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" |
| 455 | 454 | : ''; |
| 456 | 455 | } else { |
| 457 | 456 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 458 | 457 | |
| 459 | - return $ligne ? " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" : |
|
| 460 | - " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)"; |
|
| 458 | + return $ligne ? " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)" : " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)"; |
|
| 461 | 459 | } |
| 462 | 460 | } |
| 463 | 461 | |
@@ -479,14 +477,14 @@ discard block |
||
| 479 | 477 | |
| 480 | 478 | $s = preg_replace( |
| 481 | 479 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 482 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 480 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 483 | 481 | $s |
| 484 | 482 | ); |
| 485 | 483 | |
| 486 | 484 | |
| 487 | 485 | $tableau = explode('<br />', $s); |
| 488 | 486 | |
| 489 | - $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" . (string) @strlen(count($tableau)) . "d</a></span> %s<br />\n"; |
|
| 487 | + $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".(string) @strlen(count($tableau))."d</a></span> %s<br />\n"; |
|
| 490 | 488 | |
| 491 | 489 | $format10 = str_replace('white', 'lightgrey', $format); |
| 492 | 490 | $formaterr = 'color: red;'; |
@@ -530,7 +528,7 @@ discard block |
||
| 530 | 528 | . '" style="cursor: pointer;">' |
| 531 | 529 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 532 | 530 | . '</div> |
| 533 | - ' . $res . "</div>\n"; |
|
| 531 | + ' . $res."</div>\n"; |
|
| 534 | 532 | } |
| 535 | 533 | |
| 536 | 534 | // l'environnement graphique du debuggueur |
@@ -552,14 +550,14 @@ discard block |
||
| 552 | 550 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 553 | 551 | [$legend, $texte, $res2] = debusquer_source($fonc, $mode); |
| 554 | 552 | $texte .= $res2; |
| 555 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 556 | - $legend = _T('zbug_' . $mode); |
|
| 557 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 553 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 554 | + $legend = _T('zbug_'.$mode); |
|
| 555 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 558 | 556 | $texte = ancre_texte($texte, ['', '']); |
| 559 | 557 | } |
| 560 | 558 | } else { |
| 561 | 559 | if (strlen(trim($res))) { |
| 562 | - 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>"; |
|
| 560 | + 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>"; |
|
| 563 | 561 | } else { |
| 564 | 562 | // cas de l'appel sur erreur: montre la page |
| 565 | 563 | return $GLOBALS['debug_objets']['resultat']['tout'] ?? ''; |
@@ -567,7 +565,7 @@ discard block |
||
| 567 | 565 | } |
| 568 | 566 | } else { |
| 569 | 567 | $valider = charger_fonction('valider', 'xml'); |
| 570 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 568 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 571 | 569 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 572 | 570 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 573 | 571 | [$texte, $err] = emboite_texte($val, $fonc, $self); |
@@ -578,14 +576,14 @@ discard block |
||
| 578 | 576 | } else { |
| 579 | 577 | $err = ": $err"; |
| 580 | 578 | } |
| 581 | - $legend = _T('validation') . ' ' . $err; |
|
| 579 | + $legend = _T('validation').' '.$err; |
|
| 582 | 580 | $res = $id = ''; |
| 583 | 581 | } |
| 584 | 582 | |
| 585 | 583 | return trim((string) $texte) |
| 586 | - ? "<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" |
|
| 584 | + ? "<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" |
|
| 587 | 585 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 588 | - . "<a href='" . $self . '#f_' . substr((string) $fonc, 0, 37) . "'> ↑ " |
|
| 586 | + . "<a href='".$self.'#f_'.substr((string) $fonc, 0, 37)."'> ↑ " |
|
| 589 | 587 | . ($legend ?: $mode) |
| 590 | 588 | . '</a></legend>' |
| 591 | 589 | . $texte |
@@ -597,7 +595,7 @@ discard block |
||
| 597 | 595 | |
| 598 | 596 | function emboite_texte($res, $fonc = '', $self = '') { |
| 599 | 597 | $errs = $res->err; |
| 600 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 598 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 601 | 599 | |
| 602 | 600 | if (!$texte && !$errs) { |
| 603 | 601 | return [ancre_texte('', ['', '']), false]; |
@@ -653,7 +651,7 @@ discard block |
||
| 653 | 651 | $err = "<h2 style='text-align: center'>" |
| 654 | 652 | . $i |
| 655 | 653 | . "<a href='#fin_err'>" |
| 656 | - . ' ' . _T('erreur_texte') |
|
| 654 | + . ' '._T('erreur_texte') |
|
| 657 | 655 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 658 | 656 | . $err |
| 659 | 657 | . " </table><a id='fin_err'></a>"; |
@@ -663,9 +661,9 @@ discard block |
||
| 663 | 661 | [$msg, $fermant, $ouvrant] = $errs[0]; |
| 664 | 662 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 665 | 663 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 666 | - $err = $msg . |
|
| 667 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 668 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 664 | + $err = $msg. |
|
| 665 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 666 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 669 | 667 | |
| 670 | 668 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 671 | 669 | } |
@@ -698,7 +696,7 @@ discard block |
||
| 698 | 696 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 699 | 697 | ) : ''; |
| 700 | 698 | |
| 701 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 699 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 702 | 700 | . $t_skel |
| 703 | 701 | . ' ' |
| 704 | 702 | . $sourcefile |
@@ -713,7 +711,7 @@ discard block |
||
| 713 | 711 | . "'>" |
| 714 | 712 | . _T('zbug_calcul') |
| 715 | 713 | . '</a></legend>' |
| 716 | - . ($temps ? "\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />" : ('')) |
|
| 714 | + . ($temps ? "\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />" : ('')) |
|
| 717 | 715 | . debusquer_contexte($contexte[$sourcefile]) |
| 718 | 716 | . ($nav ? "<table width='100%'>\n$nav</table>\n" : ('')) |
| 719 | 717 | . "</fieldset>\n"; |
@@ -734,33 +732,33 @@ discard block |
||
| 734 | 732 | $nom = $boucle->id_boucle; |
| 735 | 733 | $req = $boucle->type_requete; |
| 736 | 734 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 737 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 738 | - |
|
| 739 | - $res .= "\n<tr style='background-color: " . |
|
| 740 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 741 | - "'><td align='right'>$i</td><td>\n" . |
|
| 742 | - "<a class='debug_link_boucle' href='" . |
|
| 743 | - $self2 . |
|
| 744 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 745 | - _T('zbug_boucle') . |
|
| 746 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 747 | - $self2 . |
|
| 748 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 749 | - _T('zbug_resultat') . |
|
| 750 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 751 | - $self2 . |
|
| 752 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 753 | - _T('zbug_code') . |
|
| 754 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 755 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 756 | - "'>" . |
|
| 757 | - _T('zbug_calcul') . |
|
| 758 | - "</a></td><td>\n" . |
|
| 759 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 760 | - "</td><td>\n" . |
|
| 761 | - $req . |
|
| 762 | - "</td><td>\n" . |
|
| 763 | - spip_htmlspecialchars($crit) . |
|
| 735 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 736 | + |
|
| 737 | + $res .= "\n<tr style='background-color: ". |
|
| 738 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 739 | + "'><td align='right'>$i</td><td>\n". |
|
| 740 | + "<a class='debug_link_boucle' href='". |
|
| 741 | + $self2. |
|
| 742 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 743 | + _T('zbug_boucle'). |
|
| 744 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 745 | + $self2. |
|
| 746 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 747 | + _T('zbug_resultat'). |
|
| 748 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 749 | + $self2. |
|
| 750 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 751 | + _T('zbug_code'). |
|
| 752 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 753 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 754 | + "'>". |
|
| 755 | + _T('zbug_calcul'). |
|
| 756 | + "</a></td><td>\n". |
|
| 757 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 758 | + "</td><td>\n". |
|
| 759 | + $req. |
|
| 760 | + "</td><td>\n". |
|
| 761 | + spip_htmlspecialchars($crit). |
|
| 764 | 762 | '</td></tr>'; |
| 765 | 763 | } |
| 766 | 764 | } |
@@ -787,7 +785,7 @@ discard block |
||
| 787 | 785 | } |
| 788 | 786 | // permettre le copier/coller facile |
| 789 | 787 | // $res = ancre_texte($req, array(), true); |
| 790 | - $res = "<div id='T" . md5((string) $req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 788 | + $res = "<div id='T".md5((string) $req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 791 | 789 | // formatage et affichage des resultats bruts de la requete |
| 792 | 790 | $ress_req = spip_query($req); |
| 793 | 791 | $brut_sql = ''; |
@@ -797,10 +795,10 @@ discard block |
||
| 797 | 795 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 798 | 796 | while ($retours_sql = sql_fetch($ress_req)) { |
| 799 | 797 | if ($num <= $max_aff) { |
| 800 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 798 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 801 | 799 | $brut_sql .= '<p>'; |
| 802 | 800 | foreach ($retours_sql as $key => $val) { |
| 803 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 801 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 804 | 802 | } |
| 805 | 803 | $brut_sql .= '</p>'; |
| 806 | 804 | } |
@@ -811,14 +809,14 @@ discard block |
||
| 811 | 809 | // ne pas afficher les $contexte_inclus |
| 812 | 810 | $view = preg_replace(',<\?php.+\?[>],Uims', '', (string) $view); |
| 813 | 811 | if ($view) { |
| 814 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 812 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 815 | 813 | } |
| 816 | 814 | } |
| 817 | 815 | } elseif ($affiche == 'code') { |
| 818 | 816 | $legend = $nom; |
| 819 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 817 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 820 | 818 | } elseif ($affiche == 'boucle') { |
| 821 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 819 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 822 | 820 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 823 | 821 | $gram = preg_match('/^([^_]+)_/', (string) $objet, $r) ? $r[1] : ''; |
| 824 | 822 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -836,23 +834,23 @@ discard block |
||
| 836 | 834 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 837 | 835 | include_spip('inc/texte'); // pour corriger_typo |
| 838 | 836 | |
| 839 | - return _DOCTYPE_ECRIRE . |
|
| 840 | - html_lang_attributes() . |
|
| 841 | - "<head>\n<title>" . |
|
| 842 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 843 | - _T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' . |
|
| 844 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 845 | - ")</title>\n" . |
|
| 846 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 847 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 848 | - "' />\n" . |
|
| 837 | + return _DOCTYPE_ECRIRE. |
|
| 838 | + html_lang_attributes(). |
|
| 839 | + "<head>\n<title>". |
|
| 840 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 841 | + _T('admin_debug').' '.spip_htmlspecialchars($titre).' ('. |
|
| 842 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 843 | + ")</title>\n". |
|
| 844 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 845 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 846 | + "' />\n". |
|
| 849 | 847 | http_script('', 'jquery.js') |
| 850 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 851 | - . "' type='text/css' />" . |
|
| 852 | - "</head>\n" . |
|
| 853 | - "<body style='margin:0 10px;'>\n" . |
|
| 854 | - "<div id='spip-debug-header'>" . |
|
| 855 | - $corps . |
|
| 856 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 848 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 849 | + . "' type='text/css' />". |
|
| 850 | + "</head>\n". |
|
| 851 | + "<body style='margin:0 10px;'>\n". |
|
| 852 | + "<div id='spip-debug-header'>". |
|
| 853 | + $corps. |
|
| 854 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 857 | 855 | '</div></body></html>'; |
| 858 | 856 | } |
@@ -26,36 +26,36 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function format_inclure_html($file, $args, $prof) { |
| 28 | 28 | if (!str_contains((string) $file, '#')) { |
| 29 | - $t = $file ? ('(' . $file . ')') : ''; |
|
| 29 | + $t = $file ? ('('.$file.')') : ''; |
|
| 30 | 30 | } else { |
| 31 | - $t = '{fond=' . $file . '}'; |
|
| 31 | + $t = '{fond='.$file.'}'; |
|
| 32 | 32 | } |
| 33 | - $args = $args ? '{' . implode(', ', $args) . '}' : (''); |
|
| 33 | + $args = $args ? '{'.implode(', ', $args).'}' : (''); |
|
| 34 | 34 | |
| 35 | - return ('<INCLURE' . $t . $args . '>'); |
|
| 35 | + return ('<INCLURE'.$t.$args.'>'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | function format_polyglotte_html($args, $prof) { |
| 39 | 39 | $contenu = []; |
| 40 | 40 | foreach ($args as $l => $t) { |
| 41 | - $contenu[] = ($l ? "[$l]" : '') . $t; |
|
| 41 | + $contenu[] = ($l ? "[$l]" : '').$t; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - return ('<multi>' . implode(' ', $contenu) . '</multi>'); |
|
| 44 | + return ('<multi>'.implode(' ', $contenu).'</multi>'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | function format_idiome_html($nom, $module, $args, $filtres, $prof) { |
| 48 | 48 | foreach ($args as $k => $v) { |
| 49 | 49 | $args[$k] = "$k=$v"; |
| 50 | 50 | } |
| 51 | - $args = ($args ? '{' . implode(',', $args) . '}' : ('')); |
|
| 51 | + $args = ($args ? '{'.implode(',', $args).'}' : ('')); |
|
| 52 | 52 | |
| 53 | - return ('<:' . ($module ? "$module:" : '') . $nom . $args . $filtres . ':>'); |
|
| 53 | + return ('<:'.($module ? "$module:" : '').$nom.$args.$filtres.':>'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function format_champ_html($nom, $boucle, $etoile, $avant, $apres, $args, $filtres, $prof) { |
| 57 | 57 | $nom = '#' |
| 58 | - . ($boucle ? ($boucle . ':') : '') |
|
| 58 | + . ($boucle ? ($boucle.':') : '') |
|
| 59 | 59 | . $nom |
| 60 | 60 | . $etoile |
| 61 | 61 | . $args |
@@ -84,12 +84,12 @@ discard block |
||
| 84 | 84 | $critere[$k] = $crit_s; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return ($critere ? '{' . implode(',', $critere) . '}' : ('')); |
|
| 87 | + return ($critere ? '{'.implode(',', $critere).'}' : ('')); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | function format_liste_html($fonc, $args, $prof) { |
| 91 | 91 | return ((($fonc !== '') ? "|$fonc" : $fonc) |
| 92 | - . ($args ? '{' . implode(',', $args) . '}' : (''))); |
|
| 92 | + . ($args ? '{'.implode(',', $args).'}' : (''))); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Concatenation sans separateur: verifier qu'on ne cree pas de faux lexemes |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // si un texte se termine par ( et est suivi d'un champ |
| 107 | 107 | // ou assimiles, forcer la notation pleine |
| 108 | 108 | if ($c1 == '(' && str_starts_with((string) $texte2, '#')) { |
| 109 | - $args[$i + 1][0] = '[(' . $texte2 . ')]'; |
|
| 109 | + $args[$i + 1][0] = '[('.$texte2.')]'; |
|
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | 112 | if ($type == 'texte') { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $c1 == '}' && str_starts_with(ltrim((string) $texte2), '|') |
| 120 | 120 | || preg_match('/[\w\d_*]/', $c1) && preg_match('/^[\w\d_*{|]/', (string) $texte2) |
| 121 | 121 | ) { |
| 122 | - $args[$i][0] = '[(' . $texte . ')]'; |
|
| 122 | + $args[$i][0] = '[('.$texte.')]'; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * texte |
| 41 | 41 | */ |
| 42 | 42 | function sandbox_composer_texte($texte, &$p) { |
| 43 | - return "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], $texte) . "'"; |
|
| 43 | + return "'".str_replace(['\\', "'"], ['\\\\', "\\'"], $texte)."'"; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $min_f = $refl->getNumberOfRequiredParameters(); |
| 79 | 79 | if (($nb_args_f < $min_f)) { |
| 80 | 80 | $msg_args = ['filtre' => texte_script($fonc), 'nb' => $min_f - $nb_args_f]; |
| 81 | - erreur_squelette([ 'zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 81 | + erreur_squelette(['zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | // le filtre n'existe pas, |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function sandbox_filtrer_squelette($skel, $corps, $filtres) { |
| 161 | 161 | $series_filtres = func_get_args(); |
| 162 | - array_shift($series_filtres);// skel |
|
| 163 | - array_shift($series_filtres);// corps |
|
| 162 | + array_shift($series_filtres); // skel |
|
| 163 | + array_shift($series_filtres); // corps |
|
| 164 | 164 | |
| 165 | 165 | // proteger les <INCLUDE> et tous les morceaux de php licites |
| 166 | 166 | if ($skel['process_ins'] == 'php') { |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | if (is_array($r)) { |
| 209 | 209 | $dst[] = $r[0]; |
| 210 | 210 | |
| 211 | - return $src[] = '___' . md5((string) $r[0]) . '___'; |
|
| 211 | + return $src[] = '___'.md5((string) $r[0]).'___'; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // si on recoit pas un tableau, on renvoit les couples de substitution |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | function chrono_requete($temps) { |
| 109 | 109 | $total = 0; |
| 110 | - $hors = '<i>' . _T('zbug_hors_compilation') . '</i>'; |
|
| 110 | + $hors = '<i>'._T('zbug_hors_compilation').'</i>'; |
|
| 111 | 111 | $t = $q = $n = $d = []; |
| 112 | 112 | // Totaliser les temps et completer le Explain |
| 113 | 113 | foreach ($temps as $key => $v) { |
| 114 | 114 | [$dt, $nb, $boucle, $query, $explain, $res, $contexte] = $v; |
| 115 | 115 | if (is_array($contexte)) { |
| 116 | - $k = ($contexte[0] . " $boucle"); |
|
| 116 | + $k = ($contexte[0]." $boucle"); |
|
| 117 | 117 | include_spip('public/compiler'); |
| 118 | 118 | $env = reconstruire_contexte_compil($contexte); |
| 119 | 119 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // Fabriquer les liens de navigations dans le tableau des temps |
| 159 | 159 | foreach ($temps as $k => $v) { |
| 160 | 160 | $titre = strip_tags((string) $v[2]); |
| 161 | - $href = quote_amp($GLOBALS['REQUEST_URI']) . "#req$i"; |
|
| 161 | + $href = quote_amp($GLOBALS['REQUEST_URI'])."#req$i"; |
|
| 162 | 162 | $href = str_replace("\\'", ''', $href); |
| 163 | 163 | |
| 164 | 164 | if (!isset($t[$v[2]])) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | unset($d['']); |
| 180 | 180 | // Fabriquer le tableau des liens de navigation dans le grand tableau |
| 181 | 181 | foreach ($d as $k => $v) { |
| 182 | - $d[$k] = $n[$k] . "</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 182 | + $d[$k] = $n[$k]."</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 183 | 183 | . implode('', $t[$k]); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | . implode("</td></tr>\n<tr><td>", $d) |
| 190 | 190 | . "</td></tr>\n" |
| 191 | 191 | . (# _request('var_mode_objet') ? '' : |
| 192 | - ('<tr><td>' . (is_countable($temps) ? count($temps) : 0) . '</td><td>' . _T('info_total') . '</td><td class="time">' . $total . '</td><td></td></tr>')) |
|
| 192 | + ('<tr><td>'.(is_countable($temps) ? count($temps) : 0).'</td><td>'._T('info_total').'</td><td class="time">'.$total.'</td><td></td></tr>')) |
|
| 193 | 193 | ]; |
| 194 | 194 | |
| 195 | 195 | return [$temps, $navigation]; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return sql_getfetsel( |
| 36 | 36 | 'virtuel', |
| 37 | 37 | 'spip_articles', |
| 38 | - ['id_article=' . (int) $id_article, "statut='publie'"], |
|
| 38 | + ['id_article='.(int) $id_article, "statut='publie'"], |
|
| 39 | 39 | '', |
| 40 | 40 | '', |
| 41 | 41 | '', |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $cache_quete[$connect][$table][$id] = sql_fetsel( |
| 79 | 79 | $cache_quete[$connect][$table]['_select'], |
| 80 | 80 | $table, |
| 81 | - $cache_quete[$connect][$table]['_id'] . '=' . (int) $id, |
|
| 81 | + $cache_quete[$connect][$table]['_id'].'='.(int) $id, |
|
| 82 | 82 | '', |
| 83 | 83 | '', |
| 84 | 84 | '', |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | return |
| 170 | 170 | (isset($GLOBALS['meta']['date_prochain_postdate']) |
| 171 | 171 | && $GLOBALS['meta']['date_prochain_postdate'] > time()) |
| 172 | - ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 172 | + ? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 173 | 173 | : '1=1'; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | && ($id_table = reset($objet)) |
| 229 | 229 | && ($objet = objet_type($id_table)) |
| 230 | 230 | ) { |
| 231 | - $w = "$mstatut<>" . sql_quote($v); |
|
| 231 | + $w = "$mstatut<>".sql_quote($v); |
|
| 232 | 232 | |
| 233 | 233 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 234 | 234 | // sinon l’auteur en session |
@@ -242,22 +242,22 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 245 | - if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) { |
|
| 245 | + if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) { |
|
| 246 | 246 | // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche |
| 247 | 247 | if (!$id_auteur) { |
| 248 | 248 | $where[] = $w; |
| 249 | 249 | } else { |
| 250 | 250 | $primary = id_table_objet($objet); |
| 251 | - $where[] = "($w OR $id_table.$primary IN (" . sql_get_select( |
|
| 251 | + $where[] = "($w OR $id_table.$primary IN (".sql_get_select( |
|
| 252 | 252 | 'ssss.id_objet', |
| 253 | 253 | 'spip_auteurs_liens AS ssss', |
| 254 | - 'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . (int) $id_auteur, |
|
| 254 | + 'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.(int) $id_auteur, |
|
| 255 | 255 | '', |
| 256 | 256 | '', |
| 257 | 257 | '', |
| 258 | 258 | '', |
| 259 | 259 | $serveur |
| 260 | - ) . '))'; |
|
| 260 | + ).'))'; |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | } // ignorer ce statut si on ne sait pas comment le filtrer |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return array|bool|null |
| 296 | 296 | */ |
| 297 | 297 | function quete_fichier($id_document, $serveur = '') { |
| 298 | - return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . (int) $id_document), '', [], '', '', $serveur); |
|
| 298 | + return sql_getfetsel('fichier', 'spip_documents', ('id_document='.(int) $id_document), '', [], '', '', $serveur); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * @return array|bool |
| 307 | 307 | */ |
| 308 | 308 | function quete_document($id_document, $serveur = '') { |
| 309 | - return sql_fetsel('*', 'spip_documents', ('id_document=' . (int) $id_document), '', [], '', '', $serveur); |
|
| 309 | + return sql_fetsel('*', 'spip_documents', ('id_document='.(int) $id_document), '', [], '', '', $serveur); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * @return array|bool|null |
| 318 | 318 | */ |
| 319 | 319 | function quete_meta($nom, $serveur) { |
| 320 | - return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur); |
|
| 320 | + return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -368,9 +368,9 @@ discard block |
||
| 368 | 368 | // qui permet de distinguer le changement de logo |
| 369 | 369 | // et placer un expire sur le dossier IMG/ |
| 370 | 370 | $res = [ |
| 371 | - $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 372 | - ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 373 | - ($taille ? ' ' . $taille[3] : ('')) |
|
| 371 | + $on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 372 | + ($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 373 | + ($taille ? ' '.$taille[3] : ('')) |
|
| 374 | 374 | ]; |
| 375 | 375 | $res['src'] = $res[0]; |
| 376 | 376 | $res['logo_on'] = $res[0]; |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | if ( |
| 481 | 481 | strcmp((string) $logo, (string) _DIR_PLUGINS) == 0 |
| 482 | 482 | || strcmp((string) $logo, (string) _DIR_PLUGINS_DIST) == 0 |
| 483 | - || strcmp((string) $logo, _DIR_RACINE . 'prive/') == 0 |
|
| 483 | + || strcmp((string) $logo, _DIR_RACINE.'prive/') == 0 |
|
| 484 | 484 | ) { |
| 485 | 485 | return $logo; |
| 486 | 486 | } |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | $exposer[$m][$type][$principal] = true; |
| 657 | 657 | if ($type == 'id_mot') { |
| 658 | 658 | if (!$parent) { |
| 659 | - $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . (int) $principal, '', '', '', '', $connect); |
|
| 659 | + $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.(int) $principal, '', '', '', '', $connect); |
|
| 660 | 660 | } |
| 661 | 661 | if ($parent) { |
| 662 | 662 | $exposer[$m]['id_groupe'][$parent] = true; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function optimiser_caches_contextes() { |
| 52 | 52 | sous_repertoire(_DIR_CACHE, 'contextes'); |
| 53 | - if (is_dir($d = _DIR_CACHE . 'contextes')) { |
|
| 53 | + if (is_dir($d = _DIR_CACHE.'contextes')) { |
|
| 54 | 54 | include_spip('inc/invalideur'); |
| 55 | 55 | purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]); |
| 56 | 56 | } |
@@ -95,16 +95,16 @@ discard block |
||
| 95 | 95 | $tables[] = array_shift($row); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - spip_log('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG); |
|
| 98 | + spip_log('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG); |
|
| 99 | 99 | if ($tables) { |
| 100 | 100 | $table_op = (int) (lire_config('optimiser_table', 0) + 1) % count($tables); |
| 101 | 101 | ecrire_config('optimiser_table', $table_op); |
| 102 | 102 | $q = $tables[$table_op]; |
| 103 | - spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 103 | + spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 104 | 104 | if (sql_optimize($q)) { |
| 105 | - spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 105 | + spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 106 | 106 | } else { |
| 107 | - spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie' . _LOG_DEBUG); |
|
| 107 | + spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie'._LOG_DEBUG); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | sql_free($sel); |
| 140 | 140 | |
| 141 | 141 | if ($in) { |
| 142 | - sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : '')); |
|
| 143 | - spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)), 'genie' . _LOG_DEBUG); |
|
| 142 | + sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : '')); |
|
| 143 | + spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)), 'genie'._LOG_DEBUG); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return count($in); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) { |
| 221 | 221 | define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600); |
| 222 | 222 | } |
| 223 | - sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU))); |
|
| 223 | + sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU))); |
|
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | 226 | * Permet aux plugins de compléter l'optimisation suite aux éléments disparus |
@@ -241,5 +241,5 @@ discard block |
||
| 241 | 241 | ]); |
| 242 | 242 | |
| 243 | 243 | |
| 244 | - spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie' . _LOG_DEBUG); |
|
| 244 | + spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie'._LOG_DEBUG); |
|
| 245 | 245 | } |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | function genie_mise_a_jour_dist($t) { |
| 29 | 29 | include_spip('inc/meta'); |
| 30 | 30 | $maj = info_maj($GLOBALS['spip_version_branche']); |
| 31 | - ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : '', 'non'); |
|
| 31 | + ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche']."|$maj") : '', 'non'); |
|
| 32 | 32 | |
| 33 | 33 | mise_a_jour_ecran_securite(); |
| 34 | 34 | |
| 35 | - spip_log('Verification version SPIP : ' . ($maj ?: 'version a jour'), 'verifie_maj'); |
|
| 35 | + spip_log('Verification version SPIP : '.($maj ?: 'version a jour'), 'verifie_maj'); |
|
| 36 | 36 | |
| 37 | 37 | return 1; |
| 38 | 38 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | // si l'ecran n'est pas deja present ou pas updatable, sortir |
| 58 | 58 | if ( |
| 59 | 59 | !_URL_ECRAN_SECURITE |
| 60 | - || !file_exists($filename = _DIR_ETC . 'ecran_securite.php') |
|
| 60 | + || !file_exists($filename = _DIR_ETC.'ecran_securite.php') |
|
| 61 | 61 | || !is_writable($filename) |
| 62 | 62 | || !($last_modified = filemtime($filename)) |
| 63 | 63 | || !($md5 = md5_file($filename)) |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | include_spip('inc/distant'); |
| 69 | - $tmp_file = _DIR_TMP . 'ecran_securite.php'; |
|
| 69 | + $tmp_file = _DIR_TMP.'ecran_securite.php'; |
|
| 70 | 70 | $url = parametre_url(_URL_ECRAN_SECURITE, 'md5', $md5); |
| 71 | 71 | $url = parametre_url($url, 'vspip', $GLOBALS['spip_version_branche']); |
| 72 | 72 | $res = recuperer_url($url, [ |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | include_once $tmp_file; |
| 86 | 86 | // ok, on le copie a la place de l'ecran existant |
| 87 | 87 | // en backupant l'ecran avant, au cas ou |
| 88 | - @copy($filename, $filename . '-bck-' . date('Y-m-d-His', $last_modified)); |
|
| 88 | + @copy($filename, $filename.'-bck-'.date('Y-m-d-His', $last_modified)); |
|
| 89 | 89 | @rename($tmp_file, $filename); |
| 90 | 90 | } else { |
| 91 | 91 | @unlink($tmp_file); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $message[] = _T('nouvelle_version_spip_majeure', ['version' => $maj['majeure']]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="' . $maj['mineure'] . '">' . implode(' | ', $message) . '</a>'; |
|
| 130 | + return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="'.$maj['mineure'].'">'.implode(' | ', $message).'</a>'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | function info_maj_cache(): ?array { |
| 145 | 145 | $contenu = ''; |
| 146 | 146 | $options = []; |
| 147 | - $nom = _DIR_CACHE . _VERSIONS_LISTE; |
|
| 147 | + $nom = _DIR_CACHE._VERSIONS_LISTE; |
|
| 148 | 148 | if (file_exists($nom)) { |
| 149 | 149 | $contenu = file_get_contents($nom); |
| 150 | 150 | $options['if_modified_since'] = filemtime($nom); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | try { |
| 166 | 166 | $json = json_decode((string) $contenu, true, 512, JSON_THROW_ON_ERROR); |
| 167 | 167 | } catch (JsonException $e) { |
| 168 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), 'verifie_maj'); |
|
| 168 | + spip_log('Failed to parse Json data : '.$e->getMessage(), 'verifie_maj'); |
|
| 169 | 169 | return null; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | foreach ($versions as $v) { |
| 199 | 199 | [$maj2, $min2, $rev2] = explode('.', $v); |
| 200 | - $branche_maj = $maj2 . '.' . $min2; |
|
| 201 | - $version_maj = $maj2 . '.' . $min2 . '.' . $rev2; |
|
| 200 | + $branche_maj = $maj2.'.'.$min2; |
|
| 201 | + $version_maj = $maj2.'.'.$min2.'.'.$rev2; |
|
| 202 | 202 | $is_version_stable = is_numeric($rev2); |
| 203 | 203 | // d'abord les mises à jour de la même branche (version mineure) |
| 204 | 204 | if ( |
@@ -107,8 +107,8 @@ |
||
| 107 | 107 | function message_crash_tables() { |
| 108 | 108 | if ($crash = verifier_crash_tables()) { |
| 109 | 109 | return |
| 110 | - '<strong>' . _T('texte_recuperer_base') . '</strong><br />' |
|
| 111 | - . ' <tt>' . implode(', ', $crash) . '</tt><br />' |
|
| 110 | + '<strong>'._T('texte_recuperer_base').'</strong><br />' |
|
| 111 | + . ' <tt>'.implode(', ', $crash).'</tt><br />' |
|
| 112 | 112 | . generer_form_ecrire( |
| 113 | 113 | 'base_repair', |
| 114 | 114 | _T('texte_crash_base'), |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $headers = ''; |
| 51 | 51 | if (isset($page['entetes']) && (is_countable($page['entetes']) ? count($page['entetes']) : 0)) { |
| 52 | 52 | foreach ($page['entetes'] as $k => $v) { |
| 53 | - $headers .= (strlen((string) $v) ? "$k: $v" : $k) . "\n"; |
|
| 53 | + $headers .= (strlen((string) $v) ? "$k: $v" : $k)."\n"; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |