@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | if ($objet == 'rubrique') { |
| 115 | 115 | // si c'est une rubrique-secteur contenant des breves, demander la |
| 116 | 116 | // confirmation du deplacement |
| 117 | - $contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . intval($id_objet)); |
|
| 117 | + $contient_breves = sql_countsel('spip_breves', 'id_rubrique='.intval($id_objet)); |
|
| 118 | 118 | |
| 119 | 119 | if ($contient_breves > 0) { |
| 120 | 120 | $scb = ($contient_breves > 1 ? 's' : ''); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | $confirm .= "\n<div class='confirmer_deplacement verdana2'>" |
| 129 | 129 | . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>" |
| 130 | - . $scb . |
|
| 130 | + . $scb. |
|
| 131 | 131 | "</label></div></div>\n"; |
| 132 | 132 | } else { |
| 133 | 133 | $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n"; |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | $form .= $confirm; |
| 137 | 137 | if ($actionable) { |
| 138 | 138 | if (strpos($form, '<select') !== false) { |
| 139 | - $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 140 | - . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>' |
|
| 139 | + $form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 140 | + . '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>' |
|
| 141 | 141 | . '</div>'; |
| 142 | 142 | } |
| 143 | - $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form; |
|
| 143 | + $form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form; |
|
| 144 | 144 | if ($action = charger_fonction("editer_$objet", 'action', true)) { |
| 145 | 145 | $form = generer_action_auteur( |
| 146 | 146 | "editer_$objet", |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | include_spip('inc/presentation'); |
| 168 | 168 | |
| 169 | - return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur(); |
|
| 169 | + return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur(); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | if ($statut == 'nouveau') { |
| 243 | 243 | if ($attente) { |
| 244 | 244 | $statut = $attente; |
| 245 | - $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')'; |
|
| 245 | + $plus = ' ('._T('info_statut_auteur_a_confirmer').')'; |
|
| 246 | 246 | } else { |
| 247 | 247 | return _T('info_statut_auteur_a_confirmer'); |
| 248 | 248 | } |
@@ -255,16 +255,16 @@ discard block |
||
| 255 | 255 | '5poubelle' => _T('texte_statut_poubelle'), // bouh |
| 256 | 256 | ]; |
| 257 | 257 | if (isset($recom[$statut])) { |
| 258 | - return $recom[$statut] . $plus; |
|
| 258 | + return $recom[$statut].$plus; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // retrouver directement par le statut sinon |
| 262 | 262 | if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) { |
| 263 | 263 | if (isset($recom[$t])) { |
| 264 | - return $recom[$t] . $plus; |
|
| 264 | + return $recom[$t].$plus; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - return _T($t) . $plus; |
|
| 267 | + return _T($t).$plus; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | // si on a pas reussi a le traduire, retournons la chaine telle quelle |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | if (!$id_rubrique and defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') and _CHOIX_RUBRIQUE_PAR_DEFAUT) { |
| 389 | 389 | $in = !(is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0) |
| 390 | 390 | ? '' |
| 391 | - : (' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 391 | + : (' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 392 | 392 | |
| 393 | 393 | // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement |
| 394 | 394 | if ($objet == 'rubrique') { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return ''; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - return propre('[->' . $virtuel . ']'); |
|
| 425 | + return propre('[->'.$virtuel.']'); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $clic = http_img_pack('rss-16.png', 'RSS', '', $title); |
| 450 | 450 | |
| 451 | 451 | $url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true); |
| 452 | - return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>"; |
|
| 452 | + return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>"; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | ); |
| 526 | 526 | |
| 527 | 527 | if ($alertes = array_filter($alertes)) { |
| 528 | - return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" . |
|
| 528 | + return "<div class='wrap-messages-alertes'><div class='messages-alertes'>". |
|
| 529 | 529 | join(' | ', $alertes) |
| 530 | 530 | . '</div></div>'; |
| 531 | 531 | } |
@@ -559,13 +559,13 @@ discard block |
||
| 559 | 559 | */ |
| 560 | 560 | function afficher_plus_info($lien, $titre = '+', $titre_lien = '') { |
| 561 | 561 | $titre = attribut_html($titre); |
| 562 | - $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" . |
|
| 563 | - http_img_pack('information-16.png', $titre) . '</a>'; |
|
| 562 | + $icone = "\n<a href='$lien' title='$titre' class='plus_info'>". |
|
| 563 | + http_img_pack('information-16.png', $titre).'</a>'; |
|
| 564 | 564 | |
| 565 | 565 | if (!$titre_lien) { |
| 566 | 566 | return $icone; |
| 567 | 567 | } else { |
| 568 | - return $icone . "\n<a href='$lien'>$titre_lien</a>"; |
|
| 568 | + return $icone."\n<a href='$lien'>$titre_lien</a>"; |
|
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | } |
| 16 | 16 | } |
| 17 | 17 | krsort($items); |
| 18 | - $texte = str_replace($placeholder, implode("\n\t", $items) . "\n", $texte); |
|
| 18 | + $texte = str_replace($placeholder, implode("\n\t", $items)."\n", $texte); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | return $texte; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | if ($changer_lang != 'herit') { |
| 46 | 46 | $set['lang'] = $changer_lang; |
| 47 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id), [], $serveur); |
|
| 47 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), [], $serveur); |
|
| 48 | 48 | include_spip('inc/rubriques'); // pour calculer_langues_rubriques et calculer_langues_utilisees |
| 49 | 49 | if ($table_objet_sql == 'spip_rubriques') { |
| 50 | 50 | calculer_langues_rubriques(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $langues = calculer_langues_utilisees($serveur); |
| 53 | 53 | ecrire_meta('langues_utilisees', $langues); |
| 54 | 54 | } else { |
| 55 | - $langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 55 | + $langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 56 | 56 | if (!$langue_parent) { |
| 57 | 57 | $langue_parent = $GLOBALS['meta']['langue_site']; |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if (isset($set['langue_choisie'])) { |
| 62 | 62 | $set['langue_choisie'] = 'non'; |
| 63 | 63 | } |
| 64 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id), [], $serveur); |
|
| 64 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), [], $serveur); |
|
| 65 | 65 | if ($table_objet_sql == 'spip_rubriques') { |
| 66 | 66 | include_spip('inc/rubriques'); |
| 67 | 67 | calculer_langues_rubriques(); |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | $link = @mysqli_connect($host, $login, $pass); |
| 59 | 59 | } |
| 60 | 60 | } catch (\mysqli_sql_exception $e) { |
| 61 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 61 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 62 | 62 | $link = false; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if (!$link) { |
| 66 | - spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS); |
|
| 66 | + spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS); |
|
| 67 | 67 | |
| 68 | 68 | return false; |
| 69 | 69 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | spip_log( |
| 85 | - "Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'), |
|
| 85 | + "Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? 'operationnelle' : 'impossible'), |
|
| 86 | 86 | _LOG_DEBUG |
| 87 | 87 | ); |
| 88 | 88 | |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) { |
| 175 | 175 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 176 | - spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG); |
|
| 176 | + spip_log('changement de charset sql : '.'SET NAMES '._q($charset), _LOG_DEBUG); |
|
| 177 | 177 | |
| 178 | - return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset)); |
|
| 178 | + return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES '._q($charset)); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) { |
| 191 | 191 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 192 | 192 | $connexion['last'] = $c = 'SHOW CHARACTER SET' |
| 193 | - . (!$charset ? '' : (' LIKE ' . _q($charset['charset']))); |
|
| 193 | + . (!$charset ? '' : (' LIKE '._q($charset['charset']))); |
|
| 194 | 194 | |
| 195 | 195 | return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur); |
| 196 | 196 | } |
@@ -234,21 +234,21 @@ discard block |
||
| 234 | 234 | $debug = ''; |
| 235 | 235 | if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) { |
| 236 | 236 | if (isset($GLOBALS['debug']['aucasou'])) { |
| 237 | - [, $id, , $infos] = $GLOBALS['debug']['aucasou']; |
|
| 238 | - $debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | '; |
|
| 237 | + [, $id,, $infos] = $GLOBALS['debug']['aucasou']; |
|
| 238 | + $debug .= "BOUCLE$id @ ".($infos[0] ?? '').' | '; |
|
| 239 | 239 | } |
| 240 | 240 | if (isset($_SERVER['REQUEST_URI'])) { |
| 241 | 241 | $debug .= $_SERVER['REQUEST_URI']; |
| 242 | 242 | } |
| 243 | 243 | if (!empty($GLOBALS['ip'])) { |
| 244 | - $debug .= ' + ' . $GLOBALS['ip']; |
|
| 244 | + $debug .= ' + '.$GLOBALS['ip']; |
|
| 245 | 245 | } |
| 246 | - $debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */'; |
|
| 246 | + $debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */'; |
|
| 247 | 247 | } |
| 248 | 248 | try { |
| 249 | - $r = mysqli_query($link, $query . $debug); |
|
| 249 | + $r = mysqli_query($link, $query.$debug); |
|
| 250 | 250 | } catch (\mysqli_sql_exception $e) { |
| 251 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 251 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 252 | 252 | $r = false; |
| 253 | 253 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 254 | 254 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -266,9 +266,9 @@ discard block |
||
| 266 | 266 | $link = $connexion['link']; |
| 267 | 267 | //On retente au cas où |
| 268 | 268 | try { |
| 269 | - $r = mysqli_query($link, $query . $debug); |
|
| 269 | + $r = mysqli_query($link, $query.$debug); |
|
| 270 | 270 | } catch (\mysqli_sql_exception $e) { |
| 271 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 271 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 272 | 272 | $r = false; |
| 273 | 273 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 274 | 274 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | // d'utiliser ceux-ci, copie-colle de phpmyadmin |
| 302 | 302 | $query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query); |
| 303 | 303 | |
| 304 | - return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 304 | + return spip_mysql_query('ALTER '.$query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * @return bool Toujours true |
| 315 | 315 | */ |
| 316 | 316 | function spip_mysql_optimize($table, $serveur = '', $requeter = true) { |
| 317 | - spip_mysql_query('OPTIMIZE TABLE ' . $table); |
|
| 317 | + spip_mysql_query('OPTIMIZE TABLE '.$table); |
|
| 318 | 318 | |
| 319 | 319 | return true; |
| 320 | 320 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $link = $connexion['link']; |
| 338 | 338 | $db = $connexion['db']; |
| 339 | 339 | |
| 340 | - $query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe); |
|
| 340 | + $query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe); |
|
| 341 | 341 | $r = mysqli_query($link, $query); |
| 342 | 342 | |
| 343 | 343 | return spip_mysql_fetch($r, null, $serveur); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | . calculer_mysql_expression('WHERE', $where) |
| 389 | 389 | . calculer_mysql_expression('GROUP BY', $groupby, ',') |
| 390 | 390 | . calculer_mysql_expression('HAVING', $having) |
| 391 | - . ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '') |
|
| 391 | + . ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '') |
|
| 392 | 392 | . ($limit ? "\nLIMIT $limit" : ''); |
| 393 | 393 | |
| 394 | 394 | // renvoyer la requete inerte si demandee |
@@ -478,12 +478,12 @@ discard block |
||
| 478 | 478 | $exp = "\n$expression "; |
| 479 | 479 | |
| 480 | 480 | if (!is_array($v)) { |
| 481 | - return $exp . $v; |
|
| 481 | + return $exp.$v; |
|
| 482 | 482 | } else { |
| 483 | 483 | if (strtoupper($join) === 'AND') { |
| 484 | - return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 484 | + return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 485 | 485 | } else { |
| 486 | - return $exp . join($join, $v); |
|
| 486 | + return $exp.join($join, $v); |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | } |
@@ -501,17 +501,17 @@ discard block |
||
| 501 | 501 | if (substr($k, -1) == '@') { |
| 502 | 502 | // c'est une jointure qui se refere au from precedent |
| 503 | 503 | // pas de virgule |
| 504 | - $res .= ' ' . $v; |
|
| 504 | + $res .= ' '.$v; |
|
| 505 | 505 | } else { |
| 506 | 506 | if (!is_numeric($k)) { |
| 507 | 507 | $p = strpos($v, ' '); |
| 508 | 508 | if ($p) { |
| 509 | - $v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p); |
|
| 509 | + $v = substr($v, 0, $p)." AS `$k`".substr($v, $p); |
|
| 510 | 510 | } else { |
| 511 | 511 | $v .= " AS `$k`"; |
| 512 | 512 | } |
| 513 | 513 | } |
| 514 | - $res .= ', ' . $v; |
|
| 514 | + $res .= ', '.$v; |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
@@ -541,13 +541,13 @@ discard block |
||
| 541 | 541 | function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) { |
| 542 | 542 | |
| 543 | 543 | if ($GLOBALS['mysql_rappel_nom_base'] and $db) { |
| 544 | - $pref = '`' . $db . '`.'; |
|
| 544 | + $pref = '`'.$db.'`.'; |
|
| 545 | 545 | } else { |
| 546 | 546 | $pref = ''; |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ($prefixe) { |
| 550 | - $pref .= $prefixe . '_'; |
|
| 550 | + $pref .= $prefixe.'_'; |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) { |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $suite_echap = $suite; |
| 567 | 567 | } |
| 568 | 568 | if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) { |
| 569 | - $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 569 | + $suite_echap = $r[1]._mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 570 | 570 | if ($echappe_textes) { |
| 571 | 571 | $suite = query_reinjecte_textes($suite_echap, $textes); |
| 572 | 572 | } |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | - $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite; |
|
| 579 | + $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite; |
|
| 580 | 580 | |
| 581 | 581 | // en option, remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
| 582 | 582 | // remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | $link = _mysql_link($serveur); |
| 613 | 613 | $ok = mysqli_select_db($link, $db); |
| 614 | 614 | if (!$ok) { |
| 615 | - spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE); |
|
| 615 | + spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE); |
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | return $ok; |
@@ -702,10 +702,10 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $character_set = ''; |
| 704 | 704 | if (@$GLOBALS['meta']['charset_sql_base']) { |
| 705 | - $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base']; |
|
| 705 | + $character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base']; |
|
| 706 | 706 | } |
| 707 | 707 | if (@$GLOBALS['meta']['charset_collation_sql_base']) { |
| 708 | - $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base']; |
|
| 708 | + $character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base']; |
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | foreach ($champs as $k => $v) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | preg_match(',(char|text),i', $defs[1]) |
| 716 | 716 | and !preg_match(',(binary|CHARACTER|COLLATE),i', $v) |
| 717 | 717 | ) { |
| 718 | - $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1])); |
|
| 718 | + $v = $defs[1].$character_set.' '.substr($v, strlen($defs[1])); |
|
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | $s = ','; |
| 728 | 728 | } |
| 729 | 729 | $temporary = $temporary ? 'TEMPORARY' : ''; |
| 730 | - $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')' |
|
| 730 | + $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')' |
|
| 731 | 731 | . ' ENGINE=MyISAM' |
| 732 | 732 | . ($character_set ? " DEFAULT $character_set" : '') |
| 733 | 733 | . "\n"; |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | return false; |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 810 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 811 | 811 | |
| 812 | 812 | return spip_mysql_query($query, $serveur, $requeter); |
| 813 | 813 | } |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | * Ressource à utiliser avec sql_fetch() |
| 866 | 866 | **/ |
| 867 | 867 | function spip_mysql_showbase($match, $serveur = '', $requeter = true) { |
| 868 | - return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter); |
|
| 868 | + return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter); |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | /** |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | * - string : requete sql, si $requeter = true |
| 900 | 900 | **/ |
| 901 | 901 | function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) { |
| 902 | - $r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter); |
|
| 902 | + $r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter); |
|
| 903 | 903 | if (!$requeter) { |
| 904 | 904 | return $r; |
| 905 | 905 | } |
@@ -981,22 +981,22 @@ discard block |
||
| 981 | 981 | } |
| 982 | 982 | if ($val['Default'] === '0' || $val['Default']) { |
| 983 | 983 | if (preg_match('/[A-Z_]/', $val['Default'])) { |
| 984 | - $nfields[$val['Field']] .= ' DEFAULT ' . $val['Default']; |
|
| 984 | + $nfields[$val['Field']] .= ' DEFAULT '.$val['Default']; |
|
| 985 | 985 | } else { |
| 986 | - $nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'"; |
|
| 986 | + $nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'"; |
|
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | if ($val['Extra']) { |
| 990 | - $nfields[$val['Field']] .= ' ' . $val['Extra']; |
|
| 990 | + $nfields[$val['Field']] .= ' '.$val['Extra']; |
|
| 991 | 991 | } |
| 992 | 992 | if ($val['Key'] == 'PRI') { |
| 993 | 993 | $nkeys['PRIMARY KEY'] = $val['Field']; |
| 994 | 994 | } else { |
| 995 | 995 | if ($val['Key'] == 'MUL') { |
| 996 | - $nkeys['KEY ' . $val['Field']] = $val['Field']; |
|
| 996 | + $nkeys['KEY '.$val['Field']] = $val['Field']; |
|
| 997 | 997 | } else { |
| 998 | 998 | if ($val['Key'] == 'UNI') { |
| 999 | - $nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field']; |
|
| 999 | + $nkeys['UNIQUE KEY '.$val['Field']] = $val['Field']; |
|
| 1000 | 1000 | } |
| 1001 | 1001 | } |
| 1002 | 1002 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | $serveur = '', |
| 1068 | 1068 | $requeter = true |
| 1069 | 1069 | ) { |
| 1070 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1070 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1071 | 1071 | |
| 1072 | 1072 | $r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter); |
| 1073 | 1073 | if (!$requeter) { |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | if ($s) { |
| 1108 | 1108 | $trace = debug_backtrace(); |
| 1109 | 1109 | if ($trace[0]['function'] != 'spip_mysql_error') { |
| 1110 | - spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR); |
|
| 1110 | + spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR); |
|
| 1111 | 1111 | } |
| 1112 | 1112 | } |
| 1113 | 1113 | |
@@ -1233,7 +1233,7 @@ discard block |
||
| 1233 | 1233 | try { |
| 1234 | 1234 | $insert = mysqli_query($link, $query); |
| 1235 | 1235 | } catch (\mysqli_sql_exception $e) { |
| 1236 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 1236 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 1237 | 1237 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 1238 | 1238 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
| 1239 | 1239 | } |
@@ -1288,8 +1288,8 @@ discard block |
||
| 1288 | 1288 | |
| 1289 | 1289 | return spip_mysql_insert( |
| 1290 | 1290 | $table, |
| 1291 | - '(' . join(',', array_keys($couples)) . ')', |
|
| 1292 | - '(' . join(',', $couples) . ')', |
|
| 1291 | + '('.join(',', array_keys($couples)).')', |
|
| 1292 | + '('.join(',', $couples).')', |
|
| 1293 | 1293 | $desc, |
| 1294 | 1294 | $serveur, |
| 1295 | 1295 | $requeter |
@@ -1326,7 +1326,7 @@ discard block |
||
| 1326 | 1326 | } |
| 1327 | 1327 | $fields = $desc['field'] ?? []; |
| 1328 | 1328 | |
| 1329 | - $cles = '(' . join(',', array_keys(reset($tab_couples))) . ')'; |
|
| 1329 | + $cles = '('.join(',', array_keys(reset($tab_couples))).')'; |
|
| 1330 | 1330 | $valeurs = []; |
| 1331 | 1331 | $r = false; |
| 1332 | 1332 | |
@@ -1335,7 +1335,7 @@ discard block |
||
| 1335 | 1335 | foreach ($couples as $champ => $val) { |
| 1336 | 1336 | $couples[$champ] = spip_mysql_cite($val, $fields[$champ]); |
| 1337 | 1337 | } |
| 1338 | - $valeurs[] = '(' . join(',', $couples) . ')'; |
|
| 1338 | + $valeurs[] = '('.join(',', $couples).')'; |
|
| 1339 | 1339 | if (count($valeurs) >= 100) { |
| 1340 | 1340 | $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter); |
| 1341 | 1341 | $valeurs = []; |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) { |
| 1373 | 1373 | $set = []; |
| 1374 | 1374 | foreach ($champs as $champ => $val) { |
| 1375 | - $set[] = $champ . "=$val"; |
|
| 1375 | + $set[] = $champ."=$val"; |
|
| 1376 | 1376 | } |
| 1377 | 1377 | if (!empty($set)) { |
| 1378 | 1378 | return spip_mysql_query( |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | } |
| 1429 | 1429 | $set = []; |
| 1430 | 1430 | foreach ($champs as $champ => $val) { |
| 1431 | - $set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]); |
|
| 1431 | + $set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]); |
|
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | 1434 | return spip_mysql_query( |
@@ -1497,10 +1497,10 @@ discard block |
||
| 1497 | 1497 | * - False en cas d'erreur. |
| 1498 | 1498 | **/ |
| 1499 | 1499 | function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) { |
| 1500 | - return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join( |
|
| 1500 | + return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join( |
|
| 1501 | 1501 | ',', |
| 1502 | 1502 | array_map('_q', $couples) |
| 1503 | - ) . ')', $serveur, $requeter); |
|
| 1503 | + ).')', $serveur, $requeter); |
|
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | 1506 | |
@@ -1529,10 +1529,10 @@ discard block |
||
| 1529 | 1529 | * - False en cas d'erreur. |
| 1530 | 1530 | **/ |
| 1531 | 1531 | function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) { |
| 1532 | - $cles = '(' . join(',', array_keys($tab_couples[0])) . ')'; |
|
| 1532 | + $cles = '('.join(',', array_keys($tab_couples[0])).')'; |
|
| 1533 | 1533 | $valeurs = []; |
| 1534 | 1534 | foreach ($tab_couples as $couples) { |
| 1535 | - $valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')'; |
|
| 1535 | + $valeurs[] = '('.join(',', array_map('_q', $couples)).')'; |
|
| 1536 | 1536 | } |
| 1537 | 1537 | $valeurs = implode(', ', $valeurs); |
| 1538 | 1538 | |
@@ -1552,28 +1552,28 @@ discard block |
||
| 1552 | 1552 | */ |
| 1553 | 1553 | function spip_mysql_multi($objet, $lang) { |
| 1554 | 1554 | $lengthlang = strlen("[$lang]"); |
| 1555 | - $posmulti = 'INSTR(' . $objet . ", '<multi>')"; |
|
| 1556 | - $posfinmulti = 'INSTR(' . $objet . ", '</multi>')"; |
|
| 1557 | - $debutchaine = 'LEFT(' . $objet . ", $posmulti-1)"; |
|
| 1558 | - $finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))"; |
|
| 1559 | - $chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1560 | - $poslang = "INSTR($chainemulti,'[" . $lang . "]')"; |
|
| 1555 | + $posmulti = 'INSTR('.$objet.", '<multi>')"; |
|
| 1556 | + $posfinmulti = 'INSTR('.$objet.", '</multi>')"; |
|
| 1557 | + $debutchaine = 'LEFT('.$objet.", $posmulti-1)"; |
|
| 1558 | + $finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))"; |
|
| 1559 | + $chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1560 | + $poslang = "INSTR($chainemulti,'[".$lang."]')"; |
|
| 1561 | 1561 | $poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)"; |
| 1562 | - $chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1563 | - $posfinlang = 'INSTR(' . $chainelang . ", '[')"; |
|
| 1562 | + $chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1563 | + $posfinlang = 'INSTR('.$chainelang.", '[')"; |
|
| 1564 | 1564 | $chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)"; |
| 1565 | 1565 | //$chainelang = "LEFT($chainelang,$posfinlang-1)"; |
| 1566 | - $retour = "(TRIM(IF($posmulti = 0 , " . |
|
| 1567 | - ' TRIM(' . $objet . '), ' . |
|
| 1568 | - ' CONCAT( ' . |
|
| 1569 | - " $debutchaine, " . |
|
| 1570 | - ' IF( ' . |
|
| 1571 | - " $poslang = 0, " . |
|
| 1572 | - " $chainemulti, " . |
|
| 1573 | - " $chainelang" . |
|
| 1574 | - ' ), ' . |
|
| 1575 | - " $finchaine" . |
|
| 1576 | - ' ) ' . |
|
| 1566 | + $retour = "(TRIM(IF($posmulti = 0 , ". |
|
| 1567 | + ' TRIM('.$objet.'), '. |
|
| 1568 | + ' CONCAT( '. |
|
| 1569 | + " $debutchaine, ". |
|
| 1570 | + ' IF( '. |
|
| 1571 | + " $poslang = 0, ". |
|
| 1572 | + " $chainemulti, ". |
|
| 1573 | + " $chainelang". |
|
| 1574 | + ' ), '. |
|
| 1575 | + " $finchaine". |
|
| 1576 | + ' ) '. |
|
| 1577 | 1577 | '))) AS multi'; |
| 1578 | 1578 | |
| 1579 | 1579 | return $retour; |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | * Valeur hexadécimale pour MySQL |
| 1591 | 1591 | **/ |
| 1592 | 1592 | function spip_mysql_hex($v) { |
| 1593 | - return '0x' . $v; |
|
| 1593 | + return '0x'.$v; |
|
| 1594 | 1594 | } |
| 1595 | 1595 | |
| 1596 | 1596 | /** |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | * Expression SQL |
| 1631 | 1631 | **/ |
| 1632 | 1632 | function spip_mysql_date_proche($champ, $interval, $unite) { |
| 1633 | - $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false ); |
|
| 1633 | + $use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false); |
|
| 1634 | 1634 | return '(' |
| 1635 | 1635 | . $champ |
| 1636 | 1636 | . (($interval <= 0) ? '>' : '<') |
@@ -1685,7 +1685,7 @@ discard block |
||
| 1685 | 1685 | } elseif ($v === null) { |
| 1686 | 1686 | return "''"; |
| 1687 | 1687 | } |
| 1688 | - return "'" . addslashes($v) . "'"; |
|
| 1688 | + return "'".addslashes($v)."'"; |
|
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | 1691 | if ($v === null) { |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | } |
| 1710 | 1710 | } |
| 1711 | 1711 | |
| 1712 | - return ("'" . addslashes($v) . "'"); |
|
| 1712 | + return ("'".addslashes($v)."'"); |
|
| 1713 | 1713 | } |
| 1714 | 1714 | |
| 1715 | 1715 | /** |
@@ -1743,7 +1743,7 @@ discard block |
||
| 1743 | 1743 | } else { |
| 1744 | 1744 | $GLOBALS['mysql_rappel_nom_base'] = false; |
| 1745 | 1745 | |
| 1746 | - return "\$GLOBALS['mysql_rappel_nom_base'] = false; " . |
|
| 1746 | + return "\$GLOBALS['mysql_rappel_nom_base'] = false; ". |
|
| 1747 | 1747 | "/* echec de test_rappel_nom_base_mysql a l'installation. */\n"; |
| 1748 | 1748 | } |
| 1749 | 1749 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($GLOBALS['spip_version_base'] != $GLOBALS['meta']['version_installee']) { |
| 57 | 57 | if (!is_numeric(_request('reinstall'))) { |
| 58 | 58 | include_spip('base/create'); |
| 59 | - spip_log('recree les tables eventuellement disparues', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 59 | + spip_log('recree les tables eventuellement disparues', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 60 | 60 | creer_base(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | exit; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 72 | + spip_log('Fin de mise a jour SQL. Debut m-a-j acces et config', 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 73 | 73 | |
| 74 | 74 | // supprimer quelques fichiers temporaires qui peuvent se retrouver invalides |
| 75 | 75 | @spip_unlink(_CACHE_RUBRIQUES); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | @spip_unlink(_CACHE_PLUGINS_OPT); |
| 79 | 79 | @spip_unlink(_CACHE_PLUGINS_FCT); |
| 80 | 80 | @spip_unlink(_CACHE_CHEMIN); |
| 81 | - @spip_unlink(_DIR_TMP . 'plugin_xml_cache.gz'); |
|
| 81 | + @spip_unlink(_DIR_TMP.'plugin_xml_cache.gz'); |
|
| 82 | 82 | |
| 83 | 83 | include_spip('inc/auth'); |
| 84 | 84 | auth_synchroniser_distant(); |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $version_installee = $GLOBALS['meta']['version_installee'] ?? null; |
| 118 | 118 | |
| 119 | 119 | spip_log( |
| 120 | - "Version anterieure: $version_installee. Courante: " . $GLOBALS['spip_version_base'], |
|
| 121 | - 'maj.' . _LOG_INFO_IMPORTANTE |
|
| 120 | + "Version anterieure: $version_installee. Courante: ".$GLOBALS['spip_version_base'], |
|
| 121 | + 'maj.'._LOG_INFO_IMPORTANTE |
|
| 122 | 122 | ); |
| 123 | 123 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 124 | 124 | sql_replace( |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | $res = maj_while($version_installee, $cible, $GLOBALS['maj'], 'version_installee', 'meta', $redirect, $debut_page); |
| 152 | 152 | if ($res) { |
| 153 | 153 | if (!is_array($res)) { |
| 154 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_ERREUR); |
|
| 154 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_ERREUR); |
|
| 155 | 155 | } else { |
| 156 | - echo _T('avis_operation_echec') . ' ' . join(' ', $res); |
|
| 156 | + echo _T('avis_operation_echec').' '.join(' ', $res); |
|
| 157 | 157 | echo install_fin_html(); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | $res = maj_while($current_version, $version_cible, $maj, $nom_meta_base_version, $table_meta, $redirect); |
| 242 | 242 | if ($res) { |
| 243 | 243 | if (!is_array($res)) { |
| 244 | - spip_log("Pb d'acces SQL a la mise a jour", 'maj.' . _LOG_ERREUR); |
|
| 244 | + spip_log("Pb d'acces SQL a la mise a jour", 'maj.'._LOG_ERREUR); |
|
| 245 | 245 | } else { |
| 246 | - echo '<p>' . _T('avis_operation_echec') . ' ' . join(' ', $res) . '</p>'; |
|
| 246 | + echo '<p>'._T('avis_operation_echec').' '.join(' ', $res).'</p>'; |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | echo(install_debut_html($titre)); |
| 300 | 300 | // script de rechargement auto sur timeout |
| 301 | 301 | $redirect = generer_url_ecrire('upgrade', "reinstall=$installee&meta=$meta&table=$table", true); |
| 302 | - echo http_script("window.setTimeout('location.href=\"" . $redirect . "\";'," . ($timeout * 1000) . ')'); |
|
| 302 | + echo http_script("window.setTimeout('location.href=\"".$redirect."\";',".($timeout * 1000).')'); |
|
| 303 | 303 | echo "<div style='text-align: left'>\n"; |
| 304 | 304 | if (ob_get_level()) { |
| 305 | 305 | ob_flush(); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | return [$v, $etape]; |
| 389 | 389 | } |
| 390 | 390 | $n = time() - $time; |
| 391 | - spip_log("$table $meta: $v en $n secondes", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 391 | + spip_log("$table $meta: $v en $n secondes", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 392 | 392 | if ($meta) { |
| 393 | 393 | ecrire_meta($meta, $installee = $v, 'oui', $table); |
| 394 | 394 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | if ($meta) { |
| 405 | 405 | ecrire_meta($meta, $cible, 'oui', $table); |
| 406 | 406 | } |
| 407 | - spip_log("MAJ terminee. $meta: $installee", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 407 | + spip_log("MAJ terminee. $meta: $installee", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 408 | 408 | |
| 409 | 409 | return []; |
| 410 | 410 | } |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * @return int |
| 430 | 430 | */ |
| 431 | 431 | function serie_alter($serie, $q = [], $meta = '', $table = 'meta', $redirect = '') { |
| 432 | - $meta2 = $meta . '_maj_' . $serie; |
|
| 432 | + $meta2 = $meta.'_maj_'.$serie; |
|
| 433 | 433 | $etape = 0; |
| 434 | 434 | if (isset($GLOBALS[$table][$meta2])) { |
| 435 | 435 | $etape = intval($GLOBALS[$table][$meta2]); |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | and function_exists($f = array_shift($r)) |
| 443 | 443 | ) { |
| 444 | 444 | // note: $r (arguments de la fonction $f) peut avoir des données tabulaires |
| 445 | - spip_log("$msg: $f " . @join(',', $r), 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 445 | + spip_log("$msg: $f ".@join(',', $r), 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 446 | 446 | // pour les fonctions atomiques sql_xx |
| 447 | 447 | // on enregistre le meta avant de lancer la fonction, |
| 448 | 448 | // de maniere a eviter de boucler sur timeout |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | relance_maj($meta, $table, $redirect); |
| 461 | 461 | } |
| 462 | 462 | ecrire_meta($meta2, $i + 1, 'non', $table); |
| 463 | - spip_log("$meta2: ok", 'maj.' . _LOG_INFO_IMPORTANTE); |
|
| 463 | + spip_log("$meta2: ok", 'maj.'._LOG_INFO_IMPORTANTE); |
|
| 464 | 464 | } else { |
| 465 | 465 | if (!is_array($r)) { |
| 466 | - spip_log("maj $i format incorrect", 'maj.' . _LOG_ERREUR); |
|
| 466 | + spip_log("maj $i format incorrect", 'maj.'._LOG_ERREUR); |
|
| 467 | 467 | } else { |
| 468 | - spip_log("maj $i fonction $f non definie", 'maj.' . _LOG_ERREUR); |
|
| 468 | + spip_log("maj $i fonction $f non definie", 'maj.'._LOG_ERREUR); |
|
| 469 | 469 | } |
| 470 | 470 | // en cas d'erreur serieuse, on s'arrete |
| 471 | 471 | // mais on permet de passer par dessus en rechargeant la page. |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | include_spip('inc/lang'); |
| 100 | 100 | |
| 101 | 101 | if ($GLOBALS['spip_lang'] <> $default) { |
| 102 | - $opt = lang_select($default); # et remplace |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | 103 | if ($GLOBALS['spip_lang'] <> $default) { |
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | 105 | if ($opt) { |
| 106 | 106 | lang_select(); |
| 107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | # lien a partir de / |
| 112 | 112 | $cible = parametre_url(self(), 'lang', '', '&'); |
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), true); |
|
| 113 | + $post = generer_url_action('converser', 'redirect='.rawurlencode($cible), true); |
|
| 114 | 114 | |
| 115 | 115 | return [ |
| 116 | 116 | 'formulaires/menu_lang', |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $n = intval(sql_errno()); |
| 62 | - spip_log("Erreur base de donnees $n " . sql_error()); |
|
| 62 | + spip_log("Erreur base de donnees $n ".sql_error()); |
|
| 63 | 63 | |
| 64 | 64 | return $n ?: 1; |
| 65 | 65 | } |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | // erreur SQL a afficher |
| 86 | 86 | $raison = minipres( |
| 87 | 87 | _T('info_travaux_titre'), |
| 88 | - _T('titre_probleme_technique') . '<p><tt>' . sql_errno() . ' ' . sql_error() . '</tt></p>' |
|
| 88 | + _T('titre_probleme_technique').'<p><tt>'.sql_errno().' '.sql_error().'</tt></p>' |
|
| 89 | 89 | ); |
| 90 | 90 | } elseif (@$raison['statut']) { |
| 91 | 91 | // un simple visiteur n'a pas acces a l'espace prive |
| 92 | - spip_log('connexion refusee a ' . @$raison['id_auteur']); |
|
| 92 | + spip_log('connexion refusee a '.@$raison['id_auteur']); |
|
| 93 | 93 | $raison = minipres(_T('avis_erreur_connexion'), _T('avis_erreur_visiteur')); |
| 94 | 94 | } else { |
| 95 | 95 | // auteur en fin de droits ... |
@@ -179,8 +179,7 @@ discard block |
||
| 179 | 179 | $where = (is_numeric($id_auteur) |
| 180 | 180 | /*AND $id_auteur>0*/ // reprise lors des restaurations |
| 181 | 181 | ) ? |
| 182 | - "id_auteur=$id_auteur" : |
|
| 183 | - (!strlen($GLOBALS['connect_login']) ? '' : 'login=' . sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 182 | + "id_auteur=$id_auteur" : (!strlen($GLOBALS['connect_login']) ? '' : 'login='.sql_quote($GLOBALS['connect_login'], '', 'text')); |
|
| 184 | 183 | |
| 185 | 184 | if (!$where) { |
| 186 | 185 | return ''; |
@@ -222,7 +221,7 @@ discard block |
||
| 222 | 221 | $GLOBALS['connect_login'] = $row['login']; |
| 223 | 222 | $GLOBALS['connect_statut'] = $row['statut']; |
| 224 | 223 | |
| 225 | - $GLOBALS['visiteur_session'] = array_merge((array)$GLOBALS['visiteur_session'], $row); |
|
| 224 | + $GLOBALS['visiteur_session'] = array_merge((array) $GLOBALS['visiteur_session'], $row); |
|
| 226 | 225 | |
| 227 | 226 | // au cas ou : ne pas memoriser les champs sensibles |
| 228 | 227 | unset($GLOBALS['visiteur_session']['pass']); |
@@ -295,7 +294,7 @@ discard block |
||
| 295 | 294 | * @return string |
| 296 | 295 | */ |
| 297 | 296 | function auth_a_loger() { |
| 298 | - $redirect = generer_url_public('login', 'url=' . rawurlencode(self('&', true)), true); |
|
| 297 | + $redirect = generer_url_public('login', 'url='.rawurlencode(self('&', true)), true); |
|
| 299 | 298 | |
| 300 | 299 | // un echec au "bonjour" (login initial) quand le statut est |
| 301 | 300 | // inconnu signale sans doute un probleme de cookies |
@@ -331,7 +330,7 @@ discard block |
||
| 331 | 330 | $date ??= date('Y-m-d H:i:s'); |
| 332 | 331 | |
| 333 | 332 | if (abs(strtotime($date) - $connect_quand) >= 60) { |
| 334 | - sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 333 | + sql_updateq('spip_auteurs', ['en_ligne' => $date], 'id_auteur='.intval($row['id_auteur'])); |
|
| 335 | 334 | $row['en_ligne'] = $date; |
| 336 | 335 | } |
| 337 | 336 | |
@@ -440,13 +439,13 @@ discard block |
||
| 440 | 439 | if ( |
| 441 | 440 | !$login |
| 442 | 441 | or !$login_base = auth_retrouver_login($login, $serveur) |
| 443 | - or !$row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 442 | + or !$row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login_base, $serveur, 'text'), '', '', '', '', $serveur) |
|
| 444 | 443 | ) { |
| 445 | 444 | // generer de fausses infos, mais credibles, pour eviter une attaque |
| 446 | 445 | // https://core.spip.net/issues/1758 + https://core.spip.net/issues/3691 |
| 447 | 446 | include_spip('inc/securiser_action'); |
| 448 | - $fauxalea1 = md5('fauxalea' . secret_du_site() . $login . floor(date('U') / 86400)); |
|
| 449 | - $fauxalea2 = md5('fauxalea' . secret_du_site() . $login . ceil(date('U') / 86400)); |
|
| 447 | + $fauxalea1 = md5('fauxalea'.secret_du_site().$login.floor(date('U') / 86400)); |
|
| 448 | + $fauxalea2 = md5('fauxalea'.secret_du_site().$login.ceil(date('U') / 86400)); |
|
| 450 | 449 | |
| 451 | 450 | $row = [ |
| 452 | 451 | 'login' => $login, |
@@ -568,7 +567,7 @@ discard block |
||
| 568 | 567 | sql_updateq( |
| 569 | 568 | 'spip_auteurs', |
| 570 | 569 | ['prefs' => serialize($p)], |
| 571 | - 'id_auteur=' . intval($auteur['id_auteur']) |
|
| 570 | + 'id_auteur='.intval($auteur['id_auteur']) |
|
| 572 | 571 | ); |
| 573 | 572 | |
| 574 | 573 | // bloquer ici le visiteur qui tente d'abuser de ses droits |
@@ -732,7 +731,7 @@ discard block |
||
| 732 | 731 | return false; |
| 733 | 732 | } |
| 734 | 733 | |
| 735 | - $row = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 734 | + $row = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login, $serveur, 'text'), '', '', '', '', $serveur); |
|
| 736 | 735 | |
| 737 | 736 | if (!$row) { |
| 738 | 737 | if ( |
@@ -786,11 +785,11 @@ discard block |
||
| 786 | 785 | $retour = $retour ?: _T('icone_retour'); |
| 787 | 786 | $corps .= "<p>$raison</p>[<a href='$public'>$retour</a>] "; |
| 788 | 787 | if ($url) { |
| 789 | - $corps .= "[<a href='" . generer_url_action('cookie', "essai_auth_http=oui&$url") . "'>$re</a>]"; |
|
| 788 | + $corps .= "[<a href='".generer_url_action('cookie', "essai_auth_http=oui&$url")."'>$re</a>]"; |
|
| 790 | 789 | } |
| 791 | 790 | |
| 792 | 791 | if ($lien) { |
| 793 | - $corps .= " [<a href='$ecrire'>" . _T('login_espace_prive') . '</a>]'; |
|
| 792 | + $corps .= " [<a href='$ecrire'>"._T('login_espace_prive').'</a>]'; |
|
| 794 | 793 | } |
| 795 | 794 | include_spip('inc/minipres'); |
| 796 | 795 | echo minipres($pb, $corps); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | static $t1 = ['&', '<', '>']; |
| 121 | 121 | static $t2 = ['&', '<', '>']; |
| 122 | 122 | |
| 123 | - return '<pre>' . str_replace($t1, $t2, (string) $t) . '</pre>'; |
|
| 123 | + return '<pre>'.str_replace($t1, $t2, (string) $t).'</pre>'; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | foreach ($lignes as &$l) { |
| 141 | 141 | $l = join('|', $l); |
| 142 | 142 | } |
| 143 | - $corps = join("\n", $lignes) . "\n"; |
|
| 144 | - $corps = $caption . |
|
| 145 | - "\n|{{" . |
|
| 146 | - join('}}|{{', $entete) . |
|
| 147 | - '}}|' . |
|
| 148 | - "\n|" . |
|
| 143 | + $corps = join("\n", $lignes)."\n"; |
|
| 144 | + $corps = $caption. |
|
| 145 | + "\n|{{". |
|
| 146 | + join('}}|{{', $entete). |
|
| 147 | + '}}|'. |
|
| 148 | + "\n|". |
|
| 149 | 149 | str_replace("\n", "|\n|", $corps); |
| 150 | 150 | include_spip('inc/texte'); |
| 151 | 151 | |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 190 | - $t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t)); |
|
| 190 | + $t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t)); |
|
| 191 | 191 | |
| 192 | - return (!$style ? '' : "\n<style>" . $style . '</style>') . $t; |
|
| 192 | + return (!$style ? '' : "\n<style>".$style.'</style>').$t; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // mais apres la fonction autoriser() |
| 123 | 123 | if ($f = find_in_path('mes_fonctions.php')) { |
| 124 | 124 | global $dossier_squelettes; |
| 125 | - include_once(_ROOT_CWD . $f); |
|
| 125 | + include_once(_ROOT_CWD.$f); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 165 | 165 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 166 | 166 | } elseif (is_numeric($qui)) { |
| 167 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 167 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | spip_log( |
| 177 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 178 | - 'autoriser' . _LOG_DEBUG |
|
| 177 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 178 | + 'autoriser'._LOG_DEBUG |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | // passer par objet_type pour avoir les alias |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 192 | 192 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 193 | 193 | ) { |
| 194 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 194 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -200,18 +200,18 @@ discard block |
||
| 200 | 200 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 201 | 201 | $fonctions = $type |
| 202 | 202 | ? [ |
| 203 | - 'autoriser_' . $type . '_' . $faire, |
|
| 204 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 205 | - 'autoriser_' . $type, |
|
| 206 | - 'autoriser_' . $type . '_dist', |
|
| 207 | - 'autoriser_' . $faire, |
|
| 208 | - 'autoriser_' . $faire . '_dist', |
|
| 203 | + 'autoriser_'.$type.'_'.$faire, |
|
| 204 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 205 | + 'autoriser_'.$type, |
|
| 206 | + 'autoriser_'.$type.'_dist', |
|
| 207 | + 'autoriser_'.$faire, |
|
| 208 | + 'autoriser_'.$faire.'_dist', |
|
| 209 | 209 | 'autoriser_defaut', |
| 210 | 210 | 'autoriser_defaut_dist' |
| 211 | 211 | ] |
| 212 | 212 | : [ |
| 213 | - 'autoriser_' . $faire, |
|
| 214 | - 'autoriser_' . $faire . '_dist', |
|
| 213 | + 'autoriser_'.$faire, |
|
| 214 | + 'autoriser_'.$faire.'_dist', |
|
| 215 | 215 | 'autoriser_defaut', |
| 216 | 216 | 'autoriser_defaut_dist' |
| 217 | 217 | ]; |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | spip_log( |
| 227 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 228 | - 'autoriser' . _LOG_DEBUG |
|
| 227 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 228 | + 'autoriser'._LOG_DEBUG |
|
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | return $a; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 375 | 375 | |
| 376 | 376 | // Le visiteur a-t-il un statut prevu par la config ? |
| 377 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 377 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 378 | 378 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } // pas de champ passe a la demande => NIET |
| 433 | 433 | $previsu = explode(',', $c['previsu']); |
| 434 | 434 | // regarder si ce statut est autorise pour l'auteur |
| 435 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 435 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 436 | 436 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 437 | 437 | // sinon l’auteur en session |
| 438 | 438 | include_spip('inc/securiser_action'); |
@@ -446,12 +446,12 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | if (!$id_auteur) { |
| 448 | 448 | return false; |
| 449 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 449 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 450 | 450 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 451 | 451 | } elseif ( |
| 452 | 452 | !sql_countsel( |
| 453 | 453 | 'spip_auteurs_liens', |
| 454 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 454 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 455 | 455 | ) |
| 456 | 456 | ) { |
| 457 | 457 | return false; |
@@ -496,16 +496,16 @@ discard block |
||
| 496 | 496 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 497 | 497 | $primary = id_table_objet($type); |
| 498 | 498 | if ($table != 'spip_rubriques') { |
| 499 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 499 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 500 | 500 | } else { |
| 501 | 501 | $id_rubrique = $id; |
| 502 | 502 | } |
| 503 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 503 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 504 | 504 | if (!$id_secteur > 0) { |
| 505 | 505 | $id_secteur = $id_rubrique; |
| 506 | 506 | } |
| 507 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 508 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 507 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 508 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 509 | 509 | if ($langue_secteur != $langue_objet) { |
| 510 | 510 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 511 | 511 | return true; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 514 | 514 | return false; |
| 515 | 515 | } else { |
| 516 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 516 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 517 | 517 | if ($id_parent != 0) { |
| 518 | 518 | // sous-rubriques : pas de choix de langue |
| 519 | 519 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | if (!isset($opt['statut'])) { |
| 567 | 567 | if (isset($desc['field']['statut'])) { |
| 568 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 568 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 569 | 569 | } else { |
| 570 | 570 | $statut = 'publie'; |
| 571 | 571 | } // pas de statut => publie |
@@ -739,11 +739,11 @@ discard block |
||
| 739 | 739 | return false; |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 742 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 743 | 743 | return false; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 746 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 747 | 747 | return false; |
| 748 | 748 | } |
| 749 | 749 | |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | if (!$id) { |
| 781 | 781 | return false; |
| 782 | 782 | } |
| 783 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 783 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 784 | 784 | |
| 785 | 785 | return |
| 786 | 786 | $r |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 792 | 792 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 793 | 793 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 794 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 794 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 795 | 795 | ) |
| 796 | 796 | ); |
| 797 | 797 | } |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if (!$id) { |
| 850 | 850 | return false; |
| 851 | 851 | } |
| 852 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 852 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | return |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | or |
| 861 | 861 | ($id |
| 862 | 862 | and $qui['id_auteur'] |
| 863 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 863 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | |
@@ -881,8 +881,8 @@ discard block |
||
| 881 | 881 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 882 | 882 | # securite, mais on aurait pas du arriver ici ! |
| 883 | 883 | if ( |
| 884 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 885 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 884 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 885 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 886 | 886 | ) { |
| 887 | 887 | return $f($faire, $type, $id, $qui, $opt); |
| 888 | 888 | } |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $n = sql_fetsel( |
| 1014 | 1014 | 'A.id_article', |
| 1015 | 1015 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1016 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1016 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1017 | 1017 | ); |
| 1018 | 1018 | |
| 1019 | 1019 | return $n ? true : false; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | and $r = sql_allfetsel( |
| 1226 | 1226 | 'id_objet', |
| 1227 | 1227 | 'spip_auteurs_liens', |
| 1228 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1228 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1229 | 1229 | ) |
| 1230 | 1230 | and is_countable($r) ? count($r) : 0 |
| 1231 | 1231 | ) { |
@@ -1910,8 +1910,8 @@ discard block |
||
| 1910 | 1910 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1911 | 1911 | $objet = objet_type($objet); |
| 1912 | 1912 | $where = [ |
| 1913 | - 'objet=' . sql_quote($objet), |
|
| 1914 | - 'id_objet=' . intval($id_objet) |
|
| 1913 | + 'objet='.sql_quote($objet), |
|
| 1914 | + 'id_objet='.intval($id_objet) |
|
| 1915 | 1915 | ]; |
| 1916 | 1916 | if (!empty($cond)) { |
| 1917 | 1917 | if (is_array($cond)) { |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | return sql_allfetsel( |
| 1947 | 1947 | 'id_auteur', |
| 1948 | 1948 | 'spip_auteurs_liens', |
| 1949 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1949 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1950 | 1950 | ); |
| 1951 | 1951 | } |
| 1952 | 1952 | |