@@ -93,7 +93,7 @@ |
||
| 93 | 93 | |
| 94 | 94 | $res = ltrim($res['texte']); |
| 95 | 95 | if (empty($res)) { |
| 96 | - spip_log("$arg $qs resultat vide", 'transmettre' . _LOG_INFO_IMPORTANTE); |
|
| 96 | + spip_log("$arg $qs resultat vide", 'transmettre'._LOG_INFO_IMPORTANTE); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | echo $res; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $boucle = &$boucles[$idb]; |
| 48 | 48 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 49 | 49 | |
| 50 | - $c = ["'='", "'$boucle->id_table." . "$id_parent'", 0]; |
|
| 50 | + $c = ["'='", "'$boucle->id_table."."$id_parent'", 0]; |
|
| 51 | 51 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | $id = $boucle->primary; |
| 71 | 71 | |
| 72 | 72 | if ($not or !$id) { |
| 73 | - return (['zbug_critere_inconnu', ['critere' => $not . $crit->op]]); |
|
| 73 | + return (['zbug_critere_inconnu', ['critere' => $not.$crit->op]]); |
|
| 74 | 74 | } |
| 75 | 75 | $arg = kwote(calculer_argument_precedent($idb, $id, $boucles)); |
| 76 | - $boucle->where[] = ["'!='", "'$boucle->id_table." . "$id'", $arg]; |
|
| 76 | + $boucle->where[] = ["'!='", "'$boucle->id_table."."$id'", $arg]; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $not = ($crit->not ? '' : 'NOT'); |
| 105 | 105 | |
| 106 | 106 | // le doublon s'applique sur un type de boucle (article) |
| 107 | - $nom = "'" . $boucle->type_requete . "'"; |
|
| 107 | + $nom = "'".$boucle->type_requete."'"; |
|
| 108 | 108 | |
| 109 | 109 | // compléter le nom avec un nom précisé {doublons nom} |
| 110 | 110 | // on obtient $nom = "'article' . 'nom'" |
| 111 | 111 | if (isset($crit->param[0])) { |
| 112 | - $nom .= '.' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 112 | + $nom .= '.'.calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // code qui déclarera l'index du stockage de nos doublons (pour éviter une notice PHP) |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | // $doublons et son index, ici $nom |
| 122 | 122 | |
| 123 | 123 | // debut du code "sql_in('articles.id_article', " |
| 124 | - $debut_in = "sql_in('" . $boucle->id_table . '.' . $primary . "', "; |
|
| 124 | + $debut_in = "sql_in('".$boucle->id_table.'.'.$primary."', "; |
|
| 125 | 125 | // lecture des données du doublon "$doublons[$doublon_index[] = " |
| 126 | 126 | // Attention : boucle->doublons désigne une variable qu'on affecte |
| 127 | - $debut_doub = '$doublons[' . (!$not ? '' : ($boucle->doublons . '[]= ')); |
|
| 127 | + $debut_doub = '$doublons['.(!$not ? '' : ($boucle->doublons.'[]= ')); |
|
| 128 | 128 | |
| 129 | 129 | // le debut complet du code des doublons |
| 130 | - $debut_doub = $debut_in . $debut_doub; |
|
| 130 | + $debut_doub = $debut_in.$debut_doub; |
|
| 131 | 131 | |
| 132 | 132 | // nom du doublon "('article' . 'nom')]" |
| 133 | 133 | $fin_doub = "($nom)]"; |
@@ -137,22 +137,22 @@ discard block |
||
| 137 | 137 | foreach ($boucle->where as $k => $w) { |
| 138 | 138 | if (strpos($w[0], $debut_doub) === 0) { |
| 139 | 139 | // fusionner le sql_in (du where) |
| 140 | - $boucle->where[$k][0] = $debut_doub . $fin_doub . ' . ' . substr($w[0], strlen($debut_in)); |
|
| 140 | + $boucle->where[$k][0] = $debut_doub.$fin_doub.' . '.substr($w[0], strlen($debut_in)); |
|
| 141 | 141 | // fusionner l'initialisation (du hash) pour faire plus joli |
| 142 | 142 | $x = strpos($boucle->hash, $init_comment); |
| 143 | 143 | $len = strlen($init_comment); |
| 144 | 144 | $boucle->hash = |
| 145 | - substr($boucle->hash, 0, $x + $len) . $init_code . substr($boucle->hash, $x + $len); |
|
| 145 | + substr($boucle->hash, 0, $x + $len).$init_code.substr($boucle->hash, $x + $len); |
|
| 146 | 146 | |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // mettre l'ensemble dans un tableau pour que ce ne soit pas vu comme une constante |
| 152 | - $boucle->where[] = [$debut_doub . $fin_doub . ", '" . $not . "')"]; |
|
| 152 | + $boucle->where[] = [$debut_doub.$fin_doub.", '".$not."')"]; |
|
| 153 | 153 | |
| 154 | 154 | // déclarer le doublon s'il n'existe pas encore |
| 155 | - $boucle->hash .= $init_comment . $init_code; |
|
| 155 | + $boucle->hash .= $init_comment.$init_code; |
|
| 156 | 156 | |
| 157 | 157 | |
| 158 | 158 | # la ligne suivante avait l'intention d'eviter une collecte deja faite |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $deux = $deux[0]->texte; |
| 215 | 215 | if ($deux) { |
| 216 | 216 | $boucles[$idb]->limit = |
| 217 | - 'intval($Pile[0]["debut' . $un . '"]) . ",' . $deux . '"'; |
|
| 217 | + 'intval($Pile[0]["debut'.$un.'"]) . ",'.$deux.'"'; |
|
| 218 | 218 | } else { |
| 219 | 219 | calculer_critere_DEFAUT_dist($idb, $boucles, $crit); |
| 220 | 220 | } |
@@ -276,26 +276,26 @@ discard block |
||
| 276 | 276 | $type = calculer_liste([$crit->param[1][0]], $idb, $boucles, $boucle->id_parent); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut" . substr($type, 1)); |
|
| 279 | + $debut = ($type[0] !== "'") ? "'debut'.$type" : ("'debut".substr($type, 1)); |
|
| 280 | 280 | $boucle->modificateur['debut_nom'] = $type; |
| 281 | 281 | $partie = |
| 282 | 282 | // tester si le numero de page demande est de la forme '@yyy' |
| 283 | - 'isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : _request(' . $debut . ");\n" |
|
| 283 | + 'isset($Pile[0]['.$debut.']) ? $Pile[0]['.$debut.'] : _request('.$debut.");\n" |
|
| 284 | 284 | . "\tif (\$debut_boucle && \$debut_boucle[0] === '@') {\n" |
| 285 | - . "\t\t" . '$debut_boucle = $Pile[0][' . $debut . '] = quete_debut_pagination(\'' . $boucle->primary . '\',$Pile[0][\'@' . $boucle->primary . '\'] = substr($debut_boucle,1),' . $pas . ',$iter);' . "\n" |
|
| 286 | - . "\t\t" . '$iter->seek(0);' . "\n" |
|
| 285 | + . "\t\t".'$debut_boucle = $Pile[0]['.$debut.'] = quete_debut_pagination(\''.$boucle->primary.'\',$Pile[0][\'@'.$boucle->primary.'\'] = substr($debut_boucle,1),'.$pas.',$iter);'."\n" |
|
| 286 | + . "\t\t".'$iter->seek(0);'."\n" |
|
| 287 | 287 | . "\t}\n" |
| 288 | - . "\t" . '$debut_boucle = intval($debut_boucle)'; |
|
| 288 | + . "\t".'$debut_boucle = intval($debut_boucle)'; |
|
| 289 | 289 | |
| 290 | 290 | $boucle->hash .= ' |
| 291 | - $command[\'pagination\'] = array((isset($Pile[0][' . $debut . ']) ? $Pile[0][' . $debut . '] : null), ' . $pas . ');'; |
|
| 291 | + $command[\'pagination\'] = array((isset($Pile[0][' . $debut.']) ? $Pile[0]['.$debut.'] : null), '.$pas.');'; |
|
| 292 | 292 | |
| 293 | 293 | $boucle->total_parties = $pas; |
| 294 | 294 | calculer_parties($boucles, $idb, $partie, 'p+'); |
| 295 | 295 | // ajouter la cle primaire dans le select pour pouvoir gerer la pagination referencee par @id |
| 296 | 296 | // sauf si pas de primaire, ou si primaire composee |
| 297 | 297 | // dans ce cas, on ne sait pas gerer une pagination indirecte |
| 298 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 298 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 299 | 299 | if ( |
| 300 | 300 | $boucle->primary |
| 301 | 301 | and !preg_match('/[,\s]/', $boucle->primary) |
@@ -342,24 +342,24 @@ discard block |
||
| 342 | 342 | $boucle->hash .= ' |
| 343 | 343 | // RECHERCHE' |
| 344 | 344 | . ($crit->cond ? ' |
| 345 | - if (!strlen(' . $quoi . ')){ |
|
| 345 | + if (!strlen(' . $quoi.')){ |
|
| 346 | 346 | list($rech_select, $rech_where) = array("0 as points",""); |
| 347 | - } else' : '') . ' |
|
| 347 | + } else' : '').' |
|
| 348 | 348 | { |
| 349 | 349 | $prepare_recherche = charger_fonction(\'prepare_recherche\', \'inc\'); |
| 350 | - list($rech_select, $rech_where) = $prepare_recherche(' . $quoi . ', "' . $boucle->id_table . '", "' . $crit->cond . '","' . $boucle->sql_serveur . '",' . $_modificateur . ',"' . $boucle->primary . '"); |
|
| 350 | + list($rech_select, $rech_where) = $prepare_recherche(' . $quoi.', "'.$boucle->id_table.'", "'.$crit->cond.'","'.$boucle->sql_serveur.'",'.$_modificateur.',"'.$boucle->primary.'"); |
|
| 351 | 351 | } |
| 352 | 352 | '; |
| 353 | 353 | |
| 354 | 354 | |
| 355 | - $t = $boucle->id_table . '.' . $boucle->primary; |
|
| 355 | + $t = $boucle->id_table.'.'.$boucle->primary; |
|
| 356 | 356 | if (!in_array($t, $boucles[$idb]->select)) { |
| 357 | 357 | $boucle->select[] = $t; |
| 358 | 358 | } # pour postgres, neuneu ici |
| 359 | 359 | // jointure uniquement sur le serveur principal |
| 360 | 360 | // (on ne peut joindre une table d'un serveur distant avec la table des resultats du serveur principal) |
| 361 | 361 | if (!$boucle->sql_serveur) { |
| 362 | - $boucle->join['resultats'] = ["'" . $boucle->id_table . "'", "'id'", "'" . $boucle->primary . "'"]; |
|
| 362 | + $boucle->join['resultats'] = ["'".$boucle->id_table."'", "'id'", "'".$boucle->primary."'"]; |
|
| 363 | 363 | $boucle->from['resultats'] = 'spip_resultats'; |
| 364 | 364 | } |
| 365 | 365 | $boucle->select[] = '$rech_select'; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $c = |
| 427 | 427 | [ |
| 428 | 428 | "'OR'", |
| 429 | - ["'='", "'$table." . "id_trad'", "'$table.$prim'"], |
|
| 429 | + ["'='", "'$table."."id_trad'", "'$table.$prim'"], |
|
| 430 | 430 | ["'='", "'$table.id_trad'", "'0'"] |
| 431 | 431 | ]; |
| 432 | 432 | $boucle->where[] = ($crit->not ? ["'NOT'", $c] : $c); |
@@ -449,13 +449,13 @@ discard block |
||
| 449 | 449 | $boucle = &$boucles[$idb]; |
| 450 | 450 | $arg = kwote(calculer_argument_precedent($idb, 'id_parent', $boucles)); |
| 451 | 451 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 452 | - $mparent = $boucle->id_table . '.' . $id_parent; |
|
| 452 | + $mparent = $boucle->id_table.'.'.$id_parent; |
|
| 453 | 453 | |
| 454 | 454 | if ($boucle->type_requete == 'rubriques' or isset($GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'])) { |
| 455 | 455 | $boucle->where[] = ["'='", "'$mparent'", $arg]; |
| 456 | 456 | } // le cas FORUMS est gere dans le plugin forum, dans la fonction critere_FORUMS_meme_parent_dist() |
| 457 | 457 | else { |
| 458 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $boucle->type_requete]]); |
|
| 458 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.$boucle->type_requete]]); |
|
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | 461 | |
@@ -508,16 +508,15 @@ discard block |
||
| 508 | 508 | if (count(trouver_champs_decomposes($champ, $desc)) > 1) { |
| 509 | 509 | $decompose = decompose_champ_id_objet($champ); |
| 510 | 510 | $champ = array_shift($decompose); |
| 511 | - $boucle->where[] = ["'='", _q($cle . '.' . reset($decompose)), '"' . sql_quote(end($decompose)) . '"']; |
|
| 511 | + $boucle->where[] = ["'='", _q($cle.'.'.reset($decompose)), '"'.sql_quote(end($decompose)).'"']; |
|
| 512 | 512 | } |
| 513 | 513 | } else { |
| 514 | 514 | $cle = $boucle->id_table; |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $c = "sql_in('$cle" . ".$champ', calcul_branche_in($arg)" |
|
| 518 | - . ($not ? ", 'NOT'" : '') . ')'; |
|
| 519 | - $boucle->where[] = !$crit->cond ? $c : |
|
| 520 | - ("($arg ? $c : " . ($not ? "'0=1'" : "'1=1'") . ')'); |
|
| 517 | + $c = "sql_in('$cle".".$champ', calcul_branche_in($arg)" |
|
| 518 | + . ($not ? ", 'NOT'" : '').')'; |
|
| 519 | + $boucle->where[] = !$crit->cond ? $c : ("($arg ? $c : ".($not ? "'0=1'" : "'1=1'").')'); |
|
| 521 | 520 | } |
| 522 | 521 | |
| 523 | 522 | /** |
@@ -537,9 +536,9 @@ discard block |
||
| 537 | 536 | $not = ($crit->not ? 'NOT' : ''); |
| 538 | 537 | $serveur = $boucle->sql_serveur; |
| 539 | 538 | |
| 540 | - $c = "sql_in('" . |
|
| 541 | - $boucle->id_table . '.' . $boucle->primary |
|
| 542 | - . "', lister_objets_avec_logos('" . $boucle->primary . "'), '$not', '$serveur')"; |
|
| 539 | + $c = "sql_in('". |
|
| 540 | + $boucle->id_table.'.'.$boucle->primary |
|
| 541 | + . "', lister_objets_avec_logos('".$boucle->primary."'), '$not', '$serveur')"; |
|
| 543 | 542 | |
| 544 | 543 | $boucle->where[] = $c; |
| 545 | 544 | } |
@@ -571,7 +570,7 @@ discard block |
||
| 571 | 570 | $t = table_objet_sql($r[1]); |
| 572 | 571 | $t = array_search($t, $boucles[$idb]->from); |
| 573 | 572 | if ($t) { |
| 574 | - $t .= '.' . $r[2]; |
|
| 573 | + $t .= '.'.$r[2]; |
|
| 575 | 574 | } |
| 576 | 575 | } |
| 577 | 576 | } else { |
@@ -586,7 +585,7 @@ discard block |
||
| 586 | 585 | $boucles[$idb]->select[] = $t; |
| 587 | 586 | } |
| 588 | 587 | } else { |
| 589 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 588 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 590 | 589 | } |
| 591 | 590 | } |
| 592 | 591 | |
@@ -656,25 +655,25 @@ discard block |
||
| 656 | 655 | (false !== $i = strpos($boucle->order[$n - 1], 'ASC')) |
| 657 | 656 | or (false !== $i = strpos($boucle->order[$n - 1], 'DESC')) |
| 658 | 657 | ) { |
| 659 | - $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . " . $boucle->modificateur['collate'] . " . ' ", $i, 0); |
|
| 658 | + $boucle->order[$n - 1] = substr_replace($boucle->order[$n - 1], "' . ".$boucle->modificateur['collate']." . ' ", $i, 0); |
|
| 660 | 659 | } else { |
| 661 | - $boucle->order[$n - 1] .= ' . ' . $boucle->modificateur['collate']; |
|
| 660 | + $boucle->order[$n - 1] .= ' . '.$boucle->modificateur['collate']; |
|
| 662 | 661 | } |
| 663 | 662 | } |
| 664 | 663 | } else { |
| 665 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . (is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 664 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' '.(is_countable($boucles[$idb]->order) ? count($boucles[$idb]->order) : 0)]]); |
|
| 666 | 665 | } |
| 667 | 666 | } |
| 668 | 667 | |
| 669 | 668 | function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') { |
| 670 | 669 | $boucle = $boucles[$idb]; |
| 671 | - $alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')'; |
|
| 672 | - $var = '$champs_' . $idb; |
|
| 670 | + $alt = "('".$boucle->id_table.'.\' . $x'.$suffix.')'; |
|
| 671 | + $var = '$champs_'.$idb; |
|
| 673 | 672 | $desc = (strpos($boucle->in, (string) "static $var =") !== false); |
| 674 | 673 | if (!$desc) { |
| 675 | 674 | $desc = $boucle->show['field']; |
| 676 | 675 | $desc = implode(',', array_map('_q', array_keys($desc))); |
| 677 | - $boucles[$idb]->in .= "\n\tstatic $var = array(" . $desc . ');'; |
|
| 676 | + $boucles[$idb]->in .= "\n\tstatic $var = array(".$desc.');'; |
|
| 678 | 677 | } |
| 679 | 678 | if ($desc) { |
| 680 | 679 | $alt = "(in_array(\$x, $var) ? $alt :(\$x$suffix))"; |
@@ -749,7 +748,7 @@ discard block |
||
| 749 | 748 | $sens = " . ' DESC'"; |
| 750 | 749 | } |
| 751 | 750 | if (isset($boucle->modificateur['collate'])) { |
| 752 | - $collecte = ' . ' . $boucle->modificateur['collate']; |
|
| 751 | + $collecte = ' . '.$boucle->modificateur['collate']; |
|
| 753 | 752 | } |
| 754 | 753 | |
| 755 | 754 | // Pour chaque paramètre du critère |
@@ -771,14 +770,14 @@ discard block |
||
| 771 | 770 | if (preg_match(',^(\w+)[\s]+(.*)$,', $par, $m)) { |
| 772 | 771 | $expression = trim($m[1]); |
| 773 | 772 | $champ = trim($m[2]); |
| 774 | - if (function_exists($f = 'calculer_critere_par_expression_' . $expression)) { |
|
| 773 | + if (function_exists($f = 'calculer_critere_par_expression_'.$expression)) { |
|
| 775 | 774 | $order = $f($idb, $boucles, $crit, $tri, $champ); |
| 776 | 775 | } else { |
| 777 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 776 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 778 | 777 | } |
| 779 | 778 | |
| 780 | 779 | // tris de la forme {par champ} ou {par FONCTION(champ)} |
| 781 | - } elseif ($boucle->type_requete == 'DATA' or preg_match(',^' . CHAMP_SQL_PLUS_FONC . '$,is', $par, $match)) { |
|
| 780 | + } elseif ($boucle->type_requete == 'DATA' or preg_match(',^'.CHAMP_SQL_PLUS_FONC.'$,is', $par, $match)) { |
|
| 782 | 781 | // {par FONCTION(champ)} |
| 783 | 782 | if (isset($match) and count($match) > 2) { |
| 784 | 783 | $par = substr($match[2], 1, -1); |
@@ -788,7 +787,7 @@ discard block |
||
| 788 | 787 | if ($par == 'hasard') { |
| 789 | 788 | $order = calculer_critere_par_hasard($idb, $boucles, $crit); |
| 790 | 789 | } elseif ($par == 'date' and !empty($boucle->show['date'])) { |
| 791 | - $order = "'" . $boucle->id_table . '.' . $boucle->show['date'] . "'"; |
|
| 790 | + $order = "'".$boucle->id_table.'.'.$boucle->show['date']."'"; |
|
| 792 | 791 | } else { |
| 793 | 792 | // cas général {par champ}, {par table.champ}, ... |
| 794 | 793 | $order = calculer_critere_par_champ($idb, $boucles, $crit, $par); |
@@ -797,7 +796,7 @@ discard block |
||
| 797 | 796 | |
| 798 | 797 | // on ne sait pas traiter… |
| 799 | 798 | else { |
| 800 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 799 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 801 | 800 | } |
| 802 | 801 | |
| 803 | 802 | // En cas d'erreur de squelette retournée par une fonction |
@@ -817,14 +816,14 @@ discard block |
||
| 817 | 816 | |
| 818 | 817 | if ($fct) { |
| 819 | 818 | if (preg_match("/^\s*'(.*)'\s*$/", $order, $r)) { |
| 820 | - $order = "'$fct(" . $r[1] . ")'"; |
|
| 819 | + $order = "'$fct(".$r[1].")'"; |
|
| 821 | 820 | } else { |
| 822 | 821 | $order = "'$fct(' . $order . ')'"; |
| 823 | 822 | } |
| 824 | 823 | } |
| 825 | - $t = $order . $collecte . $sens; |
|
| 824 | + $t = $order.$collecte.$sens; |
|
| 826 | 825 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 827 | - $t = $r[1] . $r[2]; |
|
| 826 | + $t = $r[1].$r[2]; |
|
| 828 | 827 | } |
| 829 | 828 | |
| 830 | 829 | $boucle->order[] = $t; |
@@ -874,16 +873,16 @@ discard block |
||
| 874 | 873 | function calculer_critere_par_expression_num($idb, &$boucles, $crit, $tri, $champ) { |
| 875 | 874 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 876 | 875 | if (is_array($_champ)) { |
| 877 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " num $champ"]]; |
|
| 876 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." num $champ"]]; |
|
| 878 | 877 | } |
| 879 | 878 | $boucle = &$boucles[$idb]; |
| 880 | - $texte = '0+' . $_champ; |
|
| 879 | + $texte = '0+'.$_champ; |
|
| 881 | 880 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 882 | 881 | if ($suite !== "''") { |
| 883 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 882 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 884 | 883 | } |
| 885 | - $asnum = 'num' . ($boucle->order ? count($boucle->order) : ''); |
|
| 886 | - $boucle->select[] = $texte . " AS $asnum"; |
|
| 884 | + $asnum = 'num'.($boucle->order ? count($boucle->order) : ''); |
|
| 885 | + $boucle->select[] = $texte." AS $asnum"; |
|
| 887 | 886 | |
| 888 | 887 | $orderassinum = calculer_critere_par_expression_sinum($idb, $boucles, $crit, $tri, $champ); |
| 889 | 888 | $orderassinum = trim($orderassinum, "'"); |
@@ -912,13 +911,13 @@ discard block |
||
| 912 | 911 | function calculer_critere_par_expression_sinum($idb, &$boucles, $crit, $tri, $champ) { |
| 913 | 912 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 914 | 913 | if (is_array($_champ)) { |
| 915 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " sinum $champ"]]; |
|
| 914 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." sinum $champ"]]; |
|
| 916 | 915 | } |
| 917 | 916 | $boucle = &$boucles[$idb]; |
| 918 | - $texte = '0+' . $_champ; |
|
| 917 | + $texte = '0+'.$_champ; |
|
| 919 | 918 | $suite = calculer_liste($tri, $idb, $boucles, $boucle->id_parent); |
| 920 | 919 | if ($suite !== "''") { |
| 921 | - $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')" . ' . "'; |
|
| 920 | + $texte = "\" . ((\$x = $suite) ? ('$texte' . \$x) : '0')".' . "'; |
|
| 922 | 921 | } |
| 923 | 922 | |
| 924 | 923 | $as = false; |
@@ -934,8 +933,8 @@ discard block |
||
| 934 | 933 | } |
| 935 | 934 | |
| 936 | 935 | if (!$as) { |
| 937 | - $as = 'sinum' . ($boucle->order ? count($boucle->order) : ''); |
|
| 938 | - $boucle->select[] = $select . $as; |
|
| 936 | + $as = 'sinum'.($boucle->order ? count($boucle->order) : ''); |
|
| 937 | + $boucle->select[] = $select.$as; |
|
| 939 | 938 | } |
| 940 | 939 | $order = "'$as'"; |
| 941 | 940 | return $order; |
@@ -960,10 +959,10 @@ discard block |
||
| 960 | 959 | function calculer_critere_par_expression_multi($idb, &$boucles, $crit, $tri, $champ) { |
| 961 | 960 | $_champ = calculer_critere_par_champ($idb, $boucles, $crit, $champ, true); |
| 962 | 961 | if (is_array($_champ)) { |
| 963 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " multi $champ"]]; |
|
| 962 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." multi $champ"]]; |
|
| 964 | 963 | } |
| 965 | 964 | $boucle = &$boucles[$idb]; |
| 966 | - $boucle->select[] = "\".sql_multi('" . $_champ . "', \$GLOBALS['spip_lang']).\""; |
|
| 965 | + $boucle->select[] = "\".sql_multi('".$_champ."', \$GLOBALS['spip_lang']).\""; |
|
| 967 | 966 | $order = "'multi'"; |
| 968 | 967 | return $order; |
| 969 | 968 | } |
@@ -989,7 +988,7 @@ discard block |
||
| 989 | 988 | |
| 990 | 989 | // le champ existe dans la table, pas de souci (le plus commun) |
| 991 | 990 | if (isset($desc['field'][$par])) { |
| 992 | - $par = $boucle->id_table . '.' . $par; |
|
| 991 | + $par = $boucle->id_table.'.'.$par; |
|
| 993 | 992 | } |
| 994 | 993 | // le champ est peut être une jointure |
| 995 | 994 | else { |
@@ -1010,24 +1009,24 @@ discard block |
||
| 1010 | 1009 | // Sinon on cherche le champ dans les tables possibles de jointures |
| 1011 | 1010 | // Si la table est déjà dans le from, on la réutilise. |
| 1012 | 1011 | if ($infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $table)) { |
| 1013 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1012 | + $par = $infos['alias'].'.'.$champ; |
|
| 1014 | 1013 | } elseif ( |
| 1015 | 1014 | $boucle->jointures_explicites |
| 1016 | 1015 | and $alias = trouver_jointure_champ($champ, $boucle, explode(' ', $boucle->jointures_explicites), false, $table) |
| 1017 | 1016 | ) { |
| 1018 | - $par = $alias . '.' . $champ; |
|
| 1017 | + $par = $alias.'.'.$champ; |
|
| 1019 | 1018 | } elseif ($alias = trouver_jointure_champ($champ, $boucle, $boucle->jointures, false, $table)) { |
| 1020 | - $par = $alias . '.' . $champ; |
|
| 1019 | + $par = $alias.'.'.$champ; |
|
| 1021 | 1020 | // en spécifiant directement l'alias {par L2.titre} (situation hasardeuse tout de même) |
| 1022 | 1021 | } elseif ( |
| 1023 | 1022 | $table_alias |
| 1024 | 1023 | and isset($boucle->from[$table_alias]) |
| 1025 | 1024 | and $infos = chercher_champ_dans_tables($champ, $boucle->from, $boucle->sql_serveur, $boucle->from[$table_alias]) |
| 1026 | 1025 | ) { |
| 1027 | - $par = $infos['alias'] . '.' . $champ; |
|
| 1026 | + $par = $infos['alias'].'.'.$champ; |
|
| 1028 | 1027 | } elseif ($table) { |
| 1029 | 1028 | // On avait table + champ, mais on ne les a pas trouvés |
| 1030 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . " $par"]]; |
|
| 1029 | + return ['zbug_critere_inconnu', ['critere' => $crit->op." $par"]]; |
|
| 1031 | 1030 | } else { |
| 1032 | 1031 | // Sinon tant pis, ca doit etre un champ synthetise (cf points) |
| 1033 | 1032 | } |
@@ -1051,7 +1050,7 @@ discard block |
||
| 1051 | 1050 | if (!$t) { |
| 1052 | 1051 | $t = trouver_jointure_champ($champ, $boucle); |
| 1053 | 1052 | } |
| 1054 | - return !$t ? '' : ("'" . $t . '.' . $champ . "'"); |
|
| 1053 | + return !$t ? '' : ("'".$t.'.'.$champ."'"); |
|
| 1055 | 1054 | } |
| 1056 | 1055 | |
| 1057 | 1056 | /** |
@@ -1096,9 +1095,9 @@ discard block |
||
| 1096 | 1095 | $boucle->default_order[] = ' DESC'; |
| 1097 | 1096 | } |
| 1098 | 1097 | } else { |
| 1099 | - $t = $boucle->order[$n - 1] . " . $order"; |
|
| 1098 | + $t = $boucle->order[$n - 1]." . $order"; |
|
| 1100 | 1099 | if (preg_match("/^(.*)'\s*\.\s*'([^']*')$/", $t, $r)) { |
| 1101 | - $t = $r[1] . $r[2]; |
|
| 1100 | + $t = $r[1].$r[2]; |
|
| 1102 | 1101 | } |
| 1103 | 1102 | $boucle->order[$n - 1] = $t; |
| 1104 | 1103 | } |
@@ -1133,7 +1132,7 @@ discard block |
||
| 1133 | 1132 | $_order = array_pop($boucle->order); |
| 1134 | 1133 | |
| 1135 | 1134 | $_liste = calculer_liste($crit->param[1], [], $boucles, $boucles[$idb]->id_parent); |
| 1136 | - $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'" . $boucle->sql_serveur . "')) ? \$zl : '0').')'$sens"; |
|
| 1135 | + $boucle->order[] = "'FIELD(' . $_order . ',' . ((\$zl=formate_liste_critere_par_ordre_liste($_liste,'".$boucle->sql_serveur."')) ? \$zl : '0').')'$sens"; |
|
| 1137 | 1136 | } |
| 1138 | 1137 | |
| 1139 | 1138 | |
@@ -1141,7 +1140,7 @@ discard block |
||
| 1141 | 1140 | $params = $crit->param; |
| 1142 | 1141 | |
| 1143 | 1142 | if ((is_countable($params) ? count($params) : 0) < 1) { |
| 1144 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]; |
|
| 1143 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]; |
|
| 1145 | 1144 | } |
| 1146 | 1145 | |
| 1147 | 1146 | $boucle = &$boucles[$idb]; |
@@ -1162,7 +1161,7 @@ discard block |
||
| 1162 | 1161 | if (((is_countable($date) ? count($date) : 0) == 1) and ($date[0]->type == 'texte')) { |
| 1163 | 1162 | $date = $date[0]->texte; |
| 1164 | 1163 | if (!isset($fields[$date])) { |
| 1165 | - return ['zbug_critere_inconnu', ['critere' => $crit->op . ' ' . $date]]; |
|
| 1164 | + return ['zbug_critere_inconnu', ['critere' => $crit->op.' '.$date]]; |
|
| 1166 | 1165 | } |
| 1167 | 1166 | } else { |
| 1168 | 1167 | $a = calculer_liste($date, $idb, $boucles, $parent); |
@@ -1174,38 +1173,38 @@ discard block |
||
| 1174 | 1173 | $date = "'.(($cond)\n?\$a:\"$defaut\").'"; |
| 1175 | 1174 | } |
| 1176 | 1175 | $annee = $params ? array_shift($params) : ''; |
| 1177 | - $annee = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1178 | - calculer_liste($annee, $idb, $boucles, $parent) . |
|
| 1176 | + $annee = "\n".'sprintf("%04d", ($x = '. |
|
| 1177 | + calculer_liste($annee, $idb, $boucles, $parent). |
|
| 1179 | 1178 | ') ? $x : date("Y"))'; |
| 1180 | 1179 | |
| 1181 | 1180 | $mois = $params ? array_shift($params) : ''; |
| 1182 | - $mois = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1183 | - calculer_liste($mois, $idb, $boucles, $parent) . |
|
| 1181 | + $mois = "\n".'sprintf("%02d", ($x = '. |
|
| 1182 | + calculer_liste($mois, $idb, $boucles, $parent). |
|
| 1184 | 1183 | ') ? $x : date("m"))'; |
| 1185 | 1184 | |
| 1186 | 1185 | $jour = $params ? array_shift($params) : ''; |
| 1187 | - $jour = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1188 | - calculer_liste($jour, $idb, $boucles, $parent) . |
|
| 1186 | + $jour = "\n".'sprintf("%02d", ($x = '. |
|
| 1187 | + calculer_liste($jour, $idb, $boucles, $parent). |
|
| 1189 | 1188 | ') ? $x : date("d"))'; |
| 1190 | 1189 | |
| 1191 | 1190 | $annee2 = $params ? array_shift($params) : ''; |
| 1192 | - $annee2 = "\n" . 'sprintf("%04d", ($x = ' . |
|
| 1193 | - calculer_liste($annee2, $idb, $boucles, $parent) . |
|
| 1191 | + $annee2 = "\n".'sprintf("%04d", ($x = '. |
|
| 1192 | + calculer_liste($annee2, $idb, $boucles, $parent). |
|
| 1194 | 1193 | ') ? $x : date("Y"))'; |
| 1195 | 1194 | |
| 1196 | 1195 | $mois2 = $params ? array_shift($params) : ''; |
| 1197 | - $mois2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1198 | - calculer_liste($mois2, $idb, $boucles, $parent) . |
|
| 1196 | + $mois2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1197 | + calculer_liste($mois2, $idb, $boucles, $parent). |
|
| 1199 | 1198 | ') ? $x : date("m"))'; |
| 1200 | 1199 | |
| 1201 | 1200 | $jour2 = $params ? array_shift($params) : ''; |
| 1202 | - $jour2 = "\n" . 'sprintf("%02d", ($x = ' . |
|
| 1203 | - calculer_liste($jour2, $idb, $boucles, $parent) . |
|
| 1201 | + $jour2 = "\n".'sprintf("%02d", ($x = '. |
|
| 1202 | + calculer_liste($jour2, $idb, $boucles, $parent). |
|
| 1204 | 1203 | ') ? $x : date("d"))'; |
| 1205 | 1204 | |
| 1206 | - $date = $boucle->id_table . ".$date"; |
|
| 1205 | + $date = $boucle->id_table.".$date"; |
|
| 1207 | 1206 | |
| 1208 | - $quote_end = ",'" . $boucle->sql_serveur . "','text'"; |
|
| 1207 | + $quote_end = ",'".$boucle->sql_serveur."','text'"; |
|
| 1209 | 1208 | if ($type == 'jour') { |
| 1210 | 1209 | $boucle->where[] = [ |
| 1211 | 1210 | "'='", |
@@ -1277,14 +1276,13 @@ discard block |
||
| 1277 | 1276 | [$a21, $a22] = calculer_critere_parties_aux($idb, $boucles, $a2); |
| 1278 | 1277 | |
| 1279 | 1278 | if (($op == ',') && (is_numeric($a11) && (is_numeric($a21)))) { |
| 1280 | - $boucle->limit = $a11 . ',' . $a21; |
|
| 1279 | + $boucle->limit = $a11.','.$a21; |
|
| 1281 | 1280 | } else { |
| 1282 | 1281 | // 3 dans {1/3}, {2,3} ou {1,n-3} |
| 1283 | 1282 | $boucle->total_parties = ($a21 != 'n') ? $a21 : $a22; |
| 1284 | 1283 | // 2 dans {2/3}, {2,5}, {n-2,1} |
| 1285 | 1284 | $partie = ($a11 != 'n') ? $a11 : $a12; |
| 1286 | - $mode = (($op == '/') ? '/' : |
|
| 1287 | - (($a11 == 'n') ? '-' : '+') . (($a21 == 'n') ? '-' : '+')); |
|
| 1285 | + $mode = (($op == '/') ? '/' : (($a11 == 'n') ? '-' : '+').(($a21 == 'n') ? '-' : '+')); |
|
| 1288 | 1286 | // cas simple {0,#ENV{truc}} compilons le en LIMIT : |
| 1289 | 1287 | if ($a11 !== 'n' and $a21 !== 'n' and $mode == '++' and $op == ',') { |
| 1290 | 1288 | $boucle->limit = |
@@ -1330,8 +1328,7 @@ discard block |
||
| 1330 | 1328 | // {1/3} |
| 1331 | 1329 | if ($op1 == '/') { |
| 1332 | 1330 | $pmoins1 = is_numeric($debut) ? ($debut - 1) : "($debut-1)"; |
| 1333 | - $totpos = is_numeric($total_parties) ? ($total_parties) : |
|
| 1334 | - "($total_parties ? $total_parties : 1)"; |
|
| 1331 | + $totpos = is_numeric($total_parties) ? ($total_parties) : "($total_parties ? $total_parties : 1)"; |
|
| 1335 | 1332 | $fin = "ceil(($nombre_boucle * $debut )/$totpos) - 1"; |
| 1336 | 1333 | $debut = !$pmoins1 ? 0 : "ceil(($nombre_boucle * $pmoins1)/$totpos);"; |
| 1337 | 1334 | } else { |
@@ -1342,15 +1339,13 @@ discard block |
||
| 1342 | 1339 | |
| 1343 | 1340 | // cas {x,n-1} |
| 1344 | 1341 | if ($op2 == '-') { |
| 1345 | - $fin = '$debut_boucle + ' . $nombre_boucle . ' - ' |
|
| 1346 | - . (is_numeric($total_parties) ? ($total_parties + 1) : |
|
| 1347 | - ($total_parties . ' - 1')); |
|
| 1342 | + $fin = '$debut_boucle + '.$nombre_boucle.' - ' |
|
| 1343 | + . (is_numeric($total_parties) ? ($total_parties + 1) : ($total_parties.' - 1')); |
|
| 1348 | 1344 | } else { |
| 1349 | 1345 | // {x,1} ou {pagination} |
| 1350 | 1346 | $fin = '$debut_boucle' |
| 1351 | 1347 | . (is_numeric($total_parties) ? |
| 1352 | - (($total_parties == 1) ? '' : (' + ' . ($total_parties - 1))) : |
|
| 1353 | - ('+' . $total_parties . ' - 1')); |
|
| 1348 | + (($total_parties == 1) ? '' : (' + '.($total_parties - 1))) : ('+'.$total_parties.' - 1')); |
|
| 1354 | 1349 | } |
| 1355 | 1350 | |
| 1356 | 1351 | // {pagination}, gerer le debut_xx=-1 pour tout voir |
@@ -1368,11 +1363,11 @@ discard block |
||
| 1368 | 1363 | // Utiliser min pour rabattre $fin_boucle sur total_boucle. |
| 1369 | 1364 | |
| 1370 | 1365 | $boucles[$id_boucle]->mode_partie = "\n\t" |
| 1371 | - . '$debut_boucle = ' . $debut . ";\n " |
|
| 1366 | + . '$debut_boucle = '.$debut.";\n " |
|
| 1372 | 1367 | . "\$debut_boucle = intval(\$debut_boucle);\n " |
| 1373 | - . '$fin_boucle = min(' . $fin . ", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1374 | - . '$Numrows[\'' . $id_boucle . "']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1375 | - . '$Numrows[\'' . $id_boucle . '\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1368 | + . '$fin_boucle = min('.$fin.", \$Numrows['$id_boucle']['total'] - 1);\n " |
|
| 1369 | + . '$Numrows[\''.$id_boucle."']['grand_total'] = \$Numrows['$id_boucle']['total'];\n " |
|
| 1370 | + . '$Numrows[\''.$id_boucle.'\']["total"] = max(0,$fin_boucle - $debut_boucle + 1);' |
|
| 1376 | 1371 | . "\n\tif (\$debut_boucle>0" |
| 1377 | 1372 | . " AND \$debut_boucle < \$Numrows['$id_boucle']['grand_total']" |
| 1378 | 1373 | . " AND \$iter->seek(\$debut_boucle,'continue'))" |
@@ -1457,16 +1452,16 @@ discard block |
||
| 1457 | 1452 | // critere personnalise ? |
| 1458 | 1453 | if ( |
| 1459 | 1454 | (!$serveur or |
| 1460 | - ((!function_exists($f = 'critere_' . $serveur . '_' . $table . '_' . $critere)) |
|
| 1461 | - and (!function_exists($f = $f . '_dist')) |
|
| 1462 | - and (!function_exists($f = 'critere_' . $serveur . '_' . $critere)) |
|
| 1463 | - and (!function_exists($f = $f . '_dist')) |
|
| 1455 | + ((!function_exists($f = 'critere_'.$serveur.'_'.$table.'_'.$critere)) |
|
| 1456 | + and (!function_exists($f = $f.'_dist')) |
|
| 1457 | + and (!function_exists($f = 'critere_'.$serveur.'_'.$critere)) |
|
| 1458 | + and (!function_exists($f = $f.'_dist')) |
|
| 1464 | 1459 | ) |
| 1465 | 1460 | ) |
| 1466 | - and (!function_exists($f = 'critere_' . $table . '_' . $critere)) |
|
| 1467 | - and (!function_exists($f = $f . '_dist')) |
|
| 1468 | - and (!function_exists($f = 'critere_' . $critere)) |
|
| 1469 | - and (!function_exists($f = $f . '_dist')) |
|
| 1461 | + and (!function_exists($f = 'critere_'.$table.'_'.$critere)) |
|
| 1462 | + and (!function_exists($f = $f.'_dist')) |
|
| 1463 | + and (!function_exists($f = 'critere_'.$critere)) |
|
| 1464 | + and (!function_exists($f = $f.'_dist')) |
|
| 1470 | 1465 | ) { |
| 1471 | 1466 | // fonction critere standard |
| 1472 | 1467 | $f = $defaut; |
@@ -1497,9 +1492,9 @@ discard block |
||
| 1497 | 1492 | */ |
| 1498 | 1493 | function kwote($lisp, $serveur = '', $type = '') { |
| 1499 | 1494 | if (preg_match(_CODE_QUOTE, $lisp, $r)) { |
| 1500 | - return $r[1] . '"' . sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type) . '"'; |
|
| 1495 | + return $r[1].'"'.sql_quote(str_replace(["\\'", '\\\\'], ["'", '\\'], $r[2]), $serveur, $type).'"'; |
|
| 1501 | 1496 | } else { |
| 1502 | - return "sql_quote($lisp, '$serveur', '" . str_replace("'", "\\'", $type) . "')"; |
|
| 1497 | + return "sql_quote($lisp, '$serveur', '".str_replace("'", "\\'", $type)."')"; |
|
| 1503 | 1498 | } |
| 1504 | 1499 | } |
| 1505 | 1500 | |
@@ -1521,7 +1516,7 @@ discard block |
||
| 1521 | 1516 | function critere_IN_dist($idb, &$boucles, $crit) { |
| 1522 | 1517 | $r = calculer_critere_infixe($idb, $boucles, $crit); |
| 1523 | 1518 | if (!$r) { |
| 1524 | - return (['zbug_critere_inconnu', ['critere' => $crit->op . ' ?']]); |
|
| 1519 | + return (['zbug_critere_inconnu', ['critere' => $crit->op.' ?']]); |
|
| 1525 | 1520 | } |
| 1526 | 1521 | [$arg, $op, $val, $col, $where_complement] = $r; |
| 1527 | 1522 | |
@@ -1546,8 +1541,8 @@ discard block |
||
| 1546 | 1541 | "'NOT'", |
| 1547 | 1542 | [ |
| 1548 | 1543 | "'IN'", |
| 1549 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1550 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1544 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1545 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1551 | 1546 | ] |
| 1552 | 1547 | ]; |
| 1553 | 1548 | } |
@@ -1564,22 +1559,22 @@ discard block |
||
| 1564 | 1559 | $descr = $boucles[$idb]->descr; |
| 1565 | 1560 | $cpt = &$num[$descr['nom']][$descr['gram']][$idb]; |
| 1566 | 1561 | |
| 1567 | - $var = '$in' . $cpt++; |
|
| 1562 | + $var = '$in'.$cpt++; |
|
| 1568 | 1563 | $x = "\n\t$var = array();"; |
| 1569 | 1564 | foreach ($val as $k => $v) { |
| 1570 | 1565 | if (preg_match(",^(\n//.*\n)?'(.*)'$,", $v, $r)) { |
| 1571 | 1566 | // optimiser le traitement des constantes |
| 1572 | 1567 | if (is_numeric($r[2])) { |
| 1573 | - $x .= "\n\t$var" . "[]= $r[2];"; |
|
| 1568 | + $x .= "\n\t$var"."[]= $r[2];"; |
|
| 1574 | 1569 | } else { |
| 1575 | - $x .= "\n\t$var" . '[]= ' . sql_quote($r[2]) . ';'; |
|
| 1570 | + $x .= "\n\t$var".'[]= '.sql_quote($r[2]).';'; |
|
| 1576 | 1571 | } |
| 1577 | 1572 | } else { |
| 1578 | 1573 | // Pour permettre de passer des tableaux de valeurs |
| 1579 | 1574 | // on repere l'utilisation brute de #ENV**{X}, |
| 1580 | 1575 | // c'est-a-dire sa traduction en ($PILE[0][X]). |
| 1581 | 1576 | // et on deballe mais en rajoutant l'anti XSS |
| 1582 | - $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var" . "[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1577 | + $x .= "\n\tif (!(is_array(\$a = ($v))))\n\t\t$var"."[]= \$a;\n\telse $var = array_merge($var, \$a);"; |
|
| 1583 | 1578 | } |
| 1584 | 1579 | } |
| 1585 | 1580 | |
@@ -1593,7 +1588,7 @@ discard block |
||
| 1593 | 1588 | $boucles[$idb]->default_order[] = "((!\$zqv=sql_quote($var) OR \$zqv===\"''\") ? 0 : ('FIELD($arg,' . \$zqv . ')'))"; |
| 1594 | 1589 | } |
| 1595 | 1590 | |
| 1596 | - return "sql_in('$arg', $var" . ($crit2 == 'NOT' ? ",'NOT'" : '') . ')'; |
|
| 1591 | + return "sql_in('$arg', $var".($crit2 == 'NOT' ? ",'NOT'" : '').')'; |
|
| 1597 | 1592 | } |
| 1598 | 1593 | |
| 1599 | 1594 | /** |
@@ -1666,7 +1661,7 @@ discard block |
||
| 1666 | 1661 | $champs = array_diff($champs, array_keys($boucle->modificateur['criteres'])); |
| 1667 | 1662 | } |
| 1668 | 1663 | // nous aider en mode debug. |
| 1669 | - $boucle->debug[] = 'id_ : ' . implode(', ', $champs); |
|
| 1664 | + $boucle->debug[] = 'id_ : '.implode(', ', $champs); |
|
| 1670 | 1665 | $boucle->modificateur['id_'] = $champs; |
| 1671 | 1666 | |
| 1672 | 1667 | // créer un critère {id_xxx?} de chaque champ retenu |
@@ -1917,8 +1912,8 @@ discard block |
||
| 1917 | 1912 | "'NOT'", |
| 1918 | 1913 | [ |
| 1919 | 1914 | "'IN'", |
| 1920 | - "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", |
|
| 1921 | - ["'SELF'", "'" . $boucles[$idb]->id_table . '.' . $boucles[$idb]->primary . "'", $where] |
|
| 1915 | + "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", |
|
| 1916 | + ["'SELF'", "'".$boucles[$idb]->id_table.'.'.$boucles[$idb]->primary."'", $where] |
|
| 1922 | 1917 | ] |
| 1923 | 1918 | ]; |
| 1924 | 1919 | } |
@@ -1929,7 +1924,7 @@ discard block |
||
| 1929 | 1924 | if ($crit->cond) { |
| 1930 | 1925 | $pred = calculer_argument_precedent($idb, $col, $boucles); |
| 1931 | 1926 | if ($col === 'date' or $col === 'date_redac') { |
| 1932 | - if ($pred === "\$Pile[0]['" . $col . "']") { |
|
| 1927 | + if ($pred === "\$Pile[0]['".$col."']") { |
|
| 1933 | 1928 | $pred = "(\$Pile[0]['{$col}_default']?'':$pred)"; |
| 1934 | 1929 | } |
| 1935 | 1930 | } |
@@ -2092,7 +2087,7 @@ discard block |
||
| 2092 | 2087 | // defaire le quote des int et les passer dans sql_quote avec le bon type de champ si on le connait, int sinon |
| 2093 | 2088 | // prendre en compte le debug ou la valeur arrive avec un commentaire PHP en debut |
| 2094 | 2089 | if (preg_match(",^\\A(\s*//.*?$\s*)?\"'(-?\d+)'\"\\z,ms", $val[0], $r)) { |
| 2095 | - $val[0] = $r[1] . '"' . sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote) . '"'; |
|
| 2090 | + $val[0] = $r[1].'"'.sql_quote($r[2], $boucle->sql_serveur, $type_cast_quote).'"'; |
|
| 2096 | 2091 | } |
| 2097 | 2092 | // sinon expliciter les |
| 2098 | 2093 | // sql_quote(truc) en sql_quote(truc,'',type) |
@@ -2108,14 +2103,14 @@ discard block |
||
| 2108 | 2103 | ) { |
| 2109 | 2104 | $r = $r[1] |
| 2110 | 2105 | . ((isset($r[2]) and $r[2]) ? $r[2] : ",''") |
| 2111 | - . ",'" . addslashes($type_cast_quote) . "'"; |
|
| 2106 | + . ",'".addslashes($type_cast_quote)."'"; |
|
| 2112 | 2107 | $val[0] = "sql_quote($r)"; |
| 2113 | 2108 | } |
| 2114 | 2109 | elseif ( |
| 2115 | 2110 | strpos($val[0], '@@defaultcast@@') !== false |
| 2116 | 2111 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2117 | 2112 | ) { |
| 2118 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'" . addslashes($type_cast_quote) . "')"; |
|
| 2113 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'".addslashes($type_cast_quote)."')"; |
|
| 2119 | 2114 | } |
| 2120 | 2115 | } |
| 2121 | 2116 | |
@@ -2123,7 +2118,7 @@ discard block |
||
| 2123 | 2118 | strpos($val[0], '@@defaultcast@@') !== false |
| 2124 | 2119 | and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r) |
| 2125 | 2120 | ) { |
| 2126 | - $val[0] = substr($val[0], 0, -strlen($r[0])) . "'char')"; |
|
| 2121 | + $val[0] = substr($val[0], 0, -strlen($r[0]))."'char')"; |
|
| 2127 | 2122 | } |
| 2128 | 2123 | |
| 2129 | 2124 | // Indicateur pour permettre aux fonctionx boucle_X de modifier |
@@ -2139,7 +2134,7 @@ discard block |
||
| 2139 | 2134 | // inserer le nom de la table SQL devant le nom du champ |
| 2140 | 2135 | if ($table) { |
| 2141 | 2136 | if ($col[0] == '`') { |
| 2142 | - $arg = "$table." . substr($col, 1, -1); |
|
| 2137 | + $arg = "$table.".substr($col, 1, -1); |
|
| 2143 | 2138 | } else { |
| 2144 | 2139 | $arg = "$table.$col"; |
| 2145 | 2140 | } |
@@ -2273,9 +2268,9 @@ discard block |
||
| 2273 | 2268 | **/ |
| 2274 | 2269 | function primary_doublee($decompose, $table) { |
| 2275 | 2270 | $e1 = reset($decompose); |
| 2276 | - $e2 = "sql_quote('" . end($decompose) . "')"; |
|
| 2271 | + $e2 = "sql_quote('".end($decompose)."')"; |
|
| 2277 | 2272 | |
| 2278 | - return ["'='", "'$table." . $e1 . "'", $e2]; |
|
| 2273 | + return ["'='", "'$table.".$e1."'", $e2]; |
|
| 2279 | 2274 | } |
| 2280 | 2275 | |
| 2281 | 2276 | /** |
@@ -2314,7 +2309,7 @@ discard block |
||
| 2314 | 2309 | $checkarrivee |
| 2315 | 2310 | and is_string($checkarrivee) |
| 2316 | 2311 | and $a = table_objet($checkarrivee) |
| 2317 | - and in_array($a . '_liens', $joints) |
|
| 2312 | + and in_array($a.'_liens', $joints) |
|
| 2318 | 2313 | ) { |
| 2319 | 2314 | if ($res = calculer_lien_externe_init($boucle, $joints, $col, $desc, $cond, $checkarrivee)) { |
| 2320 | 2315 | return $res; |
@@ -2334,12 +2329,12 @@ discard block |
||
| 2334 | 2329 | // la table est déjà dans le FROM, on vérifie si le champ est utilisé. |
| 2335 | 2330 | $joindre = false; |
| 2336 | 2331 | foreach ($cols as $col) { |
| 2337 | - $c = '/\b' . $t . ".$col" . '\b/'; |
|
| 2332 | + $c = '/\b'.$t.".$col".'\b/'; |
|
| 2338 | 2333 | if (trouver_champ($c, $boucle->where)) { |
| 2339 | 2334 | $joindre = true; |
| 2340 | 2335 | } else { |
| 2341 | 2336 | // mais ca peut etre dans le FIELD pour le Having |
| 2342 | - $c = "/FIELD.$t" . ".$col,/"; |
|
| 2337 | + $c = "/FIELD.$t".".$col,/"; |
|
| 2343 | 2338 | if (trouver_champ($c, $boucle->select)) { |
| 2344 | 2339 | $joindre = true; |
| 2345 | 2340 | } |
@@ -2385,7 +2380,7 @@ discard block |
||
| 2385 | 2380 | $primary_arrivee = id_table_objet($checkarrivee); |
| 2386 | 2381 | |
| 2387 | 2382 | // [FIXME] $checkarrivee peut-il arriver avec false ???? |
| 2388 | - $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee . '_liens'); |
|
| 2383 | + $intermediaire = trouver_champ_exterieur($primary_arrivee, $joints, $boucle, $checkarrivee.'_liens'); |
|
| 2389 | 2384 | $arrivee = trouver_champ_exterieur($col, $joints, $boucle, $checkarrivee); |
| 2390 | 2385 | |
| 2391 | 2386 | if (!$intermediaire or !$arrivee) { |
@@ -2489,7 +2484,7 @@ discard block |
||
| 2489 | 2484 | } elseif ($crit->cond and ($col == 'date' or $col == 'date_redac')) { |
| 2490 | 2485 | // un critere conditionnel sur date est traite a part |
| 2491 | 2486 | // car la date est mise d'office par SPIP, |
| 2492 | - $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['" . $col . "'])"; |
|
| 2487 | + $defaut = "(\$Pile[0]['{$col}_default']?'':\$Pile[0]['".$col."'])"; |
|
| 2493 | 2488 | } |
| 2494 | 2489 | |
| 2495 | 2490 | $val = calculer_argument_precedent($idb, $val, $boucles, $defaut); |
@@ -2521,7 +2516,7 @@ discard block |
||
| 2521 | 2516 | and (($p == "'") or ($p == '"')) |
| 2522 | 2517 | and $params[0][1]->type == 'champ' |
| 2523 | 2518 | ) { |
| 2524 | - $val[] = "$p\\$p#" . $params[0][1]->nom_champ . "\\$p$p"; |
|
| 2519 | + $val[] = "$p\\$p#".$params[0][1]->nom_champ."\\$p$p"; |
|
| 2525 | 2520 | } else { |
| 2526 | 2521 | foreach ((($op != 'IN') ? $params : calculer_vieux_in($params)) as $p) { |
| 2527 | 2522 | $a = calculer_liste($p, $idb, $boucles, $parent); |
@@ -2537,7 +2532,7 @@ discard block |
||
| 2537 | 2532 | $fct = $args_sql = ''; |
| 2538 | 2533 | // fonction SQL ? |
| 2539 | 2534 | // chercher FONCTION(champ) tel que CONCAT(titre,descriptif) |
| 2540 | - if (preg_match('/^(.*)' . SQL_ARGS . '$/', $col, $m)) { |
|
| 2535 | + if (preg_match('/^(.*)'.SQL_ARGS.'$/', $col, $m)) { |
|
| 2541 | 2536 | $fct = $m[1]; |
| 2542 | 2537 | preg_match('/^\(([^,]*)(.*)\)$/', $m[2], $a); |
| 2543 | 2538 | $col = $a[1]; |
@@ -2627,7 +2622,7 @@ discard block |
||
| 2627 | 2622 | # si oui choisir ce champ, sinon choisir xxxx |
| 2628 | 2623 | |
| 2629 | 2624 | if (isset($table['field']["date$suite"])) { |
| 2630 | - $date_orig = 'date' . $suite; |
|
| 2625 | + $date_orig = 'date'.$suite; |
|
| 2631 | 2626 | } else { |
| 2632 | 2627 | $date_orig = substr($suite, 1); |
| 2633 | 2628 | } |
@@ -2638,12 +2633,12 @@ discard block |
||
| 2638 | 2633 | } |
| 2639 | 2634 | } |
| 2640 | 2635 | |
| 2641 | - $date_compare = "\"' . normaliser_date(" . |
|
| 2642 | - calculer_argument_precedent($idb, $pred, $boucles) . |
|
| 2636 | + $date_compare = "\"' . normaliser_date(". |
|
| 2637 | + calculer_argument_precedent($idb, $pred, $boucles). |
|
| 2643 | 2638 | ") . '\""; |
| 2644 | 2639 | |
| 2645 | 2640 | $col_vraie = $date_orig; |
| 2646 | - $date_orig = $boucle->id_table . '.' . $date_orig; |
|
| 2641 | + $date_orig = $boucle->id_table.'.'.$date_orig; |
|
| 2647 | 2642 | |
| 2648 | 2643 | switch ($col) { |
| 2649 | 2644 | case 'date': |
@@ -2663,26 +2658,26 @@ discard block |
||
| 2663 | 2658 | break; |
| 2664 | 2659 | case 'age': |
| 2665 | 2660 | $col = calculer_param_date("\'' . date('Y-m-d H:i:00') . '\'", $date_orig); |
| 2666 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2661 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2667 | 2662 | break; |
| 2668 | 2663 | case 'age_relatif': |
| 2669 | 2664 | $col = calculer_param_date($date_compare, $date_orig); |
| 2670 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2665 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2671 | 2666 | break; |
| 2672 | 2667 | case 'jour_relatif': |
| 2673 | - $col = '(TO_DAYS(' . $date_compare . ')-TO_DAYS(' . $date_orig . '))'; |
|
| 2674 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2668 | + $col = '(TO_DAYS('.$date_compare.')-TO_DAYS('.$date_orig.'))'; |
|
| 2669 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2675 | 2670 | break; |
| 2676 | 2671 | case 'mois_relatif': |
| 2677 | - $col = 'MONTH(' . $date_compare . ')-MONTH(' . |
|
| 2678 | - $date_orig . ')+12*(YEAR(' . $date_compare . |
|
| 2679 | - ')-YEAR(' . $date_orig . '))'; |
|
| 2680 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2672 | + $col = 'MONTH('.$date_compare.')-MONTH('. |
|
| 2673 | + $date_orig.')+12*(YEAR('.$date_compare. |
|
| 2674 | + ')-YEAR('.$date_orig.'))'; |
|
| 2675 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2681 | 2676 | break; |
| 2682 | 2677 | case 'annee_relatif': |
| 2683 | - $col = 'YEAR(' . $date_compare . ')-YEAR(' . |
|
| 2684 | - $date_orig . ')'; |
|
| 2685 | - $col_vraie = '';// comparer a un int (par defaut) |
|
| 2678 | + $col = 'YEAR('.$date_compare.')-YEAR('. |
|
| 2679 | + $date_orig.')'; |
|
| 2680 | + $col_vraie = ''; // comparer a un int (par defaut) |
|
| 2686 | 2681 | break; |
| 2687 | 2682 | } |
| 2688 | 2683 | |
@@ -2743,10 +2738,10 @@ discard block |
||
| 2743 | 2738 | } |
| 2744 | 2739 | |
| 2745 | 2740 | $boucle->hash .= ' |
| 2746 | - $command[\'sourcemode\'] = ' . array_shift($args) . ";\n"; |
|
| 2741 | + $command[\'sourcemode\'] = ' . array_shift($args).";\n"; |
|
| 2747 | 2742 | |
| 2748 | 2743 | $boucle->hash .= ' |
| 2749 | - $command[\'source\'] = array(' . join(', ', $args) . ");\n"; |
|
| 2744 | + $command[\'source\'] = array(' . join(', ', $args).");\n"; |
|
| 2750 | 2745 | } |
| 2751 | 2746 | |
| 2752 | 2747 | /** |
@@ -2765,7 +2760,7 @@ discard block |
||
| 2765 | 2760 | function critere_DATA_datacache_dist($idb, &$boucles, $crit) { |
| 2766 | 2761 | $boucle = &$boucles[$idb]; |
| 2767 | 2762 | $boucle->hash .= ' |
| 2768 | - $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2763 | + $command[\'datacache\'] = ' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2769 | 2764 | } |
| 2770 | 2765 | |
| 2771 | 2766 | |
@@ -2784,7 +2779,7 @@ discard block |
||
| 2784 | 2779 | $boucle->hash .= '$command[\'args\']=array();'; |
| 2785 | 2780 | foreach ($crit->param as $param) { |
| 2786 | 2781 | $boucle->hash .= ' |
| 2787 | - $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2782 | + $command[\'args\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2788 | 2783 | } |
| 2789 | 2784 | } |
| 2790 | 2785 | |
@@ -2803,14 +2798,14 @@ discard block |
||
| 2803 | 2798 | */ |
| 2804 | 2799 | function critere_DATA_liste_dist($idb, &$boucles, $crit) { |
| 2805 | 2800 | $boucle = &$boucles[$idb]; |
| 2806 | - $boucle->hash .= "\n\t" . '$command[\'liste\'] = array();' . "\n"; |
|
| 2801 | + $boucle->hash .= "\n\t".'$command[\'liste\'] = array();'."\n"; |
|
| 2807 | 2802 | foreach ($crit->param as $param) { |
| 2808 | - $boucle->hash .= "\t" . '$command[\'liste\'][] = ' . calculer_liste( |
|
| 2803 | + $boucle->hash .= "\t".'$command[\'liste\'][] = '.calculer_liste( |
|
| 2809 | 2804 | $param, |
| 2810 | 2805 | $idb, |
| 2811 | 2806 | $boucles, |
| 2812 | 2807 | $boucles[$idb]->id_parent |
| 2813 | - ) . ";\n"; |
|
| 2808 | + ).";\n"; |
|
| 2814 | 2809 | } |
| 2815 | 2810 | } |
| 2816 | 2811 | |
@@ -2837,14 +2832,14 @@ discard block |
||
| 2837 | 2832 | */ |
| 2838 | 2833 | function critere_DATA_enum_dist($idb, &$boucles, $crit) { |
| 2839 | 2834 | $boucle = &$boucles[$idb]; |
| 2840 | - $boucle->hash .= "\n\t" . '$command[\'enum\'] = array();' . "\n"; |
|
| 2835 | + $boucle->hash .= "\n\t".'$command[\'enum\'] = array();'."\n"; |
|
| 2841 | 2836 | foreach ($crit->param as $param) { |
| 2842 | - $boucle->hash .= "\t" . '$command[\'enum\'][] = ' . calculer_liste( |
|
| 2837 | + $boucle->hash .= "\t".'$command[\'enum\'][] = '.calculer_liste( |
|
| 2843 | 2838 | $param, |
| 2844 | 2839 | $idb, |
| 2845 | 2840 | $boucles, |
| 2846 | 2841 | $boucles[$idb]->id_parent |
| 2847 | - ) . ";\n"; |
|
| 2842 | + ).";\n"; |
|
| 2848 | 2843 | } |
| 2849 | 2844 | } |
| 2850 | 2845 | |
@@ -2863,7 +2858,7 @@ discard block |
||
| 2863 | 2858 | $boucle = &$boucles[$idb]; |
| 2864 | 2859 | foreach ($crit->param as $param) { |
| 2865 | 2860 | $boucle->hash .= ' |
| 2866 | - $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ';'; |
|
| 2861 | + $command[\'datapath\'][] = ' . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).';'; |
|
| 2867 | 2862 | } |
| 2868 | 2863 | } |
| 2869 | 2864 | |
@@ -2904,7 +2899,7 @@ discard block |
||
| 2904 | 2899 | if ($crit->param) { |
| 2905 | 2900 | foreach ($crit->param as $param) { |
| 2906 | 2901 | $boucle->hash .= "\t\$command['si'][] = " |
| 2907 | - . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent) . ";\n"; |
|
| 2902 | + . calculer_liste($param, $idb, $boucles, $boucles[$idb]->id_parent).";\n"; |
|
| 2908 | 2903 | } |
| 2909 | 2904 | // interdire {si 0} aussi ! |
| 2910 | 2905 | } else { |
@@ -2928,7 +2923,7 @@ discard block |
||
| 2928 | 2923 | function critere_POUR_tableau_dist($idb, &$boucles, $crit) { |
| 2929 | 2924 | $boucle = &$boucles[$idb]; |
| 2930 | 2925 | $boucle->hash .= ' |
| 2931 | - $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent) . '); |
|
| 2926 | + $command[\'source\'] = array(' . calculer_liste($crit->param[0], $idb, $boucles, $boucles[$idb]->id_parent).'); |
|
| 2932 | 2927 | $command[\'sourcemode\'] = \'table\';'; |
| 2933 | 2928 | } |
| 2934 | 2929 | |
@@ -2963,7 +2958,7 @@ discard block |
||
| 2963 | 2958 | $id_parent = $GLOBALS['exceptions_des_tables'][$boucle->id_table]['id_parent'] ?? 'id_parent'; |
| 2964 | 2959 | |
| 2965 | 2960 | $in = 'IN'; |
| 2966 | - $where = ["'IN'", "'$boucle->id_table." . "$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2961 | + $where = ["'IN'", "'$boucle->id_table."."$primary'", "'('.sql_get_select('$id_parent', '$table_sql').')'"]; |
|
| 2967 | 2962 | if ($not) { |
| 2968 | 2963 | $where = ["'NOT'", $where]; |
| 2969 | 2964 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $row = sql_fetsel( |
| 57 | 57 | 'alea_actuel, alea_futur', |
| 58 | 58 | 'spip_auteurs', |
| 59 | - 'login=' . sql_quote($login, $serveur, 'text'), |
|
| 59 | + 'login='.sql_quote($login, $serveur, 'text'), |
|
| 60 | 60 | '', |
| 61 | 61 | '', |
| 62 | 62 | '', |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | if ($row) { |
| 68 | 68 | include_spip('auth/sha256.inc'); |
| 69 | - $shapass = spip_sha256($row['alea_actuel'] . $pass); |
|
| 70 | - $shanext = spip_sha256($row['alea_futur'] . $pass); |
|
| 71 | - $md5pass = md5($row['alea_actuel'] . $pass); |
|
| 69 | + $shapass = spip_sha256($row['alea_actuel'].$pass); |
|
| 70 | + $shanext = spip_sha256($row['alea_futur'].$pass); |
|
| 71 | + $md5pass = md5($row['alea_actuel'].$pass); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | $row = sql_fetsel( |
| 81 | 81 | '*', |
| 82 | 82 | 'spip_auteurs', |
| 83 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 83 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 84 | 84 | $shapass, |
| 85 | 85 | $serveur, |
| 86 | 86 | 'text' |
| 87 | - ) . " AND statut<>'5poubelle'", |
|
| 87 | + )." AND statut<>'5poubelle'", |
|
| 88 | 88 | '', |
| 89 | 89 | '', |
| 90 | 90 | '', |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | $row = sql_fetsel( |
| 98 | 98 | '*', |
| 99 | 99 | 'spip_auteurs', |
| 100 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 100 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 101 | 101 | $md5pass, |
| 102 | 102 | $serveur, |
| 103 | 103 | 'text' |
| 104 | - ) . " AND statut<>'5poubelle'", |
|
| 104 | + )." AND statut<>'5poubelle'", |
|
| 105 | 105 | '', |
| 106 | 106 | '', |
| 107 | 107 | '', |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | 'pass' => sql_quote($shanext, $serveur, 'text'), |
| 127 | 127 | 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text') |
| 128 | 128 | ], |
| 129 | - 'id_auteur=' . $row['id_auteur'] . ' AND pass IN (' . sql_quote( |
|
| 129 | + 'id_auteur='.$row['id_auteur'].' AND pass IN ('.sql_quote( |
|
| 130 | 130 | $shapass, |
| 131 | 131 | $serveur, |
| 132 | 132 | 'text' |
| 133 | - ) . ', ' . sql_quote($md5pass, $serveur, 'text') . ')', |
|
| 133 | + ).', '.sql_quote($md5pass, $serveur, 'text').')', |
|
| 134 | 134 | [], |
| 135 | 135 | $serveur |
| 136 | 136 | ); |
@@ -169,16 +169,16 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | // javascript qui gere la securite du login en evitant de faire circuler le pass en clair |
| 171 | 171 | $flux['data'] .= |
| 172 | - ($compat_md5 ? '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'md5.js"></script>' : '') |
|
| 173 | - . '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'login-sha-min.js"></script>' |
|
| 172 | + ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '') |
|
| 173 | + . '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>' |
|
| 174 | 174 | . '<script type="text/javascript">/*<![CDATA[*/' |
| 175 | - . "var login_info={'alea_actuel':'" . $flux['args']['contexte']['_alea_actuel'] . "'," |
|
| 176 | - . "'alea_futur':'" . $flux['args']['contexte']['_alea_futur'] . "'," |
|
| 177 | - . "'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 178 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 175 | + . "var login_info={'alea_actuel':'".$flux['args']['contexte']['_alea_actuel']."'," |
|
| 176 | + . "'alea_futur':'".$flux['args']['contexte']['_alea_futur']."'," |
|
| 177 | + . "'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 178 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 179 | 179 | . "'informe_auteur_en_cours':false," |
| 180 | 180 | . "'attente_informe':0," |
| 181 | - . "'compat_md5':" . ($compat_md5 ? 'true' : 'false') . '};' |
|
| 181 | + . "'compat_md5':".($compat_md5 ? 'true' : 'false').'};' |
|
| 182 | 182 | . "jQuery(function(){ |
| 183 | 183 | jQuery('#var_login').change(actualise_auteur); |
| 184 | 184 | jQuery('form#formulaire_login').submit(login_submit); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } else { |
| 223 | 223 | $n = sql_countsel( |
| 224 | 224 | 'spip_auteurs', |
| 225 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 225 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 226 | 226 | '', |
| 227 | 227 | '', |
| 228 | 228 | $serveur |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | if ( |
| 252 | 252 | !$id_auteur = intval($id_auteur) |
| 253 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 253 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 254 | 254 | ) { |
| 255 | 255 | return false; |
| 256 | 256 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $anciens = sql_allfetsel( |
| 266 | 266 | 'id_auteur', |
| 267 | 267 | 'spip_auteurs', |
| 268 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 268 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 269 | 269 | '', |
| 270 | 270 | '', |
| 271 | 271 | '', |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | $r = sql_getfetsel( |
| 300 | 300 | 'login', |
| 301 | 301 | 'spip_auteurs', |
| 302 | - "statut<>'5poubelle'" . |
|
| 303 | - ' AND (length(pass)>0)' . |
|
| 302 | + "statut<>'5poubelle'". |
|
| 303 | + ' AND (length(pass)>0)'. |
|
| 304 | 304 | " AND (login=$l)", |
| 305 | 305 | '', |
| 306 | 306 | '', |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | return sql_getfetsel( |
| 320 | 320 | 'login', |
| 321 | 321 | 'spip_auteurs', |
| 322 | - "statut<>'5poubelle'" . |
|
| 323 | - ' AND (length(pass)>0)' . |
|
| 322 | + "statut<>'5poubelle'". |
|
| 323 | + ' AND (length(pass)>0)'. |
|
| 324 | 324 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 325 | 325 | '', |
| 326 | 326 | '', |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | if ( |
| 413 | 413 | !$id_auteur = intval($id_auteur) |
| 414 | - or !sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 414 | + or !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 415 | 415 | ) { |
| 416 | 416 | return false; |
| 417 | 417 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $htpass = generer_htpass($new_pass); |
| 423 | 423 | $alea_actuel = creer_uniqid(); |
| 424 | 424 | $alea_futur = creer_uniqid(); |
| 425 | - $pass = spip_sha256($alea_actuel . $new_pass); |
|
| 425 | + $pass = spip_sha256($alea_actuel.$new_pass); |
|
| 426 | 426 | $c['pass'] = $pass; |
| 427 | 427 | $c['htpass'] = $htpass; |
| 428 | 428 | $c['alea_actuel'] = $alea_actuel; |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | or isset($champs['statut']) |
| 459 | 459 | or (isset($options['all']) and $options['all']) |
| 460 | 460 | ) { |
| 461 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 462 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 461 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 462 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 463 | 463 | |
| 464 | 464 | // Cette variable de configuration peut etre posee par un plugin |
| 465 | 465 | // par exemple acces_restreint ; |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | and !@file_exists($htaccess) |
| 470 | 470 | ) { |
| 471 | 471 | spip_unlink($htpasswd); |
| 472 | - spip_unlink($htpasswd . '-admin'); |
|
| 472 | + spip_unlink($htpasswd.'-admin'); |
|
| 473 | 473 | |
| 474 | 474 | return; |
| 475 | 475 | } |
@@ -487,16 +487,16 @@ discard block |
||
| 487 | 487 | ); |
| 488 | 488 | while ($t = sql_fetch($s)) { |
| 489 | 489 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 490 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 490 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 491 | 491 | if ($t['statut'] == '0minirezo') { |
| 492 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 492 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | sql_free($s); |
| 497 | 497 | if ($p1) { |
| 498 | 498 | ecrire_fichier($htpasswd, $p1); |
| 499 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 499 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 500 | 500 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 501 | 501 | } |
| 502 | 502 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | 107 | $inc ? |
| 108 | - _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($f) . '</code>']) |
|
| 108 | + _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($f).'</code>']) |
|
| 109 | 109 | . '<br />' |
| 110 | - . _T('fonction_introuvable', ['fonction' => '<code>' . spip_htmlentities($g) . '</code>']) |
|
| 110 | + . _T('fonction_introuvable', ['fonction' => '<code>'.spip_htmlentities($g).'</code>']) |
|
| 111 | 111 | : |
| 112 | - _T('fichier_introuvable', ['fichier' => '<code>' . spip_htmlentities($d) . '</code>']), |
|
| 113 | - ['all_inline' => true,'status' => 404] |
|
| 112 | + _T('fichier_introuvable', ['fichier' => '<code>'.spip_htmlentities($d).'</code>']), |
|
| 113 | + ['all_inline' => true, 'status' => 404] |
|
| 114 | 114 | ); |
| 115 | 115 | exit; |
| 116 | 116 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * - string : chemin du fichier trouvé |
| 157 | 157 | **/ |
| 158 | 158 | function include_spip($f, $include = true) { |
| 159 | - return find_in_path($f . '.php', '', $include); |
|
| 159 | + return find_in_path($f.'.php', '', $include); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * - string : chemin du fichier trouvé |
| 177 | 177 | **/ |
| 178 | 178 | function require_spip($f) { |
| 179 | - return find_in_path($f . '.php', '', 'required'); |
|
| 179 | + return find_in_path($f.'.php', '', 'required'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // donc il faut l'inclure "en globals" |
| 194 | 194 | if ($f = find_in_path('mes_fonctions.php')) { |
| 195 | 195 | global $dossier_squelettes; |
| 196 | - include_once(_ROOT_CWD . $f); |
|
| 196 | + include_once(_ROOT_CWD.$f); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | // appliquer notre fonction si elle existe |
| 301 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 301 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 302 | 302 | if (function_exists($fonc)) { |
| 303 | 303 | $val = $fonc($val); |
| 304 | 304 | } // plantage ? |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | function spip_log($message = null, $name = null) { |
| 364 | 364 | static $pre = []; |
| 365 | 365 | static $log; |
| 366 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 366 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 367 | 367 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 368 | 368 | $logname = null; |
| 369 | 369 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (!is_string($message)) { |
| 392 | 392 | $message = print_r($message, true); |
| 393 | 393 | } |
| 394 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 394 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $a = './'; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 595 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 596 | 596 | $ajouts = array_flip(explode('|', $c)); |
| 597 | 597 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 598 | 598 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 620 | 620 | // pour un tableau ce sera fait dans la prochaine boucle |
| 621 | 621 | elseif (substr($r[1], -2) != '[]') { |
| 622 | - $url[$n] = $r[1] . '=' . $u; |
|
| 622 | + $url[$n] = $r[1].'='.$u; |
|
| 623 | 623 | unset($ajouts[$r[1]]); |
| 624 | 624 | } |
| 625 | 625 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | } elseif ($testv) { |
| 641 | 641 | foreach ($ajouts as $k => $n) { |
| 642 | 642 | if (!is_array($v)) { |
| 643 | - $url[] = $k . '=' . $u; |
|
| 643 | + $url[] = $k.'='.$u; |
|
| 644 | 644 | } else { |
| 645 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 645 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 646 | 646 | foreach ($v as $w) { |
| 647 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 647 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | // recomposer l'adresse |
| 657 | 657 | if ($url) { |
| 658 | - $a .= '?' . join($sep, $url); |
|
| 658 | + $a .= '?'.join($sep, $url); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | - return $a . $ancre; |
|
| 661 | + return $a.$ancre; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | translitteration($ancre) |
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 693 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @return bool |
| 807 | 807 | */ |
| 808 | 808 | function test_plugin_actif($plugin) { |
| 809 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 809 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /** |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $value = interdire_scripts($value, -1); |
| 939 | 939 | } |
| 940 | 940 | if (!empty($options['class'])) { |
| 941 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 941 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 942 | 942 | } |
| 943 | 943 | $text = str_replace("@$name@", $value, $text); |
| 944 | 944 | unset($args[$name]); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | // Si des variables n'ont pas ete inserees, le signaler |
| 948 | 948 | // (chaines de langues pas a jour) |
| 949 | 949 | if ($args) { |
| 950 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 950 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 951 | 951 | } |
| 952 | 952 | } |
| 953 | 953 | |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | function joli_repertoire($rep) { |
| 972 | 972 | $a = substr($rep, 0, 1); |
| 973 | 973 | if ($a <> '.' and $a <> '/') { |
| 974 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 974 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 975 | 975 | } |
| 976 | 976 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 977 | 977 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $p -= ($x * 1000); |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1028 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($taches and count($taches) and !spip_connect()) { |
| 1093 | 1093 | return false; |
| 1094 | 1094 | } |
| 1095 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1095 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1096 | 1096 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1097 | 1097 | return $genie($taches); |
| 1098 | 1098 | } |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | if ($queue_next_job_time == -1) { |
| 1198 | 1198 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1199 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1199 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | // utiliser un cache memoire si dispo |
| 1202 | 1202 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | $src = ''; |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($script) { |
| 1268 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1269 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1268 | + $script = ("/*<![CDATA[*/\n". |
|
| 1269 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1270 | 1270 | '/*]]>*/'); |
| 1271 | 1271 | } |
| 1272 | 1272 | if ($noscript) { |
@@ -1352,13 +1352,13 @@ discard block |
||
| 1352 | 1352 | if ($path_base == null) { |
| 1353 | 1353 | // Chemin standard depuis l'espace public |
| 1354 | 1354 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1355 | - _DIR_RACINE . ':' . |
|
| 1356 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1357 | - _DIR_RACINE . 'prive/:' . |
|
| 1355 | + _DIR_RACINE.':'. |
|
| 1356 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1357 | + _DIR_RACINE.'prive/:'. |
|
| 1358 | 1358 | _DIR_RESTREINT; |
| 1359 | 1359 | // Ajouter squelettes/ |
| 1360 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1361 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1360 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1361 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | foreach (explode(':', $path) as $dir) { |
| 1364 | 1364 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | // Et le(s) dossier(s) des squelettes nommes |
| 1371 | 1371 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1372 | 1372 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1373 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1373 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1383 | 1383 | $tete = ''; |
| 1384 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1384 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1385 | 1385 | $tete = array_shift($path_base); |
| 1386 | 1386 | } |
| 1387 | 1387 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | // Et le(s) dossier(s) des squelettes nommes |
| 1403 | 1403 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1404 | 1404 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1405 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1405 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1473,14 +1473,14 @@ discard block |
||
| 1473 | 1473 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1474 | 1474 | if ( |
| 1475 | 1475 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1476 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1476 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1477 | 1477 | and $f = find_in_theme("$file_svg_generique") |
| 1478 | 1478 | ) { |
| 1479 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1479 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1480 | 1480 | return $themefiles["$subdir$file"] = $fsize; |
| 1481 | 1481 | } |
| 1482 | 1482 | else { |
| 1483 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1483 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | return $themefiles["$subdir$file"] = $f; |
| 1491 | 1491 | } |
| 1492 | 1492 | } |
| 1493 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1493 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $themefiles["$subdir$file"] = ''; |
| 1496 | 1496 | } |
@@ -1598,8 +1598,8 @@ discard block |
||
| 1598 | 1598 | return false; |
| 1599 | 1599 | } |
| 1600 | 1600 | if ($include and !isset($inc[$dirname][$file])) { |
| 1601 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1601 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1602 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1612,14 +1612,14 @@ discard block |
||
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | foreach (creer_chemin() as $dir) { |
| 1615 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1616 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1615 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1616 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1617 | 1617 | } |
| 1618 | 1618 | if ($dirs[$a]) { |
| 1619 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1619 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1620 | 1620 | if ($include and !isset($inc[$dirname][$file])) { |
| 1621 | - include_once _ROOT_CWD . $a; |
|
| 1622 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1621 | + include_once _ROOT_CWD.$a; |
|
| 1622 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | if (!defined('_SAUVER_CHEMIN')) { |
| 1625 | 1625 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | define('_SAUVER_CHEMIN', true); |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1632 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| 1635 | 1635 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | define('_SAUVER_CHEMIN', true); |
| 1656 | 1656 | } |
| 1657 | 1657 | |
| 1658 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1658 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | function clear_path_cache() { |
@@ -1725,12 +1725,12 @@ discard block |
||
| 1725 | 1725 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1726 | 1726 | // on a pas encore inclus flock.php |
| 1727 | 1727 | if (!function_exists('preg_files')) { |
| 1728 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1728 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | // Parcourir le chemin |
| 1732 | 1732 | foreach (creer_chemin() as $d) { |
| 1733 | - $f = $d . $dir; |
|
| 1733 | + $f = $d.$dir; |
|
| 1734 | 1734 | if (@is_dir($f)) { |
| 1735 | 1735 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1736 | 1736 | foreach ($liste as $chemin) { |
@@ -1780,9 +1780,9 @@ discard block |
||
| 1780 | 1780 | if ($type === 'defaut') { |
| 1781 | 1781 | $objet = objet_type($quoi); |
| 1782 | 1782 | if ( |
| 1783 | - $f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1783 | + $f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1784 | 1784 | // deprecated |
| 1785 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1785 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1786 | 1786 | ) { |
| 1787 | 1787 | return $f; |
| 1788 | 1788 | } |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | // inclure le module d'url |
| 1797 | - include_spip('urls/' . $type); |
|
| 1797 | + include_spip('urls/'.$type); |
|
| 1798 | 1798 | |
| 1799 | 1799 | switch ($quoi) { |
| 1800 | 1800 | case 'page': |
@@ -1950,8 +1950,8 @@ discard block |
||
| 1950 | 1950 | include_spip('base/connect_sql'); |
| 1951 | 1951 | $id_type = id_table_objet($entite, $public); |
| 1952 | 1952 | |
| 1953 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1954 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1953 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1954 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1955 | 1955 | . (!$args ? '' : "&$args") |
| 1956 | 1956 | . (!$ancre ? '' : "#$ancre"); |
| 1957 | 1957 | } |
@@ -2122,7 +2122,7 @@ discard block |
||
| 2122 | 2122 | !empty($_SERVER['QUERY_STRING']) |
| 2123 | 2123 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2124 | 2124 | ) { |
| 2125 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2125 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2126 | 2126 | } |
| 2127 | 2127 | } |
| 2128 | 2128 | } |
@@ -2157,9 +2157,9 @@ discard block |
||
| 2157 | 2157 | array_shift($myself); |
| 2158 | 2158 | $myself = implode('/', $myself); |
| 2159 | 2159 | } |
| 2160 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2160 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2161 | 2161 | |
| 2162 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2162 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2163 | 2163 | |
| 2164 | 2164 | return $url; |
| 2165 | 2165 | } |
@@ -2197,16 +2197,16 @@ discard block |
||
| 2197 | 2197 | **/ |
| 2198 | 2198 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2199 | 2199 | if (!$rel) { |
| 2200 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2200 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2201 | 2201 | } else { |
| 2202 | 2202 | if (!is_string($rel)) { |
| 2203 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2203 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2204 | 2204 | } |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | 2207 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2208 | 2208 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2209 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2209 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2210 | 2210 | } elseif ($args) { |
| 2211 | 2211 | $args = "?$args"; |
| 2212 | 2212 | } |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | $args .= "#$ancre"; |
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2217 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2218 | 2218 | } |
| 2219 | 2219 | |
| 2220 | 2220 | // |
@@ -2296,10 +2296,10 @@ discard block |
||
| 2296 | 2296 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2297 | 2297 | } |
| 2298 | 2298 | if ($args) { |
| 2299 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2299 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2300 | 2300 | } |
| 2301 | 2301 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2302 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2302 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | if (!$no_entities) { |
@@ -2311,7 +2311,7 @@ discard block |
||
| 2311 | 2311 | |
| 2312 | 2312 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2313 | 2313 | |
| 2314 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2314 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | // Pour les formulaires en methode POST, |
@@ -2346,8 +2346,7 @@ discard block |
||
| 2346 | 2346 | . "><div>\n" |
| 2347 | 2347 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2348 | 2348 | . $corps |
| 2349 | - . (!$submit ? '' : |
|
| 2350 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2349 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2351 | 2350 | . "</div></form>\n"; |
| 2352 | 2351 | } |
| 2353 | 2352 | |
@@ -2372,14 +2371,14 @@ discard block |
||
| 2372 | 2371 | ? generer_url_ecrire(_request('exec')) |
| 2373 | 2372 | : generer_url_public(); |
| 2374 | 2373 | |
| 2375 | - return "\n<form action='" . |
|
| 2376 | - $h . |
|
| 2377 | - "'" . |
|
| 2378 | - $atts . |
|
| 2379 | - ">\n" . |
|
| 2380 | - '<div>' . |
|
| 2381 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2382 | - $corps . |
|
| 2374 | + return "\n<form action='". |
|
| 2375 | + $h. |
|
| 2376 | + "'". |
|
| 2377 | + $atts. |
|
| 2378 | + ">\n". |
|
| 2379 | + '<div>'. |
|
| 2380 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2381 | + $corps. |
|
| 2383 | 2382 | '</div></form>'; |
| 2384 | 2383 | } |
| 2385 | 2384 | |
@@ -2407,7 +2406,7 @@ discard block |
||
| 2407 | 2406 | : generer_url_public('', '', false, false); |
| 2408 | 2407 | $url = parametre_url($url, 'action', $script); |
| 2409 | 2408 | if ($args) { |
| 2410 | - $url .= quote_amp('&' . $args); |
|
| 2409 | + $url .= quote_amp('&'.$args); |
|
| 2411 | 2410 | } |
| 2412 | 2411 | |
| 2413 | 2412 | if ($no_entities) { |
@@ -2441,9 +2440,9 @@ discard block |
||
| 2441 | 2440 | } |
| 2442 | 2441 | $url = |
| 2443 | 2442 | (($public ? _DIR_RACINE : _DIR_RESTREINT) ?: './') |
| 2444 | - . $script . '/' |
|
| 2443 | + . $script.'/' |
|
| 2445 | 2444 | . ($path ? trim($path, '/') : '') |
| 2446 | - . ($args ? '?' . quote_amp($args) : ''); |
|
| 2445 | + . ($args ? '?'.quote_amp($args) : ''); |
|
| 2447 | 2446 | |
| 2448 | 2447 | if ($no_entities) { |
| 2449 | 2448 | $url = str_replace('&', '&', $url); |
@@ -2492,17 +2491,17 @@ discard block |
||
| 2492 | 2491 | |
| 2493 | 2492 | // le nom du repertoire plugins/ activables/desactivables |
| 2494 | 2493 | if (!defined('_DIR_PLUGINS')) { |
| 2495 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2494 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2496 | 2495 | } |
| 2497 | 2496 | |
| 2498 | 2497 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2499 | 2498 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2500 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2499 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2501 | 2500 | } |
| 2502 | 2501 | |
| 2503 | 2502 | // le nom du repertoire des librairies |
| 2504 | 2503 | if (!defined('_DIR_LIB')) { |
| 2505 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2504 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2506 | 2505 | } |
| 2507 | 2506 | |
| 2508 | 2507 | if (!defined('_DIR_IMG')) { |
@@ -2512,29 +2511,29 @@ discard block |
||
| 2512 | 2511 | define('_DIR_LOGOS', $pa); |
| 2513 | 2512 | } |
| 2514 | 2513 | if (!defined('_DIR_IMG_ICONES')) { |
| 2515 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2514 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2516 | 2515 | } |
| 2517 | 2516 | |
| 2518 | 2517 | if (!defined('_DIR_DUMP')) { |
| 2519 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2518 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_DIR_SESSIONS')) { |
| 2522 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2521 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_DIR_TRANSFERT')) { |
| 2525 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2524 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_DIR_CACHE')) { |
| 2528 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2527 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_DIR_CACHE_XML')) { |
| 2531 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2530 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | if (!defined('_DIR_SKELS')) { |
| 2534 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2533 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2535 | 2534 | } |
| 2536 | 2535 | if (!defined('_DIR_AIDE')) { |
| 2537 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2536 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2538 | 2537 | } |
| 2539 | 2538 | if (!defined('_DIR_TMP')) { |
| 2540 | 2539 | define('_DIR_TMP', $ti); |
@@ -2563,27 +2562,27 @@ discard block |
||
| 2563 | 2562 | // Declaration des fichiers |
| 2564 | 2563 | |
| 2565 | 2564 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2566 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2565 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2567 | 2566 | } |
| 2568 | 2567 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2569 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2568 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2570 | 2569 | } |
| 2571 | 2570 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2572 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2571 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2573 | 2572 | } |
| 2574 | 2573 | if (!defined('_CACHE_PIPELINES')) { |
| 2575 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2574 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2576 | 2575 | } |
| 2577 | 2576 | if (!defined('_CACHE_CHEMIN')) { |
| 2578 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2577 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2579 | 2578 | } |
| 2580 | 2579 | |
| 2581 | 2580 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2582 | 2581 | if (!defined('_FILE_META')) { |
| 2583 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2582 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2584 | 2583 | } |
| 2585 | 2584 | if (!defined('_DIR_LOG')) { |
| 2586 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2585 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2587 | 2586 | } |
| 2588 | 2587 | if (!defined('_FILE_LOG')) { |
| 2589 | 2588 | define('_FILE_LOG', 'spip'); |
@@ -2600,8 +2599,8 @@ discard block |
||
| 2600 | 2599 | if (!defined('_FILE_CONNECT')) { |
| 2601 | 2600 | define( |
| 2602 | 2601 | '_FILE_CONNECT', |
| 2603 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2604 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2602 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2603 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2605 | 2604 | : false)) |
| 2606 | 2605 | ); |
| 2607 | 2606 | } |
@@ -2613,7 +2612,7 @@ discard block |
||
| 2613 | 2612 | if (!defined('_FILE_CHMOD')) { |
| 2614 | 2613 | define( |
| 2615 | 2614 | '_FILE_CHMOD', |
| 2616 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2615 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2617 | 2616 | : false) |
| 2618 | 2617 | ); |
| 2619 | 2618 | } |
@@ -2626,10 +2625,10 @@ discard block |
||
| 2626 | 2625 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2627 | 2626 | } |
| 2628 | 2627 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2629 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2628 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2630 | 2629 | } |
| 2631 | 2630 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2632 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2631 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2633 | 2632 | } |
| 2634 | 2633 | |
| 2635 | 2634 | // Definition des droits d'acces en ecriture |
@@ -2647,13 +2646,13 @@ discard block |
||
| 2647 | 2646 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2648 | 2647 | } |
| 2649 | 2648 | if (!defined('_ROOT_PLUGINS')) { |
| 2650 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2649 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2651 | 2650 | } |
| 2652 | 2651 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2653 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2652 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2654 | 2653 | } |
| 2655 | 2654 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2656 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2655 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2657 | 2656 | } |
| 2658 | 2657 | |
| 2659 | 2658 | // La taille des Log |
@@ -2690,7 +2689,7 @@ discard block |
||
| 2690 | 2689 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2691 | 2690 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2692 | 2691 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2693 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2692 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2694 | 2693 | |
| 2695 | 2694 | // charger tout de suite le path et son cache |
| 2696 | 2695 | load_path_cache(); |
@@ -2738,7 +2737,7 @@ discard block |
||
| 2738 | 2737 | !empty($_SERVER['QUERY_STRING']) |
| 2739 | 2738 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2740 | 2739 | ) { |
| 2741 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2740 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2742 | 2741 | } |
| 2743 | 2742 | } |
| 2744 | 2743 | |
@@ -2774,7 +2773,7 @@ discard block |
||
| 2774 | 2773 | ) { |
| 2775 | 2774 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2776 | 2775 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2777 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2776 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2778 | 2777 | } else { |
| 2779 | 2778 | $uri_ref = ''; |
| 2780 | 2779 | } |
@@ -2868,7 +2867,7 @@ discard block |
||
| 2868 | 2867 | } |
| 2869 | 2868 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2870 | 2869 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2871 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2870 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2872 | 2871 | } |
| 2873 | 2872 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2874 | 2873 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -3090,7 +3089,7 @@ discard block |
||
| 3090 | 3089 | } |
| 3091 | 3090 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3092 | 3091 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3093 | - . ' ' . _VAR_MODE); |
|
| 3092 | + . ' '._VAR_MODE); |
|
| 3094 | 3093 | } |
| 3095 | 3094 | } // pas autorise ? |
| 3096 | 3095 | else { |
@@ -3105,7 +3104,7 @@ discard block |
||
| 3105 | 3104 | if (strpos($self, 'page=login') === false) { |
| 3106 | 3105 | include_spip('inc/headers'); |
| 3107 | 3106 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3108 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3107 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3109 | 3108 | } |
| 3110 | 3109 | } |
| 3111 | 3110 | // sinon tant pis |
@@ -3147,10 +3146,10 @@ discard block |
||
| 3147 | 3146 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3148 | 3147 | // certaines constantes |
| 3149 | 3148 | @spip_initialisation_core( |
| 3150 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3151 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3152 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3153 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3149 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3150 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3151 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3152 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3154 | 3153 | ); |
| 3155 | 3154 | |
| 3156 | 3155 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3183,7 +3182,7 @@ discard block |
||
| 3183 | 3182 | } |
| 3184 | 3183 | |
| 3185 | 3184 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3186 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3185 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3187 | 3186 | $session = charger_fonction('session', 'inc'); |
| 3188 | 3187 | if ($session()) { |
| 3189 | 3188 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3263,7 +3262,7 @@ discard block |
||
| 3263 | 3262 | 'definir_session', |
| 3264 | 3263 | $GLOBALS['visiteur_session'] |
| 3265 | 3264 | ? serialize($GLOBALS['visiteur_session']) |
| 3266 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3265 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3267 | 3266 | : '' |
| 3268 | 3267 | ); |
| 3269 | 3268 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3419,11 +3418,11 @@ discard block |
||
| 3419 | 3418 | $GLOBALS['_INC_PUBLIC']++; |
| 3420 | 3419 | |
| 3421 | 3420 | // fix #4235 |
| 3422 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3421 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3423 | 3422 | |
| 3424 | 3423 | |
| 3425 | 3424 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3426 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3425 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3427 | 3426 | |
| 3428 | 3427 | $page = evaluer_fond($f, $contexte, $connect); |
| 3429 | 3428 | if ($page === '') { |
@@ -3508,7 +3507,7 @@ discard block |
||
| 3508 | 3507 | * @return array|string |
| 3509 | 3508 | */ |
| 3510 | 3509 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3511 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3510 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3512 | 3511 | if (!$pathinfo) { |
| 3513 | 3512 | return $f; |
| 3514 | 3513 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2_097_152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | else { |
| 121 | - spip_log("copie_locale : recuperation $source sur $localrac OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 121 | + spip_log("copie_locale : recuperation $source sur $localrac OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 122 | 122 | } |
| 123 | 123 | if (!$res or !$res['length']) { |
| 124 | 124 | // si $t c'est sans doute juste un not-modified-since |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if (!$is_known_host) { |
| 209 | 209 | $host = trim($parsed_url['host'], '.'); |
| 210 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 210 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 211 | 211 | $ip = gethostbyname($host); |
| 212 | 212 | if ($ip === $host) { |
| 213 | 213 | // Error condition for gethostbyname() |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | if ($ip) { |
| 231 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 231 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 232 | 232 | return false; |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | $port = $parsed_url['port']; |
| 242 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 242 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 243 | 243 | return $url; |
| 244 | 244 | } |
| 245 | 245 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | if ($taille > 500) { |
| 312 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 312 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -337,16 +337,16 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | } else { |
| 339 | 339 | // fabrique une chaine HTTP simple pour un POST |
| 340 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 340 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 341 | 341 | $chaine = []; |
| 342 | 342 | if (is_array($donnees)) { |
| 343 | 343 | foreach ($donnees as $cle => $valeur) { |
| 344 | 344 | if (is_array($valeur)) { |
| 345 | 345 | foreach ($valeur as $val2) { |
| 346 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 346 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 347 | 347 | } |
| 348 | 348 | } else { |
| 349 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 349 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | $chaine = implode('&', $chaine); |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 454 | + spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 455 | 455 | |
| 456 | 456 | // Ajout des en-têtes spécifiques si besoin |
| 457 | 457 | $formatted_data = ''; |
| 458 | 458 | if (!empty($options['headers'])) { |
| 459 | 459 | foreach ($options['headers'] as $champ => $valeur) { |
| 460 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 460 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 466 | 466 | $head .= $formatted_data; |
| 467 | 467 | if (stripos($head, 'Content-Length:') === false) { |
| 468 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 468 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 469 | 469 | } |
| 470 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 470 | + $formatted_data = $head."\r\n".$postdata; |
|
| 471 | 471 | if ( |
| 472 | 472 | strlen($postdata) |
| 473 | 473 | and !$methode_demandee |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 482 | 482 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 483 | 483 | if (!tester_url_absolue($url)) { |
| 484 | - $url = 'http://' . $url; |
|
| 484 | + $url = 'http://'.$url; |
|
| 485 | 485 | } elseif (strncmp($url, '//', 2) == 0) { |
| 486 | - $url = 'http:' . $url; |
|
| 486 | + $url = 'http:'.$url; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $url = url_to_ascii($url); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $options['if_modified_since'] |
| 513 | 513 | ); |
| 514 | 514 | if (!$handle) { |
| 515 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 515 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 516 | 516 | |
| 517 | 517 | return false; |
| 518 | 518 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | 'status' => 200, |
| 543 | 543 | ]; |
| 544 | 544 | } else { |
| 545 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 545 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 546 | 546 | return false; |
| 547 | 547 | } |
| 548 | 548 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -558,11 +558,11 @@ discard block |
||
| 558 | 558 | $options['datas'] = ''; |
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | - spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 561 | + spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 562 | 562 | |
| 563 | 563 | return recuperer_url($url, $options); |
| 564 | 564 | } elseif ($res['status'] !== 200) { |
| 565 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 565 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 566 | 566 | } |
| 567 | 567 | $result['status'] = $res['status']; |
| 568 | 568 | if (isset($res['headers'])) { |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | // on ne veut que les entetes |
| 580 | 580 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 581 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 581 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 582 | 582 | return $result; |
| 583 | 583 | } |
| 584 | 584 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | |
| 589 | 589 | $gz = false; |
| 590 | 590 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 591 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 591 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $trace = json_decode(json_encode($result), true); |
| 626 | 626 | $trace['page'] = '...'; |
| 627 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 627 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 628 | 628 | |
| 629 | 629 | return $result; |
| 630 | 630 | } |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | $sig['url'] = $url; |
| 679 | 679 | |
| 680 | 680 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 681 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 681 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 682 | 682 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 683 | 683 | $cache = "$sub$cache"; |
| 684 | 684 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $fp = false; |
| 733 | 733 | if ($fichier) { |
| 734 | 734 | include_spip('inc/acces'); |
| 735 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 735 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 736 | 736 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 737 | 737 | if (!$fp and file_exists($fichier)) { |
| 738 | 738 | return filesize($fichier); |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | $result['status'] = intval($r[1]); |
| 793 | 793 | while ($s = trim(fgets($handle, 16384))) { |
| 794 | - $result['headers'][] = $s . "\n"; |
|
| 794 | + $result['headers'][] = $s."\n"; |
|
| 795 | 795 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 796 | 796 | [, $d, $v] = $r; |
| 797 | 797 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | |
| 841 | 841 | // on se place tout le temps comme si on etait a la racine |
| 842 | 842 | if (_DIR_RACINE) { |
| 843 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 843 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | $m = md5($source); |
| 847 | 847 | |
| 848 | 848 | return $d |
| 849 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 849 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 850 | 850 | . substr($m, 0, 4) |
| 851 | 851 | . ".$extension"; |
| 852 | 852 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | // Si c'est deja local pas de souci |
| 870 | 870 | if (!tester_url_absolue($source)) { |
| 871 | 871 | if (_DIR_RACINE) { |
| 872 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 872 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | return $source; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $ext |
| 888 | 888 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 889 | 889 | and $f = nom_fichier_copie_locale($source, $ext) |
| 890 | - and file_exists(_DIR_RACINE . $f) |
|
| 890 | + and file_exists(_DIR_RACINE.$f) |
|
| 891 | 891 | ) { |
| 892 | 892 | return $f; |
| 893 | 893 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | // Si c'est deja dans la table des documents, |
| 897 | 897 | // ramener le nom de sa copie potentielle |
| 898 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 898 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 899 | 899 | |
| 900 | 900 | if ($ext) { |
| 901 | 901 | return nom_fichier_copie_locale($source, $ext); |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 908 | 908 | |
| 909 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 909 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 910 | 910 | $f = nom_fichier_copie_locale($source, $ext); |
| 911 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 911 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 912 | 912 | return $f; |
| 913 | 913 | } |
| 914 | 914 | } |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | // Ping pour voir si son extension est connue et autorisee |
| 917 | 917 | // avec mise en cache du resultat du ping |
| 918 | 918 | |
| 919 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 919 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 920 | 920 | if ( |
| 921 | 921 | !@file_exists($cache) |
| 922 | 922 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -926,10 +926,10 @@ discard block |
||
| 926 | 926 | ecrire_fichier($cache, serialize($path_parts)); |
| 927 | 927 | } |
| 928 | 928 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 929 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 929 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 930 | 930 | return nom_fichier_copie_locale($source, $ext); |
| 931 | 931 | } |
| 932 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 932 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | } else { |
| 1014 | 1014 | if ($a['body']) { |
| 1015 | 1015 | $a['extension'] = $extension; |
| 1016 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1016 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1017 | 1017 | ecrire_fichier($a['fichier'], $a['body']); |
| 1018 | 1018 | $size_image = @spip_getimagesize($a['fichier']); |
| 1019 | 1019 | $a['largeur'] = intval($size_image[0]); |
@@ -1081,20 +1081,20 @@ discard block |
||
| 1081 | 1081 | !$t |
| 1082 | 1082 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1083 | 1083 | ) { |
| 1084 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1084 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1085 | 1085 | } |
| 1086 | 1086 | if ( |
| 1087 | 1087 | !$t |
| 1088 | 1088 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1089 | 1089 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1090 | 1090 | ) { |
| 1091 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1091 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1096 | 1096 | if (!$t) { |
| 1097 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1097 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1105,11 +1105,11 @@ discard block |
||
| 1105 | 1105 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1106 | 1106 | ) { |
| 1107 | 1107 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1108 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1108 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | if ($t) { |
| 1112 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1112 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1113 | 1113 | return $t['extension']; |
| 1114 | 1114 | } else { |
| 1115 | 1115 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | } |
| 1213 | 1213 | } else { |
| 1214 | 1214 | $scheme = $t['scheme']; |
| 1215 | - $noproxy = $scheme . '://'; |
|
| 1215 | + $noproxy = $scheme.'://'; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | if (isset($t['user'])) { |
| 1218 | 1218 | $user = [$t['user'], $t['pass']]; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | if (!empty($t['query'])) { |
| 1229 | - $path .= '?' . $t['query']; |
|
| 1229 | + $path .= '?'.$t['query']; |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1300,29 +1300,29 @@ discard block |
||
| 1300 | 1300 | $proxy_user = ''; |
| 1301 | 1301 | $http_proxy = need_proxy($host); |
| 1302 | 1302 | if ($user) { |
| 1303 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1303 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | $connect = ''; |
| 1307 | 1307 | if ($http_proxy) { |
| 1308 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1309 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1310 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1308 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1309 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1310 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1311 | 1311 | . "Host: $path_host\r\n" |
| 1312 | 1312 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1313 | 1313 | } else { |
| 1314 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1314 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1315 | 1315 | . (!$user ? '' : "$user@") |
| 1316 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1316 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1317 | 1317 | } |
| 1318 | 1318 | $t2 = @parse_url($http_proxy); |
| 1319 | 1319 | $first_host = $t2['host']; |
| 1320 | 1320 | $port = ($t2['port'] ?? null) ?: 80; |
| 1321 | 1321 | if ($t2['user'] ?? null) { |
| 1322 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1322 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | } else { |
| 1325 | - $first_host = $noproxy . $host; |
|
| 1325 | + $first_host = $noproxy.$host; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | if ($connect) { |
@@ -1344,7 +1344,7 @@ discard block |
||
| 1344 | 1344 | ); |
| 1345 | 1345 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1346 | 1346 | if (!$f) { |
| 1347 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1347 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1348 | 1348 | return $errno; |
| 1349 | 1349 | } |
| 1350 | 1350 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | or !count($res = explode(' ', $res)) |
| 1358 | 1358 | or $res[1] !== '200' |
| 1359 | 1359 | ) { |
| 1360 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1360 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1361 | 1361 | fclose($f); |
| 1362 | 1362 | |
| 1363 | 1363 | return false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1375 | 1375 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1376 | 1376 | if (!$f) { |
| 1377 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1377 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1378 | 1378 | |
| 1379 | 1379 | return $errno; |
| 1380 | 1380 | } |
@@ -1384,16 +1384,16 @@ discard block |
||
| 1384 | 1384 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1385 | 1385 | |
| 1386 | 1386 | $host_port = $host; |
| 1387 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1387 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1388 | 1388 | $host_port .= ":$port"; |
| 1389 | 1389 | } |
| 1390 | 1390 | $req = "$method $path $vers\r\n" |
| 1391 | 1391 | . "Host: $host_port\r\n" |
| 1392 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1393 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1392 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1393 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1394 | 1394 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1395 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1396 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1395 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1396 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1397 | 1397 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1398 | 1398 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1399 | 1399 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // affichage "GIT [master: abcdef]" |
| 240 | 240 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 241 | 241 | if ($desc['branch']) { |
| 242 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 242 | + $commit = $desc['branch'].': '.$commit; |
|
| 243 | 243 | } |
| 244 | 244 | return "{$desc['vcs']} [$commit]"; |
| 245 | 245 | } |
@@ -258,9 +258,9 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | // version installee par GIT |
| 261 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 261 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 262 | 262 | $currentHead = trim(substr($c, 4)); |
| 263 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 263 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 264 | 264 | return [ |
| 265 | 265 | 'vcs' => 'GIT', |
| 266 | 266 | 'branch' => basename($currentHead), |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | $dir = '.'; |
| 288 | 288 | } |
| 289 | 289 | // version installee par SVN |
| 290 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 290 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 291 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 292 | 292 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 293 | 293 | if ($result) { |
| 294 | 294 | $row = $result->fetchArray(); |
@@ -306,12 +306,12 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 308 | 308 | // et laisser passer les fonctions personnelles baptisees image_... |
| 309 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 310 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 311 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 312 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 313 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 314 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 311 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 312 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 313 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 314 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 315 | 315 | |
| 316 | 316 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 317 | 317 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | */ |
| 471 | 471 | function filtre_debug($val, $key = null) { |
| 472 | 472 | $debug = ( |
| 473 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 474 | - ) . var_export($val, true); |
|
| 473 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 474 | + ).var_export($val, true); |
|
| 475 | 475 | |
| 476 | 476 | include_spip('inc/autoriser'); |
| 477 | 477 | if (autoriser('webmestre')) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $is_file = false; |
| 526 | 526 | } |
| 527 | 527 | if ($is_file) { |
| 528 | - $is_local_file = function ($path) { |
|
| 528 | + $is_local_file = function($path) { |
|
| 529 | 529 | if (strpos($path, '?') !== false) { |
| 530 | 530 | $path = supprimer_timestamp($path); |
| 531 | 531 | // remove ?24px added by find_in_theme on .svg files |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 578 | 578 | $srcover = $match[1]; |
| 579 | 579 | array_shift($args); |
| 580 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 580 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 581 | 581 | $srcover_filter = $filtre(...$args); |
| 582 | 582 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 583 | 583 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | // " -> " et tout ce genre de choses |
| 981 | 981 | $u = $GLOBALS['meta']['pcre_u']; |
| 982 | 982 | $texte = str_replace(' ', ' ', $texte); |
| 983 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 983 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 984 | 984 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 985 | 985 | $texte = entites_html($texte, false, false); |
| 986 | 986 | // mais bien echapper les double quotes ! |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | **/ |
| 1041 | 1041 | function supprimer_numero($texte) { |
| 1042 | 1042 | return preg_replace( |
| 1043 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1043 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1044 | 1044 | '', |
| 1045 | 1045 | $texte |
| 1046 | 1046 | ); |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | function recuperer_numero($texte) { |
| 1069 | 1069 | if ( |
| 1070 | 1070 | preg_match( |
| 1071 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1071 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1072 | 1072 | $texte, |
| 1073 | 1073 | $regs |
| 1074 | 1074 | ) |
@@ -1159,8 +1159,8 @@ discard block |
||
| 1159 | 1159 | **/ |
| 1160 | 1160 | function textebrut($texte) { |
| 1161 | 1161 | $u = $GLOBALS['meta']['pcre_u']; |
| 1162 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1163 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1162 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1163 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1164 | 1164 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1165 | 1165 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1166 | 1166 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | ) |
| 1195 | 1195 | ) { |
| 1196 | 1196 | foreach ($liens[0] as $a) { |
| 1197 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1197 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1198 | 1198 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1199 | 1199 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1200 | 1200 | $texte = str_replace($a, $ablank, $texte); |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | foreach ($regs[0] as $a) { |
| 1220 | 1220 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1221 | 1221 | if (strpos($rel, 'nofollow') === false) { |
| 1222 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1222 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1223 | 1223 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1224 | 1224 | $texte = str_replace($a, $anofollow, $texte); |
| 1225 | 1225 | } |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $u = $GLOBALS['meta']['pcre_u']; |
| 1249 | 1249 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1250 | 1250 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1251 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1251 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1252 | 1252 | |
| 1253 | 1253 | return $texte; |
| 1254 | 1254 | } |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | return $texte; |
| 1280 | 1280 | } |
| 1281 | 1281 | include_spip('inc/texte'); |
| 1282 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1282 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1283 | 1283 | 'div' : 'span'; |
| 1284 | 1284 | |
| 1285 | 1285 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | } |
| 1392 | 1392 | $u = $GLOBALS['meta']['pcre_u']; |
| 1393 | 1393 | if ($textebrut) { |
| 1394 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1394 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1395 | 1395 | } |
| 1396 | 1396 | $texte = texte_backend($texte); |
| 1397 | 1397 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | # un message pour abs_url |
| 1427 | 1427 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1428 | 1428 | $url = trim($url); |
| 1429 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1429 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1430 | 1430 | |
| 1431 | 1431 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1432 | 1432 | } |
@@ -1626,14 +1626,14 @@ discard block |
||
| 1626 | 1626 | if (strpos($texte, '<') !== false) { |
| 1627 | 1627 | include_spip('inc/lien'); |
| 1628 | 1628 | if (defined('_PREG_MODELE')) { |
| 1629 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1629 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1630 | 1630 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1631 | 1631 | } |
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | $debut = ''; |
| 1635 | 1635 | $suite = $texte; |
| 1636 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1636 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1637 | 1637 | $debut .= substr($suite, 0, $t - 1); |
| 1638 | 1638 | $suite = substr($suite, $t); |
| 1639 | 1639 | $car = substr($suite, 0, 1); |
@@ -1651,11 +1651,11 @@ discard block |
||
| 1651 | 1651 | $suite = substr($suite, strlen($regs[0])); |
| 1652 | 1652 | } |
| 1653 | 1653 | } |
| 1654 | - $texte = $debut . $suite; |
|
| 1654 | + $texte = $debut.$suite; |
|
| 1655 | 1655 | |
| 1656 | 1656 | $texte = echappe_retour($texte); |
| 1657 | 1657 | |
| 1658 | - return $texte . $fin; |
|
| 1658 | + return $texte.$fin; |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | foreach ($regs as $reg) { |
| 1720 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1720 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1721 | 1721 | $desc = $traduire($cle, $lang, true); |
| 1722 | 1722 | $l = $desc->langue; |
| 1723 | 1723 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1831,9 +1831,9 @@ discard block |
||
| 1831 | 1831 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1832 | 1832 | include_spip('inc/texte'); |
| 1833 | 1833 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1834 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1834 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1835 | 1835 | if ($mode === 'div') { |
| 1836 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1836 | + $trad = rtrim($trad)."\n\n"; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1839 | 1839 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2033,7 +2033,7 @@ discard block |
||
| 2033 | 2033 | if (is_array($balise)) { |
| 2034 | 2034 | array_walk( |
| 2035 | 2035 | $balise, |
| 2036 | - function (&$a, $key, $t) { |
|
| 2036 | + function(&$a, $key, $t) { |
|
| 2037 | 2037 | $a = extraire_attribut($a, $t); |
| 2038 | 2038 | }, |
| 2039 | 2039 | $attribut |
@@ -2130,14 +2130,14 @@ discard block |
||
| 2130 | 2130 | |
| 2131 | 2131 | if ($old !== null) { |
| 2132 | 2132 | // Remplacer l'ancien attribut du meme nom |
| 2133 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2133 | + $balise = $r[1].$insert.$r[5]; |
|
| 2134 | 2134 | } else { |
| 2135 | 2135 | // preferer une balise " />" (comme <img />) |
| 2136 | 2136 | if (preg_match(',/>,', $balise)) { |
| 2137 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2137 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2138 | 2138 | } // sinon une balise <a ...> ... </a> |
| 2139 | 2139 | else { |
| 2140 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2140 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2141 | 2141 | } |
| 2142 | 2142 | } |
| 2143 | 2143 | |
@@ -2192,7 +2192,7 @@ discard block |
||
| 2192 | 2192 | if ( |
| 2193 | 2193 | $class_courante |
| 2194 | 2194 | and strpos($class_courante, (string) $c) !== false |
| 2195 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2195 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2196 | 2196 | ) { |
| 2197 | 2197 | $is_class_presente = true; |
| 2198 | 2198 | } |
@@ -2200,12 +2200,12 @@ discard block |
||
| 2200 | 2200 | in_array($operation, ['ajouter', 'commuter']) |
| 2201 | 2201 | and !$is_class_presente |
| 2202 | 2202 | ) { |
| 2203 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2203 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2204 | 2204 | } elseif ( |
| 2205 | 2205 | in_array($operation, ['supprimer', 'commuter']) |
| 2206 | 2206 | and $is_class_presente |
| 2207 | 2207 | ) { |
| 2208 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2208 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2209 | 2209 | } |
| 2210 | 2210 | } |
| 2211 | 2211 | |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | // Quelques fonctions de calcul arithmetique |
| 2269 | 2269 | // |
| 2270 | 2270 | function floatstr($a) { |
| 2271 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2271 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2272 | 2272 | } |
| 2273 | 2273 | function strize($f, $a, $b) { |
| 2274 | 2274 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2404,13 +2404,13 @@ discard block |
||
| 2404 | 2404 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2405 | 2405 | define('_TAGS_NOM_AUTEUR', ''); |
| 2406 | 2406 | } |
| 2407 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2407 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2408 | 2408 | foreach ($tags_acceptes as $tag) { |
| 2409 | 2409 | if (strlen($tag)) { |
| 2410 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2411 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2412 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2413 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2410 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2411 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2412 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2413 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2414 | 2414 | } |
| 2415 | 2415 | } |
| 2416 | 2416 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2464,7 +2464,7 @@ discard block |
||
| 2464 | 2464 | . http_img_pack( |
| 2465 | 2465 | 'attachment-16.png', |
| 2466 | 2466 | $t, |
| 2467 | - 'title="' . attribut_html($t) . '"' |
|
| 2467 | + 'title="'.attribut_html($t).'"' |
|
| 2468 | 2468 | ) |
| 2469 | 2469 | . '</a>', |
| 2470 | 2470 | $tag |
@@ -2528,10 +2528,10 @@ discard block |
||
| 2528 | 2528 | $fichier = basename($url); |
| 2529 | 2529 | |
| 2530 | 2530 | return '<a rel="enclosure"' |
| 2531 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2532 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2533 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2534 | - . '>' . $fichier . '</a>'; |
|
| 2531 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2532 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2533 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2534 | + . '>'.$fichier.'</a>'; |
|
| 2535 | 2535 | } |
| 2536 | 2536 | |
| 2537 | 2537 | /** |
@@ -2559,9 +2559,9 @@ discard block |
||
| 2559 | 2559 | } # vieux data |
| 2560 | 2560 | $fichier = basename($url); |
| 2561 | 2561 | $enclosures[] = '<enclosure' |
| 2562 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2563 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2564 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2562 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2563 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2564 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2565 | 2565 | . ' />'; |
| 2566 | 2566 | } |
| 2567 | 2567 | } |
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2588 | 2588 | $subjects .= '<dc:subject>' |
| 2589 | 2589 | . texte_backend(textebrut($e)) |
| 2590 | - . '</dc:subject>' . "\n"; |
|
| 2590 | + . '</dc:subject>'."\n"; |
|
| 2591 | 2591 | } |
| 2592 | 2592 | } |
| 2593 | 2593 | |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | if (is_array($texte)) { |
| 2624 | 2624 | array_walk( |
| 2625 | 2625 | $texte, |
| 2626 | - function (&$a, $key, $t) { |
|
| 2626 | + function(&$a, $key, $t) { |
|
| 2627 | 2627 | $a = extraire_balise($a, $t); |
| 2628 | 2628 | }, |
| 2629 | 2629 | $tag |
@@ -2671,7 +2671,7 @@ discard block |
||
| 2671 | 2671 | if (is_array($texte)) { |
| 2672 | 2672 | array_walk( |
| 2673 | 2673 | $texte, |
| 2674 | - function (&$a, $key, $t) { |
|
| 2674 | + function(&$a, $key, $t) { |
|
| 2675 | 2675 | $a = extraire_balises($a, $t); |
| 2676 | 2676 | }, |
| 2677 | 2677 | $tag |
@@ -2804,7 +2804,7 @@ discard block |
||
| 2804 | 2804 | if ($fond != '404') { |
| 2805 | 2805 | $contexte = array_shift($p); |
| 2806 | 2806 | $contexte['page'] = $fond; |
| 2807 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2807 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2808 | 2808 | } |
| 2809 | 2809 | } |
| 2810 | 2810 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2859,9 +2859,9 @@ discard block |
||
| 2859 | 2859 | . '"' |
| 2860 | 2860 | . (is_null($val) |
| 2861 | 2861 | ? '' |
| 2862 | - : ' value="' . entites_html($val) . '"' |
|
| 2862 | + : ' value="'.entites_html($val).'"' |
|
| 2863 | 2863 | ) |
| 2864 | - . ' type="hidden"' . "\n/>"; |
|
| 2864 | + . ' type="hidden"'."\n/>"; |
|
| 2865 | 2865 | } |
| 2866 | 2866 | |
| 2867 | 2867 | return join('', $hidden); |
@@ -2971,7 +2971,7 @@ discard block |
||
| 2971 | 2971 | |
| 2972 | 2972 | return preg_replace_callback( |
| 2973 | 2973 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2974 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2974 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2975 | 2975 | $contenu |
| 2976 | 2976 | ); |
| 2977 | 2977 | } |
@@ -3032,14 +3032,14 @@ discard block |
||
| 3032 | 3032 | ) { |
| 3033 | 3033 | $distant = true; |
| 3034 | 3034 | $cssf = parse_url($css); |
| 3035 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3035 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3036 | 3036 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3037 | 3037 | } else { |
| 3038 | 3038 | $distant = false; |
| 3039 | 3039 | $cssf = $css; |
| 3040 | 3040 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3041 | 3041 | //propose (rien a faire dans ce cas) |
| 3042 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3042 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3043 | 3043 | if (@file_exists($f)) { |
| 3044 | 3044 | return $f; |
| 3045 | 3045 | } |
@@ -3049,7 +3049,7 @@ discard block |
||
| 3049 | 3049 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3050 | 3050 | $f = $dir_var |
| 3051 | 3051 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3052 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3052 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3053 | 3053 | |
| 3054 | 3054 | // la css peut etre distante (url absolue !) |
| 3055 | 3055 | if ($distant) { |
@@ -3095,8 +3095,8 @@ discard block |
||
| 3095 | 3095 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3096 | 3096 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3097 | 3097 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3098 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3099 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3098 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3099 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | $src[] = $regs[0][$k]; |
| 3102 | 3102 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3145,7 +3145,7 @@ discard block |
||
| 3145 | 3145 | |
| 3146 | 3146 | $f = basename($css, '.css'); |
| 3147 | 3147 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3148 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3148 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3149 | 3149 | . '.css'; |
| 3150 | 3150 | |
| 3151 | 3151 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3155,7 +3155,7 @@ discard block |
||
| 3155 | 3155 | if ($url_absolue_css == $css) { |
| 3156 | 3156 | if ( |
| 3157 | 3157 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3158 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3158 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3159 | 3159 | ) { |
| 3160 | 3160 | include_spip('inc/distant'); |
| 3161 | 3161 | $contenu = recuperer_url($css); |
@@ -3267,7 +3267,7 @@ discard block |
||
| 3267 | 3267 | $expression = str_replace('\/', '/', $expression); |
| 3268 | 3268 | $expression = str_replace('/', '\/', $expression); |
| 3269 | 3269 | |
| 3270 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3270 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3271 | 3271 | if (isset($r[$capte])) { |
| 3272 | 3272 | return $r[$capte]; |
| 3273 | 3273 | } else { |
@@ -3305,7 +3305,7 @@ discard block |
||
| 3305 | 3305 | $expression = str_replace('\/', '/', $expression); |
| 3306 | 3306 | $expression = str_replace('/', '\/', $expression); |
| 3307 | 3307 | |
| 3308 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3308 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3309 | 3309 | } |
| 3310 | 3310 | |
| 3311 | 3311 | |
@@ -3324,7 +3324,7 @@ discard block |
||
| 3324 | 3324 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3325 | 3325 | |
| 3326 | 3326 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3327 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3327 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3328 | 3328 | |
| 3329 | 3329 | if ( |
| 3330 | 3330 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3338,7 +3338,7 @@ discard block |
||
| 3338 | 3338 | if (!isset($doublons['documents'])) { |
| 3339 | 3339 | $doublons['documents'] = ''; |
| 3340 | 3340 | } |
| 3341 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3341 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3342 | 3342 | } |
| 3343 | 3343 | |
| 3344 | 3344 | return $letexte; |
@@ -3395,7 +3395,7 @@ discard block |
||
| 3395 | 3395 | if ($env) { |
| 3396 | 3396 | foreach ($env as $i => $j) { |
| 3397 | 3397 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3398 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3398 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3399 | 3399 | } |
| 3400 | 3400 | } |
| 3401 | 3401 | } |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | if ($env) { |
| 3435 | 3435 | foreach ($env as $i => $j) { |
| 3436 | 3436 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3437 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3437 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3438 | 3438 | } |
| 3439 | 3439 | } |
| 3440 | 3440 | } |
@@ -3508,10 +3508,10 @@ discard block |
||
| 3508 | 3508 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3509 | 3509 | if ( |
| 3510 | 3510 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3511 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3511 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3512 | 3512 | and file_exists($variante_svg_generique) |
| 3513 | 3513 | ) { |
| 3514 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3514 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3515 | 3515 | $img_file = $variante_svg_size; |
| 3516 | 3516 | } |
| 3517 | 3517 | else { |
@@ -3569,7 +3569,7 @@ discard block |
||
| 3569 | 3569 | return ''; |
| 3570 | 3570 | } |
| 3571 | 3571 | } |
| 3572 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3572 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3573 | 3573 | } |
| 3574 | 3574 | |
| 3575 | 3575 | if (file_exists($img_file)) { |
@@ -3579,14 +3579,14 @@ discard block |
||
| 3579 | 3579 | $alt = ''; |
| 3580 | 3580 | } |
| 3581 | 3581 | elseif ($alt or $alt === '') { |
| 3582 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3582 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3583 | 3583 | } |
| 3584 | 3584 | else { |
| 3585 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3585 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3586 | 3586 | } |
| 3587 | 3587 | return "<img src='$img_file'$alt" |
| 3588 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3589 | - . ' ' . ltrim($atts) |
|
| 3588 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3589 | + . ' '.ltrim($atts) |
|
| 3590 | 3590 | . ' />'; |
| 3591 | 3591 | } |
| 3592 | 3592 | |
@@ -3600,10 +3600,10 @@ discard block |
||
| 3600 | 3600 | */ |
| 3601 | 3601 | function http_style_background($img, $att = '', $size = null) { |
| 3602 | 3602 | if ($size and is_numeric($size)) { |
| 3603 | - $size = trim($size) . 'px'; |
|
| 3603 | + $size = trim($size).'px'; |
|
| 3604 | 3604 | } |
| 3605 | - return " style='background" . |
|
| 3606 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3605 | + return " style='background". |
|
| 3606 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3607 | 3607 | . ($size ? "background-size:{$size};" : '') |
| 3608 | 3608 | . "'"; |
| 3609 | 3609 | } |
@@ -3718,7 +3718,7 @@ discard block |
||
| 3718 | 3718 | $img = http_img_pack( |
| 3719 | 3719 | $img, |
| 3720 | 3720 | $alt, |
| 3721 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3721 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3722 | 3722 | '', |
| 3723 | 3723 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3724 | 3724 | ); |
@@ -3803,7 +3803,7 @@ discard block |
||
| 3803 | 3803 | $balise_svg_source = $balise_svg; |
| 3804 | 3804 | |
| 3805 | 3805 | // entete XML à supprimer |
| 3806 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3806 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3807 | 3807 | |
| 3808 | 3808 | // IE est toujours mon ami |
| 3809 | 3809 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3821,9 +3821,9 @@ discard block |
||
| 3821 | 3821 | // regler le alt |
| 3822 | 3822 | if ($alt) { |
| 3823 | 3823 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3824 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3824 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3825 | 3825 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3826 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3826 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3827 | 3827 | $balise_svg .= $title; |
| 3828 | 3828 | } |
| 3829 | 3829 | else { |
@@ -3871,7 +3871,7 @@ discard block |
||
| 3871 | 3871 | if (is_array($tableau)) { |
| 3872 | 3872 | foreach ($tableau as $k => $v) { |
| 3873 | 3873 | $res = recuperer_fond( |
| 3874 | - 'modeles/' . $modele, |
|
| 3874 | + 'modeles/'.$modele, |
|
| 3875 | 3875 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3876 | 3876 | ); |
| 3877 | 3877 | $texte .= $res; |
@@ -4056,7 +4056,7 @@ discard block |
||
| 4056 | 4056 | } |
| 4057 | 4057 | |
| 4058 | 4058 | $c = serialize($c); |
| 4059 | - $cle = calculer_cle_action($form . $c); |
|
| 4059 | + $cle = calculer_cle_action($form.$c); |
|
| 4060 | 4060 | $c = "$cle:$c"; |
| 4061 | 4061 | |
| 4062 | 4062 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4114,15 +4114,15 @@ discard block |
||
| 4114 | 4114 | } |
| 4115 | 4115 | // toujours encoder l'url source dans le bloc ajax |
| 4116 | 4116 | $r = self(); |
| 4117 | - $r = ' data-origin="' . $r . '"'; |
|
| 4117 | + $r = ' data-origin="'.$r.'"'; |
|
| 4118 | 4118 | $class = 'ajaxbloc'; |
| 4119 | 4119 | if ($ajaxid and is_string($ajaxid)) { |
| 4120 | 4120 | // ajaxid est normalement conforme a un nom de classe css |
| 4121 | 4121 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4122 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4122 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4123 | 4123 | } |
| 4124 | 4124 | |
| 4125 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4125 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4126 | 4126 | } |
| 4127 | 4127 | |
| 4128 | 4128 | /** |
@@ -4166,7 +4166,7 @@ discard block |
||
| 4166 | 4166 | $cle = substr($c, 0, $p); |
| 4167 | 4167 | $c = substr($c, $p + 1); |
| 4168 | 4168 | |
| 4169 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4169 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4170 | 4170 | $env = @unserialize($c); |
| 4171 | 4171 | return $env; |
| 4172 | 4172 | } |
@@ -4287,13 +4287,13 @@ discard block |
||
| 4287 | 4287 | } |
| 4288 | 4288 | } |
| 4289 | 4289 | } |
| 4290 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4290 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4291 | 4291 | } else { |
| 4292 | 4292 | $bal = 'a'; |
| 4293 | 4293 | $att = "href='$url'" |
| 4294 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4295 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4296 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4294 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4295 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4296 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4297 | 4297 | . $evt; |
| 4298 | 4298 | } |
| 4299 | 4299 | if ($libelle === null) { |
@@ -4432,7 +4432,7 @@ discard block |
||
| 4432 | 4432 | |
| 4433 | 4433 | // Icône |
| 4434 | 4434 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4435 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4435 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4436 | 4436 | |
| 4437 | 4437 | // Markup final |
| 4438 | 4438 | if ($type == 'lien') { |
@@ -4709,20 +4709,20 @@ discard block |
||
| 4709 | 4709 | $class_form = 'ajax'; |
| 4710 | 4710 | $class = str_replace('ajax', '', $class); |
| 4711 | 4711 | } |
| 4712 | - $class_btn = 'submit ' . trim($class); |
|
| 4712 | + $class_btn = 'submit '.trim($class); |
|
| 4713 | 4713 | |
| 4714 | 4714 | if ($confirm) { |
| 4715 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4715 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4716 | 4716 | if ($callback) { |
| 4717 | 4717 | $callback = "$confirm?($callback):false"; |
| 4718 | 4718 | } else { |
| 4719 | 4719 | $callback = $confirm; |
| 4720 | 4720 | } |
| 4721 | 4721 | } |
| 4722 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4722 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4723 | 4723 | $title = $title ? " title='$title'" : ''; |
| 4724 | 4724 | |
| 4725 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4725 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4726 | 4726 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4727 | 4727 | } |
| 4728 | 4728 | |
@@ -4787,14 +4787,14 @@ discard block |
||
| 4787 | 4787 | $champ_titre = ''; |
| 4788 | 4788 | if ($demande_titre) { |
| 4789 | 4789 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4790 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4790 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4791 | 4791 | } |
| 4792 | 4792 | include_spip('base/abstract_sql'); |
| 4793 | 4793 | include_spip('base/connect_sql'); |
| 4794 | 4794 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4795 | - '*' . $champ_titre, |
|
| 4795 | + '*'.$champ_titre, |
|
| 4796 | 4796 | $desc['table_sql'], |
| 4797 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4797 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4798 | 4798 | ); |
| 4799 | 4799 | |
| 4800 | 4800 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4887,8 +4887,7 @@ discard block |
||
| 4887 | 4887 | if (isset($ligne_sql['chapo'])) { |
| 4888 | 4888 | $chapo = $ligne_sql['chapo']; |
| 4889 | 4889 | $texte = strlen($descriptif) ? |
| 4890 | - '' : |
|
| 4891 | - "$chapo \n\n $texte"; |
|
| 4890 | + '' : "$chapo \n\n $texte"; |
|
| 4892 | 4891 | } |
| 4893 | 4892 | |
| 4894 | 4893 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4963,7 +4962,7 @@ discard block |
||
| 4963 | 4962 | return $texte; |
| 4964 | 4963 | } |
| 4965 | 4964 | |
| 4966 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4965 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4967 | 4966 | |
| 4968 | 4967 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4969 | 4968 | $Pile = [0 => $env]; |
@@ -4997,7 +4996,7 @@ discard block |
||
| 4997 | 4996 | } |
| 4998 | 4997 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4999 | 4998 | |
| 5000 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4999 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 5001 | 5000 | } |
| 5002 | 5001 | |
| 5003 | 5002 | /** |
@@ -5023,10 +5022,10 @@ discard block |
||
| 5023 | 5022 | function wrap($texte, $wrap) { |
| 5024 | 5023 | $balises = extraire_balises($wrap); |
| 5025 | 5024 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5026 | - $texte = $wrap . $texte; |
|
| 5025 | + $texte = $wrap.$texte; |
|
| 5027 | 5026 | $regs = array_reverse($regs[1]); |
| 5028 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5029 | - $texte = $texte . $wrap; |
|
| 5027 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5028 | + $texte = $texte.$wrap; |
|
| 5030 | 5029 | } |
| 5031 | 5030 | |
| 5032 | 5031 | return $texte; |
@@ -5057,7 +5056,7 @@ discard block |
||
| 5057 | 5056 | |
| 5058 | 5057 | // caster $u en array si besoin |
| 5059 | 5058 | if (is_object($u)) { |
| 5060 | - $u = (array)$u; |
|
| 5059 | + $u = (array) $u; |
|
| 5061 | 5060 | } |
| 5062 | 5061 | |
| 5063 | 5062 | if (is_array($u)) { |
@@ -5079,7 +5078,7 @@ discard block |
||
| 5079 | 5078 | // sinon on passe a la ligne et on indente |
| 5080 | 5079 | $i_str = str_pad('', $indent, ' '); |
| 5081 | 5080 | foreach ($u as $k => $v) { |
| 5082 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5081 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5083 | 5082 | } |
| 5084 | 5083 | |
| 5085 | 5084 | return $out; |
@@ -5133,7 +5132,7 @@ discard block |
||
| 5133 | 5132 | * @return string |
| 5134 | 5133 | */ |
| 5135 | 5134 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5136 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5135 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5137 | 5136 | $icone = chemin_image($icone); |
| 5138 | 5137 | $balise_img = charger_filtre('balise_img'); |
| 5139 | 5138 | |
@@ -5159,7 +5158,7 @@ discard block |
||
| 5159 | 5158 | */ |
| 5160 | 5159 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5161 | 5160 | $chaine = explode(':', $chaine); |
| 5162 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5161 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5163 | 5162 | return $t; |
| 5164 | 5163 | } |
| 5165 | 5164 | $chaine = implode(':', $chaine); |
@@ -5225,7 +5224,7 @@ discard block |
||
| 5225 | 5224 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5226 | 5225 | |
| 5227 | 5226 | // calculer le nom de la css |
| 5228 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5227 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5229 | 5228 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5230 | 5229 | $contexte_implicite = calculer_contexte_implicite(); |
| 5231 | 5230 | |
@@ -5233,14 +5232,14 @@ discard block |
||
| 5233 | 5232 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5234 | 5233 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5235 | 5234 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5236 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5235 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5237 | 5236 | } |
| 5238 | 5237 | else { |
| 5239 | 5238 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5240 | 5239 | ksort($contexte); |
| 5241 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5240 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5242 | 5241 | } |
| 5243 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5242 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5244 | 5243 | |
| 5245 | 5244 | // mettre a jour le fichier si il n'existe pas |
| 5246 | 5245 | // ou trop ancien |
@@ -5248,8 +5247,8 @@ discard block |
||
| 5248 | 5247 | // et recopie sur le fichier cible uniquement si il change |
| 5249 | 5248 | if ( |
| 5250 | 5249 | !file_exists($filename) |
| 5251 | - or !file_exists($filename . '.last') |
|
| 5252 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5250 | + or !file_exists($filename.'.last') |
|
| 5251 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5253 | 5252 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5254 | 5253 | ) { |
| 5255 | 5254 | $contenu = $cache['texte']; |
@@ -5270,10 +5269,10 @@ discard block |
||
| 5270 | 5269 | } |
| 5271 | 5270 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5272 | 5271 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5273 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5272 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5274 | 5273 | } |
| 5275 | 5274 | // et ecrire le fichier si il change |
| 5276 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5275 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5277 | 5276 | } |
| 5278 | 5277 | |
| 5279 | 5278 | return timestamp($filename); |
@@ -5499,7 +5498,7 @@ discard block |
||
| 5499 | 5498 | if ($e > 0 and strlen($mid) > 8) { |
| 5500 | 5499 | $mid = '***...***'; |
| 5501 | 5500 | } |
| 5502 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5501 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5503 | 5502 | } |
| 5504 | 5503 | |
| 5505 | 5504 | |
@@ -5561,7 +5560,7 @@ discard block |
||
| 5561 | 5560 | case 'id': |
| 5562 | 5561 | case 'anchor': |
| 5563 | 5562 | if (preg_match(',^\d,', $texte)) { |
| 5564 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5563 | + $texte = substr($type, 0, 1).$texte; |
|
| 5565 | 5564 | } |
| 5566 | 5565 | } |
| 5567 | 5566 | |
@@ -5571,9 +5570,9 @@ discard block |
||
| 5571 | 5570 | |
| 5572 | 5571 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5573 | 5572 | if (preg_match(',^\d,', $texte)) { |
| 5574 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5573 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5575 | 5574 | } |
| 5576 | - $texte .= $separateur . md5($original); |
|
| 5575 | + $texte .= $separateur.md5($original); |
|
| 5577 | 5576 | $texte = substr($texte, 0, $longueur_mini); |
| 5578 | 5577 | } |
| 5579 | 5578 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Mot de passe |
| 32 | 32 | **/ |
| 33 | 33 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 34 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 34 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 35 | 35 | |
| 36 | 36 | mt_srand($seed); |
| 37 | 37 | $s = ''; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | if (!$s) { |
| 43 | 43 | $s = random_int(0, mt_getrandmax()); |
| 44 | 44 | } |
| 45 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 45 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 46 | 46 | } |
| 47 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 47 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 48 | 48 | $x = $r['r'] & 63; |
| 49 | 49 | if ($x < 10) { |
| 50 | 50 | $x = chr($x + 48); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | static $seeded; |
| 83 | 83 | |
| 84 | 84 | if (!$seeded) { |
| 85 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 85 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 86 | 86 | mt_srand($seed); |
| 87 | 87 | $seeded = true; |
| 88 | 88 | } |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); |
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | - $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur)); |
|
| 171 | + $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur)); |
|
| 172 | 172 | if (!$low_sec) { |
| 173 | 173 | $low_sec = creer_pass_aleatoire(); |
| 174 | - sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur)); |
|
| 174 | + sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur)); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) { |
| 230 | 230 | $id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0; |
| 231 | 231 | $cle = afficher_low_sec($id_auteur, "$script/$format $fond $args"); |
| 232 | - $path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : ''); |
|
| 232 | + $path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : ''); |
|
| 233 | 233 | |
| 234 | 234 | return generer_url_api($script, $path, $args, $no_entities = false, $public); |
| 235 | 235 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | foreach ($args as $val => $var) { |
| 254 | 254 | if ($var) { |
| 255 | 255 | if ($val <> 'statut') { |
| 256 | - $a .= ':' . $val . '-' . $var; |
|
| 256 | + $a .= ':'.$val.'-'.$var; |
|
| 257 | 257 | } |
| 258 | - $b .= $val . '=' . $var . '&'; |
|
| 258 | + $b .= $val.'='.$var.'&'; |
|
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | $a = substr($a, 1); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * Clé |
| 286 | 286 | **/ |
| 287 | 287 | function afficher_low_sec($id_auteur, $action = '') { |
| 288 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 288 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if (!$id_auteur = intval($id_auteur)) { |
| 317 | 317 | return; |
| 318 | 318 | } // jamais trop prudent ;) |
| 319 | - sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur)); |
|
| 319 | + sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur)); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | function initialiser_sel() { |
| 328 | 328 | if (!isset($GLOBALS['htsalt'])) { |
| 329 | 329 | if (CRYPT_MD5) { |
| 330 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 330 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 331 | 331 | } else { |
| 332 | 332 | $GLOBALS['htsalt'] = ''; |
| 333 | 333 | } |
@@ -349,8 +349,8 @@ discard block |
||
| 349 | 349 | * - void sinon. |
| 350 | 350 | **/ |
| 351 | 351 | function ecrire_acces() { |
| 352 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 353 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 352 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 353 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 354 | 354 | |
| 355 | 355 | // Cette variable de configuration peut etre posee par un plugin |
| 356 | 356 | // par exemple acces_restreint ; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | and !@file_exists($htaccess) |
| 362 | 362 | ) { |
| 363 | 363 | spip_unlink($htpasswd); |
| 364 | - spip_unlink($htpasswd . '-admin'); |
|
| 364 | + spip_unlink($htpasswd.'-admin'); |
|
| 365 | 365 | return; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | $pwd_all = ''; // login:htpass pour tous |
| 391 | 391 | $pwd_admin = ''; // login:htpass pour les admins |
| 392 | 392 | |
| 393 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 393 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 394 | 394 | while ($row = sql_fetch($res)) { |
| 395 | 395 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 396 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 396 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 397 | 397 | $pwd_all .= $ligne; |
| 398 | 398 | if ($row['statut'] == '0minirezo') { |
| 399 | 399 | $pwd_admin .= $ligne; |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @return boolean |
| 439 | 439 | */ |
| 440 | 440 | function verifier_htaccess($rep, $force = false) { |
| 441 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 441 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 442 | 442 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 443 | 443 | return true; |
| 444 | 444 | } |
@@ -467,17 +467,17 @@ discard block |
||
| 467 | 467 | fputs($ht, $deny); |
| 468 | 468 | fclose($ht); |
| 469 | 469 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 470 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 470 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 471 | 471 | if ($ht = @fopen($t, 'w')) { |
| 472 | 472 | @fclose($ht); |
| 473 | 473 | include_spip('inc/distant'); |
| 474 | 474 | $t = substr($t, strlen(_DIR_RACINE)); |
| 475 | - $t = url_de_base() . $t; |
|
| 475 | + $t = url_de_base().$t; |
|
| 476 | 476 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 477 | 477 | $ht = ($ht['status'] ?? null) === 403; |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 480 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 481 | 481 | |
| 482 | 482 | return $ht; |
| 483 | 483 | } |
@@ -503,11 +503,11 @@ discard block |
||
| 503 | 503 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 504 | 504 | $dirs[] = ['extension' => 'distant']; |
| 505 | 505 | foreach ($dirs as $e) { |
| 506 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 506 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 507 | 507 | if ($f) { |
| 508 | 508 | verifier_htaccess($dir); |
| 509 | 509 | } else { |
| 510 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 510 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | -require_once _ROOT_RESTREINT . 'base/objets.php'; |
|
| 21 | +require_once _ROOT_RESTREINT.'base/objets.php'; |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $f = (!preg_match('/^[\w\.]*$/', $serveur)) |
| 60 | 60 | ? '' // nom de serveur mal ecrit |
| 61 | 61 | : ($serveur ? |
| 62 | - (_DIR_CONNECT . $serveur . '.php') // serveur externe |
|
| 62 | + (_DIR_CONNECT.$serveur.'.php') // serveur externe |
|
| 63 | 63 | : (_FILE_CONNECT ?: ($install ? _FILE_CONNECT_TMP // init du serveur principal |
| 64 | 64 | : ''))); // installation pas faite |
| 65 | 65 | |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | // chargement de la version du jeu de fonctions |
| 102 | 102 | // si pas dans le fichier par defaut |
| 103 | 103 | $type = $GLOBALS['db_ok']['type']; |
| 104 | - $jeu = 'spip_' . $type . '_functions_' . $version; |
|
| 104 | + $jeu = 'spip_'.$type.'_functions_'.$version; |
|
| 105 | 105 | if (!isset($GLOBALS[$jeu])) { |
| 106 | - if (!find_in_path($type . '_' . $version . '.php', 'req/', true)) { |
|
| 106 | + if (!find_in_path($type.'_'.$version.'.php', 'req/', true)) { |
|
| 107 | 107 | spip_log("spip_connect: serveur $index version '$version' non defini pour '$type'", _LOG_HS); |
| 108 | 108 | |
| 109 | 109 | // ne plus reessayer |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | $connexion = spip_connect($serveur); |
| 166 | 166 | $e = sql_errno($serveur); |
| 167 | 167 | $t = ($connexion['type'] ?? 'sql'); |
| 168 | - $m = "Erreur $e de $t: " . sql_error($serveur) . "\nin " . sql_error_backtrace() . "\n" . trim($connexion['last']); |
|
| 169 | - $f = $t . $serveur; |
|
| 170 | - spip_log($m, $f . '.' . _LOG_ERREUR); |
|
| 168 | + $m = "Erreur $e de $t: ".sql_error($serveur)."\nin ".sql_error_backtrace()."\n".trim($connexion['last']); |
|
| 169 | + $f = $t.$serveur; |
|
| 170 | + spip_log($m, $f.'.'._LOG_ERREUR); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | // si en cours d'installation ou si db=@test@ on ne pose rien |
| 254 | 254 | // car c'est un test de connexion |
| 255 | 255 | if (!defined('_ECRIRE_INSTALL') and $db !== '@test@') { |
| 256 | - $f = _DIR_TMP . $type . '.' . substr(md5($host . $port . $db), 0, 8) . '.out'; |
|
| 256 | + $f = _DIR_TMP.$type.'.'.substr(md5($host.$port.$db), 0, 8).'.out'; |
|
| 257 | 257 | } elseif ($db == '@test@') { |
| 258 | 258 | $db = ''; |
| 259 | 259 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // En cas d'indisponibilite du serveur, eviter de le bombarder |
| 293 | 293 | if ($f) { |
| 294 | 294 | @touch($f); |
| 295 | - spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type . '.' . _LOG_HS); |
|
| 295 | + spip_log("Echec connexion serveur $type : host[$host] port[$port] login[$login] base[$db]", $type.'.'._LOG_HS); |
|
| 296 | 296 | } |
| 297 | 297 | return null; |
| 298 | 298 | } |
@@ -390,11 +390,11 @@ discard block |
||
| 390 | 390 | } elseif (is_array($a)) { |
| 391 | 391 | return join(',', array_map('_q', $a)); |
| 392 | 392 | } elseif (is_scalar($a)) { |
| 393 | - return ("'" . addslashes($a) . "'"); |
|
| 393 | + return ("'".addslashes($a)."'"); |
|
| 394 | 394 | } elseif ($a === null) { |
| 395 | 395 | return "''"; |
| 396 | 396 | } |
| 397 | - throw new \RuntimeException('Can’t use _q with ' . gettype($a)); |
|
| 397 | + throw new \RuntimeException('Can’t use _q with '.gettype($a)); |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /** |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | $next = reset($textes); |
| 446 | 446 | if ( |
| 447 | 447 | strpos($next, "'") === 0 |
| 448 | - and strpos($query_echappees, $part . $next, $currentpos) === $nextpos |
|
| 448 | + and strpos($query_echappees, $part.$next, $currentpos) === $nextpos |
|
| 449 | 449 | ) { |
| 450 | 450 | $part .= array_shift($textes); |
| 451 | 451 | } |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $parts[$k] = [ |
| 458 | 458 | 'texte' => $part, |
| 459 | 459 | 'position' => $nextpos, |
| 460 | - 'placeholder' => '%' . $k . '$s', |
|
| 460 | + 'placeholder' => '%'.$k.'$s', |
|
| 461 | 461 | ]; |
| 462 | 462 | $currentpos = $nextpos + strlen($part); |
| 463 | 463 | } |