@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * Pour plus de détails voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | # ou est l'espace prive ? |
| 16 | 16 | if (!defined('_DIR_RESTREINT_ABS')) { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 125 | 125 | if ($var !== 1) { |
| 126 | 126 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 127 | - . $val . ($echap ? ") . '" : ' '); |
|
| 127 | + . $val.($echap ? ") . '" : ' '); |
|
| 128 | 128 | } else { |
| 129 | 129 | $val = $echap ? "'.$val.'" : $val; |
| 130 | 130 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if (!$lang) { |
| 146 | 146 | $lang = '$GLOBALS["spip_lang"]'; |
| 147 | 147 | } |
| 148 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 148 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 149 | 149 | |
| 150 | 150 | return $l; |
| 151 | 151 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 176 | 176 | if (is_string($p->texte)) { |
| 177 | 177 | $fichier = $p->texte; |
| 178 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 178 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 179 | 179 | } else { |
| 180 | 180 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 181 | 181 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return false; |
| 225 | 225 | } // j'aurais voulu toucher le fond ... |
| 226 | 226 | |
| 227 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 227 | + $contexte = 'array('.$_contexte.')'; |
|
| 228 | 228 | |
| 229 | 229 | if ($env) { |
| 230 | 230 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -239,16 +239,16 @@ discard block |
||
| 239 | 239 | $_options[] = $ajax; |
| 240 | 240 | } |
| 241 | 241 | $code = " ' . argumenter_squelette($code) . '"; |
| 242 | - $code = 'echo ' . sprintf( |
|
| 242 | + $code = 'echo '.sprintf( |
|
| 243 | 243 | CODE_RECUPERER_FOND, |
| 244 | 244 | $code, |
| 245 | 245 | $contexte, |
| 246 | 246 | implode(',', $_options), |
| 247 | 247 | "_request(\\'connect\\') ?? \\'\\'" |
| 248 | - ) . ';'; |
|
| 248 | + ).';'; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 251 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $id = $id_table; |
| 329 | 329 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 330 | 330 | } |
| 331 | - $mstatut = $id . '.' . $statut; |
|
| 331 | + $mstatut = $id.'.'.$statut; |
|
| 332 | 332 | |
| 333 | 333 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 334 | 334 | include_spip('public/quete'); |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | isset($s['post_date']) and $s['post_date'] |
| 337 | 337 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 338 | 338 | ) { |
| 339 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 339 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 340 | 340 | array_unshift( |
| 341 | 341 | $boucle->where, |
| 342 | 342 | $echapper ? |
| 343 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 343 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 344 | 344 | : |
| 345 | 345 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 346 | 346 | ); |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | $boucle->where, |
| 350 | 350 | $echapper ? |
| 351 | 351 | "\nquete_condition_statut('$mstatut'," |
| 352 | - . _q($s['previsu']) . ',' |
|
| 353 | - . _q($s['publie']) . ',' |
|
| 354 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 352 | + . _q($s['previsu']).',' |
|
| 353 | + . _q($s['publie']).',' |
|
| 354 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 355 | 355 | : |
| 356 | 356 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 357 | 357 | ); |
@@ -385,14 +385,14 @@ discard block |
||
| 385 | 385 | if (_request('var_mode_affiche') != 'resultat') { |
| 386 | 386 | $trace = ''; |
| 387 | 387 | } else { |
| 388 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 388 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 389 | 389 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 390 | 390 | $trace = " |
| 391 | 391 | if (empty($_trace)) { |
| 392 | 392 | $_trace = []; |
| 393 | 393 | } |
| 394 | 394 | if (count($_trace) < 3) { |
| 395 | - $_trace" . '[] = $t0; |
|
| 395 | + $_trace".'[] = $t0; |
|
| 396 | 396 | }'; |
| 397 | 397 | } |
| 398 | 398 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | return |
| 427 | 427 | // Numrows[$nom] peut ne pas être encore defini |
| 428 | 428 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 429 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 429 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 430 | 430 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 431 | 431 | . $trace |
| 432 | 432 | . "\n\treturn \$t0;"; |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 495 | 495 | // et puis faire un [] plutot qu'un "','." |
| 496 | 496 | if ($boucle->doublons) { |
| 497 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 497 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 498 | 498 | index_pile($id_boucle, $primary, $boucles) |
| 499 | 499 | . "; // doublons\n"; |
| 500 | 500 | } |
@@ -522,13 +522,13 @@ discard block |
||
| 522 | 522 | $corps .= |
| 523 | 523 | "\n\t\tlang_select_public(" |
| 524 | 524 | . index_pile($id_boucle, 'lang', $boucles) |
| 525 | - . ", '" . $boucle->lang_select . "'" |
|
| 525 | + . ", '".$boucle->lang_select."'" |
|
| 526 | 526 | . (in_array($type_boucle, [ |
| 527 | 527 | 'articles', |
| 528 | 528 | 'rubriques', |
| 529 | 529 | 'hierarchie', |
| 530 | 530 | 'breves' |
| 531 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 531 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 532 | 532 | . ');'; |
| 533 | 533 | } else { |
| 534 | 534 | $init_lang = ''; |
@@ -550,20 +550,16 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // gestion optimale des separateurs et des boucles constantes |
| 552 | 552 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 553 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 553 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | $corps .= |
| 557 | 557 | ((!$boucle->separateur) ? |
| 558 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 559 | - (($return === "''") ? '' : |
|
| 560 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 561 | - ("\n\t\t\$t1 " . |
|
| 558 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 562 | 559 | ((strpos($return, '$t1.') === 0) ? |
| 563 | - ('.=' . substr($return, 4)) : |
|
| 564 | - ('= ' . $return)) . |
|
| 565 | - ";\n\t\t" . |
|
| 566 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 560 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 561 | + ";\n\t\t". |
|
| 562 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 567 | 563 | |
| 568 | 564 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 569 | 565 | // souhaite invalider ces elements |
@@ -645,7 +641,7 @@ discard block |
||
| 645 | 641 | $corps, |
| 646 | 642 | $fin_lang, |
| 647 | 643 | $trace, |
| 648 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 644 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 649 | 645 | ); |
| 650 | 646 | |
| 651 | 647 | return $a; |
@@ -665,25 +661,24 @@ discard block |
||
| 665 | 661 | **/ |
| 666 | 662 | function calculer_requete_sql($boucle) { |
| 667 | 663 | $init = []; |
| 668 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 669 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 664 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 665 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 670 | 666 | # En absence de champ c'est un decompte : |
| 671 | 667 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 672 | 668 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 673 | 669 | $init[] = calculer_dec( |
| 674 | 670 | 'groupby', |
| 675 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 671 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 676 | 672 | ); |
| 677 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 678 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 673 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 674 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 679 | 675 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 680 | 676 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 681 | 677 | $init[] = calculer_dec( |
| 682 | 678 | 'limit', |
| 683 | 679 | ( |
| 684 | 680 | strpos($boucle->limit, 'intval') === false ? |
| 685 | - "'" . ($boucle->limit) . "'" : |
|
| 686 | - $boucle->limit |
|
| 681 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 687 | 682 | ) |
| 688 | 683 | ); |
| 689 | 684 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -692,17 +687,17 @@ discard block |
||
| 692 | 687 | // ou recalculée à chaque passage (vide) |
| 693 | 688 | foreach ($init as $i) { |
| 694 | 689 | if (reset($i)) { |
| 695 | - $s .= "\n\t\t" . end($i); |
|
| 690 | + $s .= "\n\t\t".end($i); |
|
| 696 | 691 | } # statique |
| 697 | 692 | else { |
| 698 | - $d .= "\n\t" . end($i); |
|
| 693 | + $d .= "\n\t".end($i); |
|
| 699 | 694 | } # dynamique |
| 700 | 695 | } |
| 701 | 696 | |
| 702 | 697 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 703 | 698 | . $boucle->in |
| 704 | 699 | . $boucle->hash |
| 705 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 700 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 706 | 701 | . $s |
| 707 | 702 | . "\n\t}" |
| 708 | 703 | . $d; |
@@ -757,7 +752,7 @@ discard block |
||
| 757 | 752 | ]; |
| 758 | 753 | |
| 759 | 754 | $p->id_boucle = $context_compil[2] ?? ''; |
| 760 | - $p->ligne = (int)($context_compil[3] ?? 0); |
|
| 755 | + $p->ligne = (int) ($context_compil[3] ?? 0); |
|
| 761 | 756 | $p->lang = $context_compil[4] ?? ''; |
| 762 | 757 | |
| 763 | 758 | return $p; |
@@ -786,7 +781,7 @@ discard block |
||
| 786 | 781 | * - index 1 : Code de l'affectation |
| 787 | 782 | **/ |
| 788 | 783 | function calculer_dec($nom, $val) { |
| 789 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 784 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 790 | 785 | // si une variable apparait dans le calcul de la clause |
| 791 | 786 | // il faut la re-evaluer a chaque passage |
| 792 | 787 | if ( |
@@ -803,7 +798,7 @@ discard block |
||
| 803 | 798 | $static = ''; |
| 804 | 799 | } |
| 805 | 800 | |
| 806 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 801 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 807 | 802 | } |
| 808 | 803 | |
| 809 | 804 | /** |
@@ -828,27 +823,27 @@ discard block |
||
| 828 | 823 | } |
| 829 | 824 | $res = ''; |
| 830 | 825 | if ($a and $a[0] == "'?'") { |
| 831 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 832 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 833 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 826 | + return ('('.calculer_dump_array($a[1]). |
|
| 827 | + ' ? '.calculer_dump_array($a[2]). |
|
| 828 | + ' : '.calculer_dump_array($a[3]). |
|
| 834 | 829 | ')'); |
| 835 | 830 | } else { |
| 836 | 831 | foreach ($a as $k => $v) { |
| 837 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 838 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 832 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 833 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 839 | 834 | } |
| 840 | 835 | |
| 841 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 836 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 842 | 837 | } |
| 843 | 838 | } |
| 844 | 839 | |
| 845 | 840 | function calculer_dump_join($a) { |
| 846 | 841 | $res = ''; |
| 847 | 842 | foreach ($a as $k => $v) { |
| 848 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 843 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 849 | 844 | } |
| 850 | 845 | |
| 851 | - return 'array(' . substr($res, 2) . ')'; |
|
| 846 | + return 'array('.substr($res, 2).')'; |
|
| 852 | 847 | } |
| 853 | 848 | |
| 854 | 849 | /** |
@@ -865,7 +860,7 @@ discard block |
||
| 865 | 860 | $res .= ",'$k' => '$v'"; |
| 866 | 861 | } |
| 867 | 862 | |
| 868 | - return 'array(' . substr($res, 1) . ')'; |
|
| 863 | + return 'array('.substr($res, 1).')'; |
|
| 869 | 864 | } |
| 870 | 865 | |
| 871 | 866 | /** |
@@ -883,7 +878,7 @@ discard block |
||
| 883 | 878 | $res .= ",'$k' => '$v'"; |
| 884 | 879 | } |
| 885 | 880 | |
| 886 | - return 'array(' . substr($res, 1) . ')'; |
|
| 881 | + return 'array('.substr($res, 1).')'; |
|
| 887 | 882 | } |
| 888 | 883 | |
| 889 | 884 | function calculer_order(&$boucle) { |
@@ -952,19 +947,19 @@ discard block |
||
| 952 | 947 | ) { |
| 953 | 948 | $res .= " .\n$tab$code"; |
| 954 | 949 | } else { |
| 955 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 950 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 956 | 951 | } |
| 957 | 952 | } |
| 958 | 953 | |
| 959 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 954 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 960 | 955 | } |
| 961 | 956 | } else { |
| 962 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 957 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 963 | 958 | |
| 964 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 959 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 965 | 960 | " ,\n$tab", |
| 966 | 961 | $codes |
| 967 | - ) . ')))'; |
|
| 962 | + ).')))'; |
|
| 968 | 963 | } |
| 969 | 964 | } |
| 970 | 965 | |
@@ -1000,7 +995,7 @@ discard block |
||
| 1000 | 995 | // texte seul |
| 1001 | 996 | case 'texte': |
| 1002 | 997 | $code = sandbox_composer_texte($p->texte, $p); |
| 1003 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 998 | + $commentaire = strlen($p->texte).' signes'; |
|
| 1004 | 999 | $avant = ''; |
| 1005 | 1000 | $apres = ''; |
| 1006 | 1001 | $altern = "''"; |
@@ -1009,14 +1004,14 @@ discard block |
||
| 1009 | 1004 | case 'polyglotte': |
| 1010 | 1005 | $code = ''; |
| 1011 | 1006 | foreach ($p->traductions as $k => $v) { |
| 1012 | - $code .= ",'" . |
|
| 1013 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1014 | - "' => '" . |
|
| 1015 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 1007 | + $code .= ",'". |
|
| 1008 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 1009 | + "' => '". |
|
| 1010 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1016 | 1011 | "'"; |
| 1017 | 1012 | } |
| 1018 | - $code = 'choisir_traduction(array(' . |
|
| 1019 | - substr($code, 1) . |
|
| 1013 | + $code = 'choisir_traduction(array('. |
|
| 1014 | + substr($code, 1). |
|
| 1020 | 1015 | '))'; |
| 1021 | 1016 | $commentaire = '&'; |
| 1022 | 1017 | $avant = ''; |
@@ -1032,7 +1027,7 @@ discard block |
||
| 1032 | 1027 | $err_e_c = true; |
| 1033 | 1028 | $code = "''"; |
| 1034 | 1029 | } else { |
| 1035 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1030 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1036 | 1031 | $avant = ''; |
| 1037 | 1032 | $apres = ''; |
| 1038 | 1033 | $altern = "''"; |
@@ -1061,8 +1056,8 @@ discard block |
||
| 1061 | 1056 | $err_e_c = true; |
| 1062 | 1057 | $code = "''"; |
| 1063 | 1058 | } else { |
| 1064 | - $code = 'BOUCLE' . |
|
| 1065 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1059 | + $code = 'BOUCLE'. |
|
| 1060 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1066 | 1061 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1067 | 1062 | $commentaire = "?$nom"; |
| 1068 | 1063 | if ( |
@@ -1104,24 +1099,22 @@ discard block |
||
| 1104 | 1099 | foreach ($p->arg as $k => $v) { |
| 1105 | 1100 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1106 | 1101 | if ($k) { |
| 1107 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1102 | + $l[] = _q($k).' => '.$_v; |
|
| 1108 | 1103 | } else { |
| 1109 | 1104 | $code = $_v; |
| 1110 | 1105 | } |
| 1111 | 1106 | } |
| 1112 | 1107 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1113 | 1108 | if ($p->module) { |
| 1114 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1109 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1115 | 1110 | } elseif ($p->nom_champ) { |
| 1116 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1111 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1117 | 1112 | } else { |
| 1118 | 1113 | $m = ''; |
| 1119 | 1114 | } |
| 1120 | 1115 | |
| 1121 | - $code = (!$code ? "'$m'" : |
|
| 1122 | - ($m ? "'$m' . $code" : |
|
| 1123 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1124 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1116 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1117 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1125 | 1118 | $code = "_T($code)"; |
| 1126 | 1119 | if ($p->param) { |
| 1127 | 1120 | $p->id_boucle = $id_boucle; |
@@ -1143,7 +1136,7 @@ discard block |
||
| 1143 | 1136 | $p->type_requete = $type; |
| 1144 | 1137 | |
| 1145 | 1138 | $code = calculer_champ($p); |
| 1146 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1139 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1147 | 1140 | $avant = calculer_liste( |
| 1148 | 1141 | $p->avant, |
| 1149 | 1142 | $descr, |
@@ -1183,10 +1176,9 @@ discard block |
||
| 1183 | 1176 | if ($code != "''") { |
| 1184 | 1177 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1185 | 1178 | $codes[] = (($mode == 'validation') ? |
| 1186 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1179 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1187 | 1180 | : (($mode == 'code') ? |
| 1188 | - "\n// $commentaire\n$code" : |
|
| 1189 | - $code)); |
|
| 1181 | + "\n// $commentaire\n$code" : $code)); |
|
| 1190 | 1182 | } |
| 1191 | 1183 | } // foreach |
| 1192 | 1184 | |
@@ -1242,19 +1234,19 @@ discard block |
||
| 1242 | 1234 | $cond = ''; |
| 1243 | 1235 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1244 | 1236 | $t = $r[2]; |
| 1245 | - $cond = '!' . $r[1]; |
|
| 1237 | + $cond = '!'.$r[1]; |
|
| 1246 | 1238 | } else { |
| 1247 | 1239 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1248 | 1240 | $t = $r[2]; |
| 1249 | 1241 | $cond = $r[1]; |
| 1250 | 1242 | } else { |
| 1251 | - $t = '$t' . $n; |
|
| 1243 | + $t = '$t'.$n; |
|
| 1252 | 1244 | $cond = "($t = $code)!==''"; |
| 1253 | 1245 | } |
| 1254 | 1246 | } |
| 1255 | 1247 | |
| 1256 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1257 | - $t . |
|
| 1248 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1249 | + $t. |
|
| 1258 | 1250 | (!$apres ? '' : " . $apres"); |
| 1259 | 1251 | |
| 1260 | 1252 | if ($res !== $t) { |
@@ -1305,12 +1297,12 @@ discard block |
||
| 1305 | 1297 | |
| 1306 | 1298 | // rendre inertes les echappements de #[](){}<> |
| 1307 | 1299 | $i = 0; |
| 1308 | - while (str_contains($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1300 | + while (str_contains($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1309 | 1301 | $i++; |
| 1310 | 1302 | } |
| 1311 | 1303 | $squelette = preg_replace_callback( |
| 1312 | 1304 | ',\\\\([#[()\]{}<>]),', |
| 1313 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1305 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1314 | 1306 | $squelette, |
| 1315 | 1307 | -1, |
| 1316 | 1308 | $esc |
@@ -1326,7 +1318,7 @@ discard block |
||
| 1326 | 1318 | // Phraser le squelette, selon sa grammaire |
| 1327 | 1319 | |
| 1328 | 1320 | $boucles = []; |
| 1329 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1321 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1330 | 1322 | |
| 1331 | 1323 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1332 | 1324 | |
@@ -1342,7 +1334,7 @@ discard block |
||
| 1342 | 1334 | ); |
| 1343 | 1335 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1344 | 1336 | ",$inerte-(\d+)-,", |
| 1345 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1337 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1346 | 1338 | $boucle->descr['squelette'] |
| 1347 | 1339 | ); |
| 1348 | 1340 | } |
@@ -1353,19 +1345,19 @@ discard block |
||
| 1353 | 1345 | include_spip('public/decompiler'); |
| 1354 | 1346 | foreach ($boucles as $id => $boucle) { |
| 1355 | 1347 | if ($id) { |
| 1356 | - $decomp = "\n/* BOUCLE " . |
|
| 1357 | - $boucle->type_requete . |
|
| 1358 | - ' ' . |
|
| 1359 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1360 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1348 | + $decomp = "\n/* BOUCLE ". |
|
| 1349 | + $boucle->type_requete. |
|
| 1350 | + ' '. |
|
| 1351 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1352 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1361 | 1353 | " */\n"; |
| 1362 | 1354 | } else { |
| 1363 | - $decomp = ("\n/*\n" . |
|
| 1355 | + $decomp = ("\n/*\n". |
|
| 1364 | 1356 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1365 | 1357 | . "\n*/"); |
| 1366 | 1358 | } |
| 1367 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1368 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1359 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1360 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1369 | 1361 | } |
| 1370 | 1362 | } |
| 1371 | 1363 | |
@@ -1388,7 +1380,7 @@ discard block |
||
| 1388 | 1380 | } |
| 1389 | 1381 | } |
| 1390 | 1382 | foreach ($boucles as $id => $boucle) { |
| 1391 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1383 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1392 | 1384 | } |
| 1393 | 1385 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1394 | 1386 | |
@@ -1479,8 +1471,7 @@ discard block |
||
| 1479 | 1471 | } else { |
| 1480 | 1472 | $boucles[$id]->type_requete = false; |
| 1481 | 1473 | $boucle = $boucles[$id]; |
| 1482 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1483 | - ($boucle->sql_serveur . ':')) . |
|
| 1474 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1484 | 1475 | $type; |
| 1485 | 1476 | $msg = [ |
| 1486 | 1477 | 'zbug_table_inconnue', |
@@ -1570,13 +1561,13 @@ discard block |
||
| 1570 | 1561 | if ( |
| 1571 | 1562 | // fonction de boucle avec serveur & table |
| 1572 | 1563 | (!$serveur or |
| 1573 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1574 | - and (!function_exists($f = $f . '_dist')) |
|
| 1564 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1565 | + and (!function_exists($f = $f.'_dist')) |
|
| 1575 | 1566 | ) |
| 1576 | 1567 | ) |
| 1577 | 1568 | // fonction de boucle avec table |
| 1578 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1579 | - and (!function_exists($f = $f . '_dist')) |
|
| 1569 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1570 | + and (!function_exists($f = $f.'_dist')) |
|
| 1580 | 1571 | ) { |
| 1581 | 1572 | // fonction de boucle standard |
| 1582 | 1573 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1584,20 +1575,20 @@ discard block |
||
| 1584 | 1575 | } |
| 1585 | 1576 | } |
| 1586 | 1577 | |
| 1587 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1588 | - "static \$connect;\n\t" . |
|
| 1589 | - "\$command['connect'] = \$connect = " . |
|
| 1590 | - _q($boucle->sql_serveur) . |
|
| 1591 | - ';' . |
|
| 1578 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1579 | + "static \$connect;\n\t". |
|
| 1580 | + "\$command['connect'] = \$connect = ". |
|
| 1581 | + _q($boucle->sql_serveur). |
|
| 1582 | + ';'. |
|
| 1592 | 1583 | $f($id, $boucles); |
| 1593 | 1584 | } else { |
| 1594 | 1585 | $req = ("\n\treturn '';"); |
| 1595 | 1586 | } |
| 1596 | 1587 | |
| 1597 | 1588 | $boucles[$id]->return = |
| 1598 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1599 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1600 | - $req . |
|
| 1589 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1590 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1591 | + $req. |
|
| 1601 | 1592 | "\n}\n"; |
| 1602 | 1593 | } |
| 1603 | 1594 | |
@@ -1607,7 +1598,7 @@ discard block |
||
| 1607 | 1598 | return false; |
| 1608 | 1599 | } |
| 1609 | 1600 | |
| 1610 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1601 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1611 | 1602 | ' |
| 1612 | 1603 | // reporter de maniere securisee les doublons inclus |
| 1613 | 1604 | . ' |
@@ -1615,15 +1606,15 @@ discard block |
||
| 1615 | 1606 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1616 | 1607 | |
| 1617 | 1608 | $connect = ' . |
| 1618 | - _q($connect) . '; |
|
| 1609 | + _q($connect).'; |
|
| 1619 | 1610 | $page = ' . |
| 1620 | 1611 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1621 | 1612 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1622 | 1613 | // avant de referencer $Cache |
| 1623 | - $corps . '; |
|
| 1614 | + $corps.'; |
|
| 1624 | 1615 | |
| 1625 | 1616 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1626 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1617 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1627 | 1618 | }'; |
| 1628 | 1619 | |
| 1629 | 1620 | $secondes = spip_timer('calcul_skel'); |
@@ -1637,10 +1628,10 @@ discard block |
||
| 1637 | 1628 | $code->return = ' |
| 1638 | 1629 | // |
| 1639 | 1630 | // Fonction principale du squelette ' . |
| 1640 | - $sourcefile . |
|
| 1641 | - ($connect ? " pour $connect" : '') . |
|
| 1642 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1643 | - "\n//\n" . |
|
| 1631 | + $sourcefile. |
|
| 1632 | + ($connect ? " pour $connect" : ''). |
|
| 1633 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1634 | + "\n//\n". |
|
| 1644 | 1635 | $principal; |
| 1645 | 1636 | |
| 1646 | 1637 | $boucles[''] = $code; |
@@ -1692,7 +1683,7 @@ discard block |
||
| 1692 | 1683 | **/ |
| 1693 | 1684 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1694 | 1685 | include_spip('iterateur/data'); |
| 1695 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1686 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1696 | 1687 | $g = charger_fonction('data', 'iterateur'); |
| 1697 | 1688 | $boucles[$id] = $g($boucle); |
| 1698 | 1689 | // from[0] stocke le type de data (rss, yql, ...) |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $select = true |
| 128 | 128 | ) { |
| 129 | 129 | if (!is_string($defaut)) { |
| 130 | - $defaut = '($Pile[0][\'' . strtolower($nom_champ) . '\'] ?? null)'; |
|
| 130 | + $defaut = '($Pile[0][\''.strtolower($nom_champ).'\'] ?? null)'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $idb_origine = $idb; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | // renseigner la boucle source de ce champ pour les traitements |
| 162 | 162 | $boucles[$idb_origine]->index_champ[$nom_champ_origine] = $idb; |
| 163 | - $champ = '$Pile[$SP' . ($i ? "-$i" : '') . '][\'' . $c . '\']'; |
|
| 163 | + $champ = '$Pile[$SP'.($i ? "-$i" : '').'][\''.$c.'\']'; |
|
| 164 | 164 | if (!$joker) { |
| 165 | 165 | return index_compose($conditionnel, $champ); |
| 166 | 166 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | function index_compose($conditionnel, $defaut) { |
| 202 | 202 | while ($c = array_pop($conditionnel)) { |
| 203 | 203 | // si on passe defaut = '', ne pas générer d'erreur de compilation. |
| 204 | - $defaut = "($c:(" . ($defaut ?: "''") . '))'; |
|
| 204 | + $defaut = "($c:(".($defaut ?: "''").'))'; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $defaut; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | if (!$r) { |
| 249 | 249 | $joker = false; // indiquer a l'appelant |
| 250 | 250 | # continuer pour chercher l'erreur suivante |
| 251 | - return ["'#" . $r . ':' . $nom_champ . "'", '']; |
|
| 251 | + return ["'#".$r.':'.$nom_champ."'", '']; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $desc = $boucles[$idb]->show; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if (preg_match('/^(.*)\.(.*)$/', $nom_champ, $r)) { |
| 292 | 292 | [, $_table, $_nom_champ] = $r; |
| 293 | 293 | if ($cle = trouver_jointure_champ($_nom_champ, $boucles[$idb], [$_table])) { |
| 294 | - $_alias = $cle . '_' . $_nom_champ; |
|
| 294 | + $_alias = $cle.'_'.$_nom_champ; |
|
| 295 | 295 | return index_exception( |
| 296 | 296 | $boucles[$idb], |
| 297 | 297 | $desc, |
@@ -371,8 +371,8 @@ discard block |
||
| 371 | 371 | $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep); |
| 372 | 372 | } |
| 373 | 373 | if ($t == null) { |
| 374 | - [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | - $excep = $x; #PHP5 de droite a gauche ! |
|
| 374 | + [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | + $excep = $x; #PHP5 de droite a gauche ! |
|
| 376 | 376 | $j = $trouver_table($e, $boucle->sql_serveur); |
| 377 | 377 | if (!$j) { |
| 378 | 378 | return ['', '']; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $l = (preg_split('/\s*,\s*/', $k)); |
| 385 | 385 | $k = $desc['key']['PRIMARY KEY']; |
| 386 | 386 | if (!in_array($k, $l)) { |
| 387 | - spip_log("jointure impossible $e " . join(',', $l)); |
|
| 387 | + spip_log("jointure impossible $e ".join(',', $l)); |
|
| 388 | 388 | |
| 389 | 389 | return ['', '']; |
| 390 | 390 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // demander a SQL de gerer le synonyme |
| 401 | 401 | // ca permet que excep soit dynamique (Cedric, 2/3/06) |
| 402 | 402 | if ($excep != $nom_champ) { |
| 403 | - $excep .= ' AS ' . $nom_champ; |
|
| 403 | + $excep .= ' AS '.$nom_champ; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | return ["$t.$excep", $nom_champ]; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | join(',', $collecte), |
| 655 | 655 | ($collecte ? $param : substr($param, 1)), # virer la virgule |
| 656 | 656 | memoriser_contexte_compil($p), |
| 657 | - (!$supp ? '' : (', ' . join(',', $supp))) |
|
| 657 | + (!$supp ? '' : (', '.join(',', $supp))) |
|
| 658 | 658 | ); |
| 659 | 659 | |
| 660 | 660 | $p->interdire_scripts = false; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | * @return array |
| 689 | 689 | * Liste des codes PHP d'éxecution des balises collectées |
| 690 | 690 | **/ |
| 691 | -function collecter_balise_dynamique(array $l, Champ &$p, string $nom): array { |
|
| 691 | +function collecter_balise_dynamique(array $l, Champ & $p, string $nom): array { |
|
| 692 | 692 | $args = []; |
| 693 | 693 | foreach ($l as $c) { |
| 694 | 694 | if ($c === null) { |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $nom = $p->id_boucle; |
| 757 | 757 | |
| 758 | 758 | if ($nom and trouver_nom_serveur_distant($p)) { |
| 759 | - spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit')); |
|
| 759 | + spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit')); |
|
| 760 | 760 | |
| 761 | 761 | return false; |
| 762 | 762 | } |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | (strpos($ps, 'typo') !== false) |
| 842 | 842 | ) |
| 843 | 843 | ) { |
| 844 | - $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')'; |
|
| 844 | + $ps = 'traiter_doublons_documents($doublons, '.$ps.')'; |
|
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | // La protection des champs par |safehtml est assuree par les extensions |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | function compose_filtres_args($p, $args, $sep) { |
| 960 | 960 | $arglist = ''; |
| 961 | 961 | foreach ($args as $arg) { |
| 962 | - $arglist .= $sep . |
|
| 962 | + $arglist .= $sep. |
|
| 963 | 963 | calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle); |
| 964 | 964 | } |
| 965 | 965 | |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | while ($b != '') { |
| 1010 | 1010 | foreach ($p->boucles[$b]->criteres as $critere) { |
| 1011 | 1011 | if ($critere->op == $motif) { |
| 1012 | - $p->code = '$Pile[$SP' . (($n == 0) ? '' : "-$n") . |
|
| 1012 | + $p->code = '$Pile[$SP'.(($n == 0) ? '' : "-$n"). |
|
| 1013 | 1013 | "]['$champ']"; |
| 1014 | 1014 | $b = ''; |
| 1015 | 1015 | break 2; |
@@ -1037,6 +1037,6 @@ discard block |
||
| 1037 | 1037 | */ |
| 1038 | 1038 | function zbug_presenter_champ($p, $champ = '') { |
| 1039 | 1039 | $balise = $champ ?: $p->nom_champ; |
| 1040 | - $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : ''; |
|
| 1040 | + $explicite = $p->nom_boucle ? $p->nom_boucle.':' : ''; |
|
| 1041 | 1041 | return "#{$explicite}{$balise}"; |
| 1042 | 1042 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 57 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 58 | 58 | |
| 59 | 59 | // si squelette est deja compile et perenne, le charger |
| 60 | 60 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | #} |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 70 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 71 | 71 | include_once $lib; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | eval("return true; $f ;"); |
| 96 | 96 | } catch (\ParseError $e) { |
| 97 | 97 | // Code syntaxiquement faux (critere etc mal programme') |
| 98 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 98 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 99 | 99 | erreur_squelette($msg, $boucle); |
| 100 | 100 | // continuer pour trouver d'autres fautes eventuelles |
| 101 | 101 | // mais prevenir que c'est mort |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if (defined('_VAR_MODE') and _VAR_MODE == 'debug') { |
| 125 | 125 | // Tracer ce qui vient d'etre compile |
| 126 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 126 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 127 | 127 | |
| 128 | 128 | // si c'est ce que demande le debusqueur, lui passer la main |
| 129 | 129 | if ( |
@@ -147,13 +147,13 @@ discard block |
||
| 147 | 147 | $code = " |
| 148 | 148 | /* |
| 149 | 149 | * Squelette : $sourcefile |
| 150 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 151 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 152 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 150 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 151 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 152 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 153 | 153 | */ '; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n"; |
|
| 156 | + $code = '<'."?php\n".$code.join('', $boucles)."\n"; |
|
| 157 | 157 | if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) { |
| 158 | 158 | ecrire_fichier($phpfile, $code); |
| 159 | 159 | } |
@@ -215,18 +215,18 @@ discard block |
||
| 215 | 215 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 216 | 216 | |
| 217 | 217 | if ($j == 'X-Spip-Filtre' and isset($headers[$j])) { |
| 218 | - $headers[$j] .= '|' . $r[3]; |
|
| 218 | + $headers[$j] .= '|'.$r[3]; |
|
| 219 | 219 | } else { |
| 220 | - $headers[$j] = str_replace(['\\\\',"\\'",'\\"'], ['\\',"'",'"'], $r[3]); |
|
| 220 | + $headers[$j] = str_replace(['\\\\', "\\'", '\\"'], ['\\', "'", '"'], $r[3]); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | // S'agit-il d'un resultat constant ou contenant du code php |
| 225 | 225 | $process_ins = ( |
| 226 | - strpos($corps, '<' . '?') === false |
|
| 226 | + strpos($corps, '<'.'?') === false |
|
| 227 | 227 | or |
| 228 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 229 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 228 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 229 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 230 | 230 | ) |
| 231 | 231 | ? 'html' |
| 232 | 232 | : 'php'; |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | if ($process_ins == 'html') { |
| 257 | 257 | $skel['process_ins'] = ( |
| 258 | - strpos($corps, '<' . '?') === false |
|
| 258 | + strpos($corps, '<'.'?') === false |
|
| 259 | 259 | or |
| 260 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 261 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 260 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 261 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 262 | 262 | ) |
| 263 | 263 | ? 'html' |
| 264 | 264 | : 'php'; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | // |
| 277 | 277 | |
| 278 | 278 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 279 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 279 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 280 | 280 | include_once("%s"); |
| 281 | 281 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 282 | 282 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | // pas de lien symbolique sous Windows |
| 308 | 308 | and !(stristr(PHP_OS, 'WIN') and str_contains($file, ':')) |
| 309 | 309 | ) { |
| 310 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 310 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | $lang = $context_compil[4]; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | $args = array_map('argumenter_squelette', $args); |
| 319 | 319 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 320 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 320 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 321 | 321 | } |
| 322 | 322 | $args = join(', ', $args); |
| 323 | 323 | |
@@ -351,14 +351,14 @@ discard block |
||
| 351 | 351 | if (is_object($v)) { |
| 352 | 352 | return var_export($v, true); |
| 353 | 353 | } elseif (!is_array($v)) { |
| 354 | - return "'" . texte_script((string) $v) . "'"; |
|
| 354 | + return "'".texte_script((string) $v)."'"; |
|
| 355 | 355 | } else { |
| 356 | 356 | $out = []; |
| 357 | 357 | foreach ($v as $k => $val) { |
| 358 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 358 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - return 'array(' . join(', ', $out) . ')'; |
|
| 361 | + return 'array('.join(', ', $out).')'; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | else { |
| 385 | 385 | $str_args = base64_encode(serialize($args)); |
| 386 | - return "<?" . "php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?".">\n"; |
|
| 386 | + return "<?"."php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?".">\n"; |
|
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | // Y a-t-il une fonction de traitement des arguments ? |
| 464 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 464 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 465 | 465 | |
| 466 | 466 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 467 | 467 | |
@@ -471,18 +471,18 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | // verifier que la fonction dyn est la, |
| 473 | 473 | // sinon se replier sur la generique si elle existe |
| 474 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 474 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 475 | 475 | if ( |
| 476 | 476 | $balise_generique = chercher_balise_generique($nom) |
| 477 | 477 | and $nom_balise_generique = $balise_generique['nom_generique'] |
| 478 | - and $file = include_spip('balise/' . strtolower($nom_balise_generique)) |
|
| 479 | - and function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 478 | + and $file = include_spip('balise/'.strtolower($nom_balise_generique)) |
|
| 479 | + and function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 480 | 480 | ) { |
| 481 | 481 | // et lui injecter en premier arg le nom de la balise |
| 482 | 482 | array_unshift($r, $nom); |
| 483 | 483 | $nom_balise = $nom_balise_generique; |
| 484 | 484 | if (!_DIR_RESTREINT) { |
| 485 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 485 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 486 | 486 | } |
| 487 | 487 | } else { |
| 488 | 488 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | $n = ''; |
| 584 | 584 | foreach (explode(',', $liste) as $val) { |
| 585 | 585 | if ($a = intval($val) and $val === strval($a)) { |
| 586 | - $n .= ',' . $val; |
|
| 586 | + $n .= ','.$val; |
|
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | if (strlen($n)) { |
@@ -762,8 +762,8 @@ discard block |
||
| 762 | 762 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 763 | 763 | $i = 0; |
| 764 | 764 | do { |
| 765 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 766 | - [$sous[1] . ' AS id'], |
|
| 765 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 766 | + [$sous[1].' AS id'], |
|
| 767 | 767 | $from, |
| 768 | 768 | $from_type, |
| 769 | 769 | $wheresub, |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | $id, |
| 777 | 777 | $serveur, |
| 778 | 778 | false |
| 779 | - ) . ')'); |
|
| 779 | + ).')'); |
|
| 780 | 780 | if (!$i) { |
| 781 | 781 | $i = 1; |
| 782 | 782 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | if ($sous[0] == 'SUBSELECT') { |
| 797 | 797 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 798 | 798 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 799 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 799 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 800 | 800 | $sous[1], # select |
| 801 | 801 | $sous[2], #from |
| 802 | 802 | [], #from_type |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | $id, |
| 812 | 812 | $serveur, |
| 813 | 813 | false |
| 814 | - ) . ')'); |
|
| 814 | + ).')'); |
|
| 815 | 815 | } |
| 816 | 816 | array_pop($where_simples); |
| 817 | 817 | } |
@@ -874,15 +874,15 @@ discard block |
||
| 874 | 874 | // sans recours a preg_match |
| 875 | 875 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 876 | 876 | $afrom[$t][$cle] = [ |
| 877 | - "\n" . |
|
| 878 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 877 | + "\n". |
|
| 878 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 879 | 879 | $from[$cle], |
| 880 | 880 | "AS $cle", |
| 881 | 881 | 'ON (', |
| 882 | 882 | "$cle.$c", |
| 883 | 883 | '=', |
| 884 | 884 | "$t.$carr", |
| 885 | - ($and ? 'AND ' . $and : '') . |
|
| 885 | + ($and ? 'AND '.$and : ''). |
|
| 886 | 886 | ')' |
| 887 | 887 | ]; |
| 888 | 888 | if (isset($afrom[$cle])) { |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | $t = key($from); |
| 921 | 921 | $c = current($from); |
| 922 | 922 | reset($from); |
| 923 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 923 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 924 | 924 | if ( |
| 925 | 925 | !(strpos($t, ' ') or // jointure des le depart cf boucle_doc |
| 926 | 926 | calculer_jointnul($t, $select, $e) or |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | unset($afrom[$t][$nt]); |
| 939 | 939 | $afrom[$nt] = $afrom[$t]; |
| 940 | 940 | unset($afrom[$t]); |
| 941 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 941 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 942 | 942 | $t = $nfrom[4]; |
| 943 | 943 | $alias = ''; |
| 944 | 944 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -949,14 +949,14 @@ discard block |
||
| 949 | 949 | if ($newcle != $oldcle) { |
| 950 | 950 | // si l'ancienne cle etait deja dans le select avec un AS |
| 951 | 951 | // reprendre simplement ce AS |
| 952 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 952 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 953 | 953 | if (preg_match($as, implode(',', $select), $m)) { |
| 954 | 954 | $alias = ''; |
| 955 | 955 | } else { |
| 956 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 956 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 957 | 957 | } |
| 958 | 958 | } |
| 959 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 959 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 960 | 960 | $join = remplacer_jointnul($t, $join, $e); |
| 961 | 961 | $where = remplacer_jointnul($t, $where, $e); |
| 962 | 962 | $having = remplacer_jointnul($t, $having, $e); |
@@ -1006,9 +1006,9 @@ discard block |
||
| 1006 | 1006 | } else { |
| 1007 | 1007 | $exp = ''; |
| 1008 | 1008 | if (strtoupper($join) === 'AND') { |
| 1009 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1009 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1010 | 1010 | } else { |
| 1011 | - return $exp . join($join, $v); |
|
| 1011 | + return $exp.join($join, $v); |
|
| 1012 | 1012 | } |
| 1013 | 1013 | } |
| 1014 | 1014 | } |
@@ -1070,6 +1070,6 @@ discard block |
||
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | return $mime_type |
| 1073 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1074 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1073 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1074 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1075 | 1075 | } |
@@ -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 !str_contains($type, '/')) { |
| 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; |
@@ -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 |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * Pour plus de détails voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Initialisation de SPIP |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../'); |
| 55 | 55 | |
| 56 | 56 | /** chemin absolu vers la racine */ |
| 57 | -define('_ROOT_RACINE', dirname(__DIR__) . '/'); |
|
| 57 | +define('_ROOT_RACINE', dirname(__DIR__).'/'); |
|
| 58 | 58 | /** chemin absolu vers le repertoire de travail */ |
| 59 | -define('_ROOT_CWD', getcwd() . '/'); |
|
| 59 | +define('_ROOT_CWD', getcwd().'/'); |
|
| 60 | 60 | /** chemin absolu vers ecrire */ |
| 61 | -define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT); |
|
| 61 | +define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT); |
|
| 62 | 62 | |
| 63 | 63 | // Icones |
| 64 | 64 | if (!defined('_NOM_IMG_PACK')) { |
@@ -66,17 +66,17 @@ discard block |
||
| 66 | 66 | define('_NOM_IMG_PACK', 'images/'); |
| 67 | 67 | } |
| 68 | 68 | /** le chemin http (relatif) vers les images standard */ |
| 69 | -define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK)); |
|
| 69 | +define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK)); |
|
| 70 | 70 | |
| 71 | 71 | /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */ |
| 72 | -define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK); |
|
| 72 | +define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK); |
|
| 73 | 73 | |
| 74 | 74 | if (!defined('_JAVASCRIPT')) { |
| 75 | 75 | /** Nom du repertoire des bibliotheques JavaScript */ |
| 76 | 76 | define('_JAVASCRIPT', 'javascript/'); |
| 77 | 77 | } // utilisable avec #CHEMIN et find_in_path |
| 78 | 78 | /** le nom du repertoire des bibliotheques JavaScript du prive */ |
| 79 | -define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT)); |
|
| 79 | +define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT)); |
|
| 80 | 80 | |
| 81 | 81 | # Le nom des 4 repertoires modifiables par les scripts lances par httpd |
| 82 | 82 | # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas) |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // Son emplacement absolu si on le trouve |
| 109 | 109 | if ( |
| 110 | - @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php') |
|
| 111 | - or (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php')) |
|
| 110 | + @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php') |
|
| 111 | + or (@file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php')) |
|
| 112 | 112 | ) { |
| 113 | 113 | /** Emplacement absolu du fichier d'option */ |
| 114 | 114 | define('_FILE_OPTIONS', $f); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | // inclure l'ecran de securite |
| 133 | 133 | if ( |
| 134 | 134 | !defined('_ECRAN_SECURITE') |
| 135 | - and @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php') |
|
| 135 | + and @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php') |
|
| 136 | 136 | ) { |
| 137 | 137 | include $f; |
| 138 | 138 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | // UA plus cibles |
| 154 | 154 | . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' |
| 155 | 155 | . ',i', |
| 156 | - (string)$_SERVER['HTTP_USER_AGENT'] |
|
| 156 | + (string) $_SERVER['HTTP_USER_AGENT'] |
|
| 157 | 157 | ) |
| 158 | 158 | ); |
| 159 | 159 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | # la matrice standard (fichiers definissant les fonctions a inclure) |
| 396 | 396 | $spip_matrice = []; |
| 397 | 397 | # les plugins a activer |
| 398 | -$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 398 | +$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 399 | 399 | # les surcharges de include_spip() |
| 400 | 400 | $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php' |
| 401 | 401 | |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | // |
| 474 | 474 | // Charger les fonctions liees aux serveurs Http et Sql. |
| 475 | 475 | // |
| 476 | -require_once _ROOT_RESTREINT . 'inc/utils.php'; |
|
| 477 | -require_once _ROOT_RESTREINT . 'base/connect_sql.php'; |
|
| 476 | +require_once _ROOT_RESTREINT.'inc/utils.php'; |
|
| 477 | +require_once _ROOT_RESTREINT.'base/connect_sql.php'; |
|
| 478 | 478 | |
| 479 | 479 | // Definition personnelles eventuelles |
| 480 | 480 | |
@@ -497,10 +497,10 @@ discard block |
||
| 497 | 497 | // ===> on execute en neutralisant les messages d'erreur |
| 498 | 498 | |
| 499 | 499 | spip_initialisation_core( |
| 500 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 501 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 502 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 503 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 500 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 501 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 502 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 503 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 504 | 504 | ); |
| 505 | 505 | |
| 506 | 506 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | // Si on est dans le site public, dire que qq s'en occupe |
| 556 | 556 | include_spip('inc/minipres'); |
| 557 | 557 | utiliser_langue_visiteur(); |
| 558 | - echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]); |
|
| 558 | + echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]); |
|
| 559 | 559 | exit; |
| 560 | 560 | } |
| 561 | 561 | // autrement c'est une install ad hoc (spikini...), on sait pas faire |
@@ -594,12 +594,12 @@ discard block |
||
| 594 | 594 | } |
| 595 | 595 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 596 | 596 | include_spip('inc/filtres_mini'); |
| 597 | - header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt')); |
|
| 597 | + header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt')); |
|
| 598 | 598 | } else { |
| 599 | 599 | // header minimal |
| 600 | - header(_HEADER_COMPOSED_BY . ' @ www.spip.net'); |
|
| 600 | + header(_HEADER_COMPOSED_BY.' @ www.spip.net'); |
|
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : '')); |
| 605 | -spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG); |
|
| 605 | +spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG); |
|
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | function inc_sql_to_array_dist($data) { |
| 122 | 122 | # sortir le connecteur de $data |
| 123 | 123 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 124 | - $serveur = (string)$v[1]; |
|
| 124 | + $serveur = (string) $v[1]; |
|
| 125 | 125 | $req = trim($v[2]); |
| 126 | 126 | if ($s = sql_query($req, $serveur)) { |
| 127 | 127 | $r = []; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $json = json_decode($data, true, 512, JSON_THROW_ON_ERROR); |
| 147 | 147 | } catch (JsonException $e) { |
| 148 | 148 | $json = null; |
| 149 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO); |
|
| 149 | + spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO); |
|
| 150 | 150 | } |
| 151 | 151 | return is_array($json) ? (array) $json : []; |
| 152 | 152 | } |
@@ -166,13 +166,13 @@ discard block |
||
| 166 | 166 | $i = 1; |
| 167 | 167 | foreach ($entete as $k => $v) { |
| 168 | 168 | if (trim($v) == '') { |
| 169 | - $v = 'col' . $i; |
|
| 169 | + $v = 'col'.$i; |
|
| 170 | 170 | } // reperer des eventuelles cases vides |
| 171 | 171 | if (is_numeric($v) and $v < 0) { |
| 172 | - $v = '__' . $v; |
|
| 172 | + $v = '__'.$v; |
|
| 173 | 173 | } // ne pas risquer d'ecraser une cle numerique |
| 174 | 174 | if (is_numeric($v)) { |
| 175 | - $v = '_' . $v; |
|
| 175 | + $v = '_'.$v; |
|
| 176 | 176 | } // ne pas risquer d'ecraser une cle numerique |
| 177 | 177 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 178 | 178 | foreach ($csv as &$item) { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * @return array|bool |
| 259 | 259 | */ |
| 260 | 260 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 261 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 261 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 274 | 274 | $a = $glob_to_array($data); |
| 275 | 275 | foreach ($a as &$v) { |
| 276 | - $b = (array)@stat($v); |
|
| 276 | + $b = (array) @stat($v); |
|
| 277 | 277 | foreach ($b as $k => $ignore) { |
| 278 | 278 | if (is_numeric($k)) { |
| 279 | 279 | unset($b[$k]); |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | - $b['file'] = preg_replace('`/$`', '', $v) ; |
|
| 282 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 283 | 283 | $v = array_merge( |
| 284 | 284 | pathinfo($v), |
| 285 | 285 | $b |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $xml_array = []; |
| 300 | 300 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 301 | 301 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 302 | - $key .= '-' . uniqid(); |
|
| 302 | + $key .= '-'.uniqid(); |
|
| 303 | 303 | } |
| 304 | 304 | $vars = get_object_vars($object->current()); |
| 305 | 305 | if (isset($vars['@attributes'])) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $texte = $x . $texte; |
|
| 67 | + $texte = $x.$texte; |
|
| 68 | 68 | |
| 69 | 69 | return $texte; |
| 70 | 70 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | || ($pos = 0); |
| 179 | 179 | |
| 180 | 180 | if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 181 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 181 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 182 | 182 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | $texte = substr_replace($texte, $x, $pos, 0); |
| 212 | 212 | // pas de preview en fenetre enfant |
| 213 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes($GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 213 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 214 | 214 | if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) { |
| 215 | 215 | $pos = -1; |
| 216 | 216 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 283 | 283 | if (($p = strpos($texte, '</body>')) !== false) { |
| 284 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 284 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 285 | 285 | } else { |
| 286 | 286 | $texte .= $code; |
| 287 | 287 | } |