@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | $res = sql_select( |
| 36 | 36 | 'rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant', |
| 37 | 37 | 'spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)', |
| 38 | - 'rub1.id_parent = ' . sql_quote($id_rubrique) . ' |
|
| 39 | - AND rub1.id_rubrique!=' . sql_quote($exclu) . ' |
|
| 40 | - AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu) . ')', |
|
| 38 | + 'rub1.id_parent = '.sql_quote($id_rubrique).' |
|
| 39 | + AND rub1.id_rubrique!=' . sql_quote($exclu).' |
|
| 40 | + AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu).')', |
|
| 41 | 41 | '', |
| 42 | 42 | '0+rub1.titre,rub1.titre' |
| 43 | 43 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if ($row['langue_choisie'] != 'oui') { |
| 51 | 51 | $t .= ' <small title="' |
| 52 | 52 | . traduire_nom_langue($row['lang']) |
| 53 | - . '">[' . $row['lang'] . ']</small>'; |
|
| 53 | + . '">['.$row['lang'].']</small>'; |
|
| 54 | 54 | } |
| 55 | 55 | $ordre[$row['id_rubrique']] = $t; |
| 56 | 56 | } |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $next = $list[$col] ?? 0; |
| 60 | 60 | if ($ordre) { |
| 61 | - $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1)); |
|
| 61 | + $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=".($col + 1)); |
|
| 62 | 62 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id="); |
| 63 | - $args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event"; |
|
| 63 | + $args = "'$idom',this,$col,'".$GLOBALS['spip_lang_left']."','$info',event"; |
|
| 64 | 64 | |
| 65 | 65 | foreach ($ordre as $id => $titrebrut) { |
| 66 | 66 | $titre = supprimer_numero($titrebrut); |
| 67 | 67 | |
| 68 | - $classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 68 | + $classe1 = 'petit-item '.($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 69 | 69 | if (isset($rub[$id]['enfants'])) { |
| 70 | 70 | $classe2 = " class='rub-ouverte'"; |
| 71 | 71 | $url = "\nhref='$rec&id=$id'"; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $url = "\nhref='javascript:void(0)'"; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $js_func = $do . '_selection_titre'; |
|
| 77 | + $js_func = $do.'_selection_titre'; |
|
| 78 | 78 | $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn " |
| 79 | 79 | . (!is_array($list) ? ' false' |
| 80 | 80 | : "aff_selection_provisoire($id,$args)") |
@@ -101,17 +101,17 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $idom2 = $idom . '_col_' . ($col + 1); |
|
| 104 | + $idom2 = $idom.'_col_'.($col + 1); |
|
| 105 | 105 | $left = ($col * 250); |
| 106 | 106 | |
| 107 | 107 | return http_img_pack( |
| 108 | 108 | 'loader.svg', |
| 109 | 109 | '', |
| 110 | - "class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 110 | + "class='loader' style='visibility: hidden; position: absolute; ".$GLOBALS['spip_lang_left'].': ' |
|
| 111 | 111 | . ($left - 30) |
| 112 | 112 | . "px; top: 2px; z-index: 2;' id='img_$idom2'" |
| 113 | 113 | ) |
| 114 | - . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 114 | + . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; ".$GLOBALS['spip_lang_left'].': ' |
|
| 115 | 115 | . ($left - 250) |
| 116 | 116 | . "px;'>" |
| 117 | 117 | . $ret |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | foreach (['script', 'iframe'] as $tag) { |
| 106 | 106 | if ( |
| 107 | 107 | stripos($t, (string) "<$tag") !== false |
| 108 | - and preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER) |
|
| 108 | + and preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER) |
|
| 109 | 109 | ) { |
| 110 | 110 | foreach ($r as $regs) { |
| 111 | 111 | $t = str_replace( |
| 112 | 112 | $regs[0], |
| 113 | - "<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', |
|
| 113 | + "<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>', |
|
| 114 | 114 | $t |
| 115 | 115 | ); |
| 116 | 116 | } |
@@ -163,10 +163,10 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // echapper les tags asp/php |
| 166 | - $t = str_replace('<' . '%', '<%', $arg); |
|
| 166 | + $t = str_replace('<'.'%', '<%', $arg); |
|
| 167 | 167 | |
| 168 | 168 | // echapper le php |
| 169 | - $t = str_replace('<' . '?', '<?', $t); |
|
| 169 | + $t = str_replace('<'.'?', '<?', $t); |
|
| 170 | 170 | |
| 171 | 171 | // echapper le < script language=php > |
| 172 | 172 | $t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '<\1', $t); |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | // Reinserer les echappements des modeles |
| 190 | 190 | if (defined('_PROTEGE_JS_MODELES')) { |
| 191 | - $t = echappe_retour($t, 'javascript' . _PROTEGE_JS_MODELES); |
|
| 191 | + $t = echappe_retour($t, 'javascript'._PROTEGE_JS_MODELES); |
|
| 192 | 192 | } |
| 193 | 193 | if (defined('_PROTEGE_PHP_MODELES')) { |
| 194 | - $t = echappe_retour($t, 'php' . _PROTEGE_PHP_MODELES); |
|
| 194 | + $t = echappe_retour($t, 'php'._PROTEGE_PHP_MODELES); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | return $dejavu[$mode_filtre][$arg] = $t; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | define('_TYPO_PROTEGER', "!':;?~%-"); |
| 290 | 290 | define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8"); |
| 291 | 291 | |
| 292 | -define('_TYPO_BALISE', ',</?[a-z!][^<>]*[' . preg_quote(_TYPO_PROTEGER) . '][^<>]*>,imsS'); |
|
| 292 | +define('_TYPO_BALISE', ',</?[a-z!][^<>]*['.preg_quote(_TYPO_PROTEGER).'][^<>]*>,imsS'); |
|
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * Corrige la typographie |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | $_texte = ($_texte ?: "''"); |
| 52 | 52 | $_titre = ($_titre ? ", $_titre" : ', null'); |
| 53 | 53 | $_class = ($_class ? ", $_class" : ', null'); |
| 54 | - $_role = ($_role ? ", $_role" : ', null'); |
|
| 55 | - $_id = ($_id ? ", $_id" : ', null'); |
|
| 54 | + $_role = ($_role ? ", $_role" : ', null'); |
|
| 55 | + $_id = ($_id ? ", $_id" : ', null'); |
|
| 56 | 56 | |
| 57 | 57 | $f = chercher_filtre('message_alerte'); |
| 58 | 58 | $p->code = "$f($_texte$_titre$_class$_role$_id)"; |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | $_class = interprete_argument_balise(2, $p); |
| 91 | 91 | $_role = interprete_argument_balise(3, $p); |
| 92 | 92 | $_id = interprete_argument_balise(4, $p); |
| 93 | - $_titre = ($_titre ? "$_titre" : 'null'); |
|
| 93 | + $_titre = ($_titre ? "$_titre" : 'null'); |
|
| 94 | 94 | $_class = ($_class ? ", $_class" : ', null'); |
| 95 | - $_role = ($_role ? ", $_role" : ', null'); |
|
| 96 | - $_id = ($_id ? ", $_id" : ', null'); |
|
| 95 | + $_role = ($_role ? ", $_role" : ', null'); |
|
| 96 | + $_id = ($_id ? ", $_id" : ', null'); |
|
| 97 | 97 | |
| 98 | 98 | $f = chercher_filtre('message_alerte_ouvrir'); |
| 99 | 99 | $p->code = "$f($_titre$_class$_role$_id)"; |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | $message_alerte_ouvrir = chercher_filtre('message_alerte_ouvrir'); |
| 164 | 164 | $message_alerte_fermer = chercher_filtre('message_alerte_fermer'); |
| 165 | 165 | $message = |
| 166 | - $message_alerte_ouvrir($titre, $class, $role, $id) . |
|
| 167 | - $texte . |
|
| 166 | + $message_alerte_ouvrir($titre, $class, $role, $id). |
|
| 167 | + $texte. |
|
| 168 | 168 | $message_alerte_fermer(); |
| 169 | 169 | |
| 170 | 170 | return $message; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | ]; |
| 214 | 214 | $type = array_intersect(explode(' ', $class), $types); |
| 215 | 215 | $type = reset($type); |
| 216 | - $class = trim(str_replace($types, '', $class) . " $type"); |
|
| 216 | + $class = trim(str_replace($types, '', $class)." $type"); |
|
| 217 | 217 | |
| 218 | 218 | // Classes |
| 219 | 219 | $class_racine = 'msg-alert'; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | // Attributs |
| 240 | 240 | $attr_role = ($role ? "role=\"$role\"" : ''); |
| 241 | - $attr_id = ($id ? "id=\"$id\"" : ''); |
|
| 241 | + $attr_id = ($id ? "id=\"$id\"" : ''); |
|
| 242 | 242 | $attr_data = ($type ? "data-alert=\"$type\"" : ''); |
| 243 | 243 | |
| 244 | 244 | $message = |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ) { |
| 39 | 39 | // Pour tous les formulaires CONFIGURER, ayant une fonction charger ou pas, on teste si autorisé |
| 40 | 40 | include_spip('inc/autoriser'); |
| 41 | - if (!autoriser('configurer', '_' . substr($form, 11))) { |
|
| 41 | + if (!autoriser('configurer', '_'.substr($form, 11))) { |
|
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | and !charger_fonction('traiter', "formulaires/$form/", true) // sans fonction traiter() |
| 73 | 73 | ) { |
| 74 | 74 | $trace = cvtconf_formulaires_configurer_enregistre($form, $flux['args']['args']); |
| 75 | - $flux['data'] = ['message_ok' => _T('config_info_enregistree') . $trace, 'editable' => true]; |
|
| 75 | + $flux['data'] = ['message_ok' => _T('config_info_enregistree').$trace, 'editable' => true]; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | return $flux; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $prefixe = $valeurs['_meta_prefixe']; |
| 147 | 147 | } |
| 148 | 148 | if (isset($valeurs['_meta_stockage'])) { |
| 149 | - $stockage = $valeurs['_meta_stockage'] . '::'; |
|
| 149 | + $stockage = $valeurs['_meta_stockage'].'::'; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // si on indique juste une table, il faut vider les autres proprietes |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | // sinon cas analyse du squelette |
| 173 | 173 | if ( |
| 174 | - $f = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/') |
|
| 174 | + $f = find_in_path($form.'.'._EXTENSION_SQUELETTES, 'formulaires/') |
|
| 175 | 175 | and lire_fichier($f, $contenu) |
| 176 | 176 | ) { |
| 177 | 177 | for ($i = 0; $i < 2; $i++) { |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | lire_metas($table); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $prefixe = ($prefixe ? $prefixe . '_' : ''); |
|
| 231 | + $prefixe = ($prefixe ? $prefixe.'_' : ''); |
|
| 232 | 232 | $table = ($table) ? "/$table/" : ''; |
| 233 | - $casier = ($casier) ? rtrim($casier, '/') . '/' : ''; // slash final, sinon rien |
|
| 233 | + $casier = ($casier) ? rtrim($casier, '/').'/' : ''; // slash final, sinon rien |
|
| 234 | 234 | |
| 235 | 235 | foreach ($store as $k => $v) { |
| 236 | 236 | ecrire_config("$stockage$table$prefixe$casier$k", $v); |
| 237 | 237 | if (_request('var_mode') == 'configurer' and autoriser('webmestre')) { |
| 238 | - $trace .= "<br />table $table : " . $prefixe . $k . " = $v;"; |
|
| 238 | + $trace .= "<br />table $table : ".$prefixe.$k." = $v;"; |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | [$table, $casier, $prefixe, $stockage] = cvtconf_definir_configurer_conteneur($form, $valeurs); |
| 253 | 253 | |
| 254 | 254 | $table = ($table) ? "/$table/" : ''; |
| 255 | - $prefixe = ($prefixe ? $prefixe . '_' : ''); |
|
| 255 | + $prefixe = ($prefixe ? $prefixe.'_' : ''); |
|
| 256 | 256 | if ($casier) { |
| 257 | 257 | $meta = lire_config("$stockage$table$prefixe$casier"); |
| 258 | 258 | $prefixe = ''; |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | foreach ($valeurs as $k => $v) { |
| 265 | 265 | if (substr($k, 0, 1) !== '_') { |
| 266 | - $valeurs[$k] = ($meta[$prefixe . $k] ?? null); |
|
| 266 | + $valeurs[$k] = ($meta[$prefixe.$k] ?? null); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -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 | |
@@ -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 |
@@ -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 | } |
@@ -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 | } |