@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 121 | 121 | if ($var !== 1) { |
| 122 | 122 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 123 | - . $val . ($echap ? ") . '" : ' '); |
|
| 123 | + . $val.($echap ? ") . '" : ' '); |
|
| 124 | 124 | } else { |
| 125 | 125 | $val = $echap ? "'.$val.'" : $val; |
| 126 | 126 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | if (!$lang) { |
| 142 | 142 | $lang = '$GLOBALS["spip_lang"]'; |
| 143 | 143 | } |
| 144 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 144 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 145 | 145 | |
| 146 | 146 | return $l; |
| 147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 172 | 172 | if (is_string($p->texte)) { |
| 173 | 173 | $fichier = $p->texte; |
| 174 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 174 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 175 | 175 | } else { |
| 176 | 176 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 177 | 177 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return false; |
| 221 | 221 | } // j'aurais voulu toucher le fond ... |
| 222 | 222 | |
| 223 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 223 | + $contexte = 'array('.$_contexte.')'; |
|
| 224 | 224 | |
| 225 | 225 | if ($env) { |
| 226 | 226 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -235,16 +235,16 @@ discard block |
||
| 235 | 235 | $_options[] = $ajax; |
| 236 | 236 | } |
| 237 | 237 | $code = " ' . argumenter_squelette($code) . '"; |
| 238 | - $code = 'echo ' . sprintf( |
|
| 238 | + $code = 'echo '.sprintf( |
|
| 239 | 239 | CODE_RECUPERER_FOND, |
| 240 | 240 | $code, |
| 241 | 241 | $contexte, |
| 242 | 242 | implode(',', $_options), |
| 243 | 243 | "_request(\\'connect\\') ?? \\'\\'" |
| 244 | - ) . ';'; |
|
| 244 | + ).';'; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 247 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $id = $id_table; |
| 325 | 325 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 326 | 326 | } |
| 327 | - $mstatut = $id . '.' . $statut; |
|
| 327 | + $mstatut = $id.'.'.$statut; |
|
| 328 | 328 | |
| 329 | 329 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 330 | 330 | include_spip('public/quete'); |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | isset($s['post_date']) and $s['post_date'] |
| 333 | 333 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 334 | 334 | ) { |
| 335 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 335 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 336 | 336 | array_unshift( |
| 337 | 337 | $boucle->where, |
| 338 | 338 | $echapper ? |
| 339 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 339 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 340 | 340 | : |
| 341 | 341 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 342 | 342 | ); |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | $boucle->where, |
| 346 | 346 | $echapper ? |
| 347 | 347 | "\nquete_condition_statut('$mstatut'," |
| 348 | - . _q($s['previsu']) . ',' |
|
| 349 | - . _q($s['publie']) . ',' |
|
| 350 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 348 | + . _q($s['previsu']).',' |
|
| 349 | + . _q($s['publie']).',' |
|
| 350 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 351 | 351 | : |
| 352 | 352 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 353 | 353 | ); |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | if (_request('var_mode_affiche') != 'resultat') { |
| 382 | 382 | $trace = ''; |
| 383 | 383 | } else { |
| 384 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 384 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 385 | 385 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 386 | 386 | $trace = " |
| 387 | 387 | if (empty($_trace)) { |
| 388 | 388 | $_trace = []; |
| 389 | 389 | } |
| 390 | 390 | if (count($_trace) < 3) { |
| 391 | - $_trace" . '[] = $t0; |
|
| 391 | + $_trace".'[] = $t0; |
|
| 392 | 392 | }'; |
| 393 | 393 | } |
| 394 | 394 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return |
| 423 | 423 | // Numrows[$nom] peut ne pas être encore defini |
| 424 | 424 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 425 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 425 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 426 | 426 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 427 | 427 | . $trace |
| 428 | 428 | . "\n\treturn \$t0;"; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 491 | 491 | // et puis faire un [] plutot qu'un "','." |
| 492 | 492 | if ($boucle->doublons) { |
| 493 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 493 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 494 | 494 | index_pile($id_boucle, $primary, $boucles) |
| 495 | 495 | . "; // doublons\n"; |
| 496 | 496 | } |
@@ -518,13 +518,13 @@ discard block |
||
| 518 | 518 | $corps .= |
| 519 | 519 | "\n\t\tlang_select_public(" |
| 520 | 520 | . index_pile($id_boucle, 'lang', $boucles) |
| 521 | - . ", '" . $boucle->lang_select . "'" |
|
| 521 | + . ", '".$boucle->lang_select."'" |
|
| 522 | 522 | . (in_array($type_boucle, [ |
| 523 | 523 | 'articles', |
| 524 | 524 | 'rubriques', |
| 525 | 525 | 'hierarchie', |
| 526 | 526 | 'breves' |
| 527 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 527 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 528 | 528 | . ');'; |
| 529 | 529 | } else { |
| 530 | 530 | $init_lang = ''; |
@@ -546,20 +546,16 @@ discard block |
||
| 546 | 546 | |
| 547 | 547 | // gestion optimale des separateurs et des boucles constantes |
| 548 | 548 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 549 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 549 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $corps .= |
| 553 | 553 | ((!$boucle->separateur) ? |
| 554 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 555 | - (($return === "''") ? '' : |
|
| 556 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 557 | - ("\n\t\t\$t1 " . |
|
| 554 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 558 | 555 | ((strpos($return, '$t1.') === 0) ? |
| 559 | - ('.=' . substr($return, 4)) : |
|
| 560 | - ('= ' . $return)) . |
|
| 561 | - ";\n\t\t" . |
|
| 562 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 556 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 557 | + ";\n\t\t". |
|
| 558 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 563 | 559 | |
| 564 | 560 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 565 | 561 | // souhaite invalider ces elements |
@@ -641,7 +637,7 @@ discard block |
||
| 641 | 637 | $corps, |
| 642 | 638 | $fin_lang, |
| 643 | 639 | $trace, |
| 644 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 640 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 645 | 641 | ); |
| 646 | 642 | |
| 647 | 643 | # var_dump($a);exit; |
@@ -662,25 +658,24 @@ discard block |
||
| 662 | 658 | **/ |
| 663 | 659 | function calculer_requete_sql($boucle) { |
| 664 | 660 | $init = []; |
| 665 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 666 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 661 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 662 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 667 | 663 | # En absence de champ c'est un decompte : |
| 668 | 664 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 669 | 665 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 670 | 666 | $init[] = calculer_dec( |
| 671 | 667 | 'groupby', |
| 672 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 668 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 673 | 669 | ); |
| 674 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 675 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 670 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 671 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 676 | 672 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 677 | 673 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 678 | 674 | $init[] = calculer_dec( |
| 679 | 675 | 'limit', |
| 680 | 676 | ( |
| 681 | 677 | strpos($boucle->limit, 'intval') === false ? |
| 682 | - "'" . ($boucle->limit) . "'" : |
|
| 683 | - $boucle->limit |
|
| 678 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 684 | 679 | ) |
| 685 | 680 | ); |
| 686 | 681 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -689,17 +684,17 @@ discard block |
||
| 689 | 684 | // ou recalculée à chaque passage (vide) |
| 690 | 685 | foreach ($init as $i) { |
| 691 | 686 | if (reset($i)) { |
| 692 | - $s .= "\n\t\t" . end($i); |
|
| 687 | + $s .= "\n\t\t".end($i); |
|
| 693 | 688 | } # statique |
| 694 | 689 | else { |
| 695 | - $d .= "\n\t" . end($i); |
|
| 690 | + $d .= "\n\t".end($i); |
|
| 696 | 691 | } # dynamique |
| 697 | 692 | } |
| 698 | 693 | |
| 699 | 694 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 700 | 695 | . $boucle->in |
| 701 | 696 | . $boucle->hash |
| 702 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 697 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 703 | 698 | . $s |
| 704 | 699 | . "\n\t}" |
| 705 | 700 | . $d; |
@@ -782,7 +777,7 @@ discard block |
||
| 782 | 777 | * - index 1 : Code de l'affectation |
| 783 | 778 | **/ |
| 784 | 779 | function calculer_dec($nom, $val) { |
| 785 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 780 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 786 | 781 | // si une variable apparait dans le calcul de la clause |
| 787 | 782 | // il faut la re-evaluer a chaque passage |
| 788 | 783 | if ( |
@@ -799,7 +794,7 @@ discard block |
||
| 799 | 794 | $static = ''; |
| 800 | 795 | } |
| 801 | 796 | |
| 802 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 797 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 803 | 798 | } |
| 804 | 799 | |
| 805 | 800 | /** |
@@ -824,27 +819,27 @@ discard block |
||
| 824 | 819 | } |
| 825 | 820 | $res = ''; |
| 826 | 821 | if ($a and $a[0] == "'?'") { |
| 827 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 828 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 829 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 822 | + return ('('.calculer_dump_array($a[1]). |
|
| 823 | + ' ? '.calculer_dump_array($a[2]). |
|
| 824 | + ' : '.calculer_dump_array($a[3]). |
|
| 830 | 825 | ')'); |
| 831 | 826 | } else { |
| 832 | 827 | foreach ($a as $k => $v) { |
| 833 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 834 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 828 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 829 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 835 | 830 | } |
| 836 | 831 | |
| 837 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 832 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 838 | 833 | } |
| 839 | 834 | } |
| 840 | 835 | |
| 841 | 836 | function calculer_dump_join($a) { |
| 842 | 837 | $res = ''; |
| 843 | 838 | foreach ($a as $k => $v) { |
| 844 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 839 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 845 | 840 | } |
| 846 | 841 | |
| 847 | - return 'array(' . substr($res, 2) . ')'; |
|
| 842 | + return 'array('.substr($res, 2).')'; |
|
| 848 | 843 | } |
| 849 | 844 | |
| 850 | 845 | /** |
@@ -861,7 +856,7 @@ discard block |
||
| 861 | 856 | $res .= ",'$k' => '$v'"; |
| 862 | 857 | } |
| 863 | 858 | |
| 864 | - return 'array(' . substr($res, 1) . ')'; |
|
| 859 | + return 'array('.substr($res, 1).')'; |
|
| 865 | 860 | } |
| 866 | 861 | |
| 867 | 862 | /** |
@@ -879,7 +874,7 @@ discard block |
||
| 879 | 874 | $res .= ",'$k' => '$v'"; |
| 880 | 875 | } |
| 881 | 876 | |
| 882 | - return 'array(' . substr($res, 1) . ')'; |
|
| 877 | + return 'array('.substr($res, 1).')'; |
|
| 883 | 878 | } |
| 884 | 879 | |
| 885 | 880 | function calculer_order(&$boucle) { |
@@ -948,19 +943,19 @@ discard block |
||
| 948 | 943 | ) { |
| 949 | 944 | $res .= " .\n$tab$code"; |
| 950 | 945 | } else { |
| 951 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 946 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 952 | 947 | } |
| 953 | 948 | } |
| 954 | 949 | |
| 955 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 950 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 956 | 951 | } |
| 957 | 952 | } else { |
| 958 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 953 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 959 | 954 | |
| 960 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 955 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 961 | 956 | " ,\n$tab", |
| 962 | 957 | $codes |
| 963 | - ) . ')))'; |
|
| 958 | + ).')))'; |
|
| 964 | 959 | } |
| 965 | 960 | } |
| 966 | 961 | |
@@ -987,7 +982,7 @@ discard block |
||
| 987 | 982 | // texte seul |
| 988 | 983 | case 'texte': |
| 989 | 984 | $code = sandbox_composer_texte($p->texte, $p); |
| 990 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 985 | + $commentaire = strlen($p->texte).' signes'; |
|
| 991 | 986 | $avant = ''; |
| 992 | 987 | $apres = ''; |
| 993 | 988 | $altern = "''"; |
@@ -996,14 +991,14 @@ discard block |
||
| 996 | 991 | case 'polyglotte': |
| 997 | 992 | $code = ''; |
| 998 | 993 | foreach ($p->traductions as $k => $v) { |
| 999 | - $code .= ",'" . |
|
| 1000 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1001 | - "' => '" . |
|
| 1002 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 994 | + $code .= ",'". |
|
| 995 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 996 | + "' => '". |
|
| 997 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1003 | 998 | "'"; |
| 1004 | 999 | } |
| 1005 | - $code = 'choisir_traduction(array(' . |
|
| 1006 | - substr($code, 1) . |
|
| 1000 | + $code = 'choisir_traduction(array('. |
|
| 1001 | + substr($code, 1). |
|
| 1007 | 1002 | '))'; |
| 1008 | 1003 | $commentaire = '&'; |
| 1009 | 1004 | $avant = ''; |
@@ -1019,7 +1014,7 @@ discard block |
||
| 1019 | 1014 | $err_e_c = true; |
| 1020 | 1015 | $code = "''"; |
| 1021 | 1016 | } else { |
| 1022 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1017 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1023 | 1018 | $avant = ''; |
| 1024 | 1019 | $apres = ''; |
| 1025 | 1020 | $altern = "''"; |
@@ -1048,8 +1043,8 @@ discard block |
||
| 1048 | 1043 | $err_e_c = true; |
| 1049 | 1044 | $code = "''"; |
| 1050 | 1045 | } else { |
| 1051 | - $code = 'BOUCLE' . |
|
| 1052 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1046 | + $code = 'BOUCLE'. |
|
| 1047 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1053 | 1048 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1054 | 1049 | $commentaire = "?$nom"; |
| 1055 | 1050 | if ( |
@@ -1091,24 +1086,22 @@ discard block |
||
| 1091 | 1086 | foreach ($p->arg as $k => $v) { |
| 1092 | 1087 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1093 | 1088 | if ($k) { |
| 1094 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1089 | + $l[] = _q($k).' => '.$_v; |
|
| 1095 | 1090 | } else { |
| 1096 | 1091 | $code = $_v; |
| 1097 | 1092 | } |
| 1098 | 1093 | } |
| 1099 | 1094 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1100 | 1095 | if ($p->module) { |
| 1101 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1096 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1102 | 1097 | } elseif ($p->nom_champ) { |
| 1103 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1098 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1104 | 1099 | } else { |
| 1105 | 1100 | $m = ''; |
| 1106 | 1101 | } |
| 1107 | 1102 | |
| 1108 | - $code = (!$code ? "'$m'" : |
|
| 1109 | - ($m ? "'$m' . $code" : |
|
| 1110 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1111 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1103 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1104 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1112 | 1105 | $code = "_T($code)"; |
| 1113 | 1106 | if ($p->param) { |
| 1114 | 1107 | $p->id_boucle = $id_boucle; |
@@ -1130,7 +1123,7 @@ discard block |
||
| 1130 | 1123 | $p->type_requete = $type; |
| 1131 | 1124 | |
| 1132 | 1125 | $code = calculer_champ($p); |
| 1133 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1126 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1134 | 1127 | $avant = calculer_liste( |
| 1135 | 1128 | $p->avant, |
| 1136 | 1129 | $descr, |
@@ -1170,10 +1163,9 @@ discard block |
||
| 1170 | 1163 | if ($code != "''") { |
| 1171 | 1164 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1172 | 1165 | $codes[] = (($mode == 'validation') ? |
| 1173 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1166 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1174 | 1167 | : (($mode == 'code') ? |
| 1175 | - "\n// $commentaire\n$code" : |
|
| 1176 | - $code)); |
|
| 1168 | + "\n// $commentaire\n$code" : $code)); |
|
| 1177 | 1169 | } |
| 1178 | 1170 | } // foreach |
| 1179 | 1171 | |
@@ -1229,19 +1221,19 @@ discard block |
||
| 1229 | 1221 | $cond = ''; |
| 1230 | 1222 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1231 | 1223 | $t = $r[2]; |
| 1232 | - $cond = '!' . $r[1]; |
|
| 1224 | + $cond = '!'.$r[1]; |
|
| 1233 | 1225 | } else { |
| 1234 | 1226 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1235 | 1227 | $t = $r[2]; |
| 1236 | 1228 | $cond = $r[1]; |
| 1237 | 1229 | } else { |
| 1238 | - $t = '$t' . $n; |
|
| 1230 | + $t = '$t'.$n; |
|
| 1239 | 1231 | $cond = "($t = $code)!==''"; |
| 1240 | 1232 | } |
| 1241 | 1233 | } |
| 1242 | 1234 | |
| 1243 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1244 | - $t . |
|
| 1235 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1236 | + $t. |
|
| 1245 | 1237 | (!$apres ? '' : " . $apres"); |
| 1246 | 1238 | |
| 1247 | 1239 | if ($res !== $t) { |
@@ -1292,12 +1284,12 @@ discard block |
||
| 1292 | 1284 | |
| 1293 | 1285 | // rendre inertes les echappements de #[](){}<> |
| 1294 | 1286 | $i = 0; |
| 1295 | - while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1287 | + while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1296 | 1288 | $i++; |
| 1297 | 1289 | } |
| 1298 | 1290 | $squelette = preg_replace_callback( |
| 1299 | 1291 | ',\\\\([#[()\]{}<>]),', |
| 1300 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1292 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1301 | 1293 | $squelette, |
| 1302 | 1294 | -1, |
| 1303 | 1295 | $esc |
@@ -1313,7 +1305,7 @@ discard block |
||
| 1313 | 1305 | // Phraser le squelette, selon sa grammaire |
| 1314 | 1306 | |
| 1315 | 1307 | $boucles = []; |
| 1316 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1308 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1317 | 1309 | |
| 1318 | 1310 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1319 | 1311 | |
@@ -1329,7 +1321,7 @@ discard block |
||
| 1329 | 1321 | ); |
| 1330 | 1322 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1331 | 1323 | ",$inerte-(\d+)-,", |
| 1332 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1324 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1333 | 1325 | $boucle->descr['squelette'] |
| 1334 | 1326 | ); |
| 1335 | 1327 | } |
@@ -1340,19 +1332,19 @@ discard block |
||
| 1340 | 1332 | include_spip('public/decompiler'); |
| 1341 | 1333 | foreach ($boucles as $id => $boucle) { |
| 1342 | 1334 | if ($id) { |
| 1343 | - $decomp = "\n/* BOUCLE " . |
|
| 1344 | - $boucle->type_requete . |
|
| 1345 | - ' ' . |
|
| 1346 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1347 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1335 | + $decomp = "\n/* BOUCLE ". |
|
| 1336 | + $boucle->type_requete. |
|
| 1337 | + ' '. |
|
| 1338 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1339 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1348 | 1340 | " */\n"; |
| 1349 | 1341 | } else { |
| 1350 | - $decomp = ("\n/*\n" . |
|
| 1342 | + $decomp = ("\n/*\n". |
|
| 1351 | 1343 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1352 | 1344 | . "\n*/"); |
| 1353 | 1345 | } |
| 1354 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1355 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1346 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1347 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1356 | 1348 | } |
| 1357 | 1349 | } |
| 1358 | 1350 | |
@@ -1375,7 +1367,7 @@ discard block |
||
| 1375 | 1367 | } |
| 1376 | 1368 | } |
| 1377 | 1369 | foreach ($boucles as $id => $boucle) { |
| 1378 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1370 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1379 | 1371 | } |
| 1380 | 1372 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1381 | 1373 | |
@@ -1466,8 +1458,7 @@ discard block |
||
| 1466 | 1458 | } else { |
| 1467 | 1459 | $boucles[$id]->type_requete = false; |
| 1468 | 1460 | $boucle = $boucles[$id]; |
| 1469 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1470 | - ($boucle->sql_serveur . ':')) . |
|
| 1461 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1471 | 1462 | $type; |
| 1472 | 1463 | $msg = [ |
| 1473 | 1464 | 'zbug_table_inconnue', |
@@ -1557,13 +1548,13 @@ discard block |
||
| 1557 | 1548 | if ( |
| 1558 | 1549 | // fonction de boucle avec serveur & table |
| 1559 | 1550 | (!$serveur or |
| 1560 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1561 | - and (!function_exists($f = $f . '_dist')) |
|
| 1551 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1552 | + and (!function_exists($f = $f.'_dist')) |
|
| 1562 | 1553 | ) |
| 1563 | 1554 | ) |
| 1564 | 1555 | // fonction de boucle avec table |
| 1565 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1566 | - and (!function_exists($f = $f . '_dist')) |
|
| 1556 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1557 | + and (!function_exists($f = $f.'_dist')) |
|
| 1567 | 1558 | ) { |
| 1568 | 1559 | // fonction de boucle standard |
| 1569 | 1560 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1571,20 +1562,20 @@ discard block |
||
| 1571 | 1562 | } |
| 1572 | 1563 | } |
| 1573 | 1564 | |
| 1574 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1575 | - "static \$connect;\n\t" . |
|
| 1576 | - "\$command['connect'] = \$connect = " . |
|
| 1577 | - _q($boucle->sql_serveur) . |
|
| 1578 | - ';' . |
|
| 1565 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1566 | + "static \$connect;\n\t". |
|
| 1567 | + "\$command['connect'] = \$connect = ". |
|
| 1568 | + _q($boucle->sql_serveur). |
|
| 1569 | + ';'. |
|
| 1579 | 1570 | $f($id, $boucles); |
| 1580 | 1571 | } else { |
| 1581 | 1572 | $req = ("\n\treturn '';"); |
| 1582 | 1573 | } |
| 1583 | 1574 | |
| 1584 | 1575 | $boucles[$id]->return = |
| 1585 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1586 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1587 | - $req . |
|
| 1576 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1577 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1578 | + $req. |
|
| 1588 | 1579 | "\n}\n"; |
| 1589 | 1580 | } |
| 1590 | 1581 | |
@@ -1594,7 +1585,7 @@ discard block |
||
| 1594 | 1585 | return false; |
| 1595 | 1586 | } |
| 1596 | 1587 | |
| 1597 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1588 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1598 | 1589 | ' |
| 1599 | 1590 | // reporter de maniere securisee les doublons inclus |
| 1600 | 1591 | . ' |
@@ -1602,15 +1593,15 @@ discard block |
||
| 1602 | 1593 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1603 | 1594 | |
| 1604 | 1595 | $connect = ' . |
| 1605 | - _q($connect) . '; |
|
| 1596 | + _q($connect).'; |
|
| 1606 | 1597 | $page = ' . |
| 1607 | 1598 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1608 | 1599 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1609 | 1600 | // avant de referencer $Cache |
| 1610 | - $corps . '; |
|
| 1601 | + $corps.'; |
|
| 1611 | 1602 | |
| 1612 | 1603 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1613 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1604 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1614 | 1605 | }'; |
| 1615 | 1606 | |
| 1616 | 1607 | $secondes = spip_timer('calcul_skel'); |
@@ -1624,10 +1615,10 @@ discard block |
||
| 1624 | 1615 | $code->return = ' |
| 1625 | 1616 | // |
| 1626 | 1617 | // Fonction principale du squelette ' . |
| 1627 | - $sourcefile . |
|
| 1628 | - ($connect ? " pour $connect" : '') . |
|
| 1629 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1630 | - "\n//\n" . |
|
| 1618 | + $sourcefile. |
|
| 1619 | + ($connect ? " pour $connect" : ''). |
|
| 1620 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1621 | + "\n//\n". |
|
| 1631 | 1622 | $principal; |
| 1632 | 1623 | |
| 1633 | 1624 | $boucles[''] = $code; |
@@ -1679,7 +1670,7 @@ discard block |
||
| 1679 | 1670 | **/ |
| 1680 | 1671 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1681 | 1672 | include_spip('iterateur/data'); |
| 1682 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1673 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1683 | 1674 | $g = charger_fonction('data', 'iterateur'); |
| 1684 | 1675 | $boucles[$id] = $g($boucle); |
| 1685 | 1676 | // from[0] stocke le type de data (rss, yql, ...) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (!$fonc) { |
| 149 | 149 | $fonc = $GLOBALS['debug_objets']['principal']; |
| 150 | 150 | } |
| 151 | - $titre = !$mode ? $fonc : ($mode . (isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' ' . $GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 151 | + $titre = !$mode ? $fonc : ($mode.(isset($GLOBALS['debug_objets']['sourcefile'][$fonc]) ? ' '.$GLOBALS['debug_objets']['sourcefile'][$fonc] : '')); |
|
| 152 | 152 | } |
| 153 | 153 | if ($message === false) { |
| 154 | 154 | lang_select(); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $fond = $GLOBALS['fond'] ?? ''; |
| 178 | 178 | // une erreur critique sort $message en array |
| 179 | 179 | $debug = is_array($msg) ? $msg[1] : $msg; |
| 180 | - spip_log('Debug: ' . $debug . ' (' . $fond . ')'); |
|
| 180 | + spip_log('Debug: '.$debug.' ('.$fond.')'); |
|
| 181 | 181 | |
| 182 | 182 | return $msg; |
| 183 | 183 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | function debusquer_bandeau($erreurs) { |
| 186 | 186 | |
| 187 | 187 | if (!empty($erreurs)) { |
| 188 | - $n = [(is_countable($erreurs) ? count($erreurs) : 0) . ' ' . _T('zbug_erreur_squelette')]; |
|
| 188 | + $n = [(is_countable($erreurs) ? count($erreurs) : 0).' '._T('zbug_erreur_squelette')]; |
|
| 189 | 189 | |
| 190 | 190 | return debusquer_navigation($erreurs, $n); |
| 191 | 191 | } elseif (!empty($GLOBALS['tableau_des_temps'])) { |
@@ -218,25 +218,25 @@ discard block |
||
| 218 | 218 | $valeur_simple = []; |
| 219 | 219 | foreach ($valeur as $v) { |
| 220 | 220 | if (is_array($v)) { |
| 221 | - $valeur_simple[] = 'array:' . count($v); |
|
| 221 | + $valeur_simple[] = 'array:'.count($v); |
|
| 222 | 222 | } elseif (is_object($v)) { |
| 223 | 223 | $valeur_simple[] = get_class($v); |
| 224 | 224 | } elseif (is_string($v)) { |
| 225 | - $valeur_simple[] = "'" . $v . "'"; |
|
| 225 | + $valeur_simple[] = "'".$v."'"; |
|
| 226 | 226 | } else { |
| 227 | 227 | $valeur_simple[] = $v; |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | $n = count($valeur); |
| 231 | - $valeur = (($n > 3) ? 'array:' . $n . ' ' : ''); |
|
| 232 | - $valeur .= '[' . join(', ', $valeur_simple) . ']'; |
|
| 231 | + $valeur = (($n > 3) ? 'array:'.$n.' ' : ''); |
|
| 232 | + $valeur .= '['.join(', ', $valeur_simple).']'; |
|
| 233 | 233 | } elseif (is_object($valeur)) { |
| 234 | 234 | $valeur = get_class($valeur); |
| 235 | 235 | } elseif (is_string($valeur)) { |
| 236 | - $valeur = "'" . $valeur . "'"; |
|
| 236 | + $valeur = "'".$valeur."'"; |
|
| 237 | 237 | } |
| 238 | - $res .= "\n<tr><td><strong>" . nl2br(entites_html($nom)) |
|
| 239 | - . '</strong></td><td>: ' . nl2br(entites_html($valeur)) |
|
| 238 | + $res .= "\n<tr><td><strong>".nl2br(entites_html($nom)) |
|
| 239 | + . '</strong></td><td>: '.nl2br(entites_html($valeur)) |
|
| 240 | 240 | . "</td></tr>\n"; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -264,10 +264,10 @@ discard block |
||
| 264 | 264 | $nom_code = $lieu->descr['nom']; |
| 265 | 265 | $skel = $lieu->descr['sourcefile']; |
| 266 | 266 | $h2 = parametre_url($href, 'var_mode_objet', $nom_code); |
| 267 | - $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette') . '#L' . $ligne; |
|
| 267 | + $h3 = parametre_url($h2, 'var_mode_affiche', 'squelette').'#L'.$ligne; |
|
| 268 | 268 | $skel = "<a href='$h3'><b>$skel</b></a>"; |
| 269 | 269 | if ($boucle) { |
| 270 | - $h3 = parametre_url($h2 . $boucle, 'var_mode_affiche', 'boucle'); |
|
| 270 | + $h3 = parametre_url($h2.$boucle, 'var_mode_affiche', 'boucle'); |
|
| 271 | 271 | $boucle = "<a href='$h3'><b>$boucle</b></a>"; |
| 272 | 272 | } |
| 273 | 273 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | // Requete erronee |
| 359 | - $err = '<b>' . _T('avis_erreur_mysql') . " $errno</b><br /><tt>\n" |
|
| 359 | + $err = '<b>'._T('avis_erreur_mysql')." $errno</b><br /><tt>\n" |
|
| 360 | 360 | . spip_htmlspecialchars($msg) |
| 361 | 361 | . "\n<br /><span style='color: red'><b>" |
| 362 | 362 | . spip_htmlspecialchars($query) |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | function trouve_boucle_debug($n, $nom, $debut = 0, $boucle = '') { |
| 372 | 372 | |
| 373 | - $id = $nom . $boucle; |
|
| 373 | + $id = $nom.$boucle; |
|
| 374 | 374 | if (is_array($GLOBALS['debug_objets']['sequence'][$id])) { |
| 375 | 375 | foreach ($GLOBALS['debug_objets']['sequence'][$id] as $v) { |
| 376 | 376 | if (!preg_match('/^(.*)(<\?.*\?>)(.*)$/s', $v[0], $r)) { |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | - $incl = ',' . $reg[1] . '[.]\w$,'; |
|
| 419 | + $incl = ','.$reg[1].'[.]\w$,'; |
|
| 420 | 420 | |
| 421 | 421 | foreach ($GLOBALS['debug_objets']['sourcefile'] as $k => $v) { |
| 422 | 422 | if (preg_match($incl, $v)) { |
@@ -431,16 +431,13 @@ discard block |
||
| 431 | 431 | [$skel, $boucle, $ligne] = trouve_boucle_debug($n, $nom); |
| 432 | 432 | |
| 433 | 433 | if (!$boucle) { |
| 434 | - return !$ligne ? '' : |
|
| 435 | - (' (' . |
|
| 436 | - (($nom != $skel) ? _T('squelette_inclus_ligne') : |
|
| 437 | - _T('squelette_ligne')) . |
|
| 434 | + return !$ligne ? '' : (' ('. |
|
| 435 | + (($nom != $skel) ? _T('squelette_inclus_ligne') : _T('squelette_ligne')). |
|
| 438 | 436 | " <a href='$self&var_mode_objet=$skel&var_mode_affiche=squelette&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"); |
| 439 | 437 | } else { |
| 440 | 438 | $self .= "&var_mode_objet=$skel$boucle&var_mode_affiche=boucle"; |
| 441 | 439 | |
| 442 | - return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : |
|
| 443 | - " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 440 | + return !$ligne ? " (boucle\n<a href='$self#$skel$boucle'>$boucle</a>)" : " (boucle $boucle ligne\n<a href='$self&var_mode_ligne=$ligne#L$ligne'>$ligne</a>)"; |
|
| 444 | 441 | } |
| 445 | 442 | } |
| 446 | 443 | |
@@ -462,14 +459,14 @@ discard block |
||
| 462 | 459 | |
| 463 | 460 | $s = preg_replace( |
| 464 | 461 | ',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,', |
| 465 | - '<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>', |
|
| 462 | + '<\1>\2</\1><br />'."\n".'<\1>\3</\1>', |
|
| 466 | 463 | $s |
| 467 | 464 | ); |
| 468 | 465 | |
| 469 | 466 | |
| 470 | 467 | $tableau = explode('<br />', $s); |
| 471 | 468 | |
| 472 | - $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: " . ($nocpt ? 'hidden' : 'visible') . ";%s' href='#T%s' title=\"%s\">%0" . strval(@strlen(count($tableau))) . "d</a></span> %s<br />\n"; |
|
| 469 | + $format = "<span style='float:left;display:block;width:50px;height:1px'><a id='L%d' style='background-color: white; visibility: ".($nocpt ? 'hidden' : 'visible').";%s' href='#T%s' title=\"%s\">%0".strval(@strlen(count($tableau)))."d</a></span> %s<br />\n"; |
|
| 473 | 470 | |
| 474 | 471 | $format10 = str_replace('white', 'lightgrey', $format); |
| 475 | 472 | $formaterr = 'color: red;'; |
@@ -513,7 +510,7 @@ discard block |
||
| 513 | 510 | . '" style="cursor: pointer;">' |
| 514 | 511 | . ($nocpt ? '' : _T('info_numero_abbreviation')) |
| 515 | 512 | . '</div> |
| 516 | - ' . $res . "</div>\n"; |
|
| 513 | + ' . $res."</div>\n"; |
|
| 517 | 514 | } |
| 518 | 515 | |
| 519 | 516 | // l'environnement graphique du debuggueur |
@@ -535,14 +532,14 @@ discard block |
||
| 535 | 532 | if (!empty($GLOBALS['debug_objets'][$mode][$fonc])) { |
| 536 | 533 | [$legend, $texte, $res2] = debusquer_source($fonc, $mode); |
| 537 | 534 | $texte .= $res2; |
| 538 | - } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc . 'tout'])) { |
|
| 539 | - $legend = _T('zbug_' . $mode); |
|
| 540 | - $texte = $GLOBALS['debug_objets'][$mode][$fonc . 'tout']; |
|
| 535 | + } elseif (!empty($GLOBALS['debug_objets'][$mode][$fonc.'tout'])) { |
|
| 536 | + $legend = _T('zbug_'.$mode); |
|
| 537 | + $texte = $GLOBALS['debug_objets'][$mode][$fonc.'tout']; |
|
| 541 | 538 | $texte = ancre_texte($texte, ['', '']); |
| 542 | 539 | } |
| 543 | 540 | } else { |
| 544 | 541 | if (strlen(trim($res))) { |
| 545 | - return "<img src='" . chemin_image('debug-xx.svg') . "' alt='afficher-masquer le debug' id='spip-debug-toggle' onclick=\"var x = document.getElementById('spip-debug'); (x.style.display == '' ? x.style.display = 'none' : x.style.display = '');\" /><div id='spip-debug'>$res</div>"; |
|
| 542 | + 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>"; |
|
| 546 | 543 | } else { |
| 547 | 544 | // cas de l'appel sur erreur: montre la page |
| 548 | 545 | return $GLOBALS['debug_objets']['resultat']['tout'] ?? ''; |
@@ -550,7 +547,7 @@ discard block |
||
| 550 | 547 | } |
| 551 | 548 | } else { |
| 552 | 549 | $valider = charger_fonction('valider', 'xml'); |
| 553 | - $val = $valider($GLOBALS['debug_objets']['validation'][$fonc . 'tout']); |
|
| 550 | + $val = $valider($GLOBALS['debug_objets']['validation'][$fonc.'tout']); |
|
| 554 | 551 | // Si erreur, signaler leur nombre dans le formulaire admin |
| 555 | 552 | $GLOBALS['debug_objets']['validation'] = $val->err ? count($val->err) : ''; |
| 556 | 553 | [$texte, $err] = emboite_texte($val, $fonc, $self); |
@@ -561,14 +558,14 @@ discard block |
||
| 561 | 558 | } else { |
| 562 | 559 | $err = ": $err"; |
| 563 | 560 | } |
| 564 | - $legend = _T('validation') . ' ' . $err; |
|
| 561 | + $legend = _T('validation').' '.$err; |
|
| 565 | 562 | $res = $id = ''; |
| 566 | 563 | } |
| 567 | 564 | |
| 568 | 565 | return !trim($texte) ? '' : ( |
| 569 | - "<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" |
|
| 566 | + "<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" |
|
| 570 | 567 | . "<div id='debug_boucle'><fieldset$id><legend>" |
| 571 | - . "<a href='" . $self . '#f_' . substr($fonc, 0, 37) . "'> ↑ " |
|
| 568 | + . "<a href='".$self.'#f_'.substr($fonc, 0, 37)."'> ↑ " |
|
| 572 | 569 | . ($legend ?: $mode) |
| 573 | 570 | . '</a></legend>' |
| 574 | 571 | . $texte |
@@ -579,7 +576,7 @@ discard block |
||
| 579 | 576 | |
| 580 | 577 | function emboite_texte($res, $fonc = '', $self = '') { |
| 581 | 578 | $errs = $res->err; |
| 582 | - $texte = $res->entete . ($errs ? '' : $res->page); |
|
| 579 | + $texte = $res->entete.($errs ? '' : $res->page); |
|
| 583 | 580 | |
| 584 | 581 | if (!$texte and !$errs) { |
| 585 | 582 | return [ancre_texte('', ['', '']), false]; |
@@ -635,7 +632,7 @@ discard block |
||
| 635 | 632 | $err = "<h2 style='text-align: center'>" |
| 636 | 633 | . $i |
| 637 | 634 | . "<a href='#fin_err'>" |
| 638 | - . ' ' . _T('erreur_texte') |
|
| 635 | + . ' '._T('erreur_texte') |
|
| 639 | 636 | . "</a></h2><table id='debut_err' style='width: 100%'>" |
| 640 | 637 | . $err |
| 641 | 638 | . " </table><a id='fin_err'></a>"; |
@@ -645,9 +642,9 @@ discard block |
||
| 645 | 642 | [$msg, $fermant, $ouvrant] = $errs[0]; |
| 646 | 643 | $rf = reference_boucle_debug($fermant, $fonc, $self); |
| 647 | 644 | $ro = reference_boucle_debug($ouvrant, $fonc, $self); |
| 648 | - $err = $msg . |
|
| 649 | - "<a href='#L" . $fermant . "'>$fermant</a>$rf<br />" . |
|
| 650 | - "<a href='#L" . $ouvrant . "'>$ouvrant</a>$ro"; |
|
| 645 | + $err = $msg. |
|
| 646 | + "<a href='#L".$fermant."'>$fermant</a>$rf<br />". |
|
| 647 | + "<a href='#L".$ouvrant."'>$ouvrant</a>$ro"; |
|
| 651 | 648 | |
| 652 | 649 | return [ancre_texte($texte, [[$ouvrant], [$fermant]]), $err]; |
| 653 | 650 | } |
@@ -680,7 +677,7 @@ discard block |
||
| 680 | 677 | ['time' => $GLOBALS['debug_objets']['profile'][$sourcefile]] |
| 681 | 678 | ); |
| 682 | 679 | |
| 683 | - $res .= "<fieldset id='f_" . $nom . "'><legend>" |
|
| 680 | + $res .= "<fieldset id='f_".$nom."'><legend>" |
|
| 684 | 681 | . $t_skel |
| 685 | 682 | . ' ' |
| 686 | 683 | . $sourcefile |
@@ -695,7 +692,7 @@ discard block |
||
| 695 | 692 | . "'>" |
| 696 | 693 | . _T('zbug_calcul') |
| 697 | 694 | . '</a></legend>' |
| 698 | - . (!$temps ? '' : ("\n<span style='display:block;float:" . $GLOBALS['spip_lang_right'] . "'>$temps</span><br />")) |
|
| 695 | + . (!$temps ? '' : ("\n<span style='display:block;float:".$GLOBALS['spip_lang_right']."'>$temps</span><br />")) |
|
| 699 | 696 | . debusquer_contexte($contexte[$sourcefile]) |
| 700 | 697 | . (!$nav ? '' : ("<table width='100%'>\n$nav</table>\n")) |
| 701 | 698 | . "</fieldset>\n"; |
@@ -716,33 +713,33 @@ discard block |
||
| 716 | 713 | $nom = $boucle->id_boucle; |
| 717 | 714 | $req = $boucle->type_requete; |
| 718 | 715 | $crit = public_decompiler($boucle, $gram, 0, 'criteres'); |
| 719 | - $self2 = $self . '&var_mode_objet=' . $objet; |
|
| 720 | - |
|
| 721 | - $res .= "\n<tr style='background-color: " . |
|
| 722 | - ($i % 2 ? '#e0e0f0' : '#f8f8ff') . |
|
| 723 | - "'><td align='right'>$i</td><td>\n" . |
|
| 724 | - "<a class='debug_link_boucle' href='" . |
|
| 725 | - $self2 . |
|
| 726 | - "&var_mode_affiche=boucle#f_$nom_skel'>" . |
|
| 727 | - _T('zbug_boucle') . |
|
| 728 | - "</a></td><td>\n<a class='debug_link_boucle' href='" . |
|
| 729 | - $self2 . |
|
| 730 | - "&var_mode_affiche=resultat#f_$nom_skel'>" . |
|
| 731 | - _T('zbug_resultat') . |
|
| 732 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 733 | - $self2 . |
|
| 734 | - "&var_mode_affiche=code#f_$nom_skel'>" . |
|
| 735 | - _T('zbug_code') . |
|
| 736 | - "</a></td><td>\n<a class='debug_link_resultat' href='" . |
|
| 737 | - str_replace('var_mode=', 'var_profile=', $self2) . |
|
| 738 | - "'>" . |
|
| 739 | - _T('zbug_calcul') . |
|
| 740 | - "</a></td><td>\n" . |
|
| 741 | - (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom) . |
|
| 742 | - "</td><td>\n" . |
|
| 743 | - $req . |
|
| 744 | - "</td><td>\n" . |
|
| 745 | - spip_htmlspecialchars($crit) . |
|
| 716 | + $self2 = $self.'&var_mode_objet='.$objet; |
|
| 717 | + |
|
| 718 | + $res .= "\n<tr style='background-color: ". |
|
| 719 | + ($i % 2 ? '#e0e0f0' : '#f8f8ff'). |
|
| 720 | + "'><td align='right'>$i</td><td>\n". |
|
| 721 | + "<a class='debug_link_boucle' href='". |
|
| 722 | + $self2. |
|
| 723 | + "&var_mode_affiche=boucle#f_$nom_skel'>". |
|
| 724 | + _T('zbug_boucle'). |
|
| 725 | + "</a></td><td>\n<a class='debug_link_boucle' href='". |
|
| 726 | + $self2. |
|
| 727 | + "&var_mode_affiche=resultat#f_$nom_skel'>". |
|
| 728 | + _T('zbug_resultat'). |
|
| 729 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 730 | + $self2. |
|
| 731 | + "&var_mode_affiche=code#f_$nom_skel'>". |
|
| 732 | + _T('zbug_code'). |
|
| 733 | + "</a></td><td>\n<a class='debug_link_resultat' href='". |
|
| 734 | + str_replace('var_mode=', 'var_profile=', $self2). |
|
| 735 | + "'>". |
|
| 736 | + _T('zbug_calcul'). |
|
| 737 | + "</a></td><td>\n". |
|
| 738 | + (($var_mode_objet == $objet) ? "<b>$nom</b>" : $nom). |
|
| 739 | + "</td><td>\n". |
|
| 740 | + $req. |
|
| 741 | + "</td><td>\n". |
|
| 742 | + spip_htmlspecialchars($crit). |
|
| 746 | 743 | '</td></tr>'; |
| 747 | 744 | } |
| 748 | 745 | } |
@@ -769,7 +766,7 @@ discard block |
||
| 769 | 766 | } |
| 770 | 767 | // permettre le copier/coller facile |
| 771 | 768 | // $res = ancre_texte($req, array(), true); |
| 772 | - $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; |
|
| 769 | + $res = "<div id='T".md5($req)."'>\n<pre>\n".$req."</pre>\n</div>\n"; |
|
| 773 | 770 | // formatage et affichage des resultats bruts de la requete |
| 774 | 771 | $ress_req = spip_query($req); |
| 775 | 772 | $brut_sql = ''; |
@@ -779,10 +776,10 @@ discard block |
||
| 779 | 776 | $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; |
| 780 | 777 | while ($retours_sql = sql_fetch($ress_req)) { |
| 781 | 778 | if ($num <= $max_aff) { |
| 782 | - $brut_sql .= '<h3>' . ($num == 1 ? $num . ' sur ' . sql_count($ress_req) : $num) . '</h3>'; |
|
| 779 | + $brut_sql .= '<h3>'.($num == 1 ? $num.' sur '.sql_count($ress_req) : $num).'</h3>'; |
|
| 783 | 780 | $brut_sql .= '<p>'; |
| 784 | 781 | foreach ($retours_sql as $key => $val) { |
| 785 | - $brut_sql .= '<strong>' . $key . '</strong> => ' . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; |
|
| 782 | + $brut_sql .= '<strong>'.$key.'</strong> => '.spip_htmlspecialchars(couper($val, 150))."<br />\n"; |
|
| 786 | 783 | } |
| 787 | 784 | $brut_sql .= '</p>'; |
| 788 | 785 | } |
@@ -793,14 +790,14 @@ discard block |
||
| 793 | 790 | // ne pas afficher les $contexte_inclus |
| 794 | 791 | $view = preg_replace(',<\?php.+\?[>],Uims', '', $view); |
| 795 | 792 | if ($view) { |
| 796 | - $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . '</fieldset>'; |
|
| 793 | + $res2 .= "\n<br /><fieldset>".interdire_scripts($view).'</fieldset>'; |
|
| 797 | 794 | } |
| 798 | 795 | } |
| 799 | 796 | } elseif ($affiche == 'code') { |
| 800 | 797 | $legend = $nom; |
| 801 | - $res = ancre_texte('<' . "?php\n" . $quoi . "\n?" . '>'); |
|
| 798 | + $res = ancre_texte('<'."?php\n".$quoi."\n?".'>'); |
|
| 802 | 799 | } elseif ($affiche == 'boucle') { |
| 803 | - $legend = _T('zbug_boucle') . ' ' . $nom; |
|
| 800 | + $legend = _T('zbug_boucle').' '.$nom; |
|
| 804 | 801 | // Le compilateur prefixe le nom des boucles par l'extension du fichier source. |
| 805 | 802 | $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; |
| 806 | 803 | $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); |
@@ -818,23 +815,23 @@ discard block |
||
| 818 | 815 | include_spip('public/assembler'); // pour inclure_balise_dynamique |
| 819 | 816 | include_spip('inc/texte'); // pour corriger_typo |
| 820 | 817 | |
| 821 | - return _DOCTYPE_ECRIRE . |
|
| 822 | - html_lang_attributes() . |
|
| 823 | - "<head>\n<title>" . |
|
| 824 | - ('SPIP ' . $GLOBALS['spip_version_affichee'] . ' ' . |
|
| 825 | - _T('admin_debug') . ' ' . $titre . ' (' . |
|
| 826 | - supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) . |
|
| 827 | - ")</title>\n" . |
|
| 828 | - "<meta http-equiv='Content-Type' content='text/html" . |
|
| 829 | - (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') . |
|
| 830 | - "' />\n" . |
|
| 818 | + return _DOCTYPE_ECRIRE. |
|
| 819 | + html_lang_attributes(). |
|
| 820 | + "<head>\n<title>". |
|
| 821 | + ('SPIP '.$GLOBALS['spip_version_affichee'].' '. |
|
| 822 | + _T('admin_debug').' '.$titre.' ('. |
|
| 823 | + supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))). |
|
| 824 | + ")</title>\n". |
|
| 825 | + "<meta http-equiv='Content-Type' content='text/html". |
|
| 826 | + (($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''). |
|
| 827 | + "' />\n". |
|
| 831 | 828 | http_script('', 'jquery.js') |
| 832 | - . "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css')) |
|
| 833 | - . "' type='text/css' />" . |
|
| 834 | - "</head>\n" . |
|
| 835 | - "<body style='margin:0 10px;'>\n" . |
|
| 836 | - "<div id='spip-debug-header'>" . |
|
| 837 | - $corps . |
|
| 838 | - inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false) . |
|
| 829 | + . "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) |
|
| 830 | + . "' type='text/css' />". |
|
| 831 | + "</head>\n". |
|
| 832 | + "<body style='margin:0 10px;'>\n". |
|
| 833 | + "<div id='spip-debug-header'>". |
|
| 834 | + $corps. |
|
| 835 | + inclure_balise_dynamique(balise_FORMULAIRE_ADMIN_dyn('spip-admin-float', $GLOBALS['debug_objets']), false). |
|
| 839 | 836 | '</div></body></html>'; |
| 840 | 837 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $boucle = &$boucles[$idb]; |
| 48 | 48 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 49 | 49 | |
| 50 | - $c = ["'='", "'$boucle->id_table." . "$id_parent'", 0]; |
|
| 50 | + $c = ["'='", "'$boucle->id_table."."$id_parent'", 0]; |
|
| 51 | 51 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | $id = $boucle->primary; |
| 71 | 71 | |
| 72 | 72 | if ($not or !$id) { |
| 73 | - return (['zbug_critere_inconnu', ['critere' => $not . $crit->op]]); |
|
| 73 | + return (['zbug_critere_inconnu', ['critere' => $not.$crit->op]]); |
|
| 74 | 74 | } |
| 75 | 75 | $arg = kwote(calculer_argument_precedent($idb, $id, $boucles)); |
| 76 | - $boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg]; |
|
| 76 | + $boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg]; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $not = ($crit->not ? '' : 'NOT'); |
| 105 | 105 | |
| 106 | 106 | // le doublon s'applique sur un type de boucle (article) |
| 107 | - $nom = "'" . $boucle->type_requete . "'"; |
|
| 107 | + $nom = "'".$boucle->type_requete."'"; |
|
| 108 | 108 | |
| 109 | 109 | // compléter le nom avec un nom précisé {doublons nom} |
| 110 | 110 | // on obtient $nom = "'article' . 'nom'" |
| 111 | 111 | if (isset($crit->param[0])) { |
| 112 | - $nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 112 | + $nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP) |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | // $doublons et son index, ici $nom |
| 122 | 122 | |
| 123 | 123 | // debut du code "sql_in('articles.id_article', " |
| 124 | - $debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', "; |
|
| 124 | + $debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', "; |
|
| 125 | 125 | // lecture des données du doublon "$doublons[$doublon_index[] = " |
| 126 | 126 | // Attention : boucle->doublons désigne une variable qu'on affecte |
| 127 | - $debut_doub = '$doublons[' . (!$not ? '' : ($boucle->doublons . '[]= ')); |
|
| 127 | + $debut_doub = '$doublons['.(!$not ? '' : ($boucle->doublons.'[]= ')); |
|
| 128 | 128 | |
| 129 | 129 | // le debut complet du code des doublons |
| 130 | - $debut_doub = $debut_in . $debut_doub; |
|
| 130 | + $debut_doub = $debut_in.$debut_doub; |
|
| 131 | 131 | |
| 132 | 132 | // nom du doublon "('article' . 'nom')]" |
| 133 | 133 | $fin_doub = "($nom)]"; |
@@ -137,22 +137,22 @@ discard block |
||
| 137 | 137 | foreach ($boucle->where as $k => $w) { |
| 138 | 138 | if (strpos($w[0], $debut_doub) === 0) { |
| 139 | 139 | // fusionner le sql_in (du where) |
| 140 | - $boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr($w[0], strlen($debut_in)); |
|
| 140 | + $boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr($w[0], strlen($debut_in)); |
|
| 141 | 141 | // fusionner l'initialisation (du hash) pour faire plus joli |
| 142 | 142 | $x = strpos($boucle->hash, $init_comment); |
| 143 | 143 | $len = strlen($init_comment); |
| 144 | 144 | $boucle->hash = |
| 145 | - substr($boucle->hash, 0, $x + $len) . $init_code . substr($boucle->hash, $x + $len); |
|
| 145 | + substr($boucle->hash, 0, $x + $len).$init_code.substr($boucle->hash, $x + $len); |
|
| 146 | 146 | |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante |
| 152 | - $boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"]; |
|
| 152 | + $boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"]; |
|
| 153 | 153 | |
| 154 | 154 | // déclarer le doublon s'il n'existe pas encore |
| 155 | - $boucle->hash .= $init_comment . $init_code; |
|
| 155 | + $boucle->hash .= $init_comment.$init_code; |
|
| 156 | 156 | |
| 157 | 157 | |
| 158 | 158 | # la ligne suivante avait l'intention d'eviter une collecte deja faite |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $deux = $deux[0]->texte; |
| 215 | 215 | if ($deux) { |
| 216 | 216 | $boucles[$idb]->limit = |
| 217 | - 'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"'; |
|
| 217 | + 'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"'; |
|
| 218 | 218 | } else { |
| 219 | 219 | calculer_critere_DEFAUT_dist($idb, $boucles, $crit); |
| 220 | 220 | } |
@@ -276,26 +276,26 @@ discard block |
||
| 276 | 276 | $type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr($type, 1)); |
|
| 279 | + $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr($type, 1)); |
|
| 280 | 280 | $boucle->modificateur['debut_nom'] = $type; |
| 281 | 281 | $partie = |
| 282 | 282 | // tester si le numero de page demande est de la forme '@yyy' |
| 283 | - 'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n" |
|
| 283 | + 'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n" |
|
| 284 | 284 | . "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n" |
| 285 | - . "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n" |
|
| 286 | - . "\t\t" . '$iter->seek(0);' . "\n" |
|
| 285 | + . "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n" |
|
| 286 | + . "\t\t".'$iter->seek(0);'."\n" |
|
| 287 | 287 | . "\t}\n" |
| 288 | - . "\t" . '$debut_boucle = intval($debut_boucle)'; |
|
| 288 | + . "\t".'$debut_boucle = intval($debut_boucle)'; |
|
| 289 | 289 | |
| 290 | 290 | $boucle->hash .= ' |
| 291 | - $command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');'; |
|
| 291 | + $command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');'; |
|
| 292 | 292 | |
| 293 | 293 | $boucle->total_parties = $pas; |
| 294 | 294 | calculer_parties($boucles, $idb, $partie, 'p+'); |
| 295 | 295 | // ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id |
| 296 | 296 | // sauf si pas de primaire, ou si primaire composee |
| 297 | 297 | // dans ce cas, on ne sait pas gerer une pagination indirecte |
| 298 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 298 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 299 | 299 | if ( |
| 300 | 300 | $boucle->primary |
| 301 | 301 | and !preg_match('/[,\s]/', $boucle->primary) |
@@ -342,24 +342,24 @@ discard block |
||
| 342 | 342 | $boucle->hash .= ' |
| 343 | 343 | // RECHERCHE' |
| 344 | 344 | . ($crit->cond ? ' |
| 345 | - if (!strlen(' . $quoi . ')){ |
|
| 345 | + if (!strlen(' . $quoi.')){ |
|
| 346 | 346 | list($rech_select, $rech_where) = array("0 as points",""); |
| 347 | - } else' : '') . ' |
|
| 347 | + } else' : '').' |
|
| 348 | 348 | { |
| 349 | 349 | $prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\'); |
| 350 | - list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '"); |
|
| 350 | + list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'"); |
|
| 351 | 351 | } |
| 352 | 352 | '; |
| 353 | 353 | |
| 354 | 354 | |
| 355 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 355 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 356 | 356 | if (!in_array($t, $boucles[$idb]->select)) { |
| 357 | 357 | $boucle->select[] = $t; |
| 358 | 358 | } # pour postgres, neuneu ici |
| 359 | 359 | // jointure uniquement sur le serveur principal |
| 360 | 360 | // (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal) |
| 361 | 361 | if (!$boucle->sql_serveur) { |
| 362 | - $boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"]; |
|
| 362 | + $boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"]; |
|
| 363 | 363 | $boucle->from['resultats'] = 'spip_resultats'; |
| 364 | 364 | } |
| 365 | 365 | $boucle->select[] = '$rech_select'; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $c = |
| 427 | 427 | [ |
| 428 | 428 | "'OR'", |
| 429 | - ["'='", "'$table." . "id_trad'", "'$table.$prim'"], |
|
| 429 | + ["'='", "'$table."."id_trad'", "'$table.$prim'"], |
|
| 430 | 430 | ["'='", "'$table.id_trad'", "'0'"] |
| 431 | 431 | ]; |
| 432 | 432 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
@@ -449,13 +449,13 @@ discard block |
||
| 449 | 449 | $boucle = &$boucles[$idb]; |
| 450 | 450 | $arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles)); |
| 451 | 451 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 452 | - $mparent = $boucle->id_table . '.' . $id_parent; |
|
| 452 | + $mparent = $boucle->id_table.'.'.$id_parent; |
|
| 453 | 453 | |
| 454 | 454 | if ($boucle->type_requete == 'rubriques' or isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) { |
| 455 | 455 | $boucle->where[] = ["'='", "'$mparent'", $arg]; |
| 456 | 456 | } // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist() |
| 457 | 457 | else { |
| 458 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]]); |
|
| 458 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]]); |
|
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | |
@@ -508,16 +508,15 @@ discard block |
||
| 508 | 508 | if (count(trouver_champs_decomposes($champ, $desc)) > 1) { |
| 509 | 509 | $decompose = decompose_champ_id_objet($champ); |
| 510 | 510 | $champ = array_shift($decompose); |
| 511 | - $boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"']; |
|
| 511 | + $boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"']; |
|
| 512 | 512 | } |
| 513 | 513 | } else { |
| 514 | 514 | $cle = $boucle->id_table; |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)" |
|
| 518 | - . ($not ? ", 'NOT'" : '') . ')'; |
|
| 519 | - $boucle->where[] = !$crit->cond ? $c : |
|
| 520 | - ("($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')'); |
|
| 517 | + $c = "sql_in('$cle".".$champ', calcul_branche_in($arg)" |
|
| 518 | + . ($not ? ", 'NOT'" : '').')'; |
|
| 519 | + $boucle->where[] = !$crit->cond ? $c : ("($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')'); |
|
| 521 | 520 | } |
| 522 | 521 | |
| 523 | 522 | /** |
@@ -537,9 +536,9 @@ discard block |
||
| 537 | 536 | $not = ($crit->not ? 'NOT' : ''); |
| 538 | 537 | $serveur = $boucle->sql_serveur; |
| 539 | 538 | |
| 540 | - $c = "sql_in('" . |
|
| 541 | - $boucle->id_table . '.' . $boucle->primary |
|
| 542 | - . "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')"; |
|
| 539 | + $c = "sql_in('". |
|
| 540 | + $boucle->id_table.'.'.$boucle->primary |
|
| 541 | + . "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')"; |
|
| 543 | 542 | |
| 544 | 543 | $boucle->where[] = $c; |
| 545 | 544 | } |
@@ -571,7 +570,7 @@ discard block |
||
| 571 | 570 | $t = table_objet_sql($r[1]); |
| 572 | 571 | $t = array_search($t, $boucles[$idb]->from); |
| 573 | 572 | if ($t) { |
| 574 | - $t .= '.' . $r[2]; |
|
| 573 | + $t .= '.'.$r[2]; |
|
| 575 | 574 | } |
| 576 | 575 | } |
| 577 | 576 | } else { |
@@ -586,7 +585,7 @@ discard block |
||
| 586 | 585 | $boucles[$idb]->select[] = $t; |
| 587 | 586 | } |
| 588 | 587 | } else { |
| 589 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 588 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 590 | 589 | } |
| 591 | 590 | } |
| 592 | 591 | |
@@ -656,25 +655,25 @@ discard block |
||
| 656 | 655 | (false !== $i = strpos($boucle->order[$n - 1], 'ASC')) |
| 657 | 656 | or (false !== $i = strpos($boucle->order[$n - 1], 'DESC')) |
| 658 | 657 | ) { |
| 659 | - $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0); |
|
| 658 | + $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0); |
|
| 660 | 659 | } else { |
| 661 | - $boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate']; |
|
| 660 | + $boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate']; |
|
| 662 | 661 | } |
| 663 | 662 | } |
| 664 | 663 | } else { |
| 665 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 664 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 666 | 665 | } |
| 667 | 666 | } |
| 668 | 667 | |
| 669 | 668 | function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') { |
| 670 | 669 | $boucle = $boucles[$idb]; |
| 671 | - $alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')'; |
|
| 672 | - $var = '$champs_' . $idb; |
|
| 670 | + $alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')'; |
|
| 671 | + $var = '$champs_'.$idb; |
|
| 673 | 672 | $desc = (strpos($boucle->in, (string) "static $var =") !== false); |
| 674 | 673 | if (!$desc) { |
| 675 | 674 | $desc = $boucle->show['field']; |
| 676 | 675 | $desc = implode(',', array_map('_q', array_keys($desc))); |
| 677 | - $boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');'; |
|
| 676 | + $boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');'; |
|
| 678 | 677 | } |
| 679 | 678 | if ($desc) { |
| 680 | 679 | $alt = "(in_array(\$x, $var) ? $alt :(\$x$suffix))"; |
@@ -749,7 +748,7 @@ discard block |
||
| 749 | 748 | $sens = " . ' DESC'"; |
| 750 | 749 | } |
| 751 | 750 | if (isset($boucle->modificateur['collate'])) { |
| 752 | - $collecte = ' . ' . $boucle->modificateur['collate']; |
|
| 751 | + $collecte = ' . '.$boucle->modificateur['collate']; |
|
| 753 | 752 | } |
| 754 | 753 | |
| 755 | 754 | // Pour chaque paramètre du critère |
@@ -771,14 +770,14 @@ discard block |
||
| 771 | 770 | if (preg_match(',^(\w+)[\s]+(.*)$,', $par, $m)) { |
| 772 | 771 | $expression = trim($m[1]); |
| 773 | 772 | $champ = trim($m[2]); |
| 774 | - if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) { |
|
| 773 | + if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) { |
|
| 775 | 774 | $order = $f($idb, $boucles, $crit, $tri, $champ); |
| 776 | 775 | } else { |
| 777 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 776 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 778 | 777 | } |
| 779 | 778 | |
| 780 | 779 | // tris de la forme {par champ} ou {par FONCTION(champ)} |
| 781 | - } elseif (preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', $par, $match)) { |
|
| 780 | + } elseif (preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', $par, $match)) { |
|
| 782 | 781 | // {par FONCTION(champ)} |
| 783 | 782 | if (count($match) > 2) { |
| 784 | 783 | $par = substr($match[2], 1, -1); |
@@ -788,7 +787,7 @@ discard block |
||
| 788 | 787 | if ($par == 'hasard') { |
| 789 | 788 | $order = calculer_critere_par_hasard($idb, $boucles, $crit); |
| 790 | 789 | } elseif ($par == 'date' and !empty($boucle->show['date'])) { |
| 791 | - $order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'"; |
|
| 790 | + $order = "'".$boucle->id_table.'.'.$boucle->show['date']."'"; |
|
| 792 | 791 | } else { |
| 793 | 792 | // cas général {par champ}, {par table.champ}, ... |
| 794 | 793 | $order = calculer_critere_par_champ($idb, $boucles, $crit, $par); |
@@ -797,7 +796,7 @@ discard block |
||
| 797 | 796 | |
| 798 | 797 | // on ne sait pas traiter… |
| 799 | 798 | else { |
| 800 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 799 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 801 | 800 | } |
| 802 | 801 | |
| 803 | 802 | // En cas d'erreur de squelette retournée par une fonction |
@@ -817,14 +816,14 @@ discard block |
||
| 817 | 816 | |
| 818 | 817 | if ($fct) { |
| 819 | 818 | if (preg_match("/^\s*'(.*)'\s*$/", $order, $r)) { |
| 820 | - $order = "'$fct(" . $r[1] . ")'"; |
|
| 819 | + $order = "'$fct(".$r[1].")'"; |
|
| 821 | 820 | } else { |
| 822 | 821 | $order = "'$fct(' . $order . ')'"; |
| 823 | 822 | } |
| 824 | 823 | } |
| 825 | - $t = $order . $collecte . $sens; |
|
| 824 | + $t = $order.$collecte.$sens; |
|
| 826 | 825 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 827 | - $t = $r[1] . $r[2]; |
|
| 826 | + $t = $r[1].$r[2]; |
|
| 828 | 827 | } |
| 829 | 828 | |
| 830 | 829 | $boucle->order[] = $t; |
@@ -874,16 +873,16 @@ discard block |
||
| 874 | 873 | function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) { |
| 875 | 874 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 876 | 875 | if (is_array($_champ)) { |
| 877 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]]; |
|
| 876 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]]; |
|
| 878 | 877 | } |
| 879 | 878 | $boucle = &$boucles[$idb]; |
| 880 | - $texte = '0+' . $_champ; |
|
| 879 | + $texte = '0+'.$_champ; |
|
| 881 | 880 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 882 | 881 | if ($suite !== "''") { |
| 883 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 882 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 884 | 883 | } |
| 885 | - $asnum = 'num' . ($boucle->order ? count($boucle->order) : ''); |
|
| 886 | - $boucle->select[] = $texte . " AS $asnum"; |
|
| 884 | + $asnum = 'num'.($boucle->order ? count($boucle->order) : ''); |
|
| 885 | + $boucle->select[] = $texte." AS $asnum"; |
|
| 887 | 886 | |
| 888 | 887 | $orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ); |
| 889 | 888 | $orderassinum = trim($orderassinum, "'"); |
@@ -912,13 +911,13 @@ discard block |
||
| 912 | 911 | function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) { |
| 913 | 912 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 914 | 913 | if (is_array($_champ)) { |
| 915 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]]; |
|
| 914 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]]; |
|
| 916 | 915 | } |
| 917 | 916 | $boucle = &$boucles[$idb]; |
| 918 | - $texte = '0+' . $_champ; |
|
| 917 | + $texte = '0+'.$_champ; |
|
| 919 | 918 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 920 | 919 | if ($suite !== "''") { |
| 921 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 920 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 922 | 921 | } |
| 923 | 922 | |
| 924 | 923 | $as = false; |
@@ -934,8 +933,8 @@ discard block |
||
| 934 | 933 | } |
| 935 | 934 | |
| 936 | 935 | if (!$as) { |
| 937 | - $as = 'sinum' . ($boucle->order ? count($boucle->order) : ''); |
|
| 938 | - $boucle->select[] = $select . $as; |
|
| 936 | + $as = 'sinum'.($boucle->order ? count($boucle->order) : ''); |
|
| 937 | + $boucle->select[] = $select.$as; |
|
| 939 | 938 | } |
| 940 | 939 | $order = "'$as'"; |
| 941 | 940 | return $order; |
@@ -960,10 +959,10 @@ discard block |
||
| 960 | 959 | function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) { |
| 961 | 960 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 962 | 961 | if (is_array($_champ)) { |
| 963 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]]; |
|
| 962 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]]; |
|
| 964 | 963 | } |
| 965 | 964 | $boucle = &$boucles[$idb]; |
| 966 | - $boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\""; |
|
| 965 | + $boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\""; |
|
| 967 | 966 | $order = "'multi'"; |
| 968 | 967 | return $order; |
| 969 | 968 | } |
@@ -989,7 +988,7 @@ discard block |
||
| 989 | 988 | |
| 990 | 989 | // le champ existe dans la table, pas de souci (le plus commun) |
| 991 | 990 | if (isset($desc['field'][$par])) { |
| 992 | - $par = $boucle->id_table . '.' . $par; |
|
| 991 | + $par = $boucle->id_table.'.'.$par; |
|
| 993 | 992 | } |
| 994 | 993 | // le champ est peut être une jointure |
| 995 | 994 | else { |
@@ -1010,24 +1009,24 @@ discard block |
||
| 1010 | 1009 | // Sinon on cherche le champ dans les tables possibles de jointures |
| 1011 | 1010 | // Si la table est déjà dans le from, on la réutilise. |
| 1012 | 1011 | if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) { |
| 1013 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1012 | + $par = $infos['alias'].'.'.$champ; |
|
| 1014 | 1013 | } elseif ( |
| 1015 | 1014 | $boucle->jointures_explicites |
| 1016 | 1015 | and $alias = trouver_jointure_champ($champ, $boucle, explode(' ', $boucle->jointures_explicites), false, $table) |
| 1017 | 1016 | ) { |
| 1018 | - $par = $alias . '.' . $champ; |
|
| 1017 | + $par = $alias.'.'.$champ; |
|
| 1019 | 1018 | } elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) { |
| 1020 | - $par = $alias . '.' . $champ; |
|
| 1019 | + $par = $alias.'.'.$champ; |
|
| 1021 | 1020 | // en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même) |
| 1022 | 1021 | } elseif ( |
| 1023 | 1022 | $table_alias |
| 1024 | 1023 | and isset($boucle->from[$table_alias]) |
| 1025 | 1024 | and $infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias]) |
| 1026 | 1025 | ) { |
| 1027 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1026 | + $par = $infos['alias'].'.'.$champ; |
|
| 1028 | 1027 | } elseif ($table) { |
| 1029 | 1028 | // On avait table + champ, mais on ne les a pas trouvés |
| 1030 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 1029 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 1031 | 1030 | } else { |
| 1032 | 1031 | // Sinon tant pis, ca doit etre un champ synthetise (cf points) |
| 1033 | 1032 | } |
@@ -1051,7 +1050,7 @@ discard block |
||
| 1051 | 1050 | if (!$t) { |
| 1052 | 1051 | $t = trouver_jointure_champ($champ, $boucle); |
| 1053 | 1052 | } |
| 1054 | - return !$t ? '' : ("'" . $t . '.' . $champ . "'"); |
|
| 1053 | + return !$t ? '' : ("'".$t.'.'.$champ."'"); |
|
| 1055 | 1054 | } |
| 1056 | 1055 | |
| 1057 | 1056 | /** |
@@ -1096,9 +1095,9 @@ discard block |
||
| 1096 | 1095 | $boucle->default_order[] = ' DESC'; |
| 1097 | 1096 | } |
| 1098 | 1097 | } else { |
| 1099 | - $t = $boucle->order[$n - 1] . " . $order"; |
|
| 1098 | + $t = $boucle->order[$n - 1]." . $order"; |
|
| 1100 | 1099 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 1101 | - $t = $r[1] . $r[2]; |
|
| 1100 | + $t = $r[1].$r[2]; |
|
| 1102 | 1101 | } |
| 1103 | 1102 | $boucle->order[$n - 1] = $t; |
| 1104 | 1103 | } |
@@ -1133,7 +1132,7 @@ discard block |
||
| 1133 | 1132 | $_order = array_pop($boucle->order); |
| 1134 | 1133 | |
| 1135 | 1134 | $_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent); |
| 1136 | - $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens"; |
|
| 1135 | + $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens"; |
|
| 1137 | 1136 | } |
| 1138 | 1137 | |
| 1139 | 1138 | |
@@ -1141,7 +1140,7 @@ discard block |
||
| 1141 | 1140 | $params = $crit->param; |
| 1142 | 1141 | |
| 1143 | 1142 | if ((is_countable($params) ? count($params) : 0) < 1) { |
| 1144 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 1143 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 1145 | 1144 | } |
| 1146 | 1145 | |
| 1147 | 1146 | $boucle = &$boucles[$idb]; |
@@ -1162,7 +1161,7 @@ discard block |
||
| 1162 | 1161 | if (((is_countable($date) ? count($date) : 0) == 1) and ($date[0]->type == 'texte')) { |
| 1163 | 1162 | $date = $date[0]->texte; |
| 1164 | 1163 | if (!isset($fields[$date])) { |
| 1165 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]]; |
|
| 1164 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]]; |
|
| 1166 | 1165 | } |
| 1167 | 1166 | } else { |
| 1168 | 1167 | $a = calculer_liste($date, $idb, $boucles, $parent); |
@@ -1174,38 +1173,38 @@ discard block |
||
| 1174 | 1173 | $date = "'.(($cond)\n?\$a:\"$defaut\").'"; |
| 1175 | 1174 | } |
| 1176 | 1175 | $annee = $params ? array_shift($params) : ''; |
| 1177 | - $annee = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1178 | - calculer_liste($annee, $idb, $boucles, $parent) . |
|
| 1176 | + $annee = "\n".'sprintf("%04d", ($x = '. |
|
| 1177 | + calculer_liste($annee, $idb, $boucles, $parent). |
|
| 1179 | 1178 | ') ? $x : date("Y"))'; |
| 1180 | 1179 | |
| 1181 | 1180 | $mois = $params ? array_shift($params) : ''; |
| 1182 | - $mois = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1183 | - calculer_liste($mois, $idb, $boucles, $parent) . |
|
| 1181 | + $mois = "\n".'sprintf("%02d", ($x = '. |
|
| 1182 | + calculer_liste($mois, $idb, $boucles, $parent). |
|
| 1184 | 1183 | ') ? $x : date("m"))'; |
| 1185 | 1184 | |
| 1186 | 1185 | $jour = $params ? array_shift($params) : ''; |
| 1187 | - $jour = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1188 | - calculer_liste($jour, $idb, $boucles, $parent) . |
|
| 1186 | + $jour = "\n".'sprintf("%02d", ($x = '. |
|
| 1187 | + calculer_liste($jour, $idb, $boucles, $parent). |
|
| 1189 | 1188 | ') ? $x : date("d"))'; |
| 1190 | 1189 | |
| 1191 | 1190 | $annee2 = $params ? array_shift($params) : ''; |
| 1192 | - $annee2 = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1193 | - calculer_liste($annee2, $idb, $boucles, $parent) . |
|
| 1191 | + $annee2 = "\n".'sprintf("%04d", ($x = '. |
|
| 1192 | + calculer_liste($annee2, $idb, $boucles, $parent). |
|
| 1194 | 1193 | ') ? $x : date("Y"))'; |
| 1195 | 1194 | |
| 1196 | 1195 | $mois2 = $params ? array_shift($params) : ''; |
| 1197 | - $mois2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1198 | - calculer_liste($mois2, $idb, $boucles, $parent) . |
|
| 1196 | + $mois2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1197 | + calculer_liste($mois2, $idb, $boucles, $parent). |
|
| 1199 | 1198 | ') ? $x : date("m"))'; |
| 1200 | 1199 | |
| 1201 | 1200 | $jour2 = $params ? array_shift($params) : ''; |
| 1202 | - $jour2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1203 | - calculer_liste($jour2, $idb, $boucles, $parent) . |
|
| 1201 | + $jour2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1202 | + calculer_liste($jour2, $idb, $boucles, $parent). |
|
| 1204 | 1203 | ') ? $x : date("d"))'; |
| 1205 | 1204 | |
| 1206 | - $date = $boucle->id_table . ".$date"; |
|
| 1205 | + $date = $boucle->id_table.".$date"; |
|
| 1207 | 1206 | |
| 1208 | - $quote_end = ",'" . $boucle->sql_serveur . "','text'"; |
|
| 1207 | + $quote_end = ",'".$boucle->sql_serveur."','text'"; |
|
| 1209 | 1208 | if ($type == 'jour') { |
| 1210 | 1209 | $boucle->where[] = [ |
| 1211 | 1210 | "'='", |
@@ -1277,14 +1276,13 @@ discard block |
||
| 1277 | 1276 | [$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2); |
| 1278 | 1277 | |
| 1279 | 1278 | if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) { |
| 1280 | - $boucle->limit = $a11 . ',' . $a21; |
|
| 1279 | + $boucle->limit = $a11.','.$a21; |
|
| 1281 | 1280 | } else { |
| 1282 | 1281 | // 3 dans {1/3}, {2,3} ou {1,n-3} |
| 1283 | 1282 | $boucle->total_parties = ($a21 != 'n') ? $a21 : $a22; |
| 1284 | 1283 | // 2 dans {2/3}, {2,5}, {n-2,1} |
| 1285 | 1284 | $partie = ($a11 != 'n') ? $a11 : $a12; |
| 1286 | - $mode = (($op == '/') ? '/' : |
|
| 1287 | - (($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+')); |
|
| 1285 | + $mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+')); |
|
| 1288 | 1286 | // cas simple {0,#ENV{truc}} compilons le en LIMIT : |
| 1289 | 1287 | if ($a11 !== 'n' and $a21 !== 'n' and $mode == '++' and $op == ',') { |
| 1290 | 1288 | $boucle->limit = |
@@ -1330,8 +1328,7 @@ discard block |
||
| 1330 | 1328 | // {1/3} |
| 1331 | 1329 | if ($op1 == '/') { |
| 1332 | 1330 | $pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)"; |
| 1333 | - $totpos = is_numeric($total_parties) ? ($total_parties) : |
|
| 1334 | - "($total_parties ? $total_parties : 1)"; |
|
| 1331 | + $totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)"; |
|
| 1335 | 1332 | $fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1"; |
| 1336 | 1333 | $debut = !$pmoins1 ? 0 : "ceil(($nombre_boucle * $pmoins1)/$totpos);"; |
| 1337 | 1334 | } else { |
@@ -1342,15 +1339,13 @@ discard block |
||
| 1342 | 1339 | |
| 1343 | 1340 | // cas {x,n-1} |
| 1344 | 1341 | if ($op2 == '-') { |
| 1345 | - $fin = '$debut_boucle + ' . $nombre_boucle . ' - ' |
|
| 1346 | - . (is_numeric($total_parties) ? ($total_parties + 1) : |
|
| 1347 | - ($total_parties . ' - 1')); |
|
| 1342 | + $fin = '$debut_boucle + '.$nombre_boucle.' - ' |
|
| 1343 | + . (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1')); |
|
| 1348 | 1344 | } else { |
| 1349 | 1345 | // {x,1} ou {pagination} |
| 1350 | 1346 | $fin = '$debut_boucle' |
| 1351 | 1347 | . (is_numeric($total_parties) ? |
| 1352 | - (($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) : |
|
| 1353 | - ('+' . $total_parties . ' - 1')); |
|
| 1348 | + (($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1')); |
|
| 1354 | 1349 | } |
| 1355 | 1350 | |
| 1356 | 1351 | // {pagination}, gerer le debut_xx=-1 pour tout voir |
@@ -1368,11 +1363,11 @@ discard block |
||
| 1368 | 1363 | // Utiliser min pour rabattre $fin_boucle sur total_boucle. |
| 1369 | 1364 | |
| 1370 | 1365 | $boucles[$id_boucle]->mode_partie = "\n\t" |
| 1371 | - . '$debut_boucle = ' . $debut . ";\n " |
|
| 1366 | + . '$debut_boucle = '.$debut.";\n " |
|
| 1372 | 1367 | . "\$debut_boucle = intval(\$debut_boucle);\n " |
| 1373 | - . '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1374 | - . '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1375 | - . '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1368 | + . '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1369 | + . '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1370 | + . '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1376 | 1371 | . "\n\tif (\$debut_boucle>0" |
| 1377 | 1372 | . " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']" |
| 1378 | 1373 | . " AND \$iter->seek(\$debut_boucle,'continue'))" |
@@ -1457,16 +1452,16 @@ discard block |
||
| 1457 | 1452 | // critere personnalise ? |
| 1458 | 1453 | if ( |
| 1459 | 1454 | (!$serveur or |
| 1460 | - ((!function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere)) |
|
| 1461 | - and (!function_exists($f = $f . '_dist')) |
|
| 1462 | - and (!function_exists($f = 'critere_' . $serveur . '_' . $critere)) |
|
| 1463 | - and (!function_exists($f = $f . '_dist')) |
|
| 1455 | + ((!function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere)) |
|
| 1456 | + and (!function_exists($f = $f.'_dist')) |
|
| 1457 | + and (!function_exists($f = 'critere_'.$serveur.'_'.$critere)) |
|
| 1458 | + and (!function_exists($f = $f.'_dist')) |
|
| 1464 | 1459 | ) |
| 1465 | 1460 | ) |
| 1466 | - and (!function_exists($f = 'critere_' . $table . '_' . $critere)) |
|
| 1467 | - and (!function_exists($f = $f . '_dist')) |
|
| 1468 | - and (!function_exists($f = 'critere_' . $critere)) |
|
| 1469 | - and (!function_exists($f = $f . '_dist')) |
|
| 1461 | + and (!function_exists($f = 'critere_'.$table.'_'.$critere)) |
|
| 1462 | + and (!function_exists($f = $f.'_dist')) |
|
| 1463 | + and (!function_exists($f = 'critere_'.$critere)) |
|
| 1464 | + and (!function_exists($f = $f.'_dist')) |
|
| 1470 | 1465 | ) { |
| 1471 | 1466 | // fonction critere standard |
| 1472 | 1467 | $f = $defaut; |
@@ -1497,9 +1492,9 @@ discard block |
||
| 1497 | 1492 | */ |
| 1498 | 1493 | function kwote($lisp, $serveur = '', $type = '') { |
| 1499 | 1494 | if (preg_match(_CODE_QUOTE, $lisp, $r)) { |
| 1500 | - return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"'; |
|
| 1495 | + return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"'; |
|
| 1501 | 1496 | } else { |
| 1502 | - return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')"; |
|
| 1497 | + return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')"; |
|
| 1503 | 1498 | } |
| 1504 | 1499 | } |
| 1505 | 1500 | |
@@ -1521,7 +1516,7 @@ discard block |
||
| 1521 | 1516 | function critere_IN_dist($idb, &$boucles, $crit) { |
| 1522 | 1517 | $r = calculer_critere_infixe($idb, $boucles, $crit); |
| 1523 | 1518 | if (!$r) { |
| 1524 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 1519 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 1525 | 1520 | } |
| 1526 | 1521 | [$arg, $op, $val, $col, $where_complement] = $r; |
| 1527 | 1522 | |
@@ -1546,8 +1541,8 @@ discard block |
||
| 1546 | 1541 | "'NOT'", |
| 1547 | 1542 | [ |
| 1548 | 1543 | "'IN'", |
| 1549 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1550 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1544 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1545 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1551 | 1546 | ] |
| 1552 | 1547 | ]; |
| 1553 | 1548 | } |
@@ -1564,22 +1559,22 @@ discard block |
||
| 1564 | 1559 | $descr = $boucles[$idb]->descr; |
| 1565 | 1560 | $cpt = &$num[$descr['nom']][$descr['gram']][$idb]; |
| 1566 | 1561 | |
| 1567 | - $var = '$in' . $cpt++; |
|
| 1562 | + $var = '$in'.$cpt++; |
|
| 1568 | 1563 | $x = "\n\t$var = array();"; |
| 1569 | 1564 | foreach ($val as $k => $v) { |
| 1570 | 1565 | if (preg_match(",^(\n//.*\n)?'(.*)'$,", $v, $r)) { |
| 1571 | 1566 | // optimiser le traitement des constantes |
| 1572 | 1567 | if (is_numeric($r[2])) { |
| 1573 | - $x .= "\n\t$var" . "[]= $r[2];"; |
|
| 1568 | + $x .= "\n\t$var"."[]= $r[2];"; |
|
| 1574 | 1569 | } else { |
| 1575 | - $x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';'; |
|
| 1570 | + $x .= "\n\t$var".'[]= '.sql_quote($r[2]).';'; |
|
| 1576 | 1571 | } |
| 1577 | 1572 | } else { |
| 1578 | 1573 | // Pour permettre de passer des tableaux de valeurs |
| 1579 | 1574 | // on repere l'utilisation brute de #ENV**{X}, |
| 1580 | 1575 | // c'est-a-dire sa traduction en ($PILE[0][X]). |
| 1581 | 1576 | // et on deballe mais en rajoutant l'anti XSS |
| 1582 | - $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1577 | + $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1583 | 1578 | } |
| 1584 | 1579 | } |
| 1585 | 1580 | |
@@ -1593,7 +1588,7 @@ discard block |
||
| 1593 | 1588 | $boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))"; |
| 1594 | 1589 | } |
| 1595 | 1590 | |
| 1596 | - return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')'; |
|
| 1591 | + return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')'; |
|
| 1597 | 1592 | } |
| 1598 | 1593 | |
| 1599 | 1594 | /** |
@@ -1666,7 +1661,7 @@ discard block |
||
| 1666 | 1661 | $champs = array_diff($champs, array_keys($boucle->modificateur['criteres'])); |
| 1667 | 1662 | } |
| 1668 | 1663 | // nous aider en mode debug. |
| 1669 | - $boucle->debug[] = 'id_ : ' . implode(', ', $champs); |
|
| 1664 | + $boucle->debug[] = 'id_ : '.implode(', ', $champs); |
|
| 1670 | 1665 | $boucle->modificateur['id_'] = $champs; |
| 1671 | 1666 | |
| 1672 | 1667 | // créer un critère {id_xxx?} de chaque champ retenu |
@@ -1917,8 +1912,8 @@ discard block |
||
| 1917 | 1912 | "'NOT'", |
| 1918 | 1913 | [ |
| 1919 | 1914 | "'IN'", |
| 1920 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1921 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1915 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1916 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1922 | 1917 | ] |
| 1923 | 1918 | ]; |
| 1924 | 1919 | } |
@@ -1929,7 +1924,7 @@ discard block |
||
| 1929 | 1924 | if ($crit->cond) { |
| 1930 | 1925 | $pred = calculer_argument_precedent($idb, $col, $boucles); |
| 1931 | 1926 | if ($col === 'date' or $col === 'date_redac') { |
| 1932 | - if ($pred === "\$Pile[0]['" . $col . "']") { |
|
| 1927 | + if ($pred === "\$Pile[0]['".$col."']") { |
|
| 1933 | 1928 | $pred = "(\$Pile[0]['{$col}_default']?'':$pred)"; |
| 1934 | 1929 | } |
| 1935 | 1930 | } |
@@ -2092,7 +2087,7 @@ discard block |
||
| 2092 | 2087 | // defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon |
| 2093 | 2088 | // prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut |
| 2094 | 2089 | if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", $val[0], $r)) { |
| 2095 | - $val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"'; |
|
| 2090 | + $val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"'; |
|
| 2096 | 2091 | } |
| 2097 | 2092 | // sinon expliciter les |
| 2098 | 2093 | // sql_quote(truc) en sql_quote(truc,'',type) |
@@ -2108,14 +2103,14 @@ discard block |
||
| 2108 | 2103 | ) { |
| 2109 | 2104 | $r = $r[1] |
| 2110 | 2105 | . ((isset($r[2]) and $r[2]) ? $r[2] : ",''") |
| 2111 | - . ",'" . addslashes($type_cast_quote) . "'"; |
|
| 2106 | + . ",'".addslashes($type_cast_quote)."'"; |
|
| 2112 | 2107 | $val[0] = "sql_quote($r)"; |
| 2113 | 2108 | } |
| 2114 | 2109 | elseif ( |
| 2115 | 2110 | strpos($val[0], '@@defaultcast@@') !== false |
| 2116 | 2111 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2117 | 2112 | ) { |
| 2118 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')"; |
|
| 2113 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'".addslashes($type_cast_quote)."')"; |
|
| 2119 | 2114 | } |
| 2120 | 2115 | } |
| 2121 | 2116 | |
@@ -2123,7 +2118,7 @@ discard block |
||
| 2123 | 2118 | strpos($val[0], '@@defaultcast@@') !== false |
| 2124 | 2119 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2125 | 2120 | ) { |
| 2126 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'char')"; |
|
| 2121 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'char')"; |
|
| 2127 | 2122 | } |
| 2128 | 2123 | |
| 2129 | 2124 | // Indicateur pour permettre aux fonctionx boucle_X de modifier |
@@ -2139,7 +2134,7 @@ discard block |
||
| 2139 | 2134 | // inserer le nom de la table SQL devant le nom du champ |
| 2140 | 2135 | if ($table) { |
| 2141 | 2136 | if ($col[0] == '`') { |
| 2142 | - $arg = "$table." . substr($col, 1, -1); |
|
| 2137 | + $arg = "$table.".substr($col, 1, -1); |
|
| 2143 | 2138 | } else { |
| 2144 | 2139 | $arg = "$table.$col"; |
| 2145 | 2140 | } |
@@ -2273,9 +2268,9 @@ discard block |
||
| 2273 | 2268 | **/ |
| 2274 | 2269 | function primary_doublee($decompose, $table) { |
| 2275 | 2270 | $e1 = reset($decompose); |
| 2276 | - $e2 = "sql_quote('" . end($decompose) . "')"; |
|
| 2271 | + $e2 = "sql_quote('".end($decompose)."')"; |
|
| 2277 | 2272 | |
| 2278 | - return ["'='", "'$table." . $e1 . "'", $e2]; |
|
| 2273 | + return ["'='", "'$table.".$e1."'", $e2]; |
|
| 2279 | 2274 | } |
| 2280 | 2275 | |
| 2281 | 2276 | /** |
@@ -2314,7 +2309,7 @@ discard block |
||
| 2314 | 2309 | $checkarrivee |
| 2315 | 2310 | and is_string($checkarrivee) |
| 2316 | 2311 | and $a = table_objet($checkarrivee) |
| 2317 | - and in_array($a . '_liens', $joints) |
|
| 2312 | + and in_array($a.'_liens', $joints) |
|
| 2318 | 2313 | ) { |
| 2319 | 2314 | if ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee)) { |
| 2320 | 2315 | return $res; |
@@ -2334,12 +2329,12 @@ discard block |
||
| 2334 | 2329 | // la table est déjà dans le FROM, on vérifie si le champ est utilisé. |
| 2335 | 2330 | $joindre = false; |
| 2336 | 2331 | foreach ($cols as $col) { |
| 2337 | - $c = '/\b' . $t . ".$col" . '\b/'; |
|
| 2332 | + $c = '/\b'.$t.".$col".'\b/'; |
|
| 2338 | 2333 | if (trouver_champ($c, $boucle->where)) { |
| 2339 | 2334 | $joindre = true; |
| 2340 | 2335 | } else { |
| 2341 | 2336 | // mais ca peut etre dans le FIELD pour le Having |
| 2342 | - $c = "/FIELD.$t" . ".$col,/"; |
|
| 2337 | + $c = "/FIELD.$t".".$col,/"; |
|
| 2343 | 2338 | if (trouver_champ($c, $boucle->select)) { |
| 2344 | 2339 | $joindre = true; |
| 2345 | 2340 | } |
@@ -2385,7 +2380,7 @@ discard block |
||
| 2385 | 2380 | $primary_arrivee = id_table_objet($checkarrivee); |
| 2386 | 2381 | |
| 2387 | 2382 | // [FIXME] $checkarrivee peut-il arriver avec false ???? |
| 2388 | - $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens'); |
|
| 2383 | + $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens'); |
|
| 2389 | 2384 | $arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee); |
| 2390 | 2385 | |
| 2391 | 2386 | if (!$intermediaire or !$arrivee) { |
@@ -2489,7 +2484,7 @@ discard block |
||
| 2489 | 2484 | } elseif ($crit->cond and ($col == 'date' or $col == 'date_redac')) { |
| 2490 | 2485 | // un critere conditionnel sur date est traite a part |
| 2491 | 2486 | // car la date est mise d'office par SPIP, |
| 2492 | - $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])"; |
|
| 2487 | + $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])"; |
|
| 2493 | 2488 | } |
| 2494 | 2489 | |
| 2495 | 2490 | $val = calculer_argument_precedent($idb, $val, $boucles, $defaut); |
@@ -2521,7 +2516,7 @@ discard block |
||
| 2521 | 2516 | and (($p == "'") or ($p == '"')) |
| 2522 | 2517 | and $params[0][1]->type == 'champ' |
| 2523 | 2518 | ) { |
| 2524 | - $val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p"; |
|
| 2519 | + $val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p"; |
|
| 2525 | 2520 | } else { |
| 2526 | 2521 | foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) { |
| 2527 | 2522 | $a = calculer_liste($p, $idb, $boucles, $parent); |
@@ -2537,7 +2532,7 @@ discard block |
||
| 2537 | 2532 | $fct = $args_sql = ''; |
| 2538 | 2533 | // fonction SQL ? |
| 2539 | 2534 | // chercher FONCTION(champ) tel que CONCAT(titre,descriptif) |
| 2540 | - if (preg_match('/^(.*)' . SQL_ARGS . '$/', $col, $m)) { |
|
| 2535 | + if (preg_match('/^(.*)'.SQL_ARGS.'$/', $col, $m)) { |
|
| 2541 | 2536 | $fct = $m[1]; |
| 2542 | 2537 | preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a); |
| 2543 | 2538 | $col = $a[1]; |
@@ -2627,7 +2622,7 @@ discard block |
||
| 2627 | 2622 | # si oui choisir ce champ, sinon choisir xxxx |
| 2628 | 2623 | |
| 2629 | 2624 | if (isset($table['field']["date$suite"])) { |
| 2630 | - $date_orig = 'date' . $suite; |
|
| 2625 | + $date_orig = 'date'.$suite; |
|
| 2631 | 2626 | } else { |
| 2632 | 2627 | $date_orig = substr($suite, 1); |
| 2633 | 2628 | } |
@@ -2638,12 +2633,12 @@ discard block |
||
| 2638 | 2633 | } |
| 2639 | 2634 | } |
| 2640 | 2635 | |
| 2641 | - $date_compare = "\"' . normaliser_date(" . |
|
| 2642 | - calculer_argument_precedent($idb, $pred, $boucles) . |
|
| 2636 | + $date_compare = "\"' . normaliser_date(". |
|
| 2637 | + calculer_argument_precedent($idb, $pred, $boucles). |
|
| 2643 | 2638 | ") . '\""; |
| 2644 | 2639 | |
| 2645 | 2640 | $col_vraie = $date_orig; |
| 2646 | - $date_orig = $boucle->id_table . '.' . $date_orig; |
|
| 2641 | + $date_orig = $boucle->id_table.'.'.$date_orig; |
|
| 2647 | 2642 | |
| 2648 | 2643 | switch ($col) { |
| 2649 | 2644 | case 'date': |
@@ -2663,26 +2658,26 @@ discard block |
||
| 2663 | 2658 | break; |
| 2664 | 2659 | case 'age': |
| 2665 | 2660 | $col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig); |
| 2666 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2661 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2667 | 2662 | break; |
| 2668 | 2663 | case 'age_relatif': |
| 2669 | 2664 | $col = calculer_param_date($date_compare, $date_orig); |
| 2670 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2665 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2671 | 2666 | break; |
| 2672 | 2667 | case 'jour_relatif': |
| 2673 | - $col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))'; |
|
| 2674 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2668 | + $col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))'; |
|
| 2669 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2675 | 2670 | break; |
| 2676 | 2671 | case 'mois_relatif': |
| 2677 | - $col = 'MONTH(' . $date_compare . ')-MONTH(' . |
|
| 2678 | - $date_orig . ')+12*(YEAR(' . $date_compare . |
|
| 2679 | - ')-YEAR(' . $date_orig . '))'; |
|
| 2680 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2672 | + $col = 'MONTH('.$date_compare.')-MONTH('. |
|
| 2673 | + $date_orig.')+12*(YEAR('.$date_compare. |
|
| 2674 | + ')-YEAR('.$date_orig.'))'; |
|
| 2675 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2681 | 2676 | break; |
| 2682 | 2677 | case 'annee_relatif': |
| 2683 | - $col = 'YEAR(' . $date_compare . ')-YEAR(' . |
|
| 2684 | - $date_orig . ')'; |
|
| 2685 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2678 | + $col = 'YEAR('.$date_compare.')-YEAR('. |
|
| 2679 | + $date_orig.')'; |
|
| 2680 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2686 | 2681 | break; |
| 2687 | 2682 | } |
| 2688 | 2683 | |
@@ -2743,10 +2738,10 @@ discard block |
||
| 2743 | 2738 | } |
| 2744 | 2739 | |
| 2745 | 2740 | $boucle->hash .= ' |
| 2746 | - $command[\'sourcemode\'] = ' . array_shift($args) . ";\n"; |
|
| 2741 | + $command[\'sourcemode\'] = ' . array_shift($args).";\n"; |
|
| 2747 | 2742 | |
| 2748 | 2743 | $boucle->hash .= ' |
| 2749 | - $command[\'source\'] = array(' . join(', ', $args) . ");\n"; |
|
| 2744 | + $command[\'source\'] = array(' . join(', ', $args).");\n"; |
|
| 2750 | 2745 | } |
| 2751 | 2746 | |
| 2752 | 2747 | /** |
@@ -2765,7 +2760,7 @@ discard block |
||
| 2765 | 2760 | function critere_DATA_datacache_dist($idb, &$boucles, $crit) { |
| 2766 | 2761 | $boucle = &$boucles[$idb]; |
| 2767 | 2762 | $boucle->hash .= ' |
| 2768 | - $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2763 | + $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2769 | 2764 | } |
| 2770 | 2765 | |
| 2771 | 2766 | |
@@ -2784,7 +2779,7 @@ discard block |
||
| 2784 | 2779 | $boucle->hash .= '$command[\'args\']=array();'; |
| 2785 | 2780 | foreach ($crit->param as $param) { |
| 2786 | 2781 | $boucle->hash .= ' |
| 2787 | - $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2782 | + $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2788 | 2783 | } |
| 2789 | 2784 | } |
| 2790 | 2785 | |
@@ -2803,14 +2798,14 @@ discard block |
||
| 2803 | 2798 | */ |
| 2804 | 2799 | function critere_DATA_liste_dist($idb, &$boucles, $crit) { |
| 2805 | 2800 | $boucle = &$boucles[$idb]; |
| 2806 | - $boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n"; |
|
| 2801 | + $boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n"; |
|
| 2807 | 2802 | foreach ($crit->param as $param) { |
| 2808 | - $boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste( |
|
| 2803 | + $boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste( |
|
| 2809 | 2804 | $param, |
| 2810 | 2805 | $idb, |
| 2811 | 2806 | $boucles, |
| 2812 | 2807 | $boucles[$idb]->id_parent |
| 2813 | - ) . ";\n"; |
|
| 2808 | + ).";\n"; |
|
| 2814 | 2809 | } |
| 2815 | 2810 | } |
| 2816 | 2811 | |
@@ -2837,14 +2832,14 @@ discard block |
||
| 2837 | 2832 | */ |
| 2838 | 2833 | function critere_DATA_enum_dist($idb, &$boucles, $crit) { |
| 2839 | 2834 | $boucle = &$boucles[$idb]; |
| 2840 | - $boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n"; |
|
| 2835 | + $boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n"; |
|
| 2841 | 2836 | foreach ($crit->param as $param) { |
| 2842 | - $boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste( |
|
| 2837 | + $boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste( |
|
| 2843 | 2838 | $param, |
| 2844 | 2839 | $idb, |
| 2845 | 2840 | $boucles, |
| 2846 | 2841 | $boucles[$idb]->id_parent |
| 2847 | - ) . ";\n"; |
|
| 2842 | + ).";\n"; |
|
| 2848 | 2843 | } |
| 2849 | 2844 | } |
| 2850 | 2845 | |
@@ -2863,7 +2858,7 @@ discard block |
||
| 2863 | 2858 | $boucle = &$boucles[$idb]; |
| 2864 | 2859 | foreach ($crit->param as $param) { |
| 2865 | 2860 | $boucle->hash .= ' |
| 2866 | - $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2861 | + $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2867 | 2862 | } |
| 2868 | 2863 | } |
| 2869 | 2864 | |
@@ -2904,7 +2899,7 @@ discard block |
||
| 2904 | 2899 | if ($crit->param) { |
| 2905 | 2900 | foreach ($crit->param as $param) { |
| 2906 | 2901 | $boucle->hash .= "\t\$command['si'][] = " |
| 2907 | - . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n"; |
|
| 2902 | + . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n"; |
|
| 2908 | 2903 | } |
| 2909 | 2904 | // interdire {si 0} aussi ! |
| 2910 | 2905 | } else { |
@@ -2928,7 +2923,7 @@ discard block |
||
| 2928 | 2923 | function critere_POUR_tableau_dist($idb, &$boucles, $crit) { |
| 2929 | 2924 | $boucle = &$boucles[$idb]; |
| 2930 | 2925 | $boucle->hash .= ' |
| 2931 | - $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . '); |
|
| 2926 | + $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).'); |
|
| 2932 | 2927 | $command[\'sourcemode\'] = \'table\';'; |
| 2933 | 2928 | } |
| 2934 | 2929 | |
@@ -2963,7 +2958,7 @@ discard block |
||
| 2963 | 2958 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 2964 | 2959 | |
| 2965 | 2960 | $in = 'IN'; |
| 2966 | - $where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2961 | + $where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2967 | 2962 | if ($not) { |
| 2968 | 2963 | $where = ["'NOT'", $where]; |
| 2969 | 2964 | } |
@@ -48,19 +48,19 @@ discard block |
||
| 48 | 48 | * Nom d'une balise #TOTO |
| 49 | 49 | * |
| 50 | 50 | * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */ |
| 51 | -define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 51 | +define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 52 | 52 | /** Balise complète [...(#TOTO) ... ] */ |
| 53 | -define('CHAMP_ETENDU', '/\[([^]\[]*)\(' . NOM_DE_CHAMP . '([^[)]*\)[^]\[]*)\]/S'); |
|
| 53 | +define('CHAMP_ETENDU', '/\[([^]\[]*)\('.NOM_DE_CHAMP.'([^[)]*\)[^]\[]*)\]/S'); |
|
| 54 | 54 | |
| 55 | 55 | define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S'); |
| 56 | 56 | define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims'); |
| 57 | 57 | define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS'); |
| 58 | -define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 58 | +define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 59 | 59 | |
| 60 | 60 | /** Champ sql dans parenthèse ex: (id_article) */ |
| 61 | 61 | define('SQL_ARGS', '(\([^)]*\))'); |
| 62 | 62 | /** Fonction SQL sur un champ ex: SUM(visites) */ |
| 63 | -define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?'); |
|
| 63 | +define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?'); |
|
| 64 | 64 | |
| 65 | 65 | function phraser_inclure($texte, $ligne, $result) { |
| 66 | 66 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * @return array |
| 216 | 216 | **/ |
| 217 | 217 | function phraser_champs($texte, $ligne, $result) { |
| 218 | - while (preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match)) { |
|
| 218 | + while (preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match)) { |
|
| 219 | 219 | $p = strpos($texte, (string) $match[0]); |
| 220 | 220 | // texte après la balise |
| 221 | 221 | $suite = substr($texte, $p + strlen($match[0])); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $collecte[] = $champ; |
| 364 | 364 | $args = ltrim($regs[count($regs) - 1]); |
| 365 | 365 | } else { |
| 366 | - if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) { |
|
| 366 | + if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) { |
|
| 367 | 367 | // 0 est un aveu d'impuissance. A completer |
| 368 | 368 | $arg = phraser_champs_exterieurs($arg, 0, $sep, $result); |
| 369 | 369 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) { |
| 448 | 448 | $res = []; |
| 449 | 449 | while (($p = strpos($texte, (string) "%$sep")) !== false) { |
| 450 | - if (!preg_match(',^%' . preg_quote($sep) . '([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 450 | + if (!preg_match(',^%'.preg_quote($sep).'([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 451 | 451 | break; |
| 452 | 452 | } |
| 453 | 453 | $debut = substr($texte, 0, $p); |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | $pos_apres = 0; |
| 488 | 488 | $result = phraser_args($match[7], ')', $sep, $result, $champ, $pos_apres); |
| 489 | 489 | phraser_vieux($champ); |
| 490 | - $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 490 | + $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 491 | 491 | $debut = substr($match[7], $pos_apres + 1); |
| 492 | 492 | if (!empty($debut)) { |
| 493 | 493 | $n += substr_count(substr($texte, 0, strpos($texte, $debut)), "\n"); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | // une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"} |
| 619 | 619 | if (preg_match(',^(["\'])(.*)\1$,', $m[4])) { |
| 620 | 620 | $c = null; |
| 621 | - eval('$c = ' . $m[4] . ';'); |
|
| 621 | + eval('$c = '.$m[4].';'); |
|
| 622 | 622 | if (isset($c)) { |
| 623 | 623 | $m[4] = $c; |
| 624 | 624 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', $param, $m)) { |
| 699 | 699 | $crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', ''); |
| 700 | 700 | } elseif ( |
| 701 | - preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC . |
|
| 701 | + preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC. |
|
| 702 | 702 | ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', $param, $m) |
| 703 | 703 | ) { |
| 704 | 704 | $a2 = trim($m[8]); |
@@ -715,8 +715,8 @@ discard block |
||
| 715 | 715 | ); |
| 716 | 716 | $crit->exclus = $m[1]; |
| 717 | 717 | } elseif ( |
| 718 | - preg_match('/^([!]?)\s*(' . |
|
| 719 | - CHAMP_SQL_PLUS_FONC . |
|
| 718 | + preg_match('/^([!]?)\s*('. |
|
| 719 | + CHAMP_SQL_PLUS_FONC. |
|
| 720 | 720 | ')\s*(\??)(.*)$/is', $param, $m) |
| 721 | 721 | ) { |
| 722 | 722 | // contient aussi les comparaisons implicites ! |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | // trouver sa position de depart reelle : au <Bxx> ou au <BBxx> |
| 864 | - $precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>'; |
|
| 864 | + $precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>'; |
|
| 865 | 865 | $pos_precond = strpos($texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 866 | 866 | if ( |
| 867 | 867 | $pos_precond !== false |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | $boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle); |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | - $preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>'; |
|
| 875 | + $preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>'; |
|
| 876 | 876 | $pos_preaff = strpos($texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 877 | 877 | if ( |
| 878 | 878 | $pos_preaff !== false |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | $pos_anonyme_next = null; |
| 921 | 921 | // si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme |
| 922 | 922 | if (!strlen($id_boucle)) { |
| 923 | - $pos_anonyme_next = strpos($texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 923 | + $pos_anonyme_next = strpos($texte, BALISE_BOUCLE.'(', $pos_courante); |
|
| 924 | 924 | } |
| 925 | 925 | |
| 926 | 926 | // |
| 927 | 927 | // 1. Recuperer la partie conditionnelle apres |
| 928 | 928 | // |
| 929 | - $apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>'; |
|
| 929 | + $apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>'; |
|
| 930 | 930 | $pos_apres = strpos($texte, $apres_boucle, $pos_courante); |
| 931 | 931 | if ( |
| 932 | 932 | $pos_apres !== false |
@@ -935,13 +935,13 @@ discard block |
||
| 935 | 935 | $boucle['pos_postcond'] = $pos_apres; |
| 936 | 936 | $pos_apres += strlen($apres_boucle); |
| 937 | 937 | $boucle['pos_postcond_inside'] = $pos_apres; |
| 938 | - $pos_courante = $pos_apres ; |
|
| 938 | + $pos_courante = $pos_apres; |
|
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | // |
| 942 | 942 | // 2. Récuperer la partie alternative apres |
| 943 | 943 | // |
| 944 | - $altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>'; |
|
| 944 | + $altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>'; |
|
| 945 | 945 | $pos_altern = strpos($texte, $altern_boucle, $pos_courante); |
| 946 | 946 | if ( |
| 947 | 947 | $pos_altern !== false |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | // |
| 957 | 957 | // 3. Recuperer la partie footer non alternative |
| 958 | 958 | // |
| 959 | - $postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>'; |
|
| 959 | + $postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>'; |
|
| 960 | 960 | $pos_postaff = strpos($texte, $postaff_boucle, $pos_courante); |
| 961 | 961 | if ( |
| 962 | 962 | $pos_postaff !== false |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | $boucle['pos_postaff'] = $pos_postaff; |
| 966 | 966 | $pos_postaff += strlen($postaff_boucle); |
| 967 | 967 | $boucle['pos_postaff_inside'] = $pos_postaff; |
| 968 | - $pos_courante = $pos_postaff ; |
|
| 968 | + $pos_courante = $pos_postaff; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | return $boucle; |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | * @return string |
| 1006 | 1006 | */ |
| 1007 | 1007 | function public_generer_boucle_placeholder($id_boucle, &$boucle, $boucle_placeholder, $nb_lignes) { |
| 1008 | - $placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']'; |
|
| 1008 | + $placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']'; |
|
| 1009 | 1009 | //memoriser la boucle a reinjecter |
| 1010 | 1010 | $id_boucle = "$id_boucle"; |
| 1011 | 1011 | phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle); |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | // definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette |
| 1019 | 1019 | if (is_null($boucle_placeholder)) { |
| 1020 | 1020 | do { |
| 1021 | - $boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid())); |
|
| 1021 | + $boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid())); |
|
| 1022 | 1022 | } while (strpos($texte, $boucle_placeholder) !== false); |
| 1023 | 1023 | } |
| 1024 | 1024 | |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | |
| 1039 | 1039 | // boucle anonyme ? |
| 1040 | 1040 | if (!strlen($id_boucle)) { |
| 1041 | - $id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1041 | + $id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | $pos_debut_boucle = $pos_courante; |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $pos_avant = $boucle['pos_precond_inside']; |
| 1053 | 1053 | $result->avant = substr($texte, $pos_avant, $pos_courante - $pos_avant); |
| 1054 | - $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1054 | + $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | // Regarder si on a une partie inconditionnelle avant <BB_xxx> |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | |
| 1061 | 1061 | $pos_preaff = $boucle['pos_preaff_inside']; |
| 1062 | 1062 | $result->preaff = substr($texte, $pos_preaff, $end_preaff - $pos_preaff); |
| 1063 | - $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1063 | + $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | $result->id_boucle = $id_boucle; |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | } else { |
| 1118 | 1118 | $pos_milieu += 1; |
| 1119 | 1119 | |
| 1120 | - $fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>'; |
|
| 1120 | + $fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>'; |
|
| 1121 | 1121 | $pos_fin = strpos($texte, $fin_boucle, $pos_milieu); |
| 1122 | 1122 | if ($pos_fin === false) { |
| 1123 | 1123 | $err_b = [ |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | else { |
| 1131 | 1131 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1132 | 1132 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1133 | - $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
|
| 1133 | + $search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'('; |
|
| 1134 | 1134 | $search_from = $pos_milieu; |
| 1135 | 1135 | $nb_open = 1; |
| 1136 | 1136 | $nb_close = 1; |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | if ($boucle['pos_postcond']) { |
| 1171 | 1171 | $result->apres = substr($texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante); |
| 1172 | 1172 | $ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']); |
| 1173 | - $pos_courante = $boucle['pos_postcond_inside'] ; |
|
| 1173 | + $pos_courante = $boucle['pos_postcond_inside']; |
|
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | if ($fail) { |
| 40 | 40 | echo info_etape(_T('info_chemin_acces_annuaire')), |
| 41 | 41 | info_progression_etape(3, 'etape_ldap', 'install/', true), |
| 42 | - "<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'), |
|
| 43 | - ' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>'; |
|
| 42 | + "<div class='error'><p><b>"._T('avis_operation_echec').'</b></p><p>'._T('avis_chemin_invalide_1'), |
|
| 43 | + ' (<tt>'.spip_htmlspecialchars($base_ldap).'</tt>) '._T('avis_chemin_invalide_2').'</p></div>'; |
|
| 44 | 44 | } else { |
| 45 | 45 | info_etape(_T('info_reglage_ldap')); |
| 46 | 46 | echo info_progression_etape(4, 'etape_ldap', 'install/'); |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
| 55 | 55 | . "<input type='hidden' name='etape' value='ldap5' />" |
| 56 | - . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" |
|
| 56 | + . "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />" |
|
| 57 | 57 | . fieldset( |
| 58 | 58 | _T('info_statut_utilisateurs_1'), |
| 59 | 59 | [ |
| 60 | 60 | 'statut_ldap' => [ |
| 61 | - 'label' => _T('info_statut_utilisateurs_2') . '<br />', |
|
| 61 | + 'label' => _T('info_statut_utilisateurs_2').'<br />', |
|
| 62 | 62 | 'valeur' => $statut_ldap, |
| 63 | 63 | 'alternatives' => $statuts |
| 64 | 64 | ] |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | function liste_statuts_ldap() { |
| 77 | 77 | $recom = [ |
| 78 | - 'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'), |
|
| 79 | - 'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'), |
|
| 80 | - 'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />') |
|
| 78 | + 'info_administrateurs' => ('<b>'._T('info_administrateur_1').'</b> '._T('info_administrateur_2').'<br />'), |
|
| 79 | + 'info_redacteurs' => ('<b>'._T('info_redacteur_1').'</b> '._T('info_redacteur_2').'<br />'), |
|
| 80 | + 'info_visiteurs' => ('<b>'._T('info_visiteur_1').'</b> '._T('info_visiteur_2').'<br />') |
|
| 81 | 81 | ]; |
| 82 | 82 | |
| 83 | 83 | $res = []; |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | function install_ldap_correspondances() { |
| 94 | 94 | $champs = []; |
| 95 | 95 | foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) { |
| 96 | - $nom = 'ldap_' . $champ; |
|
| 96 | + $nom = 'ldap_'.$champ; |
|
| 97 | 97 | $val = is_array($v) ? join(',', $v) : strval($v); |
| 98 | 98 | $champs[$nom] = [ |
| 99 | - 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 99 | + 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]).'<br />', |
|
| 100 | 100 | 'valeur' => $val |
| 101 | 101 | ]; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | return !$champs ? |
| 105 | - '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />'); |
|
| 105 | + '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />'); |
|
| 106 | 106 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, '', $server_db); |
| 45 | 45 | |
| 46 | 46 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 47 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 47 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 48 | 48 | |
| 49 | 49 | $fquery = sql_serveur('query', $server_db); |
| 50 | 50 | if ($choix_db == 'new_spip') { |
@@ -54,13 +54,13 @@ discard block |
||
| 54 | 54 | if (!$ok) { |
| 55 | 55 | $re = "Impossible de creer la base $re"; |
| 56 | 56 | spip_log($re); |
| 57 | - return '<p>' . _T('avis_connexion_erreur_creer_base') . "</p><!--\n$re\n-->"; |
|
| 57 | + return '<p>'._T('avis_connexion_erreur_creer_base')."</p><!--\n$re\n-->"; |
|
| 58 | 58 | } |
| 59 | 59 | } else { |
| 60 | 60 | $re = "Le nom de la base doit correspondre a $re"; |
| 61 | 61 | spip_log($re); |
| 62 | 62 | |
| 63 | - return '<p>' . _T('avis_connexion_erreur_nom_base') . "</p><!--\n$re\n-->"; |
|
| 63 | + return '<p>'._T('avis_connexion_erreur_nom_base')."</p><!--\n$re\n-->"; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $sel_db, $server_db); |
| 72 | 72 | |
| 73 | 73 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 74 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 74 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 75 | 75 | |
| 76 | 76 | // Completer le tableau decrivant la connexion |
| 77 | 77 | |
| 78 | 78 | $GLOBALS['connexions'][$server_db]['prefixe'] = $table_prefix; |
| 79 | 79 | $GLOBALS['connexions'][$server_db]['db'] = $sel_db; |
| 80 | 80 | |
| 81 | - $old = sql_showbase($table_prefix . '_meta', $server_db); |
|
| 81 | + $old = sql_showbase($table_prefix.'_meta', $server_db); |
|
| 82 | 82 | if ($old) { |
| 83 | 83 | $old = sql_fetch($old, $server_db); |
| 84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $charset['charset']; |
| 98 | 98 | $charsetbase = $charset['charset']; |
| 99 | 99 | } else { |
| 100 | - spip_log(_DEFAULT_CHARSET . ' inconnu du serveur SQL'); |
|
| 100 | + spip_log(_DEFAULT_CHARSET.' inconnu du serveur SQL'); |
|
| 101 | 101 | $charsetbase = 'standard'; |
| 102 | 102 | } |
| 103 | 103 | spip_log("Creation des tables. Codage $charsetbase"); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if ($r) { |
| 148 | 148 | $r = sql_fetch($r, $server_db); |
| 149 | 149 | } |
| 150 | - $version_installee = !$r ? 0 : (double)$r['valeur']; |
|
| 150 | + $version_installee = !$r ? 0 : (double) $r['valeur']; |
|
| 151 | 151 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 152 | 152 | $fupdateq( |
| 153 | 153 | 'spip_meta', |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | '', |
| 157 | 157 | $server_db |
| 158 | 158 | ); |
| 159 | - spip_log('nouvelle version installee: ' . $GLOBALS['spip_version_base']); |
|
| 159 | + spip_log('nouvelle version installee: '.$GLOBALS['spip_version_base']); |
|
| 160 | 160 | } |
| 161 | 161 | // eliminer la derniere operation d'admin mal terminee |
| 162 | 162 | // notamment la mise a jour |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if ($chmod_db) { |
| 184 | 184 | install_fichier_connexion( |
| 185 | 185 | _FILE_CHMOD_TMP, |
| 186 | - "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', " . sprintf('0%3o', $chmod_db) . ");\n" |
|
| 186 | + "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', ".sprintf('0%3o', $chmod_db).");\n" |
|
| 187 | 187 | ); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -246,16 +246,16 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | |
| 248 | 248 | function install_premier_auteur($email, $login, $nom, $pass, $hidden, $auteur_obligatoire) { |
| 249 | - return info_progression_etape(3, 'etape_', 'install/') . |
|
| 249 | + return info_progression_etape(3, 'etape_', 'install/'). |
|
| 250 | 250 | info_etape( |
| 251 | 251 | _T('info_informations_personnelles'), |
| 252 | - '<b>' . _T('texte_informations_personnelles_1') . '</b>' . |
|
| 253 | - aider('install5', true) . |
|
| 254 | - '<p>' . |
|
| 252 | + '<b>'._T('texte_informations_personnelles_1').'</b>'. |
|
| 253 | + aider('install5', true). |
|
| 254 | + '<p>'. |
|
| 255 | 255 | ($auteur_obligatoire ? |
| 256 | 256 | '' |
| 257 | 257 | : |
| 258 | - _T('texte_informations_personnelles_2') . ' ' . _T('info_laisser_champs_vides') |
|
| 258 | + _T('texte_informations_personnelles_2').' '._T('info_laisser_champs_vides') |
|
| 259 | 259 | ) |
| 260 | 260 | ) |
| 261 | 261 | . generer_form_ecrire('install', ( |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | _T('info_identification_publique'), |
| 266 | 266 | [ |
| 267 | 267 | 'nom' => [ |
| 268 | - 'label' => '<b>' . _T('entree_signature') . "</b><br />\n" . _T('entree_nom_pseudo_1') . "\n", |
|
| 268 | + 'label' => '<b>'._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n", |
|
| 269 | 269 | 'valeur' => $nom, |
| 270 | 270 | 'required' => $auteur_obligatoire, |
| 271 | 271 | ], |
| 272 | 272 | 'email' => [ |
| 273 | - 'label' => '<b>' . _T('entree_adresse_email') . "</b>\n", |
|
| 273 | + 'label' => '<b>'._T('entree_adresse_email')."</b>\n", |
|
| 274 | 274 | 'valeur' => $email, |
| 275 | 275 | ] |
| 276 | 276 | ] |
@@ -280,23 +280,23 @@ discard block |
||
| 280 | 280 | _T('entree_identifiants_connexion'), |
| 281 | 281 | [ |
| 282 | 282 | 'login' => [ |
| 283 | - 'label' => '<b>' . _T('entree_login') . "</b><br />\n" . _T( |
|
| 283 | + 'label' => '<b>'._T('entree_login')."</b><br />\n"._T( |
|
| 284 | 284 | 'info_login_trop_court_car_pluriel', |
| 285 | 285 | ['nb' => _LOGIN_TROP_COURT] |
| 286 | - ) . "\n", |
|
| 286 | + )."\n", |
|
| 287 | 287 | 'valeur' => $login, |
| 288 | 288 | 'required' => $auteur_obligatoire, |
| 289 | 289 | ], |
| 290 | 290 | 'pass' => [ |
| 291 | - 'label' => '<b>' . _T('entree_mot_passe') . "</b><br />\n" . _T( |
|
| 291 | + 'label' => '<b>'._T('entree_mot_passe')."</b><br />\n"._T( |
|
| 292 | 292 | 'info_passe_trop_court_car_pluriel', |
| 293 | 293 | ['nb' => _PASS_LONGUEUR_MINI] |
| 294 | - ) . "\n", |
|
| 294 | + )."\n", |
|
| 295 | 295 | 'valeur' => $pass, |
| 296 | 296 | 'required' => $auteur_obligatoire, |
| 297 | 297 | ], |
| 298 | 298 | 'pass_verif' => [ |
| 299 | - 'label' => '<b>' . _T('info_confirmer_passe') . "</b><br />\n", |
|
| 299 | + 'label' => '<b>'._T('info_confirmer_passe')."</b><br />\n", |
|
| 300 | 300 | 'valeur' => $pass, |
| 301 | 301 | 'required' => $auteur_obligatoire, |
| 302 | 302 | ] |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if ($res) { |
| 342 | 342 | $res = info_progression_etape(2, 'etape_', 'install/', true) |
| 343 | - . "<div class='error'><h3>" . _T('avis_operation_echec') . '</h3>' |
|
| 343 | + . "<div class='error'><h3>"._T('avis_operation_echec').'</h3>' |
|
| 344 | 344 | . $res |
| 345 | - . '<p>' . _T('texte_operation_echec') . '</p>' |
|
| 345 | + . '<p>'._T('texte_operation_echec').'</p>' |
|
| 346 | 346 | . '</div>'; |
| 347 | 347 | } |
| 348 | 348 | } else { |