Completed
Push — master ( 718d7a...c76770 )
by cam
01:03
created
config/ecran_securite.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
  * Test utilisateur
16 16
  */
17 17
 if (isset($_GET['test_ecran_securite'])) {
18
-	$ecran_securite_raison = 'test ' . _ECRAN_SECURITE;
18
+	$ecran_securite_raison = 'test '._ECRAN_SECURITE;
19 19
 }
20 20
 
21
-if (file_exists($f = __DIR__ . DIRECTORY_SEPARATOR  . 'ecran_securite_options.php')) {
21
+if (file_exists($f = __DIR__.DIRECTORY_SEPARATOR.'ecran_securite_options.php')) {
22 22
 	include ($f);
23 23
 }
24 24
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 						'yats',
227 227
 						'yeti',
228 228
 						'zeerch'
229
-					)) . ',i',
230
-				(string)$_SERVER['HTTP_USER_AGENT']
229
+					)).',i',
230
+				(string) $_SERVER['HTTP_USER_AGENT']
231 231
 			)
232 232
 	);
233 233
 }
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
 		'_IS_BOT_FRIEND',
237 237
 		isset($_SERVER['HTTP_USER_AGENT'])
238 238
 			and preg_match(
239
-				',' . implode('|', array(
239
+				','.implode('|', array(
240 240
 					'facebookexternalhit',
241 241
 					'twitterbot',
242 242
 					'flipboardproxy',
243 243
 					'wordpress'
244
-				)) . ',i',
245
-				(string)$_SERVER['HTTP_USER_AGENT']
244
+				)).',i',
245
+				(string) $_SERVER['HTTP_USER_AGENT']
246 246
 			)
247 247
 	);
248 248
 }
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
  */
292 292
 foreach (array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax_ancre', 'nom_fichier') as $var) {
293 293
 	if (isset($_GET[$var])) {
294
-		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_GET[$var]);
294
+		$_REQUEST[$var] = $GLOBALS[$var] = $_GET[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_GET[$var]);
295 295
 	}
296 296
 	if (isset($_POST[$var])) {
297
-		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string)$_POST[$var]);
297
+		$_REQUEST[$var] = $GLOBALS[$var] = $_POST[$var] = preg_replace(',[^\w\,/#&;-]+,', ' ', (string) $_POST[$var]);
298 298
 	}
299 299
 }
300 300
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
  * Filtre l'accès à spip_acces_doc (injection SQL en 1.8.2x)
303 303
  */
304 304
 if (isset($_SERVER['REQUEST_URI'])) {
305
-	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string)$_SERVER['REQUEST_URI'])) {
306
-		$file = addslashes((string)$_GET['file']);
305
+	if (preg_match(',^(.*/)?spip_acces_doc\.,', (string) $_SERVER['REQUEST_URI'])) {
306
+		$file = addslashes((string) $_GET['file']);
307 307
 	}
308 308
 }
309 309
 
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
  */
324 324
 if (
325 325
 	isset($_REQUEST['partie_cal'])
326
-	and $_REQUEST['partie_cal'] !== htmlentities((string)$_REQUEST['partie_cal'])
326
+	and $_REQUEST['partie_cal'] !== htmlentities((string) $_REQUEST['partie_cal'])
327 327
 ) {
328 328
 	$ecran_securite_raison = "partie_cal";
329 329
 }
330 330
 if (
331 331
 	isset($_REQUEST['echelle'])
332
-	and $_REQUEST['echelle'] !== htmlentities((string)$_REQUEST['echelle'])
332
+	and $_REQUEST['echelle'] !== htmlentities((string) $_REQUEST['echelle'])
333 333
 ) {
334 334
 	$ecran_securite_raison = "echelle";
335 335
 }
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
  */
340 340
 if (
341 341
 	isset($_REQUEST['exec'])
342
-	and !preg_match(',^[\w-]+$,', (string)$_REQUEST['exec'])
342
+	and !preg_match(',^[\w-]+$,', (string) $_REQUEST['exec'])
343 343
 ) {
344 344
 	$ecran_securite_raison = "exec";
345 345
 }
346 346
 if (
347 347
 	isset($_REQUEST['cherche_auteur'])
348
-	and preg_match(',[<],', (string)$_REQUEST['cherche_auteur'])
348
+	and preg_match(',[<],', (string) $_REQUEST['cherche_auteur'])
349 349
 ) {
350 350
 	$ecran_securite_raison = "cherche_auteur";
351 351
 }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	isset($_REQUEST['exec'])
354 354
 	and $_REQUEST['exec'] == 'auteurs'
355 355
 	and isset($_REQUEST['recherche'])
356
-	and preg_match(',[<],', (string)$_REQUEST['recherche'])
356
+	and preg_match(',[<],', (string) $_REQUEST['recherche'])
357 357
 ) {
358 358
 	$ecran_securite_raison = "recherche";
359 359
 }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	isset($_REQUEST['exec'])
362 362
 	and $_REQUEST['exec'] == 'info_plugin'
363 363
 	and isset($_REQUEST['plugin'])
364
-	and preg_match(',[<],', (string)$_REQUEST['plugin'])
364
+	and preg_match(',[<],', (string) $_REQUEST['plugin'])
365 365
 ) {
366 366
 	$ecran_securite_raison = "plugin";
367 367
 }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 				echo minipres(_T('info_acces_interdit'));
389 389
 				exit;
390 390
 			}
391
-			require _DIR_RESTREINT . 'action/configurer.php';
391
+			require _DIR_RESTREINT.'action/configurer.php';
392 392
 			action_configurer_dist();
393 393
 		}
394 394
 	}
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
 if (_IS_BOT) {
441 441
 	if (
442 442
 		(isset($_REQUEST['echelle']) and isset($_REQUEST['partie_cal']) and isset($_REQUEST['type']))
443
-		or (strpos((string)$_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string)$_SERVER['REQUEST_URI']))
444
-		or (isset($_REQUEST['calendrier_annee']) and strpos((string)$_SERVER['REQUEST_URI'], 'debut_'))
445
-		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string)$_SERVER['REQUEST_URI']))
443
+		or (strpos((string) $_SERVER['REQUEST_URI'], 'debut_') and preg_match(',[?&]debut_.*&debut_,', (string) $_SERVER['REQUEST_URI']))
444
+		or (isset($_REQUEST['calendrier_annee']) and strpos((string) $_SERVER['REQUEST_URI'], 'debut_'))
445
+		or (isset($_REQUEST['calendrier_annee']) and preg_match(',[?&]calendrier_annee=.*&calendrier_annee=,', (string) $_SERVER['REQUEST_URI']))
446 446
 	) {
447 447
 		$ecran_securite_raison = "robot agenda/double pagination";
448 448
 	}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	if ($_REQUEST['page'] == 'test_cfg') {
457 457
 		$ecran_securite_raison = "test_cfg";
458 458
 	}
459
-	if ($_REQUEST['page'] !== htmlspecialchars((string)$_REQUEST['page'])) {
459
+	if ($_REQUEST['page'] !== htmlspecialchars((string) $_REQUEST['page'])) {
460 460
 		$ecran_securite_raison = "xsspage";
461 461
 	}
462 462
 	if (
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
  */
473 473
 foreach (array('var_login') as $var) {
474 474
 	if (isset($_REQUEST[$var]) and is_array($_REQUEST[$var])) {
475
-		$ecran_securite_raison = "xss " . $var;
475
+		$ecran_securite_raison = "xss ".$var;
476 476
 	}
477 477
 }
478 478
 
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
  */
521 521
 if (
522 522
 	isset($_REQUEST['nom_sauvegarde'])
523
-	and strstr((string)$_REQUEST['nom_sauvegarde'], '/')
523
+	and strstr((string) $_REQUEST['nom_sauvegarde'], '/')
524 524
 ) {
525 525
 	$ecran_securite_raison = 'nom_sauvegarde manipulee';
526 526
 }
527 527
 if (
528 528
 	isset($_REQUEST['znom_sauvegarde'])
529
-	and strstr((string)$_REQUEST['znom_sauvegarde'], '/')
529
+	and strstr((string) $_REQUEST['znom_sauvegarde'], '/')
530 530
 ) {
531 531
 	$ecran_securite_raison = 'znom_sauvegarde manipulee';
532 532
 }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 	foreach ($_REQUEST as $k => $v) {
656 656
 		if (is_string($v)
657 657
 		  and strpos($v, ':') !== false
658
-		  and strpos($v, '"') !==false
658
+		  and strpos($v, '"') !== false
659 659
 		  and preg_match(',[bidsaO]:,', $v)
660 660
 		  and @unserialize($v)) {
661 661
 			$_REQUEST[$k] = htmlentities($v);
Please login to merge, or discard this patch.