@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $apl_constant = '_Z_AJAX_PARALLEL_LOAD'; |
| 53 | 53 | $page = _SPIP_PAGE; |
| 54 | 54 | $echafauder = charger_fonction('echafauder', 'public', true); |
| 55 | - define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist' . (defined('_DIR_PLUGIN_DIST') ? '|\b' . rtrim( |
|
| 55 | + define('_ZCORE_EXCLURE_PATH', '\bprive|\bsquelettes-dist'.(defined('_DIR_PLUGIN_DIST') ? '|\b'.rtrim( |
|
| 56 | 56 | (string) _DIR_PLUGIN_DIST, |
| 57 | 57 | '/' |
| 58 | 58 | ) : '')); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | && in_array($dir, $z_blocs) // verifier deja qu'on est dans un bloc Z |
| 77 | 77 | && defined($apl_constant) |
| 78 | 78 | && in_array($dir, explode(',', (string) constant($apl_constant))) // et dans un demande en APL |
| 79 | - && ($pipe = z_trouver_bloc($prefix_path . $prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 79 | + && ($pipe = z_trouver_bloc($prefix_path.$prepend, $dir, 'z_apl', $ext)) // et qui contient le squelette APL |
|
| 80 | 80 | ) { |
| 81 | 81 | $flux['data'] = $pipe; |
| 82 | 82 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $echafauder = ''; |
| 90 | 90 | } |
| 91 | 91 | if ($prepend) { |
| 92 | - $squelette = substr((string) find_in_path($prefix_path . $prepend . "$fond.$ext"), 0, -strlen(".$ext")); |
|
| 92 | + $squelette = substr((string) find_in_path($prefix_path.$prepend."$fond.$ext"), 0, -strlen(".$ext")); |
|
| 93 | 93 | if ($squelette) { |
| 94 | 94 | $flux['data'] = $squelette; |
| 95 | 95 | } |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | // se brancher sur contenu/xx si il existe |
| 110 | 110 | // ou si c'est un objet spip, associe a une table, utiliser le fond homonyme |
| 111 | 111 | if (!isset($disponible[$fond])) { |
| 112 | - $disponible[$fond] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 112 | + $disponible[$fond] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $fond, $ext, $echafauder); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if ($disponible[$fond]) { |
| 116 | - $flux['data'] = substr((string) find_in_path($prefix_path . "page.$ext"), 0, -strlen(".$ext")); |
|
| 116 | + $flux['data'] = substr((string) find_in_path($prefix_path."page.$ext"), 0, -strlen(".$ext")); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $type = $flux['args']['contexte'][$page]; |
| 127 | 127 | } |
| 128 | 128 | if (!isset($disponible[$type])) { |
| 129 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 129 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 130 | 130 | } |
| 131 | 131 | if (is_string($disponible[$type])) { |
| 132 | 132 | $flux['data'] = $disponible[$type]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $flux['data'] = $echafauder($type, $is[0], $is[1], $is[2], $ext); |
| 142 | 142 | } else { |
| 143 | 143 | $flux['data'] = ($disponible['404'] = z_contenu_disponible( |
| 144 | - $prefix_path . $prepend, |
|
| 144 | + $prefix_path.$prepend, |
|
| 145 | 145 | $z_contenu, |
| 146 | 146 | '404', |
| 147 | 147 | $ext, |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | $type = $flux['args']['contexte'][$page]; |
| 166 | 166 | } |
| 167 | 167 | if ($type !== 'page' && !isset($disponible[$type])) { |
| 168 | - $disponible[$type] = z_contenu_disponible($prefix_path . $prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 168 | + $disponible[$type] = z_contenu_disponible($prefix_path.$prepend, $z_contenu, $type, $ext, $echafauder); |
|
| 169 | 169 | } |
| 170 | 170 | if ($type == 'page' || $disponible[$type]) { |
| 171 | - $flux['data'] = z_trouver_bloc($prefix_path . $prepend, $dir, 'dist', $ext); |
|
| 171 | + $flux['data'] = z_trouver_bloc($prefix_path.$prepend, $dir, 'dist', $ext); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | if ( |
| 184 | 184 | isset($flux['args']['contexte']['type-page']) |
| 185 | 185 | && ( |
| 186 | - isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page'] . '-' . $flux['args']['contexte']['composition']) . ".$ext") |
|
| 187 | - || file_exists(($f = $squelette . '-' . $flux['args']['contexte']['type-page']) . ".$ext") |
|
| 186 | + isset($flux['args']['contexte']['composition']) && file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page'].'-'.$flux['args']['contexte']['composition']).".$ext") |
|
| 187 | + || file_exists(($f = $squelette.'-'.$flux['args']['contexte']['type-page']).".$ext") |
|
| 188 | 188 | ) |
| 189 | 189 | ) { |
| 190 | 190 | $flux['data'] = $f; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } elseif ( |
| 193 | 193 | $fond == 'structure' |
| 194 | 194 | && z_sanitize_var_zajax() |
| 195 | - && ($f = find_in_path($prefix_path . $prepend . 'ajax' . ".$ext")) |
|
| 195 | + && ($f = find_in_path($prefix_path.$prepend.'ajax'.".$ext")) |
|
| 196 | 196 | ) { |
| 197 | 197 | $flux['data'] = substr((string) $f, 0, -strlen(".$ext")); |
| 198 | 198 | } // chercher le fond correspondant a la composition |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | && ($dir = explode('/', $dir)) |
| 204 | 204 | && ($dir = reset($dir)) |
| 205 | 205 | && in_array($dir, $z_blocs) |
| 206 | - && ($f = find_in_path($prefix_path . $prepend . $fond . '-' . $flux['args']['contexte']['composition'] . ".$ext")) |
|
| 206 | + && ($f = find_in_path($prefix_path.$prepend.$fond.'-'.$flux['args']['contexte']['composition'].".$ext")) |
|
| 207 | 207 | ) { |
| 208 | 208 | $flux['data'] = substr((string) $f, 0, -strlen(".$ext")); |
| 209 | 209 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * `true` si on peut l'utiliser, `false` sinon. |
| 264 | 264 | **/ |
| 265 | 265 | function z_fond_valide($squelette) { |
| 266 | - return !_ZCORE_EXCLURE_PATH || !preg_match(',(' . _ZCORE_EXCLURE_PATH . ')/,', $squelette); |
|
| 266 | + return !_ZCORE_EXCLURE_PATH || !preg_match(',('._ZCORE_EXCLURE_PATH.')/,', $squelette); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
@@ -378,23 +378,23 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | $dir = z_blocs(test_espace_prive()); |
| 380 | 380 | $dir = reset($dir); |
| 381 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/" . $fond . ',objet=' . $type . ',id_objet=#' . strtoupper((string) $primary) . ',env}>'; |
|
| 381 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/".$fond.',objet='.$type.',id_objet=#'.strtoupper((string) $primary).',env}>'; |
|
| 382 | 382 | } // page objets |
| 383 | 383 | elseif (($type = $desc_exec) && !str_contains($type, '/')) { |
| 384 | 384 | $dir = z_blocs(test_espace_prive()); |
| 385 | 385 | $dir = reset($dir); |
| 386 | - $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=" . $type . ',env} />'; |
|
| 386 | + $scaffold = "<INCLURE{fond=prive/echafaudage/$dir/objets,objet=".$type.',env} />'; |
|
| 387 | 387 | } |
| 388 | 388 | // morceau d'objet : on fournit le fond de sibstitution dans $desc_exec |
| 389 | 389 | // et objet et tire de $table |
| 390 | 390 | elseif ($fond = $desc_exec) { |
| 391 | 391 | $dir = md5(dirname($fond)); |
| 392 | - $scaffold = "<INCLURE{fond=$fond,objet=" . objet_type($table) . ',env} />'; |
|
| 392 | + $scaffold = "<INCLURE{fond=$fond,objet=".objet_type($table).',env} />'; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | $base_dir = sous_repertoire(_DIR_CACHE, 'scaffold', false); |
| 396 | 396 | $base_dir = sous_repertoire($base_dir, $dir, false); |
| 397 | - $f = $base_dir . "$exec"; |
|
| 397 | + $f = $base_dir."$exec"; |
|
| 398 | 398 | ecrire_fichier("$f.$ext", $scaffold); |
| 399 | 399 | |
| 400 | 400 | return $f; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * texte |
| 41 | 41 | */ |
| 42 | 42 | function sandbox_composer_texte($texte, &$p) { |
| 43 | - return "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], $texte) . "'"; |
|
| 43 | + return "'".str_replace(['\\', "'"], ['\\\\', "\\'"], $texte)."'"; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $min_f = $refl->getNumberOfRequiredParameters(); |
| 79 | 79 | if (($nb_args_f < $min_f)) { |
| 80 | 80 | $msg_args = ['filtre' => texte_script($fonc), 'nb' => $min_f - $nb_args_f]; |
| 81 | - erreur_squelette([ 'zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 81 | + erreur_squelette(['zbug_erreur_filtre_nbarg_min', $msg_args], $p); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | // le filtre n'existe pas, |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function sandbox_filtrer_squelette($skel, $corps, $filtres) { |
| 161 | 161 | $series_filtres = func_get_args(); |
| 162 | - array_shift($series_filtres);// skel |
|
| 163 | - array_shift($series_filtres);// corps |
|
| 162 | + array_shift($series_filtres); // skel |
|
| 163 | + array_shift($series_filtres); // corps |
|
| 164 | 164 | |
| 165 | 165 | // proteger les <INCLUDE> et tous les morceaux de php licites |
| 166 | 166 | if ($skel['process_ins'] == 'php') { |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | if (is_array($r)) { |
| 209 | 209 | $dst[] = $r[0]; |
| 210 | 210 | |
| 211 | - return $src[] = '___' . md5((string) $r[0]) . '___'; |
|
| 211 | + return $src[] = '___'.md5((string) $r[0]).'___'; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // si on recoit pas un tableau, on renvoit les couples de substitution |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | function chrono_requete($temps) { |
| 109 | 109 | $total = 0; |
| 110 | - $hors = '<i>' . _T('zbug_hors_compilation') . '</i>'; |
|
| 110 | + $hors = '<i>'._T('zbug_hors_compilation').'</i>'; |
|
| 111 | 111 | $t = $q = $n = $d = []; |
| 112 | 112 | // Totaliser les temps et completer le Explain |
| 113 | 113 | foreach ($temps as $key => $v) { |
| 114 | 114 | [$dt, $nb, $boucle, $query, $explain, $res, $contexte] = $v; |
| 115 | 115 | if (is_array($contexte)) { |
| 116 | - $k = ($contexte[0] . " $boucle"); |
|
| 116 | + $k = ($contexte[0]." $boucle"); |
|
| 117 | 117 | include_spip('public/compiler'); |
| 118 | 118 | $env = reconstruire_contexte_compil($contexte); |
| 119 | 119 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // Fabriquer les liens de navigations dans le tableau des temps |
| 159 | 159 | foreach ($temps as $k => $v) { |
| 160 | 160 | $titre = strip_tags((string) $v[2]); |
| 161 | - $href = quote_amp($GLOBALS['REQUEST_URI']) . "#req$i"; |
|
| 161 | + $href = quote_amp($GLOBALS['REQUEST_URI'])."#req$i"; |
|
| 162 | 162 | $href = str_replace("\\'", ''', $href); |
| 163 | 163 | |
| 164 | 164 | if (!isset($t[$v[2]])) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | unset($d['']); |
| 180 | 180 | // Fabriquer le tableau des liens de navigation dans le grand tableau |
| 181 | 181 | foreach ($d as $k => $v) { |
| 182 | - $d[$k] = $n[$k] . "</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 182 | + $d[$k] = $n[$k]."</td><td>$k</td><td class='time'>$v</td><td class='liste-reqs'>" |
|
| 183 | 183 | . implode('', $t[$k]); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | . implode("</td></tr>\n<tr><td>", $d) |
| 190 | 190 | . "</td></tr>\n" |
| 191 | 191 | . (# _request('var_mode_objet') ? '' : |
| 192 | - ('<tr><td>' . (is_countable($temps) ? count($temps) : 0) . '</td><td>' . _T('info_total') . '</td><td class="time">' . $total . '</td><td></td></tr>')) |
|
| 192 | + ('<tr><td>'.(is_countable($temps) ? count($temps) : 0).'</td><td>'._T('info_total').'</td><td class="time">'.$total.'</td><td></td></tr>')) |
|
| 193 | 193 | ]; |
| 194 | 194 | |
| 195 | 195 | return [$temps, $navigation]; |
@@ -55,19 +55,19 @@ discard block |
||
| 55 | 55 | * Nom d'une balise #TOTO |
| 56 | 56 | * |
| 57 | 57 | * Écriture alambiquée pour rester compatible avec les hexadecimaux des vieux squelettes */ |
| 58 | -define('NOM_DE_CHAMP', '#((' . NOM_DE_BOUCLE . "):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 58 | +define('NOM_DE_CHAMP', '#(('.NOM_DE_BOUCLE."):)?(([A-F]*[G-Z_][A-Z_0-9]*)|[A-Z_]+)\b(\*{0,2})"); |
|
| 59 | 59 | /** Balise complète [...(#TOTO) ... ] */ |
| 60 | -define('CHAMP_ETENDU', '/\[([^]\[]*)\(' . NOM_DE_CHAMP . '([^[)]*\)[^]\[]*)\]/S'); |
|
| 60 | +define('CHAMP_ETENDU', '/\[([^]\[]*)\('.NOM_DE_CHAMP.'([^[)]*\)[^]\[]*)\]/S'); |
|
| 61 | 61 | |
| 62 | 62 | define('BALISE_INCLURE', '/<INCLU[DR]E[[:space:]]*(\(([^)]*)\))?/S'); |
| 63 | 63 | define('BALISE_POLYGLOTTE', ',<multi>(.*)</multi>,Uims'); |
| 64 | 64 | define('BALISE_IDIOMES', ',<:(([a-z0-9_]+):)?([a-z0-9_]*)({([^\|=>]*=[^\|>]*)})?((\|[^>]*)?:/?>),iS'); |
| 65 | -define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*((' . NOM_DE_CHAMP . '[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 65 | +define('BALISE_IDIOMES_ARGS', '@^\s*([^= ]*)\s*=\s*(('.NOM_DE_CHAMP.'[{][^}]*})?[^,]*)\s*,?\s*@s'); |
|
| 66 | 66 | |
| 67 | 67 | /** Champ sql dans parenthèse ex: (id_article) */ |
| 68 | 68 | define('SQL_ARGS', '(\([^)]*\))'); |
| 69 | 69 | /** Fonction SQL sur un champ ex: SUM(visites) */ |
| 70 | -define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)' . SQL_ARGS . '?`?'); |
|
| 70 | +define('CHAMP_SQL_PLUS_FONC', '`?([A-Z_\/][A-Z_\/0-9.]*)'.SQL_ARGS.'?`?'); |
|
| 71 | 71 | |
| 72 | 72 | function phraser_inclure($texte, $ligne, $result) { |
| 73 | 73 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @return array |
| 223 | 223 | **/ |
| 224 | 224 | function phraser_champs($texte, $ligne, $result) { |
| 225 | - while (preg_match('/' . NOM_DE_CHAMP . '/S', $texte, $match)) { |
|
| 225 | + while (preg_match('/'.NOM_DE_CHAMP.'/S', $texte, $match)) { |
|
| 226 | 226 | $p = strpos($texte, (string) $match[0]); |
| 227 | 227 | // texte après la balise |
| 228 | 228 | $suite = substr($texte, $p + strlen($match[0])); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $collecte[] = $champ; |
| 370 | 370 | $args = ltrim($regs[count($regs) - 1]); |
| 371 | 371 | } else { |
| 372 | - if (!preg_match('/' . NOM_DE_CHAMP . '([{|])/', $arg, $r)) { |
|
| 372 | + if (!preg_match('/'.NOM_DE_CHAMP.'([{|])/', $arg, $r)) { |
|
| 373 | 373 | // 0 est un aveu d'impuissance. A completer |
| 374 | 374 | $arg = phraser_champs_exterieurs($arg, 0, $sep, $result); |
| 375 | 375 | |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) { |
| 454 | 454 | $res = []; |
| 455 | 455 | while (($p = strpos((string) $texte, (string) "%$sep")) !== false) { |
| 456 | - if (!preg_match(',^%' . preg_quote((string) $sep, ',') . '([0-9]+)@,', substr((string) $texte, $p), $m)) { |
|
| 456 | + if (!preg_match(',^%'.preg_quote((string) $sep, ',').'([0-9]+)@,', substr((string) $texte, $p), $m)) { |
|
| 457 | 457 | break; |
| 458 | 458 | } |
| 459 | 459 | $debut = substr((string) $texte, 0, $p); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | $pos_apres = 0; |
| 494 | 494 | $result = phraser_args($match[7], ')', $sep, $result, $champ, $pos_apres); |
| 495 | 495 | phraser_vieux($champ); |
| 496 | - $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 496 | + $champ->avant = phraser_champs_exterieurs($match[1], $n, $sep, $result); |
|
| 497 | 497 | $debut = substr($match[7], $pos_apres + 1); |
| 498 | 498 | if (!empty($debut)) { |
| 499 | 499 | $n += substr_count(substr((string) $texte, 0, strpos((string) $texte, $debut)), "\n"); |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | // une maniere tres sale de supprimer les "' autour de {critere "xxx","yyy"} |
| 624 | 624 | if (preg_match(',^(["\'])(.*)\1$,', $m[4])) { |
| 625 | 625 | $c = null; |
| 626 | - eval('$c = ' . $m[4] . ';'); |
|
| 626 | + eval('$c = '.$m[4].';'); |
|
| 627 | 627 | if (isset($c)) { |
| 628 | 628 | $m[4] = $c; |
| 629 | 629 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | if (preg_match(',^ *([0-9-]+) *(/) *(.+) *$,', (string) $param, $m)) { |
| 704 | 704 | $crit = phraser_critere_infixe($m[1], $m[3], $v, '/', '', ''); |
| 705 | 705 | } elseif ( |
| 706 | - preg_match(',^([!]?)(' . CHAMP_SQL_PLUS_FONC . |
|
| 706 | + preg_match(',^([!]?)('.CHAMP_SQL_PLUS_FONC. |
|
| 707 | 707 | ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', (string) $param, $m) |
| 708 | 708 | ) { |
| 709 | 709 | $a2 = trim($m[8]); |
@@ -720,8 +720,8 @@ discard block |
||
| 720 | 720 | ); |
| 721 | 721 | $crit->exclus = $m[1]; |
| 722 | 722 | } elseif ( |
| 723 | - preg_match('/^([!]?)\s*(' . |
|
| 724 | - CHAMP_SQL_PLUS_FONC . |
|
| 723 | + preg_match('/^([!]?)\s*('. |
|
| 724 | + CHAMP_SQL_PLUS_FONC. |
|
| 725 | 725 | ')\s*(\??)(.*)$/is', (string) $param, $m) |
| 726 | 726 | ) { |
| 727 | 727 | // contient aussi les comparaisons implicites ! |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | // trouver sa position de depart reelle : au <Bxx> ou au <BBxx> |
| 869 | - $precond_boucle = BALISE_PRECOND_BOUCLE . $id_boucle . '>'; |
|
| 869 | + $precond_boucle = BALISE_PRECOND_BOUCLE.$id_boucle.'>'; |
|
| 870 | 870 | $pos_precond = strpos((string) $texte, $precond_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 871 | 871 | if ( |
| 872 | 872 | $pos_precond !== false |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | $boucle['pos_precond_inside'] = $pos_precond + strlen($precond_boucle); |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | - $preaff_boucle = BALISE_PREAFF_BOUCLE . $id_boucle . '>'; |
|
| 880 | + $preaff_boucle = BALISE_PREAFF_BOUCLE.$id_boucle.'>'; |
|
| 881 | 881 | $pos_preaff = strpos((string) $texte, $preaff_boucle, $id_boucle ? $pos_debut_texte : $pos_derniere_boucle_anonyme); |
| 882 | 882 | if ( |
| 883 | 883 | $pos_preaff !== false |
@@ -925,13 +925,13 @@ discard block |
||
| 925 | 925 | $pos_anonyme_next = null; |
| 926 | 926 | // si c'est une boucle anonyme, chercher la position de la prochaine boucle anonyme |
| 927 | 927 | if (!strlen((string) $id_boucle)) { |
| 928 | - $pos_anonyme_next = strpos((string) $texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 928 | + $pos_anonyme_next = strpos((string) $texte, BALISE_BOUCLE.'(', $pos_courante); |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | // |
| 932 | 932 | // 1. Recuperer la partie conditionnelle apres |
| 933 | 933 | // |
| 934 | - $apres_boucle = BALISE_POSTCOND_BOUCLE . $id_boucle . '>'; |
|
| 934 | + $apres_boucle = BALISE_POSTCOND_BOUCLE.$id_boucle.'>'; |
|
| 935 | 935 | $pos_apres = strpos((string) $texte, $apres_boucle, $pos_courante); |
| 936 | 936 | if ( |
| 937 | 937 | $pos_apres !== false |
@@ -940,13 +940,13 @@ discard block |
||
| 940 | 940 | $boucle['pos_postcond'] = $pos_apres; |
| 941 | 941 | $pos_apres += strlen($apres_boucle); |
| 942 | 942 | $boucle['pos_postcond_inside'] = $pos_apres; |
| 943 | - $pos_courante = $pos_apres ; |
|
| 943 | + $pos_courante = $pos_apres; |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | // |
| 947 | 947 | // 2. Récuperer la partie alternative apres |
| 948 | 948 | // |
| 949 | - $altern_boucle = BALISE_ALT_BOUCLE . $id_boucle . '>'; |
|
| 949 | + $altern_boucle = BALISE_ALT_BOUCLE.$id_boucle.'>'; |
|
| 950 | 950 | $pos_altern = strpos((string) $texte, $altern_boucle, $pos_courante); |
| 951 | 951 | if ( |
| 952 | 952 | $pos_altern !== false |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | // |
| 962 | 962 | // 3. Recuperer la partie footer non alternative |
| 963 | 963 | // |
| 964 | - $postaff_boucle = BALISE_POSTAFF_BOUCLE . $id_boucle . '>'; |
|
| 964 | + $postaff_boucle = BALISE_POSTAFF_BOUCLE.$id_boucle.'>'; |
|
| 965 | 965 | $pos_postaff = strpos((string) $texte, $postaff_boucle, $pos_courante); |
| 966 | 966 | if ( |
| 967 | 967 | $pos_postaff !== false |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | $boucle['pos_postaff'] = $pos_postaff; |
| 971 | 971 | $pos_postaff += strlen($postaff_boucle); |
| 972 | 972 | $boucle['pos_postaff_inside'] = $pos_postaff; |
| 973 | - $pos_courante = $pos_postaff ; |
|
| 973 | + $pos_courante = $pos_postaff; |
|
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | return $boucle; |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | * @return string |
| 1011 | 1011 | */ |
| 1012 | 1012 | function public_generer_boucle_placeholder($id_boucle, &$boucle, $boucle_placeholder, $nb_lignes) { |
| 1013 | - $placeholder = "[(#{$boucle_placeholder}{" . $id_boucle . '})' . str_pad('', $nb_lignes, "\n") . ']'; |
|
| 1013 | + $placeholder = "[(#{$boucle_placeholder}{".$id_boucle.'})'.str_pad('', $nb_lignes, "\n").']'; |
|
| 1014 | 1014 | //memoriser la boucle a reinjecter |
| 1015 | 1015 | $id_boucle = "$id_boucle"; |
| 1016 | 1016 | phraser_boucle_placeholder($id_boucle, $boucle_placeholder, $boucle); |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | // definir un placholder pour les boucles dont on est sur d'avoir aucune occurence dans le squelette |
| 1024 | 1024 | if (is_null($boucle_placeholder)) { |
| 1025 | 1025 | do { |
| 1026 | - $boucle_placeholder = 'BOUCLE_PLACEHOLDER_' . strtoupper(md5(uniqid())); |
|
| 1026 | + $boucle_placeholder = 'BOUCLE_PLACEHOLDER_'.strtoupper(md5(uniqid())); |
|
| 1027 | 1027 | } while (str_contains((string) $texte, $boucle_placeholder)); |
| 1028 | 1028 | } |
| 1029 | 1029 | |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | |
| 1044 | 1044 | // boucle anonyme ? |
| 1045 | 1045 | if (!strlen((string) $id_boucle)) { |
| 1046 | - $id_boucle = '_anon_L' . $ligne_milieu . '_' . substr(md5('anonyme:' . $id_parent . ':' . json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1046 | + $id_boucle = '_anon_L'.$ligne_milieu.'_'.substr(md5('anonyme:'.$id_parent.':'.json_encode($boucle, JSON_THROW_ON_ERROR)), 0, 8); |
|
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | $pos_debut_boucle = $pos_courante; |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | |
| 1057 | 1057 | $pos_avant = $boucle['pos_precond_inside']; |
| 1058 | 1058 | $result->avant = substr((string) $texte, $pos_avant, $pos_courante - $pos_avant); |
| 1059 | - $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1059 | + $ligne_avant = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_avant); |
|
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | // Regarder si on a une partie inconditionnelle avant <BB_xxx> |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | |
| 1066 | 1066 | $pos_preaff = $boucle['pos_preaff_inside']; |
| 1067 | 1067 | $result->preaff = substr((string) $texte, $pos_preaff, $end_preaff - $pos_preaff); |
| 1068 | - $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1068 | + $ligne_preaff = $ligne_debut_texte + public_compte_ligne($texte, $pos_debut_texte, $pos_preaff); |
|
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | $result->id_boucle = $id_boucle; |
@@ -1122,7 +1122,7 @@ discard block |
||
| 1122 | 1122 | } else { |
| 1123 | 1123 | $pos_milieu += 1; |
| 1124 | 1124 | |
| 1125 | - $fin_boucle = BALISE_FIN_BOUCLE . $id_boucle_search . '>'; |
|
| 1125 | + $fin_boucle = BALISE_FIN_BOUCLE.$id_boucle_search.'>'; |
|
| 1126 | 1126 | $pos_fin = strpos((string) $texte, $fin_boucle, $pos_milieu); |
| 1127 | 1127 | if ($pos_fin === false) { |
| 1128 | 1128 | $err_b = [ |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | else { |
| 1136 | 1136 | // verifier une eventuelle imbrication d'une boucle homonyme |
| 1137 | 1137 | // (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur) |
| 1138 | - $search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '('; |
|
| 1138 | + $search_debut_boucle = BALISE_BOUCLE.$id_boucle_search.'('; |
|
| 1139 | 1139 | $search_from = $pos_milieu; |
| 1140 | 1140 | $nb_open = 1; |
| 1141 | 1141 | $nb_close = 1; |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | if ($boucle['pos_postcond']) { |
| 1176 | 1176 | $result->apres = substr((string) $texte, $pos_courante, $boucle['pos_postcond'] - $pos_courante); |
| 1177 | 1177 | $ligne_suite += public_compte_ligne($texte, $pos_courante, $boucle['pos_postcond_inside']); |
| 1178 | - $pos_courante = $boucle['pos_postcond_inside'] ; |
|
| 1178 | + $pos_courante = $boucle['pos_postcond_inside']; |
|
| 1179 | 1179 | } |
| 1180 | 1180 | |
| 1181 | 1181 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $boucle = &$boucles[$idb]; |
| 51 | 51 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 52 | 52 | |
| 53 | - $c = ["'='", "'$boucle->id_table." . "$id_parent'", 0]; |
|
| 53 | + $c = ["'='", "'$boucle->id_table."."$id_parent'", 0]; |
|
| 54 | 54 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | $id = $boucle->primary; |
| 74 | 74 | |
| 75 | 75 | if ($not || !$id) { |
| 76 | - return ['zbug_critere_inconnu', ['critere' => $not . $crit->op]]; |
|
| 76 | + return ['zbug_critere_inconnu', ['critere' => $not.$crit->op]]; |
|
| 77 | 77 | } |
| 78 | 78 | $arg = kwote(calculer_argument_precedent($idb, $id, $boucles)); |
| 79 | - $boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg]; |
|
| 79 | + $boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg]; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | $not = ($crit->not ? '' : 'NOT'); |
| 108 | 108 | |
| 109 | 109 | // le doublon s'applique sur un type de boucle (article) |
| 110 | - $nom = "'" . $boucle->type_requete . "'"; |
|
| 110 | + $nom = "'".$boucle->type_requete."'"; |
|
| 111 | 111 | |
| 112 | 112 | // compléter le nom avec un nom précisé {doublons nom} |
| 113 | 113 | // on obtient $nom = "'article' . 'nom'" |
| 114 | 114 | if (isset($crit->param[0])) { |
| 115 | - $nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 115 | + $nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP) |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | // $doublons et son index, ici $nom |
| 125 | 125 | |
| 126 | 126 | // debut du code "sql_in('articles.id_article', " |
| 127 | - $debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', "; |
|
| 127 | + $debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', "; |
|
| 128 | 128 | // lecture des données du doublon "$doublons[$doublon_index[] = " |
| 129 | 129 | // Attention : boucle->doublons désigne une variable qu'on affecte |
| 130 | - $debut_doub = '$doublons[' . ($not ? $boucle->doublons . '[]= ' : ('')); |
|
| 130 | + $debut_doub = '$doublons['.($not ? $boucle->doublons.'[]= ' : ('')); |
|
| 131 | 131 | |
| 132 | 132 | // le debut complet du code des doublons |
| 133 | - $debut_doub = $debut_in . $debut_doub; |
|
| 133 | + $debut_doub = $debut_in.$debut_doub; |
|
| 134 | 134 | |
| 135 | 135 | // nom du doublon "('article' . 'nom')]" |
| 136 | 136 | $fin_doub = "($nom)]"; |
@@ -140,22 +140,22 @@ discard block |
||
| 140 | 140 | foreach ($boucle->where as $k => $w) { |
| 141 | 141 | if (str_starts_with((string) $w[0], $debut_doub)) { |
| 142 | 142 | // fusionner le sql_in (du where) |
| 143 | - $boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr((string) $w[0], strlen($debut_in)); |
|
| 143 | + $boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr((string) $w[0], strlen($debut_in)); |
|
| 144 | 144 | // fusionner l'initialisation (du hash) pour faire plus joli |
| 145 | 145 | $x = strpos((string) $boucle->hash, $init_comment); |
| 146 | 146 | $len = strlen($init_comment); |
| 147 | 147 | $boucle->hash = |
| 148 | - substr((string) $boucle->hash, 0, $x + $len) . $init_code . substr((string) $boucle->hash, $x + $len); |
|
| 148 | + substr((string) $boucle->hash, 0, $x + $len).$init_code.substr((string) $boucle->hash, $x + $len); |
|
| 149 | 149 | |
| 150 | 150 | return; |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante |
| 155 | - $boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"]; |
|
| 155 | + $boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"]; |
|
| 156 | 156 | |
| 157 | 157 | // déclarer le doublon s'il n'existe pas encore |
| 158 | - $boucle->hash .= $init_comment . $init_code; |
|
| 158 | + $boucle->hash .= $init_comment.$init_code; |
|
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | # la ligne suivante avait l'intention d'eviter une collecte deja faite |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $deux = $deux[0]->texte; |
| 218 | 218 | if ($deux) { |
| 219 | 219 | $boucles[$idb]->limit = |
| 220 | - 'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"'; |
|
| 220 | + 'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"'; |
|
| 221 | 221 | } else { |
| 222 | 222 | calculer_critere_DEFAUT_dist($idb, $boucles, $crit); |
| 223 | 223 | } |
@@ -280,26 +280,26 @@ discard block |
||
| 280 | 280 | $type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr((string) $type, 1)); |
|
| 283 | + $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr((string) $type, 1)); |
|
| 284 | 284 | $boucle->modificateur['debut_nom'] = $type; |
| 285 | 285 | $partie = |
| 286 | 286 | // tester si le numero de page demande est de la forme '@yyy' |
| 287 | - 'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n" |
|
| 287 | + 'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n" |
|
| 288 | 288 | . "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n" |
| 289 | - . "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n" |
|
| 290 | - . "\t\t" . '$iter->seek(0);' . "\n" |
|
| 289 | + . "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n" |
|
| 290 | + . "\t\t".'$iter->seek(0);'."\n" |
|
| 291 | 291 | . "\t}\n" |
| 292 | - . "\t" . '$debut_boucle = intval($debut_boucle)'; |
|
| 292 | + . "\t".'$debut_boucle = intval($debut_boucle)'; |
|
| 293 | 293 | |
| 294 | 294 | $boucle->hash .= ' |
| 295 | - $command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');'; |
|
| 295 | + $command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');'; |
|
| 296 | 296 | |
| 297 | 297 | $boucle->total_parties = $pas; |
| 298 | 298 | calculer_parties($boucles, $idb, $partie, 'p+'); |
| 299 | 299 | // ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id |
| 300 | 300 | // sauf si pas de primaire, ou si primaire composee |
| 301 | 301 | // dans ce cas, on ne sait pas gerer une pagination indirecte |
| 302 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 302 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 303 | 303 | if ( |
| 304 | 304 | $boucle->primary |
| 305 | 305 | && !preg_match('/[,\s]/', (string) $boucle->primary) |
@@ -346,24 +346,24 @@ discard block |
||
| 346 | 346 | $boucle->hash .= ' |
| 347 | 347 | // RECHERCHE' |
| 348 | 348 | . ($crit->cond ? ' |
| 349 | - if (!strlen(' . $quoi . ')){ |
|
| 349 | + if (!strlen(' . $quoi.')){ |
|
| 350 | 350 | list($rech_select, $rech_where) = array("0 as points",""); |
| 351 | - } else' : '') . ' |
|
| 351 | + } else' : '').' |
|
| 352 | 352 | { |
| 353 | 353 | $prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\'); |
| 354 | - list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '"); |
|
| 354 | + list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'"); |
|
| 355 | 355 | } |
| 356 | 356 | '; |
| 357 | 357 | |
| 358 | 358 | |
| 359 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 359 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 360 | 360 | if (!in_array($t, $boucles[$idb]->select)) { |
| 361 | 361 | $boucle->select[] = $t; |
| 362 | 362 | } # pour postgres, neuneu ici |
| 363 | 363 | // jointure uniquement sur le serveur principal |
| 364 | 364 | // (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal) |
| 365 | 365 | if (!$boucle->sql_serveur) { |
| 366 | - $boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"]; |
|
| 366 | + $boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"]; |
|
| 367 | 367 | $boucle->from['resultats'] = 'spip_resultats'; |
| 368 | 368 | } |
| 369 | 369 | $boucle->select[] = '$rech_select'; |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | $c = |
| 431 | 431 | [ |
| 432 | 432 | "'OR'", |
| 433 | - ["'='", "'$table." . "id_trad'", "'$table.$prim'"], |
|
| 433 | + ["'='", "'$table."."id_trad'", "'$table.$prim'"], |
|
| 434 | 434 | ["'='", "'$table.id_trad'", "'0'"] |
| 435 | 435 | ]; |
| 436 | 436 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
@@ -453,13 +453,13 @@ discard block |
||
| 453 | 453 | $boucle = &$boucles[$idb]; |
| 454 | 454 | $arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles)); |
| 455 | 455 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 456 | - $mparent = $boucle->id_table . '.' . $id_parent; |
|
| 456 | + $mparent = $boucle->id_table.'.'.$id_parent; |
|
| 457 | 457 | |
| 458 | 458 | if ($boucle->type_requete == 'rubriques' || isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) { |
| 459 | 459 | $boucle->where[] = ["'='", "'$mparent'", $arg]; |
| 460 | 460 | } // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist() |
| 461 | 461 | else { |
| 462 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]]; |
|
| 462 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]]; |
|
| 463 | 463 | } |
| 464 | 464 | } |
| 465 | 465 | |
@@ -512,16 +512,16 @@ discard block |
||
| 512 | 512 | if (count(trouver_champs_decomposes($champ, $desc)) > 1) { |
| 513 | 513 | $decompose = decompose_champ_id_objet($champ); |
| 514 | 514 | $champ = array_shift($decompose); |
| 515 | - $boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"']; |
|
| 515 | + $boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"']; |
|
| 516 | 516 | } |
| 517 | 517 | } else { |
| 518 | 518 | $cle = $boucle->id_table; |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - $c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)" |
|
| 522 | - . ($not ? ", 'NOT'" : '') . ')'; |
|
| 521 | + $c = "sql_in('$cle".".$champ', calcul_branche_in($arg)" |
|
| 522 | + . ($not ? ", 'NOT'" : '').')'; |
|
| 523 | 523 | $boucle->where[] = $crit->cond |
| 524 | - ? "($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')' |
|
| 524 | + ? "($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')' |
|
| 525 | 525 | : $c; |
| 526 | 526 | } |
| 527 | 527 | |
@@ -542,9 +542,9 @@ discard block |
||
| 542 | 542 | $not = ($crit->not ? 'NOT' : ''); |
| 543 | 543 | $serveur = $boucle->sql_serveur; |
| 544 | 544 | |
| 545 | - $c = "sql_in('" . |
|
| 546 | - $boucle->id_table . '.' . $boucle->primary |
|
| 547 | - . "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')"; |
|
| 545 | + $c = "sql_in('". |
|
| 546 | + $boucle->id_table.'.'.$boucle->primary |
|
| 547 | + . "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')"; |
|
| 548 | 548 | |
| 549 | 549 | $boucle->where[] = $c; |
| 550 | 550 | } |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | $t = table_objet_sql($r[1]); |
| 577 | 577 | $t = array_search($t, $boucles[$idb]->from); |
| 578 | 578 | if ($t) { |
| 579 | - $t .= '.' . $r[2]; |
|
| 579 | + $t .= '.'.$r[2]; |
|
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | } else { |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | $boucles[$idb]->select[] = $t; |
| 592 | 592 | } |
| 593 | 593 | } else { |
| 594 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 594 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 595 | 595 | } |
| 596 | 596 | } |
| 597 | 597 | |
@@ -661,25 +661,25 @@ discard block |
||
| 661 | 661 | (false !== $i = strpos((string) $boucle->order[$n - 1], 'ASC')) |
| 662 | 662 | || (false !== $i = strpos((string) $boucle->order[$n - 1], 'DESC')) |
| 663 | 663 | ) { |
| 664 | - $boucle->order[$n - 1] = substr_replace((string) $boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0); |
|
| 664 | + $boucle->order[$n - 1] = substr_replace((string) $boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0); |
|
| 665 | 665 | } else { |
| 666 | - $boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate']; |
|
| 666 | + $boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate']; |
|
| 667 | 667 | } |
| 668 | 668 | } |
| 669 | 669 | } else { |
| 670 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 670 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') { |
| 675 | 675 | $boucle = $boucles[$idb]; |
| 676 | - $alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')'; |
|
| 677 | - $var = '$champs_' . $idb; |
|
| 676 | + $alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')'; |
|
| 677 | + $var = '$champs_'.$idb; |
|
| 678 | 678 | $desc = (str_contains((string) $boucle->in, (string) "static $var =")); |
| 679 | 679 | if (!$desc) { |
| 680 | 680 | $desc = $boucle->show['field']; |
| 681 | 681 | $desc = implode(',', array_map('_q', array_keys($desc))); |
| 682 | - $boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');'; |
|
| 682 | + $boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');'; |
|
| 683 | 683 | } |
| 684 | 684 | if ($desc) { |
| 685 | 685 | $alt = "(in_array(\$x, $var) ? $alt :(\$x$suffix))"; |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | $sens = " . ' DESC'"; |
| 755 | 755 | } |
| 756 | 756 | if (isset($boucle->modificateur['collate'])) { |
| 757 | - $collecte = ' . ' . $boucle->modificateur['collate']; |
|
| 757 | + $collecte = ' . '.$boucle->modificateur['collate']; |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | // Pour chaque paramètre du critère |
@@ -776,14 +776,14 @@ discard block |
||
| 776 | 776 | if (preg_match(',^(\w+)[\s]+(.*)$,', (string) $par, $m)) { |
| 777 | 777 | $expression = trim($m[1]); |
| 778 | 778 | $champ = trim($m[2]); |
| 779 | - if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) { |
|
| 779 | + if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) { |
|
| 780 | 780 | $order = $f($idb, $boucles, $crit, $tri, $champ); |
| 781 | 781 | } else { |
| 782 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 782 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | // tris de la forme {par champ} ou {par FONCTION(champ)} |
| 786 | - } elseif ($boucle->type_requete == 'DATA' || preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', (string) $par, $match)) { |
|
| 786 | + } elseif ($boucle->type_requete == 'DATA' || preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', (string) $par, $match)) { |
|
| 787 | 787 | // {par FONCTION(champ)} |
| 788 | 788 | if (isset($match) && count($match) > 2) { |
| 789 | 789 | $par = substr($match[2], 1, -1); |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | if ($par == 'hasard') { |
| 794 | 794 | $order = calculer_critere_par_hasard($idb, $boucles, $crit); |
| 795 | 795 | } elseif ($par == 'date' && !empty($boucle->show['date'])) { |
| 796 | - $order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'"; |
|
| 796 | + $order = "'".$boucle->id_table.'.'.$boucle->show['date']."'"; |
|
| 797 | 797 | } else { |
| 798 | 798 | // cas général {par champ}, {par table.champ}, ... |
| 799 | 799 | $order = calculer_critere_par_champ($idb, $boucles, $crit, $par); |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | |
| 803 | 803 | // on ne sait pas traiter… |
| 804 | 804 | else { |
| 805 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 805 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // En cas d'erreur de squelette retournée par une fonction |
@@ -822,12 +822,12 @@ discard block |
||
| 822 | 822 | |
| 823 | 823 | if ($fct) { |
| 824 | 824 | $order = preg_match("/^\s*'(.*)'\s*$/", (string) $order, $r) |
| 825 | - ? "'$fct(" . $r[1] . ")'" |
|
| 825 | + ? "'$fct(".$r[1].")'" |
|
| 826 | 826 | : "'$fct(' . $order . ')'"; |
| 827 | 827 | } |
| 828 | - $t = $order . $collecte . $sens; |
|
| 828 | + $t = $order.$collecte.$sens; |
|
| 829 | 829 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 830 | - $t = $r[1] . $r[2]; |
|
| 830 | + $t = $r[1].$r[2]; |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | $boucle->order[] = $t; |
@@ -877,16 +877,16 @@ discard block |
||
| 877 | 877 | function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) { |
| 878 | 878 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 879 | 879 | if (is_array($_champ)) { |
| 880 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]]; |
|
| 880 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]]; |
|
| 881 | 881 | } |
| 882 | 882 | $boucle = &$boucles[$idb]; |
| 883 | - $texte = '0+' . $_champ; |
|
| 883 | + $texte = '0+'.$_champ; |
|
| 884 | 884 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 885 | 885 | if ($suite !== "''") { |
| 886 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 886 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 887 | 887 | } |
| 888 | - $asnum = 'num' . ($boucle->order ? count($boucle->order) : ''); |
|
| 889 | - $boucle->select[] = $texte . " AS $asnum"; |
|
| 888 | + $asnum = 'num'.($boucle->order ? count($boucle->order) : ''); |
|
| 889 | + $boucle->select[] = $texte." AS $asnum"; |
|
| 890 | 890 | |
| 891 | 891 | $orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ); |
| 892 | 892 | $orderassinum = trim($orderassinum, "'"); |
@@ -913,13 +913,13 @@ discard block |
||
| 913 | 913 | function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) { |
| 914 | 914 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 915 | 915 | if (is_array($_champ)) { |
| 916 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]]; |
|
| 916 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]]; |
|
| 917 | 917 | } |
| 918 | 918 | $boucle = &$boucles[$idb]; |
| 919 | - $texte = '0+' . $_champ; |
|
| 919 | + $texte = '0+'.$_champ; |
|
| 920 | 920 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 921 | 921 | if ($suite !== "''") { |
| 922 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 922 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | $as = false; |
@@ -935,8 +935,8 @@ discard block |
||
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | if (!$as) { |
| 938 | - $as = 'sinum' . ($boucle->order ? count($boucle->order) : ''); |
|
| 939 | - $boucle->select[] = $select . $as; |
|
| 938 | + $as = 'sinum'.($boucle->order ? count($boucle->order) : ''); |
|
| 939 | + $boucle->select[] = $select.$as; |
|
| 940 | 940 | } |
| 941 | 941 | return "'$as'"; |
| 942 | 942 | } |
@@ -960,10 +960,10 @@ discard block |
||
| 960 | 960 | function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) { |
| 961 | 961 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 962 | 962 | if (is_array($_champ)) { |
| 963 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]]; |
|
| 963 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]]; |
|
| 964 | 964 | } |
| 965 | 965 | $boucle = &$boucles[$idb]; |
| 966 | - $boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\""; |
|
| 966 | + $boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\""; |
|
| 967 | 967 | return "'multi'"; |
| 968 | 968 | } |
| 969 | 969 | |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | |
| 989 | 989 | // le champ existe dans la table, pas de souci (le plus commun) |
| 990 | 990 | if (isset($desc['field'][$par])) { |
| 991 | - $par = $boucle->id_table . '.' . $par; |
|
| 991 | + $par = $boucle->id_table.'.'.$par; |
|
| 992 | 992 | } |
| 993 | 993 | // le champ est peut être une jointure |
| 994 | 994 | else { |
@@ -1009,24 +1009,24 @@ discard block |
||
| 1009 | 1009 | // Sinon on cherche le champ dans les tables possibles de jointures |
| 1010 | 1010 | // Si la table est déjà dans le from, on la réutilise. |
| 1011 | 1011 | if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) { |
| 1012 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1012 | + $par = $infos['alias'].'.'.$champ; |
|
| 1013 | 1013 | } elseif ( |
| 1014 | 1014 | $boucle->jointures_explicites |
| 1015 | 1015 | && ($alias = trouver_jointure_champ($champ, $boucle, explode(' ', (string) $boucle->jointures_explicites), false, $table)) |
| 1016 | 1016 | ) { |
| 1017 | - $par = $alias . '.' . $champ; |
|
| 1017 | + $par = $alias.'.'.$champ; |
|
| 1018 | 1018 | } elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) { |
| 1019 | - $par = $alias . '.' . $champ; |
|
| 1019 | + $par = $alias.'.'.$champ; |
|
| 1020 | 1020 | // en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même) |
| 1021 | 1021 | } elseif ( |
| 1022 | 1022 | $table_alias |
| 1023 | 1023 | && isset($boucle->from[$table_alias]) |
| 1024 | 1024 | && ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias])) |
| 1025 | 1025 | ) { |
| 1026 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1026 | + $par = $infos['alias'].'.'.$champ; |
|
| 1027 | 1027 | } elseif ($table) { |
| 1028 | 1028 | // On avait table + champ, mais on ne les a pas trouvés |
| 1029 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 1029 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 1030 | 1030 | } else { |
| 1031 | 1031 | // Sinon tant pis, ca doit etre un champ synthetise (cf points) |
| 1032 | 1032 | } |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | if (!$t) { |
| 1051 | 1051 | $t = trouver_jointure_champ($champ, $boucle); |
| 1052 | 1052 | } |
| 1053 | - return $t ? "'" . $t . '.' . $champ . "'" : ''; |
|
| 1053 | + return $t ? "'".$t.'.'.$champ."'" : ''; |
|
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | /** |
@@ -1095,9 +1095,9 @@ discard block |
||
| 1095 | 1095 | $boucle->default_order[] = ' DESC'; |
| 1096 | 1096 | } |
| 1097 | 1097 | } else { |
| 1098 | - $t = $boucle->order[$n - 1] . " . $order"; |
|
| 1098 | + $t = $boucle->order[$n - 1]." . $order"; |
|
| 1099 | 1099 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 1100 | - $t = $r[1] . $r[2]; |
|
| 1100 | + $t = $r[1].$r[2]; |
|
| 1101 | 1101 | } |
| 1102 | 1102 | $boucle->order[$n - 1] = $t; |
| 1103 | 1103 | } |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | |
| 1135 | 1135 | $_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent); |
| 1136 | 1136 | |
| 1137 | - $order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens"; |
|
| 1137 | + $order = "'-FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste(array_reverse($_liste),'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens"; |
|
| 1138 | 1138 | $boucle->order[] = $order; |
| 1139 | 1139 | } |
| 1140 | 1140 | |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | $params = $crit->param; |
| 1144 | 1144 | |
| 1145 | 1145 | if ((is_countable($params) ? count($params) : 0) < 1) { |
| 1146 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 1146 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | $boucle = &$boucles[$idb]; |
@@ -1164,7 +1164,7 @@ discard block |
||
| 1164 | 1164 | if ((is_countable($date) ? count($date) : 0) == 1 && $date[0]->type == 'texte') { |
| 1165 | 1165 | $date = $date[0]->texte; |
| 1166 | 1166 | if (!isset($fields[$date])) { |
| 1167 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]]; |
|
| 1167 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]]; |
|
| 1168 | 1168 | } |
| 1169 | 1169 | } else { |
| 1170 | 1170 | $a = calculer_liste($date, $idb, $boucles, $parent); |
@@ -1176,38 +1176,38 @@ discard block |
||
| 1176 | 1176 | $date = "'.(($cond)\n?\$a:\"$defaut\").'"; |
| 1177 | 1177 | } |
| 1178 | 1178 | $annee = $params ? array_shift($params) : ''; |
| 1179 | - $annee = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1180 | - calculer_liste($annee, $idb, $boucles, $parent) . |
|
| 1179 | + $annee = "\n".'sprintf("%04d", ($x = '. |
|
| 1180 | + calculer_liste($annee, $idb, $boucles, $parent). |
|
| 1181 | 1181 | ') ? $x : date("Y"))'; |
| 1182 | 1182 | |
| 1183 | 1183 | $mois = $params ? array_shift($params) : ''; |
| 1184 | - $mois = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1185 | - calculer_liste($mois, $idb, $boucles, $parent) . |
|
| 1184 | + $mois = "\n".'sprintf("%02d", ($x = '. |
|
| 1185 | + calculer_liste($mois, $idb, $boucles, $parent). |
|
| 1186 | 1186 | ') ? $x : date("m"))'; |
| 1187 | 1187 | |
| 1188 | 1188 | $jour = $params ? array_shift($params) : ''; |
| 1189 | - $jour = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1190 | - calculer_liste($jour, $idb, $boucles, $parent) . |
|
| 1189 | + $jour = "\n".'sprintf("%02d", ($x = '. |
|
| 1190 | + calculer_liste($jour, $idb, $boucles, $parent). |
|
| 1191 | 1191 | ') ? $x : date("d"))'; |
| 1192 | 1192 | |
| 1193 | 1193 | $annee2 = $params ? array_shift($params) : ''; |
| 1194 | - $annee2 = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1195 | - calculer_liste($annee2, $idb, $boucles, $parent) . |
|
| 1194 | + $annee2 = "\n".'sprintf("%04d", ($x = '. |
|
| 1195 | + calculer_liste($annee2, $idb, $boucles, $parent). |
|
| 1196 | 1196 | ') ? $x : date("Y"))'; |
| 1197 | 1197 | |
| 1198 | 1198 | $mois2 = $params ? array_shift($params) : ''; |
| 1199 | - $mois2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1200 | - calculer_liste($mois2, $idb, $boucles, $parent) . |
|
| 1199 | + $mois2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1200 | + calculer_liste($mois2, $idb, $boucles, $parent). |
|
| 1201 | 1201 | ') ? $x : date("m"))'; |
| 1202 | 1202 | |
| 1203 | 1203 | $jour2 = $params ? array_shift($params) : ''; |
| 1204 | - $jour2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1205 | - calculer_liste($jour2, $idb, $boucles, $parent) . |
|
| 1204 | + $jour2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1205 | + calculer_liste($jour2, $idb, $boucles, $parent). |
|
| 1206 | 1206 | ') ? $x : date("d"))'; |
| 1207 | 1207 | |
| 1208 | - $date = $boucle->id_table . ".$date"; |
|
| 1208 | + $date = $boucle->id_table.".$date"; |
|
| 1209 | 1209 | |
| 1210 | - $quote_end = ",'" . $boucle->sql_serveur . "','text'"; |
|
| 1210 | + $quote_end = ",'".$boucle->sql_serveur."','text'"; |
|
| 1211 | 1211 | if ($type == 'jour') { |
| 1212 | 1212 | $boucle->where[] = [ |
| 1213 | 1213 | "'='", |
@@ -1279,14 +1279,13 @@ discard block |
||
| 1279 | 1279 | [$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2); |
| 1280 | 1280 | |
| 1281 | 1281 | if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) { |
| 1282 | - $boucle->limit = $a11 . ',' . $a21; |
|
| 1282 | + $boucle->limit = $a11.','.$a21; |
|
| 1283 | 1283 | } else { |
| 1284 | 1284 | // 3 dans {1/3}, {2,3} ou {1,n-3} |
| 1285 | 1285 | $boucle->total_parties = ($a21 != 'n') ? $a21 : $a22; |
| 1286 | 1286 | // 2 dans {2/3}, {2,5}, {n-2,1} |
| 1287 | 1287 | $partie = ($a11 != 'n') ? $a11 : $a12; |
| 1288 | - $mode = (($op == '/') ? '/' : |
|
| 1289 | - (($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+')); |
|
| 1288 | + $mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+')); |
|
| 1290 | 1289 | // cas simple {0,#ENV{truc}} compilons le en LIMIT : |
| 1291 | 1290 | if ($a11 !== 'n' && $a21 !== 'n' && $mode == '++' && $op == ',') { |
| 1292 | 1291 | $boucle->limit = |
@@ -1332,8 +1331,7 @@ discard block |
||
| 1332 | 1331 | // {1/3} |
| 1333 | 1332 | if ($op1 == '/') { |
| 1334 | 1333 | $pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)"; |
| 1335 | - $totpos = is_numeric($total_parties) ? ($total_parties) : |
|
| 1336 | - "($total_parties ? $total_parties : 1)"; |
|
| 1334 | + $totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)"; |
|
| 1337 | 1335 | $fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1"; |
| 1338 | 1336 | $debut = $pmoins1 ? "ceil(($nombre_boucle * $pmoins1)/$totpos);" : 0; |
| 1339 | 1337 | } else { |
@@ -1344,15 +1342,13 @@ discard block |
||
| 1344 | 1342 | |
| 1345 | 1343 | // cas {x,n-1} |
| 1346 | 1344 | if ($op2 == '-') { |
| 1347 | - $fin = '$debut_boucle + ' . $nombre_boucle . ' - ' |
|
| 1348 | - . (is_numeric($total_parties) ? ($total_parties + 1) : |
|
| 1349 | - ($total_parties . ' - 1')); |
|
| 1345 | + $fin = '$debut_boucle + '.$nombre_boucle.' - ' |
|
| 1346 | + . (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1')); |
|
| 1350 | 1347 | } else { |
| 1351 | 1348 | // {x,1} ou {pagination} |
| 1352 | 1349 | $fin = '$debut_boucle' |
| 1353 | 1350 | . (is_numeric($total_parties) ? |
| 1354 | - (($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) : |
|
| 1355 | - ('+' . $total_parties . ' - 1')); |
|
| 1351 | + (($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1')); |
|
| 1356 | 1352 | } |
| 1357 | 1353 | |
| 1358 | 1354 | // {pagination}, gerer le debut_xx=-1 pour tout voir |
@@ -1370,11 +1366,11 @@ discard block |
||
| 1370 | 1366 | // Utiliser min pour rabattre $fin_boucle sur total_boucle. |
| 1371 | 1367 | |
| 1372 | 1368 | $boucles[$id_boucle]->mode_partie = "\n\t" |
| 1373 | - . '$debut_boucle = ' . $debut . ";\n " |
|
| 1369 | + . '$debut_boucle = '.$debut.";\n " |
|
| 1374 | 1370 | . "\$debut_boucle = intval(\$debut_boucle);\n " |
| 1375 | - . '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1376 | - . '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1377 | - . '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1371 | + . '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1372 | + . '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1373 | + . '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1378 | 1374 | . "\n\tif (\$debut_boucle>0" |
| 1379 | 1375 | . " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']" |
| 1380 | 1376 | . " AND \$iter->seek(\$debut_boucle,'continue'))" |
@@ -1459,14 +1455,14 @@ discard block |
||
| 1459 | 1455 | // critere personnalise ? |
| 1460 | 1456 | if ( |
| 1461 | 1457 | (!$serveur |
| 1462 | - || !function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere) |
|
| 1458 | + || !function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere) |
|
| 1463 | 1459 | && !function_exists($f .= '_dist') |
| 1464 | - && !function_exists($f = 'critere_' . $serveur . '_' . $critere) |
|
| 1460 | + && !function_exists($f = 'critere_'.$serveur.'_'.$critere) |
|
| 1465 | 1461 | && !function_exists($f .= '_dist') |
| 1466 | 1462 | ) |
| 1467 | - && !function_exists($f = 'critere_' . $table . '_' . $critere) |
|
| 1463 | + && !function_exists($f = 'critere_'.$table.'_'.$critere) |
|
| 1468 | 1464 | && !function_exists($f .= '_dist') |
| 1469 | - && !function_exists($f = 'critere_' . $critere) |
|
| 1465 | + && !function_exists($f = 'critere_'.$critere) |
|
| 1470 | 1466 | && !function_exists($f .= '_dist') |
| 1471 | 1467 | ) { |
| 1472 | 1468 | // fonction critere standard |
@@ -1498,9 +1494,9 @@ discard block |
||
| 1498 | 1494 | */ |
| 1499 | 1495 | function kwote($lisp, $serveur = '', $type = '') { |
| 1500 | 1496 | if (preg_match(_CODE_QUOTE, $lisp, $r)) { |
| 1501 | - return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"'; |
|
| 1497 | + return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"'; |
|
| 1502 | 1498 | } else { |
| 1503 | - return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')"; |
|
| 1499 | + return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')"; |
|
| 1504 | 1500 | } |
| 1505 | 1501 | } |
| 1506 | 1502 | |
@@ -1522,7 +1518,7 @@ discard block |
||
| 1522 | 1518 | function critere_IN_dist($idb, &$boucles, $crit) { |
| 1523 | 1519 | $r = calculer_critere_infixe($idb, $boucles, $crit); |
| 1524 | 1520 | if (!$r) { |
| 1525 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 1521 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 1526 | 1522 | } |
| 1527 | 1523 | [$arg, $op, $val, $col, $where_complement] = $r; |
| 1528 | 1524 | |
@@ -1547,8 +1543,8 @@ discard block |
||
| 1547 | 1543 | "'NOT'", |
| 1548 | 1544 | [ |
| 1549 | 1545 | "'IN'", |
| 1550 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1551 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1546 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1547 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1552 | 1548 | ] |
| 1553 | 1549 | ]; |
| 1554 | 1550 | } |
@@ -1565,22 +1561,22 @@ discard block |
||
| 1565 | 1561 | $descr = $boucles[$idb]->descr; |
| 1566 | 1562 | $cpt = &$num[$descr['nom']][$descr['gram']][$idb]; |
| 1567 | 1563 | |
| 1568 | - $var = '$in' . $cpt++; |
|
| 1564 | + $var = '$in'.$cpt++; |
|
| 1569 | 1565 | $x = "\n\t$var = array();"; |
| 1570 | 1566 | foreach ($val as $k => $v) { |
| 1571 | 1567 | if (preg_match(",^(\n//.*\n)?'(.*)'$,", (string) $v, $r)) { |
| 1572 | 1568 | // optimiser le traitement des constantes |
| 1573 | 1569 | if (is_numeric($r[2])) { |
| 1574 | - $x .= "\n\t$var" . "[]= $r[2];"; |
|
| 1570 | + $x .= "\n\t$var"."[]= $r[2];"; |
|
| 1575 | 1571 | } else { |
| 1576 | - $x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';'; |
|
| 1572 | + $x .= "\n\t$var".'[]= '.sql_quote($r[2]).';'; |
|
| 1577 | 1573 | } |
| 1578 | 1574 | } else { |
| 1579 | 1575 | // Pour permettre de passer des tableaux de valeurs |
| 1580 | 1576 | // on repere l'utilisation brute de #ENV**{X}, |
| 1581 | 1577 | // c'est-a-dire sa traduction en ($PILE[0][X]). |
| 1582 | 1578 | // et on deballe mais en rajoutant l'anti XSS |
| 1583 | - $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1579 | + $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1584 | 1580 | } |
| 1585 | 1581 | } |
| 1586 | 1582 | |
@@ -1594,7 +1590,7 @@ discard block |
||
| 1594 | 1590 | $boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))"; |
| 1595 | 1591 | } |
| 1596 | 1592 | |
| 1597 | - return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')'; |
|
| 1593 | + return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')'; |
|
| 1598 | 1594 | } |
| 1599 | 1595 | |
| 1600 | 1596 | /** |
@@ -1667,7 +1663,7 @@ discard block |
||
| 1667 | 1663 | $champs = array_diff($champs, array_keys($boucle->modificateur['criteres'])); |
| 1668 | 1664 | } |
| 1669 | 1665 | // nous aider en mode debug. |
| 1670 | - $boucle->debug[] = 'id_ : ' . implode(', ', $champs); |
|
| 1666 | + $boucle->debug[] = 'id_ : '.implode(', ', $champs); |
|
| 1671 | 1667 | $boucle->modificateur['id_'] = $champs; |
| 1672 | 1668 | |
| 1673 | 1669 | // créer un critère {id_xxx?} de chaque champ retenu |
@@ -1922,8 +1918,8 @@ discard block |
||
| 1922 | 1918 | "'NOT'", |
| 1923 | 1919 | [ |
| 1924 | 1920 | "'IN'", |
| 1925 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1926 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1921 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1922 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1927 | 1923 | ] |
| 1928 | 1924 | ]; |
| 1929 | 1925 | } |
@@ -1933,7 +1929,7 @@ discard block |
||
| 1933 | 1929 | // traiter a part la date, elle est mise d'office par SPIP, |
| 1934 | 1930 | if ($crit->cond) { |
| 1935 | 1931 | $pred = calculer_argument_precedent($idb, $col, $boucles); |
| 1936 | - if (($col === 'date' || $col === 'date_redac') && $pred === "\$Pile[0]['" . $col . "']") { |
|
| 1932 | + if (($col === 'date' || $col === 'date_redac') && $pred === "\$Pile[0]['".$col."']") { |
|
| 1937 | 1933 | $pred = "(\$Pile[0]['{$col}_default']?'':$pred)"; |
| 1938 | 1934 | } |
| 1939 | 1935 | |
@@ -2095,7 +2091,7 @@ discard block |
||
| 2095 | 2091 | // defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon |
| 2096 | 2092 | // prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut |
| 2097 | 2093 | if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", (string) $val[0], $r)) { |
| 2098 | - $val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"'; |
|
| 2094 | + $val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"'; |
|
| 2099 | 2095 | } |
| 2100 | 2096 | // sinon expliciter les |
| 2101 | 2097 | // sql_quote(truc) en sql_quote(truc,'',type) |
@@ -2110,14 +2106,14 @@ discard block |
||
| 2110 | 2106 | ) { |
| 2111 | 2107 | $r = $r[1] |
| 2112 | 2108 | . ((isset($r[2]) && $r[2]) ? $r[2] : ",''") |
| 2113 | - . ",'" . addslashes((string) $type_cast_quote) . "'"; |
|
| 2109 | + . ",'".addslashes((string) $type_cast_quote)."'"; |
|
| 2114 | 2110 | $val[0] = "sql_quote($r)"; |
| 2115 | 2111 | } |
| 2116 | 2112 | elseif ( |
| 2117 | 2113 | str_contains((string) $val[0], '@@defaultcast@@') |
| 2118 | 2114 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r) |
| 2119 | 2115 | ) { |
| 2120 | - $val[0] = substr((string) $val[0], 0, -strlen($r[0])) . "'" . addslashes((string) $type_cast_quote) . "')"; |
|
| 2116 | + $val[0] = substr((string) $val[0], 0, -strlen($r[0]))."'".addslashes((string) $type_cast_quote)."')"; |
|
| 2121 | 2117 | } |
| 2122 | 2118 | } |
| 2123 | 2119 | |
@@ -2125,7 +2121,7 @@ discard block |
||
| 2125 | 2121 | str_contains((string) $val[0], '@@defaultcast@@') |
| 2126 | 2122 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", (string) $val[0], $r) |
| 2127 | 2123 | ) { |
| 2128 | - $val[0] = substr((string) $val[0], 0, -strlen($r[0])) . "'char')"; |
|
| 2124 | + $val[0] = substr((string) $val[0], 0, -strlen($r[0]))."'char')"; |
|
| 2129 | 2125 | } |
| 2130 | 2126 | |
| 2131 | 2127 | // Indicateur pour permettre aux fonctionx boucle_X de modifier |
@@ -2140,7 +2136,7 @@ discard block |
||
| 2140 | 2136 | |
| 2141 | 2137 | // inserer le nom de la table SQL devant le nom du champ |
| 2142 | 2138 | if ($table) { |
| 2143 | - $arg = $col[0] == '`' ? "$table." . substr((string) $col, 1, -1) : "$table.$col"; |
|
| 2139 | + $arg = $col[0] == '`' ? "$table.".substr((string) $col, 1, -1) : "$table.$col"; |
|
| 2144 | 2140 | } else { |
| 2145 | 2141 | $arg = $col; |
| 2146 | 2142 | } |
@@ -2269,9 +2265,9 @@ discard block |
||
| 2269 | 2265 | **/ |
| 2270 | 2266 | function primary_doublee($decompose, $table) { |
| 2271 | 2267 | $e1 = reset($decompose); |
| 2272 | - $e2 = "sql_quote('" . end($decompose) . "')"; |
|
| 2268 | + $e2 = "sql_quote('".end($decompose)."')"; |
|
| 2273 | 2269 | |
| 2274 | - return ["'='", "'$table." . $e1 . "'", $e2]; |
|
| 2270 | + return ["'='", "'$table.".$e1."'", $e2]; |
|
| 2275 | 2271 | } |
| 2276 | 2272 | |
| 2277 | 2273 | /** |
@@ -2310,7 +2306,7 @@ discard block |
||
| 2310 | 2306 | $checkarrivee |
| 2311 | 2307 | && is_string($checkarrivee) |
| 2312 | 2308 | && ($a = table_objet($checkarrivee)) |
| 2313 | - && in_array($a . '_liens', $joints) |
|
| 2309 | + && in_array($a.'_liens', $joints) |
|
| 2314 | 2310 | && ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee)) |
| 2315 | 2311 | ) { |
| 2316 | 2312 | return $res; |
@@ -2329,12 +2325,12 @@ discard block |
||
| 2329 | 2325 | // la table est déjà dans le FROM, on vérifie si le champ est utilisé. |
| 2330 | 2326 | $joindre = false; |
| 2331 | 2327 | foreach ($cols as $col) { |
| 2332 | - $c = '/\b' . $t . ".$col" . '\b/'; |
|
| 2328 | + $c = '/\b'.$t.".$col".'\b/'; |
|
| 2333 | 2329 | if (trouver_champ($c, $boucle->where)) { |
| 2334 | 2330 | $joindre = true; |
| 2335 | 2331 | } else { |
| 2336 | 2332 | // mais ca peut etre dans le FIELD pour le Having |
| 2337 | - $c = "/FIELD.$t" . ".$col,/"; |
|
| 2333 | + $c = "/FIELD.$t".".$col,/"; |
|
| 2338 | 2334 | if (trouver_champ($c, $boucle->select)) { |
| 2339 | 2335 | $joindre = true; |
| 2340 | 2336 | } |
@@ -2380,7 +2376,7 @@ discard block |
||
| 2380 | 2376 | $primary_arrivee = id_table_objet($checkarrivee); |
| 2381 | 2377 | |
| 2382 | 2378 | // [FIXME] $checkarrivee peut-il arriver avec false ???? |
| 2383 | - $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens'); |
|
| 2379 | + $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens'); |
|
| 2384 | 2380 | $arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee); |
| 2385 | 2381 | |
| 2386 | 2382 | if (!$intermediaire || !$arrivee) { |
@@ -2484,7 +2480,7 @@ discard block |
||
| 2484 | 2480 | } elseif ($crit->cond && ($col == 'date' || $col == 'date_redac')) { |
| 2485 | 2481 | // un critere conditionnel sur date est traite a part |
| 2486 | 2482 | // car la date est mise d'office par SPIP, |
| 2487 | - $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])"; |
|
| 2483 | + $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])"; |
|
| 2488 | 2484 | } |
| 2489 | 2485 | |
| 2490 | 2486 | $val = calculer_argument_precedent($idb, $val, $boucles, $defaut); |
@@ -2516,7 +2512,7 @@ discard block |
||
| 2516 | 2512 | && ($p == "'" || $p == '"') |
| 2517 | 2513 | && $params[0][1]->type == 'champ' |
| 2518 | 2514 | ) { |
| 2519 | - $val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p"; |
|
| 2515 | + $val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p"; |
|
| 2520 | 2516 | } else { |
| 2521 | 2517 | foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) { |
| 2522 | 2518 | $a = calculer_liste($p, $idb, $boucles, $parent); |
@@ -2531,7 +2527,7 @@ discard block |
||
| 2531 | 2527 | $fct = $args_sql = ''; |
| 2532 | 2528 | // fonction SQL ? |
| 2533 | 2529 | // chercher FONCTION(champ) tel que CONCAT(titre,descriptif) |
| 2534 | - if (preg_match('/^(.*)' . SQL_ARGS . '$/', (string) $col, $m)) { |
|
| 2530 | + if (preg_match('/^(.*)'.SQL_ARGS.'$/', (string) $col, $m)) { |
|
| 2535 | 2531 | $fct = $m[1]; |
| 2536 | 2532 | preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a); |
| 2537 | 2533 | $col = $a[1]; |
@@ -2617,7 +2613,7 @@ discard block |
||
| 2617 | 2613 | if (isset($regs[3]) && ($suite = $regs[3])) { |
| 2618 | 2614 | # Recherche de l'existence du champ date_xxxx, |
| 2619 | 2615 | # si oui choisir ce champ, sinon choisir xxxx |
| 2620 | - $date_orig = isset($table['field']["date$suite"]) ? 'date' . $suite : substr($suite, 1); |
|
| 2616 | + $date_orig = isset($table['field']["date$suite"]) ? 'date'.$suite : substr($suite, 1); |
|
| 2621 | 2617 | |
| 2622 | 2618 | $pred = $date_orig; |
| 2623 | 2619 | } else { // Sinon il FAUT avoir déclaré le champ date officiel dans l'API objet |
@@ -2634,12 +2630,12 @@ discard block |
||
| 2634 | 2630 | } |
| 2635 | 2631 | } |
| 2636 | 2632 | |
| 2637 | - $date_compare = "\"' . normaliser_date(" . |
|
| 2638 | - calculer_argument_precedent($idb, $pred, $boucles) . |
|
| 2633 | + $date_compare = "\"' . normaliser_date(". |
|
| 2634 | + calculer_argument_precedent($idb, $pred, $boucles). |
|
| 2639 | 2635 | ") . '\""; |
| 2640 | 2636 | |
| 2641 | 2637 | $col_vraie = $date_orig; |
| 2642 | - $date_orig = $boucle->id_table . '.' . $date_orig; |
|
| 2638 | + $date_orig = $boucle->id_table.'.'.$date_orig; |
|
| 2643 | 2639 | |
| 2644 | 2640 | switch ($col) { |
| 2645 | 2641 | case 'date': |
@@ -2659,26 +2655,26 @@ discard block |
||
| 2659 | 2655 | break; |
| 2660 | 2656 | case 'age': |
| 2661 | 2657 | $col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig); |
| 2662 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2658 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2663 | 2659 | break; |
| 2664 | 2660 | case 'age_relatif': |
| 2665 | 2661 | $col = calculer_param_date($date_compare, $date_orig); |
| 2666 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2662 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2667 | 2663 | break; |
| 2668 | 2664 | case 'jour_relatif': |
| 2669 | - $col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))'; |
|
| 2670 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2665 | + $col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))'; |
|
| 2666 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2671 | 2667 | break; |
| 2672 | 2668 | case 'mois_relatif': |
| 2673 | - $col = 'MONTH(' . $date_compare . ')-MONTH(' . |
|
| 2674 | - $date_orig . ')+12*(YEAR(' . $date_compare . |
|
| 2675 | - ')-YEAR(' . $date_orig . '))'; |
|
| 2676 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2669 | + $col = 'MONTH('.$date_compare.')-MONTH('. |
|
| 2670 | + $date_orig.')+12*(YEAR('.$date_compare. |
|
| 2671 | + ')-YEAR('.$date_orig.'))'; |
|
| 2672 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2677 | 2673 | break; |
| 2678 | 2674 | case 'annee_relatif': |
| 2679 | - $col = 'YEAR(' . $date_compare . ')-YEAR(' . |
|
| 2680 | - $date_orig . ')'; |
|
| 2681 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2675 | + $col = 'YEAR('.$date_compare.')-YEAR('. |
|
| 2676 | + $date_orig.')'; |
|
| 2677 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2682 | 2678 | break; |
| 2683 | 2679 | } |
| 2684 | 2680 | |
@@ -2736,10 +2732,10 @@ discard block |
||
| 2736 | 2732 | } |
| 2737 | 2733 | |
| 2738 | 2734 | $boucle->hash .= ' |
| 2739 | - $command[\'sourcemode\'] = ' . array_shift($args) . ";\n"; |
|
| 2735 | + $command[\'sourcemode\'] = ' . array_shift($args).";\n"; |
|
| 2740 | 2736 | |
| 2741 | 2737 | $boucle->hash .= ' |
| 2742 | - $command[\'source\'] = array(' . implode(', ', $args) . ");\n"; |
|
| 2738 | + $command[\'source\'] = array(' . implode(', ', $args).");\n"; |
|
| 2743 | 2739 | } |
| 2744 | 2740 | |
| 2745 | 2741 | /** |
@@ -2758,7 +2754,7 @@ discard block |
||
| 2758 | 2754 | function critere_DATA_datacache_dist($idb, &$boucles, $crit) { |
| 2759 | 2755 | $boucle = &$boucles[$idb]; |
| 2760 | 2756 | $boucle->hash .= ' |
| 2761 | - $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2757 | + $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2762 | 2758 | } |
| 2763 | 2759 | |
| 2764 | 2760 | |
@@ -2777,7 +2773,7 @@ discard block |
||
| 2777 | 2773 | $boucle->hash .= '$command[\'args\']=array();'; |
| 2778 | 2774 | foreach ($crit->param as $param) { |
| 2779 | 2775 | $boucle->hash .= ' |
| 2780 | - $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2776 | + $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2781 | 2777 | } |
| 2782 | 2778 | } |
| 2783 | 2779 | |
@@ -2796,14 +2792,14 @@ discard block |
||
| 2796 | 2792 | */ |
| 2797 | 2793 | function critere_DATA_liste_dist($idb, &$boucles, $crit) { |
| 2798 | 2794 | $boucle = &$boucles[$idb]; |
| 2799 | - $boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n"; |
|
| 2795 | + $boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n"; |
|
| 2800 | 2796 | foreach ($crit->param as $param) { |
| 2801 | - $boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste( |
|
| 2797 | + $boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste( |
|
| 2802 | 2798 | $param, |
| 2803 | 2799 | $idb, |
| 2804 | 2800 | $boucles, |
| 2805 | 2801 | $boucles[$idb]->id_parent |
| 2806 | - ) . ";\n"; |
|
| 2802 | + ).";\n"; |
|
| 2807 | 2803 | } |
| 2808 | 2804 | } |
| 2809 | 2805 | |
@@ -2830,14 +2826,14 @@ discard block |
||
| 2830 | 2826 | */ |
| 2831 | 2827 | function critere_DATA_enum_dist($idb, &$boucles, $crit) { |
| 2832 | 2828 | $boucle = &$boucles[$idb]; |
| 2833 | - $boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n"; |
|
| 2829 | + $boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n"; |
|
| 2834 | 2830 | foreach ($crit->param as $param) { |
| 2835 | - $boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste( |
|
| 2831 | + $boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste( |
|
| 2836 | 2832 | $param, |
| 2837 | 2833 | $idb, |
| 2838 | 2834 | $boucles, |
| 2839 | 2835 | $boucles[$idb]->id_parent |
| 2840 | - ) . ";\n"; |
|
| 2836 | + ).";\n"; |
|
| 2841 | 2837 | } |
| 2842 | 2838 | } |
| 2843 | 2839 | |
@@ -2856,7 +2852,7 @@ discard block |
||
| 2856 | 2852 | $boucle = &$boucles[$idb]; |
| 2857 | 2853 | foreach ($crit->param as $param) { |
| 2858 | 2854 | $boucle->hash .= ' |
| 2859 | - $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2855 | + $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2860 | 2856 | } |
| 2861 | 2857 | } |
| 2862 | 2858 | |
@@ -2897,7 +2893,7 @@ discard block |
||
| 2897 | 2893 | if ($crit->param) { |
| 2898 | 2894 | foreach ($crit->param as $param) { |
| 2899 | 2895 | $boucle->hash .= "\t\$command['si'][] = " |
| 2900 | - . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n"; |
|
| 2896 | + . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n"; |
|
| 2901 | 2897 | } |
| 2902 | 2898 | // interdire {si 0} aussi ! |
| 2903 | 2899 | } else { |
@@ -2921,7 +2917,7 @@ discard block |
||
| 2921 | 2917 | function critere_POUR_tableau_dist($idb, &$boucles, $crit) { |
| 2922 | 2918 | $boucle = &$boucles[$idb]; |
| 2923 | 2919 | $boucle->hash .= ' |
| 2924 | - $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . '); |
|
| 2920 | + $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).'); |
|
| 2925 | 2921 | $command[\'sourcemode\'] = \'table\';'; |
| 2926 | 2922 | } |
| 2927 | 2923 | |
@@ -2956,7 +2952,7 @@ discard block |
||
| 2956 | 2952 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 2957 | 2953 | |
| 2958 | 2954 | $in = 'IN'; |
| 2959 | - $where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2955 | + $where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2960 | 2956 | if ($not) { |
| 2961 | 2957 | $where = ["'NOT'", $where]; |
| 2962 | 2958 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return sql_getfetsel( |
| 36 | 36 | 'virtuel', |
| 37 | 37 | 'spip_articles', |
| 38 | - ['id_article=' . (int) $id_article, "statut='publie'"], |
|
| 38 | + ['id_article='.(int) $id_article, "statut='publie'"], |
|
| 39 | 39 | '', |
| 40 | 40 | '', |
| 41 | 41 | '', |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $cache_quete[$connect][$table][$id] = sql_fetsel( |
| 79 | 79 | $cache_quete[$connect][$table]['_select'], |
| 80 | 80 | $table, |
| 81 | - $cache_quete[$connect][$table]['_id'] . '=' . (int) $id, |
|
| 81 | + $cache_quete[$connect][$table]['_id'].'='.(int) $id, |
|
| 82 | 82 | '', |
| 83 | 83 | '', |
| 84 | 84 | '', |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | return |
| 170 | 170 | (isset($GLOBALS['meta']['date_prochain_postdate']) |
| 171 | 171 | && $GLOBALS['meta']['date_prochain_postdate'] > time()) |
| 172 | - ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 172 | + ? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 173 | 173 | : '1=1'; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | && ($id_table = reset($objet)) |
| 229 | 229 | && ($objet = objet_type($id_table)) |
| 230 | 230 | ) { |
| 231 | - $w = "$mstatut<>" . sql_quote($v); |
|
| 231 | + $w = "$mstatut<>".sql_quote($v); |
|
| 232 | 232 | |
| 233 | 233 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 234 | 234 | // sinon l’auteur en session |
@@ -242,22 +242,22 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 245 | - if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) { |
|
| 245 | + if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) { |
|
| 246 | 246 | // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche |
| 247 | 247 | if (!$id_auteur) { |
| 248 | 248 | $where[] = $w; |
| 249 | 249 | } else { |
| 250 | 250 | $primary = id_table_objet($objet); |
| 251 | - $where[] = "($w OR $id_table.$primary IN (" . sql_get_select( |
|
| 251 | + $where[] = "($w OR $id_table.$primary IN (".sql_get_select( |
|
| 252 | 252 | 'ssss.id_objet', |
| 253 | 253 | 'spip_auteurs_liens AS ssss', |
| 254 | - 'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . (int) $id_auteur, |
|
| 254 | + 'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.(int) $id_auteur, |
|
| 255 | 255 | '', |
| 256 | 256 | '', |
| 257 | 257 | '', |
| 258 | 258 | '', |
| 259 | 259 | $serveur |
| 260 | - ) . '))'; |
|
| 260 | + ).'))'; |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | } // ignorer ce statut si on ne sait pas comment le filtrer |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return array|bool|null |
| 296 | 296 | */ |
| 297 | 297 | function quete_fichier($id_document, $serveur = '') { |
| 298 | - return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . (int) $id_document), '', [], '', '', $serveur); |
|
| 298 | + return sql_getfetsel('fichier', 'spip_documents', ('id_document='.(int) $id_document), '', [], '', '', $serveur); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * @return array|bool |
| 307 | 307 | */ |
| 308 | 308 | function quete_document($id_document, $serveur = '') { |
| 309 | - return sql_fetsel('*', 'spip_documents', ('id_document=' . (int) $id_document), '', [], '', '', $serveur); |
|
| 309 | + return sql_fetsel('*', 'spip_documents', ('id_document='.(int) $id_document), '', [], '', '', $serveur); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * @return array|bool|null |
| 318 | 318 | */ |
| 319 | 319 | function quete_meta($nom, $serveur) { |
| 320 | - return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur); |
|
| 320 | + return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -368,9 +368,9 @@ discard block |
||
| 368 | 368 | // qui permet de distinguer le changement de logo |
| 369 | 369 | // et placer un expire sur le dossier IMG/ |
| 370 | 370 | $res = [ |
| 371 | - $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 372 | - ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 373 | - ($taille ? ' ' . $taille[3] : ('')) |
|
| 371 | + $on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 372 | + ($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 373 | + ($taille ? ' '.$taille[3] : ('')) |
|
| 374 | 374 | ]; |
| 375 | 375 | $res['src'] = $res[0]; |
| 376 | 376 | $res['logo_on'] = $res[0]; |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | if ( |
| 481 | 481 | strcmp((string) $logo, (string) _DIR_PLUGINS) == 0 |
| 482 | 482 | || strcmp((string) $logo, (string) _DIR_PLUGINS_DIST) == 0 |
| 483 | - || strcmp((string) $logo, _DIR_RACINE . 'prive/') == 0 |
|
| 483 | + || strcmp((string) $logo, _DIR_RACINE.'prive/') == 0 |
|
| 484 | 484 | ) { |
| 485 | 485 | return $logo; |
| 486 | 486 | } |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | $exposer[$m][$type][$principal] = true; |
| 657 | 657 | if ($type == 'id_mot') { |
| 658 | 658 | if (!$parent) { |
| 659 | - $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . (int) $principal, '', '', '', '', $connect); |
|
| 659 | + $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.(int) $principal, '', '', '', '', $connect); |
|
| 660 | 660 | } |
| 661 | 661 | if ($parent) { |
| 662 | 662 | $exposer[$m]['id_groupe'][$parent] = true; |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../'); |
| 52 | 52 | |
| 53 | 53 | /** chemin absolu vers la racine */ |
| 54 | -define('_ROOT_RACINE', dirname(__DIR__) . '/'); |
|
| 54 | +define('_ROOT_RACINE', dirname(__DIR__).'/'); |
|
| 55 | 55 | /** chemin absolu vers le repertoire de travail */ |
| 56 | -define('_ROOT_CWD', getcwd() . '/'); |
|
| 56 | +define('_ROOT_CWD', getcwd().'/'); |
|
| 57 | 57 | /** chemin absolu vers ecrire */ |
| 58 | -define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT); |
|
| 58 | +define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT); |
|
| 59 | 59 | |
| 60 | 60 | # Le nom des 4 repertoires modifiables par les scripts lances par httpd |
| 61 | 61 | # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas) |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | // inclure l'ecran de securite si il n'a pas été inclus en prepend php |
| 81 | 81 | if ( |
| 82 | 82 | !defined('_ECRAN_SECURITE') |
| 83 | - && @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php') |
|
| 83 | + && @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php') |
|
| 84 | 84 | ) { |
| 85 | 85 | include $f; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // et on peut lancer l'autoloader |
| 89 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 89 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 90 | 90 | |
| 91 | 91 | // Icones |
| 92 | 92 | if (!defined('_NOM_IMG_PACK')) { |
@@ -94,17 +94,17 @@ discard block |
||
| 94 | 94 | define('_NOM_IMG_PACK', 'images/'); |
| 95 | 95 | } |
| 96 | 96 | /** le chemin http (relatif) vers les images standard */ |
| 97 | -define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK)); |
|
| 97 | +define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK)); |
|
| 98 | 98 | |
| 99 | 99 | /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */ |
| 100 | -define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK); |
|
| 100 | +define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK); |
|
| 101 | 101 | |
| 102 | 102 | if (!defined('_JAVASCRIPT')) { |
| 103 | 103 | /** Nom du repertoire des bibliotheques JavaScript */ |
| 104 | 104 | define('_JAVASCRIPT', 'javascript/'); |
| 105 | 105 | } // utilisable avec #CHEMIN et find_in_path |
| 106 | 106 | /** le nom du repertoire des bibliotheques JavaScript du prive */ |
| 107 | -define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT)); |
|
| 107 | +define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT)); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | /** Le nom du fichier de personnalisation */ |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | // Son emplacement absolu si on le trouve |
| 116 | 116 | if ( |
| 117 | - @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php') |
|
| 118 | - || @file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php') |
|
| 117 | + @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php') |
|
| 118 | + || @file_exists($f = _ROOT_RESTREINT._NOM_CONFIG.'.php') |
|
| 119 | 119 | ) { |
| 120 | 120 | /** Emplacement absolu du fichier d'option */ |
| 121 | 121 | define('_FILE_OPTIONS', $f); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // UA plus cibles |
| 152 | 152 | . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' |
| 153 | 153 | . ',i', |
| 154 | - (string)$_SERVER['HTTP_USER_AGENT'] |
|
| 154 | + (string) $_SERVER['HTTP_USER_AGENT'] |
|
| 155 | 155 | ) |
| 156 | 156 | ); |
| 157 | 157 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | # la matrice standard (fichiers definissant les fonctions a inclure) |
| 394 | 394 | $spip_matrice = []; |
| 395 | 395 | # les plugins a activer |
| 396 | -$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 396 | +$plugins = []; // voir le contenu du repertoire /plugins/ |
|
| 397 | 397 | # les surcharges de include_spip() |
| 398 | 398 | $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php' |
| 399 | 399 | |
@@ -471,8 +471,8 @@ discard block |
||
| 471 | 471 | // |
| 472 | 472 | // Charger les fonctions liees aux serveurs Http et Sql. |
| 473 | 473 | // |
| 474 | -require_once _ROOT_RESTREINT . 'inc/utils.php'; |
|
| 475 | -require_once _ROOT_RESTREINT . 'base/connect_sql.php'; |
|
| 474 | +require_once _ROOT_RESTREINT.'inc/utils.php'; |
|
| 475 | +require_once _ROOT_RESTREINT.'base/connect_sql.php'; |
|
| 476 | 476 | |
| 477 | 477 | // Definition personnelles eventuelles |
| 478 | 478 | |
@@ -495,10 +495,10 @@ discard block |
||
| 495 | 495 | // ===> on execute en neutralisant les messages d'erreur |
| 496 | 496 | |
| 497 | 497 | spip_initialisation_core( |
| 498 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 499 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 500 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 501 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 498 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 499 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 500 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 501 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 502 | 502 | ); |
| 503 | 503 | |
| 504 | 504 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | include_spip('inc/lang'); |
| 555 | 555 | utiliser_langue_visiteur(); |
| 556 | 556 | include_spip('inc/minipres'); |
| 557 | - echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]); |
|
| 557 | + echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]); |
|
| 558 | 558 | exit; |
| 559 | 559 | } |
| 560 | 560 | // autrement c'est une install ad hoc (spikini...), on sait pas faire |
@@ -593,12 +593,12 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) { |
| 595 | 595 | include_spip('inc/filtres_mini'); |
| 596 | - header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt')); |
|
| 596 | + header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt')); |
|
| 597 | 597 | } else { |
| 598 | 598 | // header minimal |
| 599 | - header(_HEADER_COMPOSED_BY . ' @ www.spip.net'); |
|
| 599 | + header(_HEADER_COMPOSED_BY.' @ www.spip.net'); |
|
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : '')); |
| 604 | -spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG); |
|
| 604 | +spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG); |
|
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function optimiser_caches_contextes() { |
| 52 | 52 | sous_repertoire(_DIR_CACHE, 'contextes'); |
| 53 | - if (is_dir($d = _DIR_CACHE . 'contextes')) { |
|
| 53 | + if (is_dir($d = _DIR_CACHE.'contextes')) { |
|
| 54 | 54 | include_spip('inc/invalideur'); |
| 55 | 55 | purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]); |
| 56 | 56 | } |
@@ -95,16 +95,16 @@ discard block |
||
| 95 | 95 | $tables[] = array_shift($row); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - spip_log('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG); |
|
| 98 | + spip_log('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG); |
|
| 99 | 99 | if ($tables) { |
| 100 | 100 | $table_op = (int) (lire_config('optimiser_table', 0) + 1) % count($tables); |
| 101 | 101 | ecrire_config('optimiser_table', $table_op); |
| 102 | 102 | $q = $tables[$table_op]; |
| 103 | - spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 103 | + spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 104 | 104 | if (sql_optimize($q)) { |
| 105 | - spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 105 | + spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 106 | 106 | } else { |
| 107 | - spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie' . _LOG_DEBUG); |
|
| 107 | + spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie'._LOG_DEBUG); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | sql_free($sel); |
| 140 | 140 | |
| 141 | 141 | if ($in) { |
| 142 | - sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : '')); |
|
| 143 | - spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)), 'genie' . _LOG_DEBUG); |
|
| 142 | + sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : '')); |
|
| 143 | + spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)), 'genie'._LOG_DEBUG); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return count($in); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) { |
| 221 | 221 | define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600); |
| 222 | 222 | } |
| 223 | - sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU))); |
|
| 223 | + sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - (int) _AUTEURS_DELAI_REJET_NOUVEAU))); |
|
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | 226 | * Permet aux plugins de compléter l'optimisation suite aux éléments disparus |
@@ -241,5 +241,5 @@ discard block |
||
| 241 | 241 | ]); |
| 242 | 242 | |
| 243 | 243 | |
| 244 | - spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie' . _LOG_DEBUG); |
|
| 244 | + spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie'._LOG_DEBUG); |
|
| 245 | 245 | } |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | function genie_mise_a_jour_dist($t) { |
| 29 | 29 | include_spip('inc/meta'); |
| 30 | 30 | $maj = info_maj($GLOBALS['spip_version_branche']); |
| 31 | - ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche'] . "|$maj") : '', 'non'); |
|
| 31 | + ecrire_meta('info_maj_spip', $maj ? ($GLOBALS['spip_version_branche']."|$maj") : '', 'non'); |
|
| 32 | 32 | |
| 33 | 33 | mise_a_jour_ecran_securite(); |
| 34 | 34 | |
| 35 | - spip_log('Verification version SPIP : ' . ($maj ?: 'version a jour'), 'verifie_maj'); |
|
| 35 | + spip_log('Verification version SPIP : '.($maj ?: 'version a jour'), 'verifie_maj'); |
|
| 36 | 36 | |
| 37 | 37 | return 1; |
| 38 | 38 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | // si l'ecran n'est pas deja present ou pas updatable, sortir |
| 58 | 58 | if ( |
| 59 | 59 | !_URL_ECRAN_SECURITE |
| 60 | - || !file_exists($filename = _DIR_ETC . 'ecran_securite.php') |
|
| 60 | + || !file_exists($filename = _DIR_ETC.'ecran_securite.php') |
|
| 61 | 61 | || !is_writable($filename) |
| 62 | 62 | || !($last_modified = filemtime($filename)) |
| 63 | 63 | || !($md5 = md5_file($filename)) |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | include_spip('inc/distant'); |
| 69 | - $tmp_file = _DIR_TMP . 'ecran_securite.php'; |
|
| 69 | + $tmp_file = _DIR_TMP.'ecran_securite.php'; |
|
| 70 | 70 | $url = parametre_url(_URL_ECRAN_SECURITE, 'md5', $md5); |
| 71 | 71 | $url = parametre_url($url, 'vspip', $GLOBALS['spip_version_branche']); |
| 72 | 72 | $res = recuperer_url($url, [ |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | include_once $tmp_file; |
| 86 | 86 | // ok, on le copie a la place de l'ecran existant |
| 87 | 87 | // en backupant l'ecran avant, au cas ou |
| 88 | - @copy($filename, $filename . '-bck-' . date('Y-m-d-His', $last_modified)); |
|
| 88 | + @copy($filename, $filename.'-bck-'.date('Y-m-d-His', $last_modified)); |
|
| 89 | 89 | @rename($tmp_file, $filename); |
| 90 | 90 | } else { |
| 91 | 91 | @unlink($tmp_file); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $message[] = _T('nouvelle_version_spip_majeure', ['version' => $maj['majeure']]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="' . $maj['mineure'] . '">' . implode(' | ', $message) . '</a>'; |
|
| 130 | + return '<a class="info_maj_spip" href="https://www.spip.net/fr_update" title="'.$maj['mineure'].'">'.implode(' | ', $message).'</a>'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | function info_maj_cache(): ?array { |
| 145 | 145 | $contenu = ''; |
| 146 | 146 | $options = []; |
| 147 | - $nom = _DIR_CACHE . _VERSIONS_LISTE; |
|
| 147 | + $nom = _DIR_CACHE._VERSIONS_LISTE; |
|
| 148 | 148 | if (file_exists($nom)) { |
| 149 | 149 | $contenu = file_get_contents($nom); |
| 150 | 150 | $options['if_modified_since'] = filemtime($nom); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | try { |
| 166 | 166 | $json = json_decode((string) $contenu, true, 512, JSON_THROW_ON_ERROR); |
| 167 | 167 | } catch (JsonException $e) { |
| 168 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), 'verifie_maj'); |
|
| 168 | + spip_log('Failed to parse Json data : '.$e->getMessage(), 'verifie_maj'); |
|
| 169 | 169 | return null; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | foreach ($versions as $v) { |
| 199 | 199 | [$maj2, $min2, $rev2] = explode('.', $v); |
| 200 | - $branche_maj = $maj2 . '.' . $min2; |
|
| 201 | - $version_maj = $maj2 . '.' . $min2 . '.' . $rev2; |
|
| 200 | + $branche_maj = $maj2.'.'.$min2; |
|
| 201 | + $version_maj = $maj2.'.'.$min2.'.'.$rev2; |
|
| 202 | 202 | $is_version_stable = is_numeric($rev2); |
| 203 | 203 | // d'abord les mises à jour de la même branche (version mineure) |
| 204 | 204 | if ( |