@@ -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 | srand($seed); |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | if (!$s) { |
| 44 | 44 | $s = rand(); |
| 45 | 45 | } |
| 46 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 46 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 47 | 47 | } |
| 48 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 48 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 49 | 49 | $x = $r['r'] & 63; |
| 50 | 50 | if ($x < 10) { |
| 51 | 51 | $x = chr($x + 48); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | static $seeded; |
| 84 | 84 | |
| 85 | 85 | if (!$seeded) { |
| 86 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 86 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 87 | 87 | mt_srand($seed); |
| 88 | 88 | srand($seed); |
| 89 | 89 | $seeded = true; |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | foreach ($args as $val => $var) { |
| 194 | 194 | if ($var) { |
| 195 | 195 | if ($val <> 'statut') { |
| 196 | - $a .= ':' . $val . '-' . $var; |
|
| 196 | + $a .= ':'.$val.'-'.$var; |
|
| 197 | 197 | } |
| 198 | - $b .= $val . '=' . $var . '&'; |
|
| 198 | + $b .= $val.'='.$var.'&'; |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | $a = substr($a, 1); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * Clé |
| 226 | 226 | **/ |
| 227 | 227 | function afficher_low_sec($id_auteur, $action = '') { |
| 228 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 228 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | function initialiser_sel() { |
| 268 | 268 | if (!isset($GLOBALS['htsalt'])) { |
| 269 | 269 | if (CRYPT_MD5) { |
| 270 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 270 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 271 | 271 | } else { |
| 272 | 272 | $GLOBALS['htsalt'] = ''; |
| 273 | 273 | } |
@@ -289,8 +289,8 @@ discard block |
||
| 289 | 289 | * - void sinon. |
| 290 | 290 | **/ |
| 291 | 291 | function ecrire_acces() { |
| 292 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 293 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 292 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 293 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 294 | 294 | |
| 295 | 295 | // Cette variable de configuration peut etre posee par un plugin |
| 296 | 296 | // par exemple acces_restreint ; |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | and !@file_exists($htaccess) |
| 301 | 301 | ) { |
| 302 | 302 | spip_unlink($htpasswd); |
| 303 | - spip_unlink($htpasswd . '-admin'); |
|
| 303 | + spip_unlink($htpasswd.'-admin'); |
|
| 304 | 304 | return; |
| 305 | 305 | } |
| 306 | 306 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
| 333 | 333 | while ($row = sql_fetch($res)) { |
| 334 | 334 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 335 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 335 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 336 | 336 | $pwd_all .= $ligne; |
| 337 | 337 | if ($row['statut'] == '0minirezo') { |
| 338 | 338 | $pwd_admin .= $ligne; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | * @return boolean |
| 378 | 378 | */ |
| 379 | 379 | function verifier_htaccess($rep, $force = false) { |
| 380 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 380 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 381 | 381 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 382 | 382 | return true; |
| 383 | 383 | } |
@@ -404,17 +404,17 @@ discard block |
||
| 404 | 404 | fputs($ht, $deny); |
| 405 | 405 | fclose($ht); |
| 406 | 406 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 407 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 407 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 408 | 408 | if ($ht = @fopen($t, 'w')) { |
| 409 | 409 | @fclose($ht); |
| 410 | 410 | include_spip('inc/distant'); |
| 411 | 411 | $t = substr($t, strlen(_DIR_RACINE)); |
| 412 | - $t = url_de_base() . $t; |
|
| 412 | + $t = url_de_base().$t; |
|
| 413 | 413 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 414 | 414 | $ht = ($ht['status'] ?? null) === 403; |
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 417 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 418 | 418 | |
| 419 | 419 | return $ht; |
| 420 | 420 | } |
@@ -440,11 +440,11 @@ discard block |
||
| 440 | 440 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 441 | 441 | $dirs[] = array('extension' => 'distant'); |
| 442 | 442 | foreach ($dirs as $e) { |
| 443 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 443 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 444 | 444 | if ($f) { |
| 445 | 445 | verifier_htaccess($dir); |
| 446 | 446 | } else { |
| 447 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 447 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | } |