@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $type .= ($struct->type_requete ?: $struct->table_optionnelle); |
| 31 | 31 | |
| 32 | 32 | if ($struct->jointures_explicites) { |
| 33 | - $type .= ' ' . $struct->jointures_explicites; |
|
| 33 | + $type .= ' '.$struct->jointures_explicites; |
|
| 34 | 34 | } |
| 35 | 35 | if ($struct->table_optionnelle) { |
| 36 | 36 | $type .= '?'; |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $crit = $struct->param; |
| 41 | 41 | if ($crit && !is_array($crit[0])) { |
| 42 | - $type = strtolower($type) . array_shift($crit); |
|
| 42 | + $type = strtolower($type).array_shift($crit); |
|
| 43 | 43 | } |
| 44 | 44 | $crit = decompiler_criteres($struct, $fmt, $prof); |
| 45 | 45 | |
| 46 | - $f = 'format_boucle_' . $fmt; |
|
| 46 | + $f = 'format_boucle_'.$fmt; |
|
| 47 | 47 | |
| 48 | 48 | return $f($preaff, $avant, $nom, $type, $crit, $milieu, $apres, $altern, $postaff, $prof); |
| 49 | 49 | } |
@@ -56,21 +56,20 @@ discard block |
||
| 56 | 56 | $res[] = decompiler_($v, $fmt, $prof); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | - $file = is_string($struct->texte) ? $struct->texte : |
|
| 60 | - decompiler_($struct->texte, $fmt, $prof); |
|
| 61 | - $f = 'format_inclure_' . $fmt; |
|
| 59 | + $file = is_string($struct->texte) ? $struct->texte : decompiler_($struct->texte, $fmt, $prof); |
|
| 60 | + $f = 'format_inclure_'.$fmt; |
|
| 62 | 61 | |
| 63 | 62 | return $f($file, $res, $prof); |
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | function decompiler_texte($struct, $fmt = '', $prof = 0) { |
| 67 | - $f = 'format_texte_' . $fmt; |
|
| 66 | + $f = 'format_texte_'.$fmt; |
|
| 68 | 67 | |
| 69 | 68 | return strlen($struct->texte) ? $f($struct->texte, $prof) : ''; |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 | function decompiler_polyglotte($struct, $fmt = '', $prof = 0) { |
| 73 | - $f = 'format_polyglotte_' . $fmt; |
|
| 72 | + $f = 'format_polyglotte_'.$fmt; |
|
| 74 | 73 | |
| 75 | 74 | return $f($struct->traductions, $prof); |
| 76 | 75 | } |
@@ -83,7 +82,7 @@ discard block |
||
| 83 | 82 | |
| 84 | 83 | $filtres = decompiler_liste($struct->param, $fmt, $prof); |
| 85 | 84 | |
| 86 | - $f = 'format_idiome_' . $fmt; |
|
| 85 | + $f = 'format_idiome_'.$fmt; |
|
| 87 | 86 | |
| 88 | 87 | return $f($struct->nom_champ, $struct->module, $args, $filtres, $prof); |
| 89 | 88 | } |
@@ -98,7 +97,7 @@ discard block |
||
| 98 | 97 | } |
| 99 | 98 | $filtres = decompiler_liste($p, $fmt, $prof); |
| 100 | 99 | } |
| 101 | - $f = 'format_champ_' . $fmt; |
|
| 100 | + $f = 'format_champ_'.$fmt; |
|
| 102 | 101 | |
| 103 | 102 | return $f($struct->nom_champ, $struct->nom_boucle, $struct->etoile, $avant, $apres, $args, $filtres, $prof); |
| 104 | 103 | } |
@@ -107,7 +106,7 @@ discard block |
||
| 107 | 106 | if (!is_array($sources)) { |
| 108 | 107 | return ''; |
| 109 | 108 | } |
| 110 | - $f = 'format_liste_' . $fmt; |
|
| 109 | + $f = 'format_liste_'.$fmt; |
|
| 111 | 110 | $res = ''; |
| 112 | 111 | foreach ($sources as $arg) { |
| 113 | 112 | if (!is_array($arg)) { |
@@ -124,7 +123,7 @@ discard block |
||
| 124 | 123 | && strlen($v[0]->apres) == 1 |
| 125 | 124 | && $v[0]->apres == $v[0]->avant |
| 126 | 125 | ) { |
| 127 | - $args[] = $v[0]->avant . $v[0]->texte . $v[0]->apres; |
|
| 126 | + $args[] = $v[0]->avant.$v[0]->texte.$v[0]->apres; |
|
| 128 | 127 | } else { |
| 129 | 128 | $args[] = decompiler_($v, $fmt, 0 - $prof); |
| 130 | 129 | } |
@@ -147,7 +146,7 @@ discard block |
||
| 147 | 146 | return ''; |
| 148 | 147 | } |
| 149 | 148 | $res = ''; |
| 150 | - $f = 'format_critere_' . $fmt; |
|
| 149 | + $f = 'format_critere_'.$fmt; |
|
| 151 | 150 | foreach ($sources as $crit) { |
| 152 | 151 | if (!is_array($crit)) { |
| 153 | 152 | continue; |
@@ -160,13 +159,13 @@ discard block |
||
| 160 | 159 | && $v[0]->type == 'texte' |
| 161 | 160 | && $v[0]->apres |
| 162 | 161 | ) { |
| 163 | - $args[] = [['texte', ($v[0]->apres . $v[0]->texte . $v[0]->apres)]]; |
|
| 162 | + $args[] = [['texte', ($v[0]->apres.$v[0]->texte.$v[0]->apres)]]; |
|
| 164 | 163 | } else { |
| 165 | 164 | $res2 = []; |
| 166 | 165 | foreach ($v as $k => $p) { |
| 167 | 166 | if ( |
| 168 | 167 | isset($p->type) |
| 169 | - && function_exists($d = 'decompiler_' . $p->type) |
|
| 168 | + && function_exists($d = 'decompiler_'.$p->type) |
|
| 170 | 169 | ) { |
| 171 | 170 | $r = $d($p, $fmt, (0 - $prof)); |
| 172 | 171 | $res2[] = [$p->type, $r]; |
@@ -194,7 +193,7 @@ discard block |
||
| 194 | 193 | if (!isset($p->type)) { |
| 195 | 194 | continue; |
| 196 | 195 | } #?????? |
| 197 | - $d = 'decompiler_' . $p->type; |
|
| 196 | + $d = 'decompiler_'.$p->type; |
|
| 198 | 197 | $next = $liste[$k + 1] ?? false; |
| 199 | 198 | // Forcer le champ etendu si son source (pas les reecritures) |
| 200 | 199 | // contenait des args et s'il est suivi d'espaces, |
@@ -219,16 +218,16 @@ discard block |
||
| 219 | 218 | } |
| 220 | 219 | $contenu[] = [$d($p, $fmt, $prof2), $p->type]; |
| 221 | 220 | } |
| 222 | - $f = 'format_suite_' . $fmt; |
|
| 221 | + $f = 'format_suite_'.$fmt; |
|
| 223 | 222 | |
| 224 | 223 | return $f($contenu); |
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | function public_decompiler($liste, $fmt = '', $prof = 0, $quoi = '') { |
| 228 | - if (!include_spip('public/format_' . $fmt)) { |
|
| 227 | + if (!include_spip('public/format_'.$fmt)) { |
|
| 229 | 228 | return "'$fmt'?"; |
| 230 | 229 | } |
| 231 | - $f = 'decompiler_' . $quoi; |
|
| 230 | + $f = 'decompiler_'.$quoi; |
|
| 232 | 231 | |
| 233 | 232 | return $f($liste, $fmt, $prof); |
| 234 | 233 | } |
@@ -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($w[0], $debut_doub)) { |
| 142 | 142 | // fusionner le sql_in (du where) |
| 143 | - $boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr($w[0], strlen($debut_in)); |
|
| 143 | + $boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr($w[0], strlen($debut_in)); |
|
| 144 | 144 | // fusionner l'initialisation (du hash) pour faire plus joli |
| 145 | 145 | $x = strpos($boucle->hash, $init_comment); |
| 146 | 146 | $len = strlen($init_comment); |
| 147 | 147 | $boucle->hash = |
| 148 | - substr($boucle->hash, 0, $x + $len) . $init_code . substr($boucle->hash, $x + $len); |
|
| 148 | + substr($boucle->hash, 0, $x + $len).$init_code.substr($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($type, 1)); |
|
| 283 | + $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr($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]/', $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($boucle->order[$n - 1], 'ASC')) |
| 662 | 662 | || (false !== $i = strpos($boucle->order[$n - 1], 'DESC')) |
| 663 | 663 | ) { |
| 664 | - $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0); |
|
| 664 | + $boucle->order[$n - 1] = substr_replace($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($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]+(.*)$,', $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', $par, $match)) { |
|
| 786 | + } elseif ($boucle->type_requete == 'DATA' || preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', $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*$/", $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(' ', $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)?'(.*)'$,", $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", $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($type_cast_quote) . "'"; |
|
| 2109 | + . ",'".addslashes($type_cast_quote)."'"; |
|
| 2114 | 2110 | $val[0] = "sql_quote($r)"; |
| 2115 | 2111 | } |
| 2116 | 2112 | elseif ( |
| 2117 | 2113 | str_contains($val[0], '@@defaultcast@@') |
| 2118 | 2114 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2119 | 2115 | ) { |
| 2120 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')"; |
|
| 2116 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'".addslashes($type_cast_quote)."')"; |
|
| 2121 | 2117 | } |
| 2122 | 2118 | } |
| 2123 | 2119 | |
@@ -2125,7 +2121,7 @@ discard block |
||
| 2125 | 2121 | str_contains($val[0], '@@defaultcast@@') |
| 2126 | 2122 | && preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2127 | 2123 | ) { |
| 2128 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'char')"; |
|
| 2124 | + $val[0] = substr($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($col, 1, -1) : "$table.$col"; |
|
| 2139 | + $arg = $col[0] == '`' ? "$table.".substr($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 . '$/', $col, $m)) { |
|
| 2530 | + if (preg_match('/^(.*)'.SQL_ARGS.'$/', $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 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | try { |
| 52 | - $res = eval('?' . '>' . $page['texte']); |
|
| 52 | + $res = eval('?'.'>'.$page['texte']); |
|
| 53 | 53 | $page['texte'] = ob_get_contents(); |
| 54 | 54 | } catch (\Throwable $e) { |
| 55 | 55 | $code = $page['texte']; |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | if (!function_exists('numerote_ligne_php')) { |
| 58 | 58 | function numerote_ligne_php($match) { |
| 59 | 59 | $GLOBALS['numero_ligne_php']++; |
| 60 | - return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 60 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 63 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 64 | 64 | $code = trim(highlight_string($code, true)); |
| 65 | - erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]); |
|
| 65 | + erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]); |
|
| 66 | 66 | $page['texte'] = '<!-- Erreur -->'; |
| 67 | 67 | } |
| 68 | 68 | ob_end_clean(); |
@@ -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($logo, _DIR_PLUGINS) == 0 |
| 482 | 482 | || strcmp($logo, _DIR_PLUGINS_DIST) == 0 |
| 483 | - || strcmp($logo, _DIR_RACINE . 'prive/') == 0 |
|
| 483 | + || strcmp($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; |
@@ -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($r[0]) . '___'; |
|
| 211 | + return $src[] = '___'.md5($r[0]).'___'; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // si on recoit pas un tableau, on renvoit les couples de substitution |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $texte = $intro; |
| 87 | 87 | } else { |
| 88 | 88 | if ( |
| 89 | - !str_contains("\n" . $texte, "\n|") |
|
| 89 | + !str_contains("\n".$texte, "\n|") |
|
| 90 | 90 | && strlen($texte) > 2.5 * $longueur |
| 91 | 91 | ) { |
| 92 | 92 | if (str_contains($texte, '<multi')) { |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | if ($pas < 1) { |
| 171 | 171 | return ''; |
| 172 | 172 | } |
| 173 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 174 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 173 | + $ancre = 'pagination'.$nom; // #pagination_articles |
|
| 174 | + $debut = 'debut'.$nom; // 'debut_articles' |
|
| 175 | 175 | |
| 176 | 176 | // n'afficher l'ancre qu'une fois |
| 177 | - $bloc_ancre = isset($ancres[$ancre]) ? '' : ($ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>"); |
|
| 177 | + $bloc_ancre = isset($ancres[$ancre]) ? '' : ($ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>"); |
|
| 178 | 178 | // liste = false : on ne veut que l'ancre |
| 179 | 179 | if (!$liste) { |
| 180 | 180 | return $ancres[$ancre]; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | if ($modele) { |
| 205 | 205 | $pagination['type_pagination'] = $modele; |
| 206 | - $modele = trouver_fond('pagination_' . $modele, 'modeles') ? '_' . $modele : ''; |
|
| 206 | + $modele = trouver_fond('pagination_'.$modele, 'modeles') ? '_'.$modele : ''; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if (!defined('_PAGINATION_NOMBRE_LIENS_MAX')) { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | function lister_objets_avec_logos($type) { |
| 279 | 279 | |
| 280 | 280 | $objet = objet_type($type); |
| 281 | - $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet)); |
|
| 281 | + $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet)); |
|
| 282 | 282 | if ($ids) { |
| 283 | 283 | $ids = array_column($ids, 'id_objet'); |
| 284 | 284 | return implode(',', $ids); |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | // Classes : on indique le sens de tri et l'item exposé |
| 473 | 473 | if (!$is_sens_fixe) { |
| 474 | - $classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 474 | + $classe .= ' item-tri item-tri_'.($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 475 | 475 | } |
| 476 | 476 | if ($champ_ou_sens === $tri_champ) { |
| 477 | 477 | $classe .= ' item-tri_actif'; |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | function tri_champ_order($t, $from = null, $senstri = '') { |
| 512 | 512 | if (str_starts_with($t, 'multi ')) { |
| 513 | - return 'multi' . $senstri; |
|
| 513 | + return 'multi'.$senstri; |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | $champ = $t; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | return match ($prefixe) { |
| 541 | 541 | 'num ' => "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}, 0+$champ{$senstri}", |
| 542 | 542 | 'sinum ' => "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}", |
| 543 | - default => $champ . $senstri, |
|
| 543 | + default => $champ.$senstri, |
|
| 544 | 544 | }; |
| 545 | 545 | } |
| 546 | 546 | |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | $l = couleur_hex_to_hsl($couleur, 'l'); |
| 642 | 642 | $styles .= ":root {--spip-login-color-theme--hs: {$hs};--spip-login-color-theme--l: {$l};}\n"; |
| 643 | 643 | } |
| 644 | - $logo_bg = _DIR_IMG . 'spip_fond_login.jpg'; |
|
| 644 | + $logo_bg = _DIR_IMG.'spip_fond_login.jpg'; |
|
| 645 | 645 | if (file_exists($logo_bg)) { |
| 646 | 646 | include_spip('inc/filtres_images_mini'); |
| 647 | 647 | $logo_mini = image_reduire($logo_bg, 64, 64); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 56 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 57 | 57 | |
| 58 | 58 | // si squelette est deja compile et perenne, le charger |
| 59 | 59 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | #} |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 69 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 70 | 70 | include_once $lib; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | eval("return true; $f ;"); |
| 95 | 95 | } catch (\ParseError $e) { |
| 96 | 96 | // Code syntaxiquement faux (critere etc mal programme') |
| 97 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 97 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 98 | 98 | erreur_squelette($msg, $boucle); |
| 99 | 99 | // continuer pour trouver d'autres fautes eventuelles |
| 100 | 100 | // mais prevenir que c'est mort |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | if (defined('_VAR_MODE') and _VAR_MODE == 'debug') { |
| 124 | 124 | // Tracer ce qui vient d'etre compile |
| 125 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 125 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 126 | 126 | |
| 127 | 127 | // si c'est ce que demande le debusqueur, lui passer la main |
| 128 | 128 | if ( |
@@ -146,13 +146,13 @@ discard block |
||
| 146 | 146 | $code = " |
| 147 | 147 | /* |
| 148 | 148 | * Squelette : $sourcefile |
| 149 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 150 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 151 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 149 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 150 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 151 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 152 | 152 | */ '; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n"; |
|
| 155 | + $code = '<'."?php\n".$code.join('', $boucles)."\n"; |
|
| 156 | 156 | if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) { |
| 157 | 157 | ecrire_fichier($phpfile, $code); |
| 158 | 158 | } |
@@ -214,18 +214,18 @@ discard block |
||
| 214 | 214 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 215 | 215 | |
| 216 | 216 | if ($j == 'X-Spip-Filtre' and isset($headers[$j])) { |
| 217 | - $headers[$j] .= '|' . $r[3]; |
|
| 217 | + $headers[$j] .= '|'.$r[3]; |
|
| 218 | 218 | } else { |
| 219 | - $headers[$j] = str_replace(['\\\\',"\\'",'\\"'], ['\\',"'",'"'], $r[3]); |
|
| 219 | + $headers[$j] = str_replace(['\\\\', "\\'", '\\"'], ['\\', "'", '"'], $r[3]); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | // S'agit-il d'un resultat constant ou contenant du code php |
| 224 | 224 | $process_ins = ( |
| 225 | - strpos($corps, '<' . '?') === false |
|
| 225 | + strpos($corps, '<'.'?') === false |
|
| 226 | 226 | or |
| 227 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 228 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 227 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 228 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 229 | 229 | ) |
| 230 | 230 | ? 'html' |
| 231 | 231 | : 'php'; |
@@ -254,10 +254,10 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | if ($process_ins == 'html') { |
| 256 | 256 | $skel['process_ins'] = ( |
| 257 | - strpos($corps, '<' . '?') === false |
|
| 257 | + strpos($corps, '<'.'?') === false |
|
| 258 | 258 | or |
| 259 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 260 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 259 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 260 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 261 | 261 | ) |
| 262 | 262 | ? 'html' |
| 263 | 263 | : 'php'; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | // |
| 276 | 276 | |
| 277 | 277 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 278 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 278 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 279 | 279 | include_once("%s"); |
| 280 | 280 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 281 | 281 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | // pas de lien symbolique sous Windows |
| 307 | 307 | and !(stristr(PHP_OS, 'WIN') and str_contains($file, ':')) |
| 308 | 308 | ) { |
| 309 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 309 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | $lang = $context_compil[4]; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | $args = array_map('argumenter_squelette', $args); |
| 318 | 318 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 319 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 319 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 320 | 320 | } |
| 321 | 321 | $args = join(', ', $args); |
| 322 | 322 | |
@@ -350,14 +350,14 @@ discard block |
||
| 350 | 350 | if (is_object($v)) { |
| 351 | 351 | return var_export($v, true); |
| 352 | 352 | } elseif (!is_array($v)) { |
| 353 | - return "'" . texte_script((string) $v) . "'"; |
|
| 353 | + return "'".texte_script((string) $v)."'"; |
|
| 354 | 354 | } else { |
| 355 | 355 | $out = []; |
| 356 | 356 | foreach ($v as $k => $val) { |
| 357 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 357 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - return 'array(' . join(', ', $out) . ')'; |
|
| 360 | + return 'array('.join(', ', $out).')'; |
|
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | } |
| 383 | 383 | else { |
| 384 | 384 | $str_args = base64_encode(serialize($args)); |
| 385 | - return '<?' . "php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?" . ">\n"; |
|
| 385 | + return '<?'."php \$_zargs=unserialize(base64_decode('$str_args'));echo executer_balise_dynamique(...\$_zargs); ?".">\n"; |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | // Y a-t-il une fonction de traitement des arguments ? |
| 463 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 463 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 464 | 464 | |
| 465 | 465 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 466 | 466 | |
@@ -470,18 +470,18 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | // verifier que la fonction dyn est la, |
| 472 | 472 | // sinon se replier sur la generique si elle existe |
| 473 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 473 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 474 | 474 | if ( |
| 475 | 475 | $balise_generique = chercher_balise_generique($nom) |
| 476 | 476 | and $nom_balise_generique = $balise_generique['nom_generique'] |
| 477 | - and $file = include_spip('balise/' . strtolower($nom_balise_generique)) |
|
| 478 | - and function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 477 | + and $file = include_spip('balise/'.strtolower($nom_balise_generique)) |
|
| 478 | + and function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 479 | 479 | ) { |
| 480 | 480 | // et lui injecter en premier arg le nom de la balise |
| 481 | 481 | array_unshift($r, $nom); |
| 482 | 482 | $nom_balise = $nom_balise_generique; |
| 483 | 483 | if (!_DIR_RESTREINT) { |
| 484 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 484 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 485 | 485 | } |
| 486 | 486 | } else { |
| 487 | 487 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | $n = ''; |
| 583 | 583 | foreach (explode(',', $liste) as $val) { |
| 584 | 584 | if ($a = intval($val) and $val === strval($a)) { |
| 585 | - $n .= ',' . $val; |
|
| 585 | + $n .= ','.$val; |
|
| 586 | 586 | } |
| 587 | 587 | } |
| 588 | 588 | if (strlen($n)) { |
@@ -761,8 +761,8 @@ discard block |
||
| 761 | 761 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 762 | 762 | $i = 0; |
| 763 | 763 | do { |
| 764 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 765 | - [$sous[1] . ' AS id'], |
|
| 764 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 765 | + [$sous[1].' AS id'], |
|
| 766 | 766 | $from, |
| 767 | 767 | $from_type, |
| 768 | 768 | $wheresub, |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | $id, |
| 776 | 776 | $serveur, |
| 777 | 777 | false |
| 778 | - ) . ')'); |
|
| 778 | + ).')'); |
|
| 779 | 779 | if (!$i) { |
| 780 | 780 | $i = 1; |
| 781 | 781 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | if ($sous[0] == 'SUBSELECT') { |
| 796 | 796 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 797 | 797 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 798 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 798 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 799 | 799 | $sous[1], # select |
| 800 | 800 | $sous[2], #from |
| 801 | 801 | [], #from_type |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | $id, |
| 811 | 811 | $serveur, |
| 812 | 812 | false |
| 813 | - ) . ')'); |
|
| 813 | + ).')'); |
|
| 814 | 814 | } |
| 815 | 815 | array_pop($where_simples); |
| 816 | 816 | } |
@@ -873,15 +873,15 @@ discard block |
||
| 873 | 873 | // sans recours a preg_match |
| 874 | 874 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 875 | 875 | $afrom[$t][$cle] = [ |
| 876 | - "\n" . |
|
| 877 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 876 | + "\n". |
|
| 877 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 878 | 878 | $from[$cle], |
| 879 | 879 | "AS $cle", |
| 880 | 880 | 'ON (', |
| 881 | 881 | "$cle.$c", |
| 882 | 882 | '=', |
| 883 | 883 | "$t.$carr", |
| 884 | - ($and ? 'AND ' . $and : '') . |
|
| 884 | + ($and ? 'AND '.$and : ''). |
|
| 885 | 885 | ')' |
| 886 | 886 | ]; |
| 887 | 887 | if (isset($afrom[$cle])) { |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | $t = key($from); |
| 920 | 920 | $c = current($from); |
| 921 | 921 | reset($from); |
| 922 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 922 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 923 | 923 | if ( |
| 924 | 924 | !(strpos($t, ' ') or // jointure des le depart cf boucle_doc |
| 925 | 925 | calculer_jointnul($t, $select, $e) or |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | unset($afrom[$t][$nt]); |
| 938 | 938 | $afrom[$nt] = $afrom[$t]; |
| 939 | 939 | unset($afrom[$t]); |
| 940 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 940 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 941 | 941 | $t = $nfrom[4]; |
| 942 | 942 | $alias = ''; |
| 943 | 943 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -948,14 +948,14 @@ discard block |
||
| 948 | 948 | if ($newcle != $oldcle) { |
| 949 | 949 | // si l'ancienne cle etait deja dans le select avec un AS |
| 950 | 950 | // reprendre simplement ce AS |
| 951 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 951 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 952 | 952 | if (preg_match($as, implode(',', $select), $m)) { |
| 953 | 953 | $alias = ''; |
| 954 | 954 | } else { |
| 955 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 955 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 958 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 959 | 959 | $join = remplacer_jointnul($t, $join, $e); |
| 960 | 960 | $where = remplacer_jointnul($t, $where, $e); |
| 961 | 961 | $having = remplacer_jointnul($t, $having, $e); |
@@ -1005,9 +1005,9 @@ discard block |
||
| 1005 | 1005 | } else { |
| 1006 | 1006 | $exp = ''; |
| 1007 | 1007 | if (strtoupper($join) === 'AND') { |
| 1008 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1008 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 1009 | 1009 | } else { |
| 1010 | - return $exp . join($join, $v); |
|
| 1010 | + return $exp.join($join, $v); |
|
| 1011 | 1011 | } |
| 1012 | 1012 | } |
| 1013 | 1013 | } |
@@ -1069,6 +1069,6 @@ discard block |
||
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | return $mime_type |
| 1072 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1073 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1072 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1073 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1074 | 1074 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $select = true |
| 127 | 127 | ) { |
| 128 | 128 | if (!is_string($defaut)) { |
| 129 | - $defaut = '($Pile[0][\'' . strtolower($nom_champ) . '\'] ?? null)'; |
|
| 129 | + $defaut = '($Pile[0][\''.strtolower($nom_champ).'\'] ?? null)'; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $idb_origine = $idb; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | // renseigner la boucle source de ce champ pour les traitements |
| 161 | 161 | $boucles[$idb_origine]->index_champ[$nom_champ_origine] = $idb; |
| 162 | - $champ = '$Pile[$SP' . ($i ? "-$i" : '') . '][\'' . $c . '\']'; |
|
| 162 | + $champ = '$Pile[$SP'.($i ? "-$i" : '').'][\''.$c.'\']'; |
|
| 163 | 163 | if (!$joker) { |
| 164 | 164 | return index_compose($conditionnel, $champ); |
| 165 | 165 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | function index_compose($conditionnel, $defaut) { |
| 201 | 201 | while ($c = array_pop($conditionnel)) { |
| 202 | 202 | // si on passe defaut = '', ne pas générer d'erreur de compilation. |
| 203 | - $defaut = "($c:(" . ($defaut ?: "''") . '))'; |
|
| 203 | + $defaut = "($c:(".($defaut ?: "''").'))'; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | return $defaut; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | if (!$r) { |
| 248 | 248 | $joker = false; // indiquer a l'appelant |
| 249 | 249 | # continuer pour chercher l'erreur suivante |
| 250 | - return ["'#" . $r . ':' . $nom_champ . "'", '']; |
|
| 250 | + return ["'#".$r.':'.$nom_champ."'", '']; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $desc = $boucles[$idb]->show; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | if (preg_match('/^(.*)\.(.*)$/', $nom_champ, $r)) { |
| 291 | 291 | [, $_table, $_nom_champ] = $r; |
| 292 | 292 | if ($cle = trouver_jointure_champ($_nom_champ, $boucles[$idb], [$_table])) { |
| 293 | - $_alias = $cle . '_' . $_nom_champ; |
|
| 293 | + $_alias = $cle.'_'.$_nom_champ; |
|
| 294 | 294 | return index_exception( |
| 295 | 295 | $boucles[$idb], |
| 296 | 296 | $desc, |
@@ -371,8 +371,8 @@ discard block |
||
| 371 | 371 | $t = $index_exception_derogatoire($boucle, $desc, $nom_champ, $excep); |
| 372 | 372 | } |
| 373 | 373 | if ($t == null) { |
| 374 | - [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | - $excep = $x; #PHP5 de droite a gauche ! |
|
| 374 | + [$e, $x] = $excep; #PHP4 affecte de gauche a droite |
|
| 375 | + $excep = $x; #PHP5 de droite a gauche ! |
|
| 376 | 376 | $j = $trouver_table($e, $boucle->sql_serveur); |
| 377 | 377 | if (!$j) { |
| 378 | 378 | return ['', '']; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $l = (preg_split('/\s*,\s*/', $k)); |
| 385 | 385 | $k = $desc['key']['PRIMARY KEY']; |
| 386 | 386 | if (!in_array($k, $l)) { |
| 387 | - spip_log("jointure impossible $e " . implode(',', $l)); |
|
| 387 | + spip_log("jointure impossible $e ".implode(',', $l)); |
|
| 388 | 388 | |
| 389 | 389 | return ['', '']; |
| 390 | 390 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // demander a SQL de gerer le synonyme |
| 401 | 401 | // ca permet que excep soit dynamique (Cedric, 2/3/06) |
| 402 | 402 | if ($excep != $nom_champ) { |
| 403 | - $excep .= ' AS ' . $nom_champ; |
|
| 403 | + $excep .= ' AS '.$nom_champ; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | return ["$t.$excep", $nom_champ]; |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | implode(',', $collecte), |
| 649 | 649 | ($collecte ? $param : substr($param, 1)), # virer la virgule |
| 650 | 650 | memoriser_contexte_compil($p), |
| 651 | - ($supp ? ', ' . implode(',', $supp) : ('')) |
|
| 651 | + ($supp ? ', '.implode(',', $supp) : ('')) |
|
| 652 | 652 | ); |
| 653 | 653 | |
| 654 | 654 | $p->interdire_scripts = false; |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | * @return array |
| 683 | 683 | * Liste des codes PHP d'éxecution des balises collectées |
| 684 | 684 | **/ |
| 685 | -function collecter_balise_dynamique(array $l, Champ &$p, string $nom): array { |
|
| 685 | +function collecter_balise_dynamique(array $l, Champ & $p, string $nom): array { |
|
| 686 | 686 | $args = []; |
| 687 | 687 | foreach ($l as $c) { |
| 688 | 688 | if ($c === null) { |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | $nom = $p->id_boucle; |
| 748 | 748 | |
| 749 | 749 | if ($nom && trouver_nom_serveur_distant($p)) { |
| 750 | - spip_log($nom . ':' . $p->nom_champ . ' ' . _T('zbug_distant_interdit')); |
|
| 750 | + spip_log($nom.':'.$p->nom_champ.' '._T('zbug_distant_interdit')); |
|
| 751 | 751 | |
| 752 | 752 | return false; |
| 753 | 753 | } |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | && $p->descr['documents'] |
| 824 | 824 | && (str_contains($ps, 'propre') || str_contains($ps, 'typo')) |
| 825 | 825 | ) { |
| 826 | - $ps = 'traiter_doublons_documents($doublons, ' . $ps . ')'; |
|
| 826 | + $ps = 'traiter_doublons_documents($doublons, '.$ps.')'; |
|
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | // La protection des champs par |safehtml est assuree par les extensions |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | function compose_filtres_args($p, $args, $sep) { |
| 928 | 928 | $arglist = ''; |
| 929 | 929 | foreach ($args as $arg) { |
| 930 | - $arglist .= $sep . |
|
| 930 | + $arglist .= $sep. |
|
| 931 | 931 | calculer_liste($arg, $p->descr, $p->boucles, $p->id_boucle); |
| 932 | 932 | } |
| 933 | 933 | |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | while ($b != '') { |
| 978 | 978 | foreach ($p->boucles[$b]->criteres as $critere) { |
| 979 | 979 | if ($critere->op == $motif) { |
| 980 | - $p->code = '$Pile[$SP' . (($n == 0) ? '' : "-$n") . |
|
| 980 | + $p->code = '$Pile[$SP'.(($n == 0) ? '' : "-$n"). |
|
| 981 | 981 | "]['$champ']"; |
| 982 | 982 | $b = ''; |
| 983 | 983 | break 2; |
@@ -1005,6 +1005,6 @@ discard block |
||
| 1005 | 1005 | */ |
| 1006 | 1006 | function zbug_presenter_champ($p, $champ = '') { |
| 1007 | 1007 | $balise = $champ ?: $p->nom_champ; |
| 1008 | - $explicite = $p->nom_boucle ? $p->nom_boucle . ':' : ''; |
|
| 1008 | + $explicite = $p->nom_boucle ? $p->nom_boucle.':' : ''; |
|
| 1009 | 1009 | return "#{$explicite}{$balise}"; |
| 1010 | 1010 | } |
@@ -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($texte, (string) "%$sep")) !== false) { |
| 456 | - if (!preg_match(',^%' . preg_quote($sep, ',') . '([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 456 | + if (!preg_match(',^%'.preg_quote($sep, ',').'([0-9]+)@,', substr($texte, $p), $m)) { |
|
| 457 | 457 | break; |
| 458 | 458 | } |
| 459 | 459 | $debut = substr($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($texte, 0, strpos($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-]+) *(/) *(.+) *$,', $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', $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', $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($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($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($id_boucle)) { |
| 928 | - $pos_anonyme_next = strpos($texte, BALISE_BOUCLE . '(', $pos_courante); |
|
| 928 | + $pos_anonyme_next = strpos($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($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($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($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($texte, $boucle_placeholder)); |
| 1028 | 1028 | } |
| 1029 | 1029 | |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | |
| 1044 | 1044 | // boucle anonyme ? |
| 1045 | 1045 | if (!strlen($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($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($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($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($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 | |