@@ -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, ...) |
@@ -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 | } |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | foreach ($debug['sourcefile'] as $k => $v) { |
| 103 | 103 | if (strpos($v, 'administration.') !== false) { |
| 104 | - if (isset($debug['resultat'][$k . 'tout'])) { |
|
| 105 | - return $debug['resultat'][$k . 'tout']; |
|
| 104 | + if (isset($debug['resultat'][$k.'tout'])) { |
|
| 105 | + return $debug['resultat'][$k.'tout']; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | and $id = intval($id) |
| 181 | 181 | and $desc = $trouver_table(table_objet_sql($type)) |
| 182 | 182 | ) { |
| 183 | - $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . intval($id)); |
|
| 183 | + $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
|
| 184 | 184 | if ($id) { |
| 185 | 185 | $env[$_id_type] = $id; |
| 186 | 186 | $env['objet'] = $type; |
| 187 | 187 | $env['id_objet'] = $id; |
| 188 | - $env['voir_' . $obj] = |
|
| 188 | + $env['voir_'.$obj] = |
|
| 189 | 189 | str_replace('&', '&', generer_objet_url($id, $obj, '', '', false)); |
| 190 | 190 | if ( |
| 191 | 191 | isset($desc['field']['id_rubrique']) |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $notpub = sql_in('statut', ['prop', 'prive']); |
| 240 | 240 | |
| 241 | 241 | if ($type == 'article' and $GLOBALS['meta']['post_dates'] != 'oui') { |
| 242 | - $notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ')'; |
|
| 242 | + $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).')'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . '=' . $id . " AND ($notpub)"); |
|
| 245 | + return sql_fetsel('1', table_objet_sql($type), id_table_objet($type).'='.$id." AND ($notpub)"); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | $alang = ''; |
| 257 | 257 | if (!empty($_COOKIE['spip_admin'])) { |
| 258 | 258 | $email_or_login = preg_replace(',^@,', '', $_COOKIE['spip_admin']); |
| 259 | - $alang = sql_getfetsel('lang', 'spip_auteurs', 'email=' . sql_quote($email_or_login)); |
|
| 259 | + $alang = sql_getfetsel('lang', 'spip_auteurs', 'email='.sql_quote($email_or_login)); |
|
| 260 | 260 | if (!$alang) { |
| 261 | - $alang = sql_getfetsel('lang', 'spip_auteurs', 'login=' . sql_quote($email_or_login)); |
|
| 261 | + $alang = sql_getfetsel('lang', 'spip_auteurs', 'login='.sql_quote($email_or_login)); |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | if (!$alang) { |
@@ -283,9 +283,8 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | return ((!isset($GLOBALS['xhtml']) or $GLOBALS['xhtml'] !== 'true') ? |
| 285 | 285 | (parametre_url(self(), 'var_mode', 'debug', '&') |
| 286 | - . '&var_mode_affiche=validation') : |
|
| 287 | - ('http://validator.w3.org/check?uri=' |
|
| 288 | - . rawurlencode('http://' . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 286 | + . '&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri=' |
|
| 287 | + . rawurlencode('http://'.$_SERVER['HTTP_HOST'].nettoyer_uri()))); |
|
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | /** |
@@ -54,12 +54,12 @@ |
||
| 54 | 54 | $_params = '['; |
| 55 | 55 | $nb_params = is_countable($p->param[0]) ? count($p->param[0]) : 0; // 1ère valeur vide donc 1 en plus |
| 56 | 56 | for ($i = 3; $i < $nb_params; $i++) { |
| 57 | - $_params .= interprete_argument_balise($i, $p) . ','; |
|
| 57 | + $_params .= interprete_argument_balise($i, $p).','; |
|
| 58 | 58 | } |
| 59 | 59 | $_params .= ']'; |
| 60 | 60 | |
| 61 | 61 | $info_sql = strtolower(substr($info, 5)); |
| 62 | - $code = "generer_objet_info($id_objet, $type_objet, '$info_sql', " . ($p->etoile ? _q($p->etoile) : "''") . ", $_params)"; |
|
| 62 | + $code = "generer_objet_info($id_objet, $type_objet, '$info_sql', ".($p->etoile ? _q($p->etoile) : "''").", $_params)"; |
|
| 63 | 63 | $p->code = champ_sql($info, $p, $code); |
| 64 | 64 | $p->interdire_scripts = true; |
| 65 | 65 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite |
| 24 | 24 | define('_separateur_urls_page', ''); |
| 25 | 25 | # on peut indiquer '' si on a installe le .htaccess |
| 26 | -define('_debut_urls_page', get_spip_script('./') . '?'); |
|
| 26 | +define('_debut_urls_page', get_spip_script('./').'?'); |
|
| 27 | 27 | ####### |
| 28 | 28 | |
| 29 | 29 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | - . $id . \_terminaison_urls_page; |
|
| 49 | + $url = \_debut_urls_page.$objet.\_separateur_urls_page |
|
| 50 | + . $id.\_terminaison_urls_page; |
|
| 51 | 51 | |
| 52 | 52 | if ($args) { |
| 53 | 53 | $args = strpos($url, '?') ? "&$args" : "?$args"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 56 | + return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : ''); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
| 40 | 40 | if (!autoriser('ecrire')) { |
| 41 | 41 | $retour = |
| 42 | - '<ul class="deroulant__sous-menu" data-profondeur="1">' . |
|
| 43 | - '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' . |
|
| 44 | - '<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' . |
|
| 45 | - '<span class="libelle">' . _T('public:lien_connecter') . '</span>' . |
|
| 46 | - '</a>' . |
|
| 47 | - '</li>' . |
|
| 42 | + '<ul class="deroulant__sous-menu" data-profondeur="1">'. |
|
| 43 | + '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'. |
|
| 44 | + '<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'. |
|
| 45 | + '<span class="libelle">'._T('public:lien_connecter').'</span>'. |
|
| 46 | + '</a>'. |
|
| 47 | + '</li>'. |
|
| 48 | 48 | '</ul>'; |
| 49 | 49 | include_spip('inc/actions'); |
| 50 | 50 | ajax_retour($retour); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ($date = intval(_request('date'))) { |
| 55 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT'); |
|
| 55 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date).' GMT'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $r = gen_liste_rubriques(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/') |
| 63 | 63 | ) { |
| 64 | 64 | include_spip('inc/headers'); |
| 65 | - header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 65 | + header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 66 | 66 | http_response_code(304); |
| 67 | 67 | exit; |
| 68 | 68 | } else { |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | **/ |
| 86 | 86 | function menu_rubriques($complet = true) { |
| 87 | 87 | $ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">' |
| 88 | - . '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">' |
|
| 89 | - . '<span class="libelle">' . _T('info_tout_site') . '</span>' |
|
| 88 | + . '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">' |
|
| 89 | + . '<span class="libelle">'._T('info_tout_site').'</span>' |
|
| 90 | 90 | . '</a>' |
| 91 | 91 | . '</li>'; |
| 92 | 92 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | static $zmax = 6; |
| 146 | 146 | $profondeur_next = $profondeur + 1; |
| 147 | 147 | |
| 148 | - $nav = '<a class="deroulant__lien" href="' . generer_objet_url($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">" |
|
| 149 | - . '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>' |
|
| 148 | + $nav = '<a class="deroulant__lien" href="'.generer_objet_url($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">" |
|
| 149 | + . '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>' |
|
| 150 | 150 | . "</a>\n"; |
| 151 | 151 | |
| 152 | 152 | // Limiter volontairement le nombre de sous-menus |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ) { |
| 204 | 204 | $r = nettoyer_url_page($url, $contexte); |
| 205 | 205 | if ($r) { |
| 206 | - [$contexte, $type, , , $suite] = $r; |
|
| 206 | + [$contexte, $type,,, $suite] = $r; |
|
| 207 | 207 | $_id = id_table_objet($type); |
| 208 | 208 | $id_objet = $contexte[$_id]; |
| 209 | 209 | $url_propre = generer_objet_url($id_objet, $type); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function nettoyer_url_page($url, $contexte = []) { |
| 276 | 276 | $url_objets = urls_liste_objets(); |
| 277 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 277 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 280 | 280 | |
| 281 | 281 | if ( |
| 282 | 282 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | $id = intval($id); |
| 315 | 315 | if (!isset($furls[$objet])) { |
| 316 | 316 | if ( |
| 317 | - function_exists($f = 'generer_' . $objet . '_url_ecrire') |
|
| 317 | + function_exists($f = 'generer_'.$objet.'_url_ecrire') |
|
| 318 | 318 | // ou definie par un plugin |
| 319 | 319 | or $f = charger_fonction($f, 'urls', true) |
| 320 | 320 | // deprecated |
| 321 | - or function_exists($f = 'generer_url_ecrire_' . $objet) or $f = charger_fonction($f, 'urls', true) |
|
| 321 | + or function_exists($f = 'generer_url_ecrire_'.$objet) or $f = charger_fonction($f, 'urls', true) |
|
| 322 | 322 | ) { |
| 323 | 323 | $furls[$objet] = $f; |
| 324 | 324 | } else { |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | if ($public or $connect) { |
| 337 | 337 | return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect); |
| 338 | 338 | } |
| 339 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 339 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 340 | 340 | if (!function_exists('objet_info')) { |
| 341 | 341 | include_spip('inc/filtres'); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 344 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | asort($liste_plugins); |
| 65 | 65 | $exposed = urldecode(_request('plugin') ?? ''); |
| 66 | 66 | |
| 67 | - $block_par_lettre = false;//count($liste_plugins)>10; |
|
| 67 | + $block_par_lettre = false; //count($liste_plugins)>10; |
|
| 68 | 68 | $fast_liste_plugins_actifs = []; |
| 69 | 69 | $fast_liste_plugins_checked = []; |
| 70 | 70 | if (is_array($liste_plugins_actifs)) { |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | $actif = isset($fast_liste_plugins_actifs[$plug]); |
| 90 | 90 | $checked = isset($fast_liste_plugins_checked[$plug]); |
| 91 | 91 | $block_actif = $block_actif | $actif; |
| 92 | - $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins . $plug or $exposed == substr( |
|
| 92 | + $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins.$plug or $exposed == substr( |
|
| 93 | 93 | $dir_plugins, |
| 94 | 94 | strlen(_DIR_RACINE) |
| 95 | - ) . $plug)); |
|
| 96 | - $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins) . "\n"; |
|
| 95 | + ).$plug)); |
|
| 96 | + $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins)."\n"; |
|
| 97 | 97 | } |
| 98 | 98 | $res .= $block_par_lettre ? affiche_block_initiale($initiale, $block, $block_actif) : $block; |
| 99 | 99 | $class = basename($dir_plugins); |