@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Mot de passe |
| 32 | 32 | **/ |
| 33 | 33 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 34 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 34 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 35 | 35 | |
| 36 | 36 | mt_srand($seed); |
| 37 | 37 | $s = ''; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | if (!$s) { |
| 43 | 43 | $s = random_int(0, mt_getrandmax()); |
| 44 | 44 | } |
| 45 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 45 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 46 | 46 | } |
| 47 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 47 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 48 | 48 | $x = $r['r'] & 63; |
| 49 | 49 | if ($x < 10) { |
| 50 | 50 | $x = chr($x + 48); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | static $seeded; |
| 83 | 83 | |
| 84 | 84 | if (!$seeded) { |
| 85 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 85 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 86 | 86 | mt_srand($seed); |
| 87 | 87 | $seeded = true; |
| 88 | 88 | } |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); |
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | - $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur)); |
|
| 171 | + $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur)); |
|
| 172 | 172 | if (!$low_sec) { |
| 173 | 173 | $low_sec = creer_pass_aleatoire(); |
| 174 | - sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur)); |
|
| 174 | + sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur)); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | foreach ($args as $val => $var) { |
| 196 | 196 | if ($var) { |
| 197 | 197 | if ($val <> 'statut') { |
| 198 | - $a .= ':' . $val . '-' . $var; |
|
| 198 | + $a .= ':'.$val.'-'.$var; |
|
| 199 | 199 | } |
| 200 | - $b .= $val . '=' . $var . '&'; |
|
| 200 | + $b .= $val.'='.$var.'&'; |
|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | $a = substr($a, 1); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | * Clé |
| 228 | 228 | **/ |
| 229 | 229 | function afficher_low_sec($id_auteur, $action = '') { |
| 230 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 230 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if (!$id_auteur = intval($id_auteur)) { |
| 259 | 259 | return; |
| 260 | 260 | } // jamais trop prudent ;) |
| 261 | - sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur)); |
|
| 261 | + sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur)); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | function initialiser_sel() { |
| 270 | 270 | if (!isset($GLOBALS['htsalt'])) { |
| 271 | 271 | if (CRYPT_MD5) { |
| 272 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 272 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 273 | 273 | } else { |
| 274 | 274 | $GLOBALS['htsalt'] = ''; |
| 275 | 275 | } |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | * - void sinon. |
| 292 | 292 | **/ |
| 293 | 293 | function ecrire_acces() { |
| 294 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 295 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 294 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 295 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 296 | 296 | |
| 297 | 297 | // Cette variable de configuration peut etre posee par un plugin |
| 298 | 298 | // par exemple acces_restreint ; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | and !@file_exists($htaccess) |
| 304 | 304 | ) { |
| 305 | 305 | spip_unlink($htpasswd); |
| 306 | - spip_unlink($htpasswd . '-admin'); |
|
| 306 | + spip_unlink($htpasswd.'-admin'); |
|
| 307 | 307 | return; |
| 308 | 308 | } |
| 309 | 309 | |
@@ -332,10 +332,10 @@ discard block |
||
| 332 | 332 | $pwd_all = ''; // login:htpass pour tous |
| 333 | 333 | $pwd_admin = ''; // login:htpass pour les admins |
| 334 | 334 | |
| 335 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 335 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 336 | 336 | while ($row = sql_fetch($res)) { |
| 337 | 337 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 338 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 338 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 339 | 339 | $pwd_all .= $ligne; |
| 340 | 340 | if ($row['statut'] == '0minirezo') { |
| 341 | 341 | $pwd_admin .= $ligne; |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | * @return boolean |
| 381 | 381 | */ |
| 382 | 382 | function verifier_htaccess($rep, $force = false) { |
| 383 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 383 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 384 | 384 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 385 | 385 | return true; |
| 386 | 386 | } |
@@ -409,17 +409,17 @@ discard block |
||
| 409 | 409 | fputs($ht, $deny); |
| 410 | 410 | fclose($ht); |
| 411 | 411 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 412 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 412 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 413 | 413 | if ($ht = @fopen($t, 'w')) { |
| 414 | 414 | @fclose($ht); |
| 415 | 415 | include_spip('inc/distant'); |
| 416 | 416 | $t = substr($t, strlen(_DIR_RACINE)); |
| 417 | - $t = url_de_base() . $t; |
|
| 417 | + $t = url_de_base().$t; |
|
| 418 | 418 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 419 | 419 | $ht = ($ht['status'] ?? null) === 403; |
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 422 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 423 | 423 | |
| 424 | 424 | return $ht; |
| 425 | 425 | } |
@@ -445,11 +445,11 @@ discard block |
||
| 445 | 445 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 446 | 446 | $dirs[] = ['extension' => 'distant']; |
| 447 | 447 | foreach ($dirs as $e) { |
| 448 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 448 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 449 | 449 | if ($f) { |
| 450 | 450 | verifier_htaccess($dir); |
| 451 | 451 | } else { |
| 452 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 452 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | // si id numerique et un seul objet possible, pas d'ambiguite |
| 160 | 160 | if (is_numeric($ref) and count($objets) === 1) { |
| 161 | - $ref = reset($objets) . $ref; |
|
| 161 | + $ref = reset($objets).$ref; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Si la référence ne correspond à rien, c'est fini |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | return json_export(false); |
| 167 | 167 | } |
| 168 | 168 | // Sinon on récupère les infos utiles |
| 169 | - @[$type, , $id, , , , ] = $match; |
|
| 169 | + @[$type,, $id,,,,] = $match; |
|
| 170 | 170 | |
| 171 | 171 | // On regarde si le type trouvé fait partie des objets sélectionnables |
| 172 | 172 | if (!in_array(table_objet($type), $objets)) { |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $types = (is_array($types) ? array_filter($types) : []); |
| 212 | 212 | |
| 213 | 213 | // recuperer tous les freres et soeurs de la rubrique visee |
| 214 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 215 | - $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent=' . intval($id_parent)); |
|
| 214 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 215 | + $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent='.intval($id_parent)); |
|
| 216 | 216 | $fratrie = array_column($fratrie, 'id_rubrique'); |
| 217 | 217 | $has = sql_allfetsel('DISTINCT id_parent', 'spip_rubriques', sql_in('id_parent', $fratrie)); |
| 218 | 218 | $has = array_column($has, 'id_parent'); |
@@ -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 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | return $r ?: traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | -define('_EXTRAIRE_LIEN', ',^\s*(?:' . _PROTOCOLES_STD . '):?/?/?\s*$,iS'); |
|
| 105 | +define('_EXTRAIRE_LIEN', ',^\s*(?:'._PROTOCOLES_STD.'):?/?/?\s*$,iS'); |
|
| 106 | 106 | |
| 107 | 107 | // https://code.spip.net/@traiter_lien_explicite |
| 108 | 108 | function traiter_lien_explicite($ref, $texte = '', $pour = 'url', string $connect = '', $echappe_typo = true) { |
@@ -119,19 +119,19 @@ discard block |
||
| 119 | 119 | $lien_court = charger_fonction('lien_court', 'inc'); |
| 120 | 120 | $texte = $lien_court($texte); |
| 121 | 121 | if ($echappe_typo) { |
| 122 | - $texte = '<html>' . quote_amp($texte) . '</html>'; |
|
| 122 | + $texte = '<html>'.quote_amp($texte).'</html>'; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | // petites corrections d'URL |
| 127 | 127 | if (preg_match('/^www\.[^@]+$/S', $lien)) { |
| 128 | - $lien = 'http://' . $lien; |
|
| 128 | + $lien = 'http://'.$lien; |
|
| 129 | 129 | } else { |
| 130 | 130 | if (strpos($lien, '@') && email_valide($lien)) { |
| 131 | 131 | if (!$texte) { |
| 132 | 132 | $texte = $lien; |
| 133 | 133 | } |
| 134 | - $lien = 'mailto:' . $lien; |
|
| 134 | + $lien = 'mailto:'.$lien; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | function liens_implicite_glose_dist($texte, $id, $type, $args, $ancre, string $connect = '') { |
| 150 | - if (function_exists($f = 'glossaire_' . $ancre)) { |
|
| 150 | + if (function_exists($f = 'glossaire_'.$ancre)) { |
|
| 151 | 151 | $url = $f($texte, $id); |
| 152 | 152 | } else { |
| 153 | 153 | $url = glossaire_std($texte); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | if (!($match = typer_raccourci($ref))) { |
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | - @[$type, , $id, , $args, , $ancre] = $match; |
|
| 165 | + @[$type,, $id,, $args,, $ancre] = $match; |
|
| 166 | 166 | // attention dans le cas des sites le lien doit pointer non pas sur |
| 167 | 167 | // la page locale du site, mais directement sur le site lui-meme |
| 168 | 168 | if ($f = charger_fonction("implicite_$type", 'liens', true)) { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $r['titre'] = $texte; |
| 190 | 190 | } |
| 191 | 191 | if (!@$r['titre']) { |
| 192 | - $r['titre'] = _T($type) . " $id"; |
|
| 192 | + $r['titre'] = _T($type)." $id"; |
|
| 193 | 193 | } |
| 194 | 194 | if ($pour == 'titre') { |
| 195 | 195 | return $r['titre']; |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | and $mime = sql_getfetsel( |
| 203 | 203 | 'mime_type', |
| 204 | 204 | 'spip_types_documents', |
| 205 | - 'extension IN (' . sql_get_select('extension', 'spip_documents', 'id_document=' . sql_quote($id)) . ')', |
|
| 205 | + 'extension IN ('.sql_get_select('extension', 'spip_documents', 'id_document='.sql_quote($id)).')', |
|
| 206 | 206 | '', |
| 207 | 207 | '', |
| 208 | 208 | '', |
@@ -305,11 +305,11 @@ discard block |
||
| 305 | 305 | '(<([a-z_-]{3,})' # <modele |
| 306 | 306 | . '\s*([0-9]*)\s*' # id |
| 307 | 307 | . '([|](?:<[^<>]*>|[^>])*?)?' # |arguments (y compris des tags <...>) |
| 308 | - . '\s*/?' . '>)' # fin du modele > |
|
| 308 | + . '\s*/?'.'>)' # fin du modele > |
|
| 309 | 309 | . '\s*(<\/a>)?' # eventuel </a> |
| 310 | 310 | ); |
| 311 | 311 | |
| 312 | -define('_RACCOURCI_MODELE_DEBUT', '@^' . _RACCOURCI_MODELE . '@isS'); |
|
| 312 | +define('_RACCOURCI_MODELE_DEBUT', '@^'._RACCOURCI_MODELE.'@isS'); |
|
| 313 | 313 | |
| 314 | 314 | // https://code.spip.net/@traiter_modeles |
| 315 | 315 | function traiter_modeles($texte, $doublons = false, $echap = '', string $connect = '', $liens = null, $env = []) { |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | if (test_espace_prive()) { |
| 390 | 390 | $modele = entites_html(substr($texte, $a, $cherche)); |
| 391 | 391 | if (!is_null($liens)) { |
| 392 | - $modele = '<pre>' . str_replace($liens[0], $liens[1], $modele) . '</pre>'; |
|
| 392 | + $modele = '<pre>'.str_replace($liens[0], $liens[1], $modele).'</pre>'; |
|
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite |
| 24 | 24 | define('_separateur_urls_page', ''); |
| 25 | 25 | # on peut indiquer '' si on a installe le .htaccess |
| 26 | -define('_debut_urls_page', get_spip_script('./') . '?'); |
|
| 26 | +define('_debut_urls_page', get_spip_script('./').'?'); |
|
| 27 | 27 | ####### |
| 28 | 28 | |
| 29 | 29 | |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $url = \_DEBUT_URLS_PAGE . $type . \_SEPARATEUR_URLS_PAGE |
|
| 41 | - . $id . \_TERMINAISON_URLS_PAGE; |
|
| 40 | + $url = \_DEBUT_URLS_PAGE.$type.\_SEPARATEUR_URLS_PAGE |
|
| 41 | + . $id.\_TERMINAISON_URLS_PAGE; |
|
| 42 | 42 | |
| 43 | 43 | if ($args) { |
| 44 | 44 | $args = strpos($url, '?') ? "&$args" : "?$args"; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 47 | + return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : ''); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // retrouve le fond et les parametres d'une URL abregee |
@@ -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 | } |