@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 118 | 118 | + [ |
| 119 | 119 | $id => new Bouton( |
| 120 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | - $infos['titre'], // titre |
|
| 120 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | + $infos['titre'], // titre |
|
| 122 | 122 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 123 | 123 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 124 | 124 | ) |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 136 | 136 | + [ |
| 137 | 137 | $id => new Bouton( |
| 138 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | - $infos['titre'], // titre |
|
| 138 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | + $infos['titre'], // titre |
|
| 140 | 140 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 141 | 141 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 142 | 142 | ) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $libelles = $isfavoris = $favoris = []; |
| 182 | 182 | foreach ($menu->sousmenu as $key => $item) { |
| 183 | 183 | $libelles[$key] = strtolower(translitteration(_T($item->libelle))); |
| 184 | - $isfavoris[$key] = (bool)$item->favori; |
|
| 184 | + $isfavoris[$key] = (bool) $item->favori; |
|
| 185 | 185 | $favoris[$key] = $item->favori; |
| 186 | 186 | } |
| 187 | 187 | if ($avec_favoris) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $url = str_replace('&', '&', $url); |
| 224 | 224 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 225 | 225 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 226 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 226 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 227 | 227 | } |
| 228 | 228 | $val = _request($matches[2], $contexte); |
| 229 | 229 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $hsl = _couleur_hex_to_hsl($couleur); |
| 205 | 205 | $hsl = [ |
| 206 | 206 | 'h' => round($hsl['h'] * 360), |
| 207 | - 's' => round($hsl['s'] * 100) . '%', |
|
| 208 | - 'l' => round($hsl['l'] * 100) . '%' |
|
| 207 | + 's' => round($hsl['s'] * 100).'%', |
|
| 208 | + 'l' => round($hsl['l'] * 100).'%' |
|
| 209 | 209 | ]; |
| 210 | 210 | if ($format === null) { |
| 211 | 211 | return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})"; |
@@ -384,11 +384,11 @@ discard block |
||
| 384 | 384 | $process = 'AUTO' |
| 385 | 385 | ) { |
| 386 | 386 | // PHP 7+ type hint |
| 387 | - $img = (string)$img; |
|
| 388 | - $taille_x = (int)$taille_x; |
|
| 389 | - $taille_y = (int)$taille_y; |
|
| 390 | - $force = (bool)$force; |
|
| 391 | - $process = (string)$process; |
|
| 387 | + $img = (string) $img; |
|
| 388 | + $taille_x = (int) $taille_x; |
|
| 389 | + $taille_y = (int) $taille_y; |
|
| 390 | + $force = (bool) $force; |
|
| 391 | + $process = (string) $process; |
|
| 392 | 392 | |
| 393 | 393 | if (!$img) { |
| 394 | 394 | return ''; |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $process = 'AUTO' |
| 466 | 466 | ) { |
| 467 | 467 | // PHP 7+ type hint |
| 468 | - $img = (string)$img; |
|
| 469 | - $taille = (int)$taille; |
|
| 470 | - $taille_y = (int)$taille_y; |
|
| 471 | - $force = (bool)$force; |
|
| 472 | - $process = (string)$process; |
|
| 468 | + $img = (string) $img; |
|
| 469 | + $taille = (int) $taille; |
|
| 470 | + $taille_y = (int) $taille_y; |
|
| 471 | + $force = (bool) $force; |
|
| 472 | + $process = (string) $process; |
|
| 473 | 473 | |
| 474 | 474 | // Determiner la taille x,y maxi |
| 475 | 475 | // prendre le reglage de previsu par defaut |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $background_color = 'white' |
| 513 | 513 | ) { |
| 514 | 514 | if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') { |
| 515 | - return image_reduire(image_recadre($im, $width . ':' . $height, '-', $position, $background_color), $width, $height); |
|
| 515 | + return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | 516 | } else { return image_passe_partout($im, $width, $height); |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | **/ |
| 534 | 534 | function image_reduire_par($img, $val = 1, $force = false) { |
| 535 | 535 | // PHP 7+ type hint |
| 536 | - $img = (string)$img; |
|
| 537 | - $val = (int)$val; |
|
| 538 | - $force = (bool)$force; |
|
| 536 | + $img = (string) $img; |
|
| 537 | + $val = (int) $val; |
|
| 538 | + $force = (bool) $force; |
|
| 539 | 539 | |
| 540 | 540 | [$hauteur, $largeur] = taille_image($img); |
| 541 | 541 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // si spip_log() dans mes_options, ou repertoire log/ non present, poser dans tmp/ |
| 55 | 55 | if (!defined('_DIR_LOG') or !$test_repertoire[$d]) { |
| 56 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 56 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $rotate = 0; |
| 60 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 60 | + $pid = '(pid '.@getmypid().')'; |
|
| 61 | 61 | |
| 62 | 62 | // accepter spip_log( Array ) |
| 63 | 63 | if (!is_string($message)) { |
@@ -72,10 +72,10 @@ discard block |
||
| 72 | 72 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 73 | 73 | } |
| 74 | 74 | $fu = $debug[2]['function'] ?? ''; |
| 75 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 75 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' ' |
|
| 78 | + $m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' ' |
|
| 79 | 79 | //distinguer les logs prives et publics dans les grep |
| 80 | 80 | . $debugverb |
| 81 | 81 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | $rotate-- > 0 |
| 101 | 101 | and function_exists('spip_unlink') |
| 102 | 102 | ) { |
| 103 | - spip_unlink($logfile . '.' . $rotate); |
|
| 103 | + spip_unlink($logfile.'.'.$rotate); |
|
| 104 | 104 | while ($rotate--) { |
| 105 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 105 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
| 136 | 136 | if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
| 137 | - $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 137 | + $from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // nettoyer les é ’, &emdash; etc... |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (!_TEST_EMAIL_DEST) { |
| 172 | 172 | return false; |
| 173 | 173 | } else { |
| 174 | - $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 174 | + $texte = "Dest : $destinataire\r\n".$texte; |
|
| 175 | 175 | $destinataire = _TEST_EMAIL_DEST; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Ajouter le Content-Type et consort s'il n'y est pas deja |
| 196 | 196 | if (strpos($headers, 'Content-Type: ') === false) { |
| 197 | 197 | $type = |
| 198 | - "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 198 | + "Content-Type: text/plain;charset=\"$charset\";\n". |
|
| 199 | 199 | "Content-Transfer-Encoding: 8bit\n"; |
| 200 | 200 | } else { |
| 201 | 201 | $type = ''; |
@@ -207,17 +207,17 @@ discard block |
||
| 207 | 207 | $domain = $domain[0]; |
| 208 | 208 | } |
| 209 | 209 | else { |
| 210 | - $domain = '@unknown-' . md5($from) . '.org'; |
|
| 210 | + $domain = '@unknown-'.md5($from).'.org'; |
|
| 211 | 211 | } |
| 212 | - $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
|
| 212 | + $uniq = random_int(0, mt_getrandmax()).'_'.md5($to.$texte).$domain; |
|
| 213 | 213 | |
| 214 | 214 | // Si multi-part, s'en servir comme borne ... |
| 215 | 215 | if ($parts) { |
| 216 | - $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 216 | + $texte = "--$uniq\n$type\n".$texte."\n"; |
|
| 217 | 217 | foreach ($parts as $part) { |
| 218 | - $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 218 | + $n = strlen($part[1]).($part[0] ? "\n" : ''); |
|
| 219 | 219 | $e = join("\n", $part[0]); |
| 220 | - $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 220 | + $texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1]; |
|
| 221 | 221 | } |
| 222 | 222 | $texte .= "\n\n--$uniq--\n"; |
| 223 | 223 | // Si boundary n'est pas entre guillemets, |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | // .. et s'en servir pour plaire a SpamAssassin |
| 229 | 229 | |
| 230 | - $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 230 | + $mid = 'Message-Id: <'.$uniq.'>'; |
|
| 231 | 231 | |
| 232 | 232 | // indispensable pour les sites qui collent d'office From: serveur-http |
| 233 | 233 | // sauf si deja mis par l'envoyeur |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | // mais apres la fonction autoriser() |
| 116 | 116 | if ($f = find_in_path('mes_fonctions.php')) { |
| 117 | 117 | global $dossier_squelettes; |
| 118 | - include_once(_ROOT_CWD . $f); |
|
| 118 | + include_once(_ROOT_CWD.$f); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 158 | 158 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 159 | 159 | } elseif (is_numeric($qui)) { |
| 160 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 160 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | spip_log( |
| 170 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 171 | - 'autoriser' . _LOG_DEBUG |
|
| 170 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 171 | + 'autoriser'._LOG_DEBUG |
|
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | 174 | // passer par objet_type pour avoir les alias |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 185 | 185 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 186 | 186 | ) { |
| 187 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 187 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 188 | 188 | return true; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 194 | 194 | $fonctions = $type |
| 195 | 195 | ? [ |
| 196 | - 'autoriser_' . $type . '_' . $faire, |
|
| 197 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 198 | - 'autoriser_' . $type, |
|
| 199 | - 'autoriser_' . $type . '_dist', |
|
| 200 | - 'autoriser_' . $faire, |
|
| 201 | - 'autoriser_' . $faire . '_dist', |
|
| 196 | + 'autoriser_'.$type.'_'.$faire, |
|
| 197 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 198 | + 'autoriser_'.$type, |
|
| 199 | + 'autoriser_'.$type.'_dist', |
|
| 200 | + 'autoriser_'.$faire, |
|
| 201 | + 'autoriser_'.$faire.'_dist', |
|
| 202 | 202 | 'autoriser_defaut', |
| 203 | 203 | 'autoriser_defaut_dist' |
| 204 | 204 | ] |
| 205 | 205 | : [ |
| 206 | - 'autoriser_' . $faire, |
|
| 207 | - 'autoriser_' . $faire . '_dist', |
|
| 206 | + 'autoriser_'.$faire, |
|
| 207 | + 'autoriser_'.$faire.'_dist', |
|
| 208 | 208 | 'autoriser_defaut', |
| 209 | 209 | 'autoriser_defaut_dist' |
| 210 | 210 | ]; |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | spip_log( |
| 220 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 221 | - 'autoriser' . _LOG_DEBUG |
|
| 220 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 221 | + 'autoriser'._LOG_DEBUG |
|
| 222 | 222 | ); |
| 223 | 223 | |
| 224 | 224 | return $a; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | function autoriser_previsualiser_dist(string $faire, string $type, int $id, array $qui, array $opt): bool { |
| 354 | 354 | |
| 355 | 355 | // Le visiteur a-t-il un statut prevu par la config ? |
| 356 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 356 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 357 | 357 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 358 | 358 | } |
| 359 | 359 | |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | } // pas de champ passe a la demande => NIET |
| 411 | 411 | $previsu = explode(',', $c['previsu']); |
| 412 | 412 | // regarder si ce statut est autorise pour l'auteur |
| 413 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 413 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 414 | 414 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 415 | 415 | // sinon l’auteur en session |
| 416 | 416 | include_spip('inc/securiser_action'); |
@@ -424,12 +424,12 @@ discard block |
||
| 424 | 424 | |
| 425 | 425 | if (!$id_auteur) { |
| 426 | 426 | return false; |
| 427 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 427 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 428 | 428 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 429 | 429 | } elseif ( |
| 430 | 430 | !sql_countsel( |
| 431 | 431 | 'spip_auteurs_liens', |
| 432 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 432 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 433 | 433 | ) |
| 434 | 434 | ) { |
| 435 | 435 | return false; |
@@ -472,16 +472,16 @@ discard block |
||
| 472 | 472 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 473 | 473 | $primary = id_table_objet($type); |
| 474 | 474 | if ($table != 'spip_rubriques') { |
| 475 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 475 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 476 | 476 | } else { |
| 477 | 477 | $id_rubrique = $id; |
| 478 | 478 | } |
| 479 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 479 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 480 | 480 | if (!$id_secteur > 0) { |
| 481 | 481 | $id_secteur = $id_rubrique; |
| 482 | 482 | } |
| 483 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 484 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 483 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 484 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 485 | 485 | if ($langue_secteur != $langue_objet) { |
| 486 | 486 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 487 | 487 | return true; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 490 | 490 | return false; |
| 491 | 491 | } else { |
| 492 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 492 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 493 | 493 | if ($id_parent != 0) { |
| 494 | 494 | // sous-rubriques : pas de choix de langue |
| 495 | 495 | return false; |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | |
| 538 | 538 | if (!isset($opt['statut'])) { |
| 539 | 539 | if (isset($desc['field']['statut'])) { |
| 540 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 540 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 541 | 541 | } else { |
| 542 | 542 | $statut = 'publie'; |
| 543 | 543 | } // pas de statut => publie |
@@ -697,11 +697,11 @@ discard block |
||
| 697 | 697 | return false; |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 700 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 701 | 701 | return false; |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 704 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 705 | 705 | return false; |
| 706 | 706 | } |
| 707 | 707 | |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | if (!$id) { |
| 737 | 737 | return false; |
| 738 | 738 | } |
| 739 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 739 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 740 | 740 | |
| 741 | 741 | return |
| 742 | 742 | $r |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 748 | 748 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 749 | 749 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 750 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 750 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 751 | 751 | ) |
| 752 | 752 | ); |
| 753 | 753 | } |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | if (!$id) { |
| 802 | 802 | return false; |
| 803 | 803 | } |
| 804 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 804 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | return |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | or |
| 813 | 813 | ($id |
| 814 | 814 | and $qui['id_auteur'] |
| 815 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 815 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 816 | 816 | } |
| 817 | 817 | |
| 818 | 818 | |
@@ -831,8 +831,8 @@ discard block |
||
| 831 | 831 | function autoriser_voir_dist(string $faire, string $type, int $id, array $qui, array $opt): bool { |
| 832 | 832 | # securite, mais on aurait pas du arriver ici ! |
| 833 | 833 | if ( |
| 834 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 835 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 834 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 835 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 836 | 836 | ) { |
| 837 | 837 | return $f($faire, $type, $id, $qui, $opt); |
| 838 | 838 | } |
@@ -953,7 +953,7 @@ discard block |
||
| 953 | 953 | $n = sql_fetsel( |
| 954 | 954 | 'A.id_article', |
| 955 | 955 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 956 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 956 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 957 | 957 | ); |
| 958 | 958 | |
| 959 | 959 | return $n ? true : false; |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | and $r = sql_allfetsel( |
| 1156 | 1156 | 'id_objet', |
| 1157 | 1157 | 'spip_auteurs_liens', |
| 1158 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1158 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1159 | 1159 | ) |
| 1160 | 1160 | and is_countable($r) ? count($r) : 0 |
| 1161 | 1161 | ) { |
@@ -1771,8 +1771,8 @@ discard block |
||
| 1771 | 1771 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1772 | 1772 | $objet = objet_type($objet); |
| 1773 | 1773 | $where = [ |
| 1774 | - 'objet=' . sql_quote($objet), |
|
| 1775 | - 'id_objet=' . intval($id_objet) |
|
| 1774 | + 'objet='.sql_quote($objet), |
|
| 1775 | + 'id_objet='.intval($id_objet) |
|
| 1776 | 1776 | ]; |
| 1777 | 1777 | if (!empty($cond)) { |
| 1778 | 1778 | if (is_array($cond)) { |
@@ -1807,7 +1807,7 @@ discard block |
||
| 1807 | 1807 | return sql_allfetsel( |
| 1808 | 1808 | 'id_auteur', |
| 1809 | 1809 | 'spip_auteurs_liens', |
| 1810 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1810 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1811 | 1811 | ); |
| 1812 | 1812 | } |
| 1813 | 1813 | |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | spip_log("supprimer sessions auteur $id_auteur", 'session'); |
| 83 | 83 | if ($toutes or $id_auteur !== $GLOBALS['visiteur_session']['id_auteur']) { |
| 84 | 84 | if ($dir = opendir(_DIR_SESSIONS)) { |
| 85 | - $t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut |
|
| 86 | - $t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut |
|
| 85 | + $t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut |
|
| 86 | + $t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut |
|
| 87 | 87 | $t = time() - (4 * _RENOUVELLE_ALEA); |
| 88 | 88 | while (($f = readdir($dir)) !== false) { |
| 89 | 89 | $nb_files++; |
| 90 | 90 | if (preg_match(',^[^\d-]*(-?\d+)_\w{32}\.php[3]?$,', $f, $regs)) { |
| 91 | - $f = _DIR_SESSIONS . $f; |
|
| 91 | + $f = _DIR_SESSIONS.$f; |
|
| 92 | 92 | if (($actives and $regs[1] == $id_auteur) or ($t > filemtime($f))) { |
| 93 | 93 | spip_unlink($f); |
| 94 | 94 | } |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | if ( |
| 173 | 173 | !isset($_COOKIE['spip_session']) |
| 174 | - or !preg_match(',^' . $id_auteur . '_,', $_COOKIE['spip_session']) |
|
| 174 | + or !preg_match(',^'.$id_auteur.'_,', $_COOKIE['spip_session']) |
|
| 175 | 175 | ) { |
| 176 | - $_COOKIE['spip_session'] = $id_auteur . '_' . md5(uniqid(random_int(0, mt_getrandmax()), true)); |
|
| 176 | + $_COOKIE['spip_session'] = $id_auteur.'_'.md5(uniqid(random_int(0, mt_getrandmax()), true)); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // Maintenant on sait qu'on a des choses à écrire |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } else { |
| 207 | 207 | $fichier_session = fichier_session('alea_ephemere'); |
| 208 | 208 | if (!ecrire_fichier_session($fichier_session, $auteur)) { |
| 209 | - spip_log('Echec ecriture fichier session ' . $fichier_session, 'session' . _LOG_HS); |
|
| 209 | + spip_log('Echec ecriture fichier session '.$fichier_session, 'session'._LOG_HS); |
|
| 210 | 210 | include_spip('inc/minipres'); |
| 211 | 211 | echo minipres(); |
| 212 | 212 | exit; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | include_spip('inc/autoriser'); |
| 230 | 230 | } |
| 231 | 231 | if (autoriser('ecrire', '', '', $auteur) and _DUREE_COOKIE_ADMIN) { |
| 232 | - spip_setcookie('spip_admin', '@' . ($auteur['email'] ?: $auteur['login']), [ |
|
| 232 | + spip_setcookie('spip_admin', '@'.($auteur['email'] ?: $auteur['login']), [ |
|
| 233 | 233 | 'expires' => time() + max(_DUREE_COOKIE_ADMIN, $duree) |
| 234 | 234 | ]); |
| 235 | 235 | } // sinon le supprimer ... |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $coef = 20; |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | - return (int)(_RENOUVELLE_ALEA * $coef); |
|
| 273 | + return (int) (_RENOUVELLE_ALEA * $coef); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | // Renouveler la session avec l'alea courant |
| 320 | 320 | include($fichier_session); |
| 321 | - spip_log('renouvelle session ' . $GLOBALS['visiteur_session']['id_auteur'], 'session'); |
|
| 321 | + spip_log('renouvelle session '.$GLOBALS['visiteur_session']['id_auteur'], 'session'); |
|
| 322 | 322 | spip_unlink($fichier_session); |
| 323 | 323 | ajouter_session($GLOBALS['visiteur_session']); |
| 324 | 324 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | } else { |
| 352 | 352 | if ($change) { |
| 353 | - spip_log("rejoue session $fichier_session " . $_COOKIE['spip_session'], 'session'); |
|
| 353 | + spip_log("rejoue session $fichier_session ".$_COOKIE['spip_session'], 'session'); |
|
| 354 | 354 | if ($fichier_session) { |
| 355 | 355 | spip_unlink($fichier_session); |
| 356 | 356 | } |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | // liste des sessions |
| 570 | - $sessions = preg_files(_DIR_SESSIONS, '/' . $id_auteur . '_.*\.php$'); |
|
| 570 | + $sessions = preg_files(_DIR_SESSIONS, '/'.$id_auteur.'_.*\.php$'); |
|
| 571 | 571 | |
| 572 | 572 | // si on en a plus que la limite, supprimer les plus vieilles |
| 573 | 573 | // si ce ne sont pas des sessions anonymes car elles sont alors chacune differentes |
@@ -648,12 +648,12 @@ discard block |
||
| 648 | 648 | $auteur = preparer_ecriture_session($auteur); |
| 649 | 649 | |
| 650 | 650 | // enregistrer les autres donnees du visiteur |
| 651 | - $texte = '<' . "?php\n"; |
|
| 651 | + $texte = '<'."?php\n"; |
|
| 652 | 652 | foreach ($auteur as $var => $val) { |
| 653 | - $texte .= '$GLOBALS[\'visiteur_session\'][' . var_export($var, true) . '] = ' |
|
| 654 | - . var_export($val, true) . ";\n"; |
|
| 653 | + $texte .= '$GLOBALS[\'visiteur_session\']['.var_export($var, true).'] = ' |
|
| 654 | + . var_export($val, true).";\n"; |
|
| 655 | 655 | } |
| 656 | - $texte .= '?' . ">\n"; |
|
| 656 | + $texte .= '?'.">\n"; |
|
| 657 | 657 | |
| 658 | 658 | return ecrire_fichier($fichier, $texte); |
| 659 | 659 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $repertoire = sous_repertoire(_DIR_SESSIONS, '', false, $tantpis); |
| 684 | 684 | $c = $_COOKIE['spip_session']; |
| 685 | 685 | |
| 686 | - return $repertoire . intval($c) . '_' . md5($c . ' ' . $GLOBALS['meta'][$alea]) . '.php'; |
|
| 686 | + return $repertoire.intval($c).'_'.md5($c.' '.$GLOBALS['meta'][$alea]).'.php'; |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | * @return string |
| 702 | 702 | */ |
| 703 | 703 | function rejouer_session() { |
| 704 | - return '<img src="' . generer_url_action('cookie', 'change_session=oui', true) . '" width="0" height="0" alt="" />'; |
|
| 704 | + return '<img src="'.generer_url_action('cookie', 'change_session=oui', true).'" width="0" height="0" alt="" />'; |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | return $res; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - return $res = md5($GLOBALS['ip'] . ($_SERVER['HTTP_USER_AGENT'] ?? '')); |
|
| 719 | + return $res = md5($GLOBALS['ip'].($_SERVER['HTTP_USER_AGENT'] ?? '')); |
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | |
@@ -51,5 +51,5 @@ |
||
| 51 | 51 | } |
| 52 | 52 | $d = is_countable($delete) ? count($delete) : 0; |
| 53 | 53 | $r = count($res); |
| 54 | - spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 54 | + spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 55 | 55 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | $infos['url_voir'] = $infos['type']; |
| 704 | 704 | } |
| 705 | 705 | if (!isset($infos['url_edit'])) { |
| 706 | - $infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : ''); |
|
| 706 | + $infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : ''); |
|
| 707 | 707 | } |
| 708 | 708 | if (!isset($infos['icone_objet'])) { |
| 709 | 709 | $infos['icone_objet'] = $infos['type']; |
@@ -715,48 +715,48 @@ discard block |
||
| 715 | 715 | $infos['texte_retour'] = 'icone_retour'; |
| 716 | 716 | } |
| 717 | 717 | if (!isset($infos['texte_modifier'])) { |
| 718 | - $infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type']; |
|
| 718 | + $infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type']; |
|
| 719 | 719 | } |
| 720 | 720 | if (!isset($infos['texte_creer'])) { |
| 721 | - $infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type']; |
|
| 721 | + $infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type']; |
|
| 722 | 722 | } |
| 723 | 723 | if (!isset($infos['texte_creer_associer'])) { |
| 724 | - $infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type']; |
|
| 724 | + $infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type']; |
|
| 725 | 725 | } |
| 726 | 726 | if (!isset($infos['texte_ajouter'])) { |
| 727 | 727 | // Ajouter un X |
| 728 | - $infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type']; |
|
| 728 | + $infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type']; |
|
| 729 | 729 | } |
| 730 | 730 | if (!isset($infos['texte_objets'])) { |
| 731 | - $infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet']; |
|
| 731 | + $infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet']; |
|
| 732 | 732 | } |
| 733 | 733 | if (!isset($infos['texte_objet'])) { |
| 734 | - $infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type']; |
|
| 734 | + $infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type']; |
|
| 735 | 735 | } |
| 736 | 736 | if (!isset($infos['texte_logo_objet'])) { |
| 737 | 737 | // objet:titre_logo_objet "Logo de ce X" |
| 738 | - $infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type']; |
|
| 738 | + $infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type']; |
|
| 739 | 739 | } |
| 740 | 740 | if (!isset($infos['texte_langue_objet'])) { |
| 741 | 741 | // objet:texte_langue_objet "Langue de ce X" |
| 742 | - $infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type']; |
|
| 742 | + $infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type']; |
|
| 743 | 743 | } |
| 744 | 744 | if (!isset($infos['texte_definir_comme_traduction_objet'])) { |
| 745 | 745 | // "Ce X est une traduction du X numéro :" |
| 746 | - $infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type']; |
|
| 746 | + $infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type']; |
|
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | // objet:info_aucun_objet |
| 750 | 750 | if (!isset($infos['info_aucun_objet'])) { |
| 751 | - $infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type']; |
|
| 751 | + $infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type']; |
|
| 752 | 752 | } |
| 753 | 753 | // objet:info_1_objet |
| 754 | 754 | if (!isset($infos['info_1_objet'])) { |
| 755 | - $infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type']; |
|
| 755 | + $infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type']; |
|
| 756 | 756 | } |
| 757 | 757 | // objet:info_nb_objets |
| 758 | 758 | if (!isset($infos['info_nb_objets'])) { |
| 759 | - $infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet']; |
|
| 759 | + $infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet']; |
|
| 760 | 760 | } |
| 761 | 761 | |
| 762 | 762 | if (!isset($infos['champs_editables'])) { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | } |
| 957 | 957 | $ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso) |
| 958 | 958 | $connexion = $GLOBALS['connexions'][$serveur ?: 0]; |
| 959 | - $spip = $connexion['prefixe'] . '_'; |
|
| 959 | + $spip = $connexion['prefixe'].'_'; |
|
| 960 | 960 | foreach ($ts as $t) { |
| 961 | 961 | $t = substr($t, strlen($spip)); |
| 962 | 962 | $tables[$serveur]["spip_$t"] = $t; |
@@ -1025,10 +1025,10 @@ discard block |
||
| 1025 | 1025 | if ($serveur !== false) { |
| 1026 | 1026 | $t = lister_tables_spip($serveur); |
| 1027 | 1027 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 1028 | - $typetrim = rtrim($type, 's') . 's'; |
|
| 1028 | + $typetrim = rtrim($type, 's').'s'; |
|
| 1029 | 1029 | if ( |
| 1030 | 1030 | (isset($t[$typetrim]) or in_array($typetrim, $t)) |
| 1031 | - and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur)) |
|
| 1031 | + and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur)) |
|
| 1032 | 1032 | ) { |
| 1033 | 1033 | return $desc['id_table']; |
| 1034 | 1034 | } elseif ( |
@@ -1038,11 +1038,11 @@ discard block |
||
| 1038 | 1038 | return $desc['id_table']; |
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - spip_log('table_objet(' . $type . ') calculee sans verification'); |
|
| 1041 | + spip_log('table_objet('.$type.') calculee sans verification'); |
|
| 1042 | 1042 | #spip_log(debug_backtrace(),'db'); |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | - return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false |
|
| 1045 | + return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false |
|
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | /** |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | function objet_test_si_publie($objet, $id_objet, $serveur = '') { |
| 1227 | 1227 | // voir si une fonction est definie pour faire le boulot |
| 1228 | 1228 | // elle a la priorite dans ce cas |
| 1229 | - if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) { |
|
| 1229 | + if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) { |
|
| 1230 | 1230 | return $f($objet, $id_objet, $serveur); |
| 1231 | 1231 | } |
| 1232 | 1232 | |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $boucle->sql_serveur = $serveur; |
| 1249 | 1249 | $boucle->select[] = $id_table_objet; |
| 1250 | 1250 | $boucle->from[$table_objet] = table_objet_sql($objet, $serveur); |
| 1251 | - $boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet); |
|
| 1251 | + $boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet); |
|
| 1252 | 1252 | |
| 1253 | 1253 | $boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php |
| 1254 | 1254 | $boucle->descr['sourcefile'] = 'internal'; |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | ? "{$parent_methode['source_champ']} = $id_objet" |
| 1376 | 1376 | : "${cle_objet} = $id_objet"; |
| 1377 | 1377 | if (isset($parent_methode['source_champ_type'])) { |
| 1378 | - $where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet); |
|
| 1378 | + $where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | // -- Condition supplémentaire sur la détection du parent |
| 1381 | 1381 | if (isset($parent_methode['table_condition'])) { |
@@ -1499,11 +1499,11 @@ discard block |
||
| 1499 | 1499 | $where = []; |
| 1500 | 1500 | // -- L'identifiant du parent |
| 1501 | 1501 | if (isset($_methode_parent['champ'])) { |
| 1502 | - $where[] = $_methode_parent['champ'] . ' = ' . $id_objet; |
|
| 1502 | + $where[] = $_methode_parent['champ'].' = '.$id_objet; |
|
| 1503 | 1503 | } |
| 1504 | 1504 | // -- Si le parent est variable |
| 1505 | 1505 | if (isset($_methode_parent['champ_type'])) { |
| 1506 | - $where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet); |
|
| 1506 | + $where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet); |
|
| 1507 | 1507 | } |
| 1508 | 1508 | |
| 1509 | 1509 | // On détermine la table, le champ id des enfants et on complète éventuellement les conditions |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($compil_info) { |
| 55 | 55 | $contexte_compil = [ |
| 56 | - $trace[0]['file'],// sourcefile |
|
| 56 | + $trace[0]['file'], // sourcefile |
|
| 57 | 57 | '', //nom |
| 58 | - (isset($trace[1]) ? $trace[1]['function'] . "(){\n" : '') |
|
| 59 | - . $trace[0]['function'] . '();' |
|
| 58 | + (isset($trace[1]) ? $trace[1]['function']."(){\n" : '') |
|
| 59 | + . $trace[0]['function'].'();' |
|
| 60 | 60 | . (isset($trace[1]) ? "\n}" : ''), //id_boucle |
| 61 | 61 | $trace[0]['line'], // ligne |
| 62 | 62 | $GLOBALS['spip_lang'], // lang |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | return $contexte_compil; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $message = count($trace) ? $trace[0]['file'] . ' L' . $trace[0]['line'] : ''; |
|
| 68 | + $message = count($trace) ? $trace[0]['file'].' L'.$trace[0]['line'] : ''; |
|
| 69 | 69 | $f = []; |
| 70 | 70 | while (count($trace) and $t = array_shift($trace)) { |
| 71 | 71 | if (in_array($t['function'], ['include_once', 'include_spip', 'find_in_path'])) { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $f[] = $t['function']; |
| 75 | 75 | } |
| 76 | 76 | if (count($f)) { |
| 77 | - $message .= ' [' . implode('(),', $f) . '()]'; |
|
| 77 | + $message .= ' ['.implode('(),', $f).'()]'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | return $message; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // le debug, c'est pour ce qui a ete produit par le compilateur |
| 268 | 268 | if (isset($GLOBALS['debug']['aucasou'])) { |
| 269 | 269 | [$table, $id, ] = $GLOBALS['debug']['aucasou']; |
| 270 | - $nom = $GLOBALS['debug_objets']['courant'] . $id; |
|
| 270 | + $nom = $GLOBALS['debug_objets']['courant'].$id; |
|
| 271 | 271 | $GLOBALS['debug_objets']['requete'][$nom] = $query; |
| 272 | 272 | } |
| 273 | 273 | $res = $f($select, $from, $where, $groupby, $orderby, $limit, $having, $serveur, true); |
@@ -1144,7 +1144,7 @@ discard block |
||
| 1144 | 1144 | // la globale n'est remplie qu'apres l'appel de sql_serveur. |
| 1145 | 1145 | if ($spip == null) { |
| 1146 | 1146 | $connexion = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 1147 | - $spip = $connexion['prefixe'] . '\_%'; |
|
| 1147 | + $spip = $connexion['prefixe'].'\_%'; |
|
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | 1150 | return $f($spip, $serveur, $option !== false); |
@@ -2302,9 +2302,9 @@ discard block |
||
| 2302 | 2302 | $jour = 0; |
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | - return sprintf('%04u', $annee) . '-' . sprintf('%02u', $mois) . '-' |
|
| 2306 | - . sprintf('%02u', $jour) . ' ' . sprintf('%02u', $h) . ':' |
|
| 2307 | - . sprintf('%02u', $m) . ':' . sprintf('%02u', $s); |
|
| 2305 | + return sprintf('%04u', $annee).'-'.sprintf('%02u', $mois).'-' |
|
| 2306 | + . sprintf('%02u', $jour).' '.sprintf('%02u', $h).':' |
|
| 2307 | + . sprintf('%02u', $m).':'.sprintf('%02u', $s); |
|
| 2308 | 2308 | } |
| 2309 | 2309 | |
| 2310 | 2310 | |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | */ |
| 2367 | 2367 | function prefixer_table_spip($table, $prefixe) { |
| 2368 | 2368 | if ($prefixe) { |
| 2369 | - $table = preg_replace('/^spip_/', $prefixe . '_', $table); |
|
| 2369 | + $table = preg_replace('/^spip_/', $prefixe.'_', $table); |
|
| 2370 | 2370 | } |
| 2371 | 2371 | return $table; |
| 2372 | 2372 | } |