Passed
Pull Request — release-2.1 (#5337)
by Michael
05:21
created
Themes/default/Calendar.template.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -425,7 +425,8 @@  discard block
 block discarded – undo
425 425
 					if (!empty($day['events']))
426 426
 					{
427 427
 						// Sort events by start time (all day events will be listed first)
428
-						uasort($day['events'], function($a, $b) {
428
+						uasort($day['events'], function($a, $b)
429
+						{
429 430
 							if ($a['start_timestamp'] == $b['start_timestamp'])
430 431
 								return 0;
431 432
 
@@ -619,7 +620,8 @@  discard block
 block discarded – undo
619 620
 			if (!empty($day['events']))
620 621
 			{
621 622
 				// Sort events by start time (all day events will be listed first)
622
-				uasort($day['events'], function($a, $b) {
623
+				uasort($day['events'], function($a, $b)
624
+				{
623 625
 					if ($a['start_timestamp'] == $b['start_timestamp'])
624 626
 						return 0;
625 627
 					return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
Please login to merge, or discard this patch.
other/upgrade.php 2 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3388,7 +3388,7 @@  discard block
 block discarded – undo
3388 3388
 
3389 3389
 	$regex = <<<'EOT'
3390 3390
 (\s*#\s*Make\s+sure\s+the\s+paths\s+are\s+correct\.\.\.\s+at\s+least\s+try\s+to\s+fix\s+them\.\s+)?if\s*\(\!file_exists\(\$boarddir\)\s+&&\s+file_exists\(dirname\(__FILE__\)\s+\.\s+'/agreement\.txt'\)\)\s+\$boarddir\s*\=\s*dirname\(__FILE__\);\s+if\s*\(\!file_exists\(\$sourcedir\)\s+&&\s+file_exists\(\$boarddir\s*\.\s*'/Sources'\)\)\s+\$sourcedir\s*\=\s*\$boarddir\s*\.\s*'/Sources';\s+if\s*\(\!file_exists\(\$cachedir\)\s+&&\s+file_exists\(\$boarddir\s*\.\s*'/cache'\)\)\s+\$cachedir\s*\=\s*\$boarddir\s*\.\s*'/cache';
3391
-EOT;
3391
+eot;
3392 3392
 
3393 3393
 	$replacement = <<<'EOT'
3394 3394
 # Make sure the paths are correct... at least try to fix them.
@@ -3400,7 +3400,7 @@  discard block
 block discarded – undo
3400 3400
 	$cachedir = $boarddir . '/cache';
3401 3401
 
3402 3402
 
3403
-EOT;
3403
+eot;
3404 3404
 
3405 3405
 	if (preg_match('~' . $regex . '~', $settings) && preg_match('~(#+\s*Error-Catching\s*#+)~', $settings))
3406 3406
 	{
Please login to merge, or discard this patch.
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$to = explode('/', $lang_dir);
491 491
 		$relPath = $to;
492 492
 
493
-		foreach($from as $depth => $dir)
493
+		foreach ($from as $depth => $dir)
494 494
 		{
495 495
 			if ($dir === $to[$depth])
496 496
 				array_shift($relPath);
@@ -2863,94 +2863,94 @@  discard block
 block discarded – undo
2863 2863
 		// Translation table for the character sets not native for MySQL.
2864 2864
 		$translation_tables = array(
2865 2865
 			'windows-1255' => array(
2866
-				'0x81' => '\'\'',		'0x8A' => '\'\'',		'0x8C' => '\'\'',
2867
-				'0x8D' => '\'\'',		'0x8E' => '\'\'',		'0x8F' => '\'\'',
2868
-				'0x90' => '\'\'',		'0x9A' => '\'\'',		'0x9C' => '\'\'',
2869
-				'0x9D' => '\'\'',		'0x9E' => '\'\'',		'0x9F' => '\'\'',
2870
-				'0xCA' => '\'\'',		'0xD9' => '\'\'',		'0xDA' => '\'\'',
2871
-				'0xDB' => '\'\'',		'0xDC' => '\'\'',		'0xDD' => '\'\'',
2872
-				'0xDE' => '\'\'',		'0xDF' => '\'\'',		'0xFB' => '0xD792',
2873
-				'0xFC' => '0xE282AC',		'0xFF' => '0xD6B2',		'0xC2' => '0xFF',
2874
-				'0x80' => '0xFC',		'0xE2' => '0xFB',		'0xA0' => '0xC2A0',
2875
-				'0xA1' => '0xC2A1',		'0xA2' => '0xC2A2',		'0xA3' => '0xC2A3',
2876
-				'0xA5' => '0xC2A5',		'0xA6' => '0xC2A6',		'0xA7' => '0xC2A7',
2877
-				'0xA8' => '0xC2A8',		'0xA9' => '0xC2A9',		'0xAB' => '0xC2AB',
2878
-				'0xAC' => '0xC2AC',		'0xAD' => '0xC2AD',		'0xAE' => '0xC2AE',
2879
-				'0xAF' => '0xC2AF',		'0xB0' => '0xC2B0',		'0xB1' => '0xC2B1',
2880
-				'0xB2' => '0xC2B2',		'0xB3' => '0xC2B3',		'0xB4' => '0xC2B4',
2881
-				'0xB5' => '0xC2B5',		'0xB6' => '0xC2B6',		'0xB7' => '0xC2B7',
2882
-				'0xB8' => '0xC2B8',		'0xB9' => '0xC2B9',		'0xBB' => '0xC2BB',
2883
-				'0xBC' => '0xC2BC',		'0xBD' => '0xC2BD',		'0xBE' => '0xC2BE',
2884
-				'0xBF' => '0xC2BF',		'0xD7' => '0xD7B3',		'0xD1' => '0xD781',
2885
-				'0xD4' => '0xD7B0',		'0xD5' => '0xD7B1',		'0xD6' => '0xD7B2',
2886
-				'0xE0' => '0xD790',		'0xEA' => '0xD79A',		'0xEC' => '0xD79C',
2887
-				'0xED' => '0xD79D',		'0xEE' => '0xD79E',		'0xEF' => '0xD79F',
2888
-				'0xF0' => '0xD7A0',		'0xF1' => '0xD7A1',		'0xF2' => '0xD7A2',
2889
-				'0xF3' => '0xD7A3',		'0xF5' => '0xD7A5',		'0xF6' => '0xD7A6',
2890
-				'0xF7' => '0xD7A7',		'0xF8' => '0xD7A8',		'0xF9' => '0xD7A9',
2891
-				'0x82' => '0xE2809A',	'0x84' => '0xE2809E',	'0x85' => '0xE280A6',
2892
-				'0x86' => '0xE280A0',	'0x87' => '0xE280A1',	'0x89' => '0xE280B0',
2893
-				'0x8B' => '0xE280B9',	'0x93' => '0xE2809C',	'0x94' => '0xE2809D',
2894
-				'0x95' => '0xE280A2',	'0x97' => '0xE28094',	'0x99' => '0xE284A2',
2895
-				'0xC0' => '0xD6B0',		'0xC1' => '0xD6B1',		'0xC3' => '0xD6B3',
2896
-				'0xC4' => '0xD6B4',		'0xC5' => '0xD6B5',		'0xC6' => '0xD6B6',
2897
-				'0xC7' => '0xD6B7',		'0xC8' => '0xD6B8',		'0xC9' => '0xD6B9',
2898
-				'0xCB' => '0xD6BB',		'0xCC' => '0xD6BC',		'0xCD' => '0xD6BD',
2899
-				'0xCE' => '0xD6BE',		'0xCF' => '0xD6BF',		'0xD0' => '0xD780',
2900
-				'0xD2' => '0xD782',		'0xE3' => '0xD793',		'0xE4' => '0xD794',
2901
-				'0xE5' => '0xD795',		'0xE7' => '0xD797',		'0xE9' => '0xD799',
2902
-				'0xFD' => '0xE2808E',	'0xFE' => '0xE2808F',	'0x92' => '0xE28099',
2903
-				'0x83' => '0xC692',		'0xD3' => '0xD783',		'0x88' => '0xCB86',
2904
-				'0x98' => '0xCB9C',		'0x91' => '0xE28098',	'0x96' => '0xE28093',
2905
-				'0xBA' => '0xC3B7',		'0x9B' => '0xE280BA',	'0xAA' => '0xC397',
2906
-				'0xA4' => '0xE282AA',	'0xE1' => '0xD791',		'0xE6' => '0xD796',
2907
-				'0xE8' => '0xD798',		'0xEB' => '0xD79B',		'0xF4' => '0xD7A4',
2866
+				'0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'',
2867
+				'0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'',
2868
+				'0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'',
2869
+				'0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'',
2870
+				'0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'',
2871
+				'0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'',
2872
+				'0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792',
2873
+				'0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF',
2874
+				'0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0',
2875
+				'0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3',
2876
+				'0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7',
2877
+				'0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB',
2878
+				'0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE',
2879
+				'0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1',
2880
+				'0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4',
2881
+				'0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7',
2882
+				'0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB',
2883
+				'0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE',
2884
+				'0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781',
2885
+				'0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2',
2886
+				'0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C',
2887
+				'0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F',
2888
+				'0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2',
2889
+				'0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6',
2890
+				'0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9',
2891
+				'0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6',
2892
+				'0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0',
2893
+				'0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D',
2894
+				'0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2',
2895
+				'0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3',
2896
+				'0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6',
2897
+				'0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9',
2898
+				'0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD',
2899
+				'0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780',
2900
+				'0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794',
2901
+				'0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799',
2902
+				'0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099',
2903
+				'0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86',
2904
+				'0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093',
2905
+				'0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397',
2906
+				'0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796',
2907
+				'0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4',
2908 2908
 				'0xFA' => '0xD7AA',
2909 2909
 			),
2910 2910
 			'windows-1253' => array(
2911
-				'0x81' => '\'\'',			'0x88' => '\'\'',			'0x8A' => '\'\'',
2912
-				'0x8C' => '\'\'',			'0x8D' => '\'\'',			'0x8E' => '\'\'',
2913
-				'0x8F' => '\'\'',			'0x90' => '\'\'',			'0x98' => '\'\'',
2914
-				'0x9A' => '\'\'',			'0x9C' => '\'\'',			'0x9D' => '\'\'',
2915
-				'0x9E' => '\'\'',			'0x9F' => '\'\'',			'0xAA' => '\'\'',
2916
-				'0xD2' => '0xE282AC',			'0xFF' => '0xCE92',			'0xCE' => '0xCE9E',
2917
-				'0xB8' => '0xCE88',		'0xBA' => '0xCE8A',		'0xBC' => '0xCE8C',
2918
-				'0xBE' => '0xCE8E',		'0xBF' => '0xCE8F',		'0xC0' => '0xCE90',
2919
-				'0xC8' => '0xCE98',		'0xCA' => '0xCE9A',		'0xCC' => '0xCE9C',
2920
-				'0xCD' => '0xCE9D',		'0xCF' => '0xCE9F',		'0xDA' => '0xCEAA',
2921
-				'0xE8' => '0xCEB8',		'0xEA' => '0xCEBA',		'0xEC' => '0xCEBC',
2922
-				'0xEE' => '0xCEBE',		'0xEF' => '0xCEBF',		'0xC2' => '0xFF',
2923
-				'0xBD' => '0xC2BD',		'0xED' => '0xCEBD',		'0xB2' => '0xC2B2',
2924
-				'0xA0' => '0xC2A0',		'0xA3' => '0xC2A3',		'0xA4' => '0xC2A4',
2925
-				'0xA5' => '0xC2A5',		'0xA6' => '0xC2A6',		'0xA7' => '0xC2A7',
2926
-				'0xA8' => '0xC2A8',		'0xA9' => '0xC2A9',		'0xAB' => '0xC2AB',
2927
-				'0xAC' => '0xC2AC',		'0xAD' => '0xC2AD',		'0xAE' => '0xC2AE',
2928
-				'0xB0' => '0xC2B0',		'0xB1' => '0xC2B1',		'0xB3' => '0xC2B3',
2929
-				'0xB5' => '0xC2B5',		'0xB6' => '0xC2B6',		'0xB7' => '0xC2B7',
2930
-				'0xBB' => '0xC2BB',		'0xE2' => '0xCEB2',		'0x80' => '0xD2',
2931
-				'0x82' => '0xE2809A',	'0x84' => '0xE2809E',	'0x85' => '0xE280A6',
2932
-				'0x86' => '0xE280A0',	'0xA1' => '0xCE85',		'0xA2' => '0xCE86',
2933
-				'0x87' => '0xE280A1',	'0x89' => '0xE280B0',	'0xB9' => '0xCE89',
2934
-				'0x8B' => '0xE280B9',	'0x91' => '0xE28098',	'0x99' => '0xE284A2',
2935
-				'0x92' => '0xE28099',	'0x93' => '0xE2809C',	'0x94' => '0xE2809D',
2936
-				'0x95' => '0xE280A2',	'0x96' => '0xE28093',	'0x97' => '0xE28094',
2937
-				'0x9B' => '0xE280BA',	'0xAF' => '0xE28095',	'0xB4' => '0xCE84',
2938
-				'0xC1' => '0xCE91',		'0xC3' => '0xCE93',		'0xC4' => '0xCE94',
2939
-				'0xC5' => '0xCE95',		'0xC6' => '0xCE96',		'0x83' => '0xC692',
2940
-				'0xC7' => '0xCE97',		'0xC9' => '0xCE99',		'0xCB' => '0xCE9B',
2941
-				'0xD0' => '0xCEA0',		'0xD1' => '0xCEA1',		'0xD3' => '0xCEA3',
2942
-				'0xD4' => '0xCEA4',		'0xD5' => '0xCEA5',		'0xD6' => '0xCEA6',
2943
-				'0xD7' => '0xCEA7',		'0xD8' => '0xCEA8',		'0xD9' => '0xCEA9',
2944
-				'0xDB' => '0xCEAB',		'0xDC' => '0xCEAC',		'0xDD' => '0xCEAD',
2945
-				'0xDE' => '0xCEAE',		'0xDF' => '0xCEAF',		'0xE0' => '0xCEB0',
2946
-				'0xE1' => '0xCEB1',		'0xE3' => '0xCEB3',		'0xE4' => '0xCEB4',
2947
-				'0xE5' => '0xCEB5',		'0xE6' => '0xCEB6',		'0xE7' => '0xCEB7',
2948
-				'0xE9' => '0xCEB9',		'0xEB' => '0xCEBB',		'0xF0' => '0xCF80',
2949
-				'0xF1' => '0xCF81',		'0xF2' => '0xCF82',		'0xF3' => '0xCF83',
2950
-				'0xF4' => '0xCF84',		'0xF5' => '0xCF85',		'0xF6' => '0xCF86',
2951
-				'0xF7' => '0xCF87',		'0xF8' => '0xCF88',		'0xF9' => '0xCF89',
2952
-				'0xFA' => '0xCF8A',		'0xFB' => '0xCF8B',		'0xFC' => '0xCF8C',
2953
-				'0xFD' => '0xCF8D',		'0xFE' => '0xCF8E',
2911
+				'0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'',
2912
+				'0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'',
2913
+				'0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'',
2914
+				'0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'',
2915
+				'0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'',
2916
+				'0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E',
2917
+				'0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C',
2918
+				'0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90',
2919
+				'0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C',
2920
+				'0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA',
2921
+				'0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC',
2922
+				'0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF',
2923
+				'0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2',
2924
+				'0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4',
2925
+				'0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7',
2926
+				'0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB',
2927
+				'0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE',
2928
+				'0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3',
2929
+				'0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7',
2930
+				'0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2',
2931
+				'0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6',
2932
+				'0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86',
2933
+				'0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89',
2934
+				'0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2',
2935
+				'0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D',
2936
+				'0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094',
2937
+				'0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84',
2938
+				'0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94',
2939
+				'0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692',
2940
+				'0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B',
2941
+				'0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3',
2942
+				'0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6',
2943
+				'0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9',
2944
+				'0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD',
2945
+				'0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0',
2946
+				'0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4',
2947
+				'0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7',
2948
+				'0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80',
2949
+				'0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83',
2950
+				'0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86',
2951
+				'0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89',
2952
+				'0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C',
2953
+				'0xFD' => '0xCF8D', '0xFE' => '0xCF8E',
2954 2954
 			),
2955 2955
 		);
2956 2956
 
Please login to merge, or discard this patch.
Sources/random_compat/random_int.php 2 patches
Indentation   +200 added lines, -200 removed lines patch added patch discarded remove patch
@@ -1,204 +1,204 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!is_callable('random_int')) {
4
-    /**
5
-     * Random_* Compatibility Library
6
-     * for using the new PHP 7 random_* API in PHP 5 projects
7
-     *
8
-     * The MIT License (MIT)
9
-     *
10
-     * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
11
-     *
12
-     * Permission is hereby granted, free of charge, to any person obtaining a copy
13
-     * of this software and associated documentation files (the "Software"), to deal
14
-     * in the Software without restriction, including without limitation the rights
15
-     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
-     * copies of the Software, and to permit persons to whom the Software is
17
-     * furnished to do so, subject to the following conditions:
18
-     *
19
-     * The above copyright notice and this permission notice shall be included in
20
-     * all copies or substantial portions of the Software.
21
-     *
22
-     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
-     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
-     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
-     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
-     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
-     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
-     * SOFTWARE.
29
-     */
30
-
31
-    /**
32
-     * Fetch a random integer between $min and $max inclusive
33
-     *
34
-     * @param int $min
35
-     * @param int $max
36
-     *
37
-     * @throws Exception
38
-     *
39
-     * @return int
40
-     */
41
-    function random_int($min, $max)
42
-    {
43
-        /**
44
-         * Type and input logic checks
45
-         *
46
-         * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)
47
-         * (non-inclusive), it will sanely cast it to an int. If you it's equal to
48
-         * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats
49
-         * lose precision, so the <= and => operators might accidentally let a float
50
-         * through.
51
-         */
52
-
53
-        try {
54
-            /** @var int $min */
55
-            $min = RandomCompat_intval($min);
56
-        } catch (TypeError $ex) {
57
-            throw new TypeError(
58
-                'random_int(): $min must be an integer'
59
-            );
60
-        }
61
-
62
-        try {
63
-            /** @var int $max */
64
-            $max = RandomCompat_intval($max);
65
-        } catch (TypeError $ex) {
66
-            throw new TypeError(
67
-                'random_int(): $max must be an integer'
68
-            );
69
-        }
70
-
71
-        /**
72
-         * Now that we've verified our weak typing system has given us an integer,
73
-         * let's validate the logic then we can move forward with generating random
74
-         * integers along a given range.
75
-         */
76
-        if ($min > $max) {
77
-            throw new Error(
78
-                'Minimum value must be less than or equal to the maximum value'
79
-            );
80
-        }
81
-
82
-        if ($max === $min) {
83
-            return (int) $min;
84
-        }
85
-
86
-        /**
87
-         * Initialize variables to 0
88
-         *
89
-         * We want to store:
90
-         * $bytes => the number of random bytes we need
91
-         * $mask => an integer bitmask (for use with the &) operator
92
-         *          so we can minimize the number of discards
93
-         */
94
-        $attempts = $bits = $bytes = $mask = $valueShift = 0;
95
-        /** @var int $attempts */
96
-        /** @var int $bits */
97
-        /** @var int $bytes */
98
-        /** @var int $mask */
99
-        /** @var int $valueShift */
100
-
101
-        /**
102
-         * At this point, $range is a positive number greater than 0. It might
103
-         * overflow, however, if $max - $min > PHP_INT_MAX. PHP will cast it to
104
-         * a float and we will lose some precision.
105
-         *
106
-         * @var int|float $range
107
-         */
108
-        $range = $max - $min;
109
-
110
-        /**
111
-         * Test for integer overflow:
112
-         */
113
-        if (!is_int($range)) {
114
-
115
-            /**
116
-             * Still safely calculate wider ranges.
117
-             * Provided by @CodesInChaos, @oittaa
118
-             *
119
-             * @ref https://gist.github.com/CodesInChaos/03f9ea0b58e8b2b8d435
120
-             *
121
-             * We use ~0 as a mask in this case because it generates all 1s
122
-             *
123
-             * @ref https://eval.in/400356 (32-bit)
124
-             * @ref http://3v4l.org/XX9r5  (64-bit)
125
-             */
126
-            $bytes = PHP_INT_SIZE;
127
-            /** @var int $mask */
128
-            $mask = ~0;
129
-
130
-        } else {
131
-
132
-            /**
133
-             * $bits is effectively ceil(log($range, 2)) without dealing with
134
-             * type juggling
135
-             */
136
-            while ($range > 0) {
137
-                if ($bits % 8 === 0) {
138
-                    ++$bytes;
139
-                }
140
-                ++$bits;
141
-                $range >>= 1;
142
-                /** @var int $mask */
143
-                $mask = $mask << 1 | 1;
144
-            }
145
-            $valueShift = $min;
146
-        }
147
-
148
-        /** @var int $val */
149
-        $val = 0;
150
-        /**
151
-         * Now that we have our parameters set up, let's begin generating
152
-         * random integers until one falls between $min and $max
153
-         */
154
-        /** @psalm-suppress RedundantCondition */
155
-        do {
156
-            /**
157
-             * The rejection probability is at most 0.5, so this corresponds
158
-             * to a failure probability of 2^-128 for a working RNG
159
-             */
160
-            if ($attempts > 128) {
161
-                throw new Exception(
162
-                    'random_int: RNG is broken - too many rejections'
163
-                );
164
-            }
165
-
166
-            /**
167
-             * Let's grab the necessary number of random bytes
168
-             */
169
-            $randomByteString = random_bytes($bytes);
170
-
171
-            /**
172
-             * Let's turn $randomByteString into an integer
173
-             *
174
-             * This uses bitwise operators (<< and |) to build an integer
175
-             * out of the values extracted from ord()
176
-             *
177
-             * Example: [9F] | [6D] | [32] | [0C] =>
178
-             *   159 + 27904 + 3276800 + 201326592 =>
179
-             *   204631455
180
-             */
181
-            $val &= 0;
182
-            for ($i = 0; $i < $bytes; ++$i) {
183
-                $val |= ord($randomByteString[$i]) << ($i * 8);
184
-            }
185
-            /** @var int $val */
186
-
187
-            /**
188
-             * Apply mask
189
-             */
190
-            $val &= $mask;
191
-            $val += $valueShift;
192
-
193
-            ++$attempts;
194
-            /**
195
-             * If $val overflows to a floating point number,
196
-             * ... or is larger than $max,
197
-             * ... or smaller than $min,
198
-             * then try again.
199
-             */
200
-        } while (!is_int($val) || $val > $max || $val < $min);
201
-
202
-        return (int) $val;
203
-    }
4
+	/**
5
+	 * Random_* Compatibility Library
6
+	 * for using the new PHP 7 random_* API in PHP 5 projects
7
+	 *
8
+	 * The MIT License (MIT)
9
+	 *
10
+	 * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
11
+	 *
12
+	 * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+	 * of this software and associated documentation files (the "Software"), to deal
14
+	 * in the Software without restriction, including without limitation the rights
15
+	 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+	 * copies of the Software, and to permit persons to whom the Software is
17
+	 * furnished to do so, subject to the following conditions:
18
+	 *
19
+	 * The above copyright notice and this permission notice shall be included in
20
+	 * all copies or substantial portions of the Software.
21
+	 *
22
+	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+	 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+	 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+	 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+	 * SOFTWARE.
29
+	 */
30
+
31
+	/**
32
+	 * Fetch a random integer between $min and $max inclusive
33
+	 *
34
+	 * @param int $min
35
+	 * @param int $max
36
+	 *
37
+	 * @throws Exception
38
+	 *
39
+	 * @return int
40
+	 */
41
+	function random_int($min, $max)
42
+	{
43
+		/**
44
+		 * Type and input logic checks
45
+		 *
46
+		 * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)
47
+		 * (non-inclusive), it will sanely cast it to an int. If you it's equal to
48
+		 * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats
49
+		 * lose precision, so the <= and => operators might accidentally let a float
50
+		 * through.
51
+		 */
52
+
53
+		try {
54
+			/** @var int $min */
55
+			$min = RandomCompat_intval($min);
56
+		} catch (TypeError $ex) {
57
+			throw new TypeError(
58
+				'random_int(): $min must be an integer'
59
+			);
60
+		}
61
+
62
+		try {
63
+			/** @var int $max */
64
+			$max = RandomCompat_intval($max);
65
+		} catch (TypeError $ex) {
66
+			throw new TypeError(
67
+				'random_int(): $max must be an integer'
68
+			);
69
+		}
70
+
71
+		/**
72
+		 * Now that we've verified our weak typing system has given us an integer,
73
+		 * let's validate the logic then we can move forward with generating random
74
+		 * integers along a given range.
75
+		 */
76
+		if ($min > $max) {
77
+			throw new Error(
78
+				'Minimum value must be less than or equal to the maximum value'
79
+			);
80
+		}
81
+
82
+		if ($max === $min) {
83
+			return (int) $min;
84
+		}
85
+
86
+		/**
87
+		 * Initialize variables to 0
88
+		 *
89
+		 * We want to store:
90
+		 * $bytes => the number of random bytes we need
91
+		 * $mask => an integer bitmask (for use with the &) operator
92
+		 *          so we can minimize the number of discards
93
+		 */
94
+		$attempts = $bits = $bytes = $mask = $valueShift = 0;
95
+		/** @var int $attempts */
96
+		/** @var int $bits */
97
+		/** @var int $bytes */
98
+		/** @var int $mask */
99
+		/** @var int $valueShift */
100
+
101
+		/**
102
+		 * At this point, $range is a positive number greater than 0. It might
103
+		 * overflow, however, if $max - $min > PHP_INT_MAX. PHP will cast it to
104
+		 * a float and we will lose some precision.
105
+		 *
106
+		 * @var int|float $range
107
+		 */
108
+		$range = $max - $min;
109
+
110
+		/**
111
+		 * Test for integer overflow:
112
+		 */
113
+		if (!is_int($range)) {
114
+
115
+			/**
116
+			 * Still safely calculate wider ranges.
117
+			 * Provided by @CodesInChaos, @oittaa
118
+			 *
119
+			 * @ref https://gist.github.com/CodesInChaos/03f9ea0b58e8b2b8d435
120
+			 *
121
+			 * We use ~0 as a mask in this case because it generates all 1s
122
+			 *
123
+			 * @ref https://eval.in/400356 (32-bit)
124
+			 * @ref http://3v4l.org/XX9r5  (64-bit)
125
+			 */
126
+			$bytes = PHP_INT_SIZE;
127
+			/** @var int $mask */
128
+			$mask = ~0;
129
+
130
+		} else {
131
+
132
+			/**
133
+			 * $bits is effectively ceil(log($range, 2)) without dealing with
134
+			 * type juggling
135
+			 */
136
+			while ($range > 0) {
137
+				if ($bits % 8 === 0) {
138
+					++$bytes;
139
+				}
140
+				++$bits;
141
+				$range >>= 1;
142
+				/** @var int $mask */
143
+				$mask = $mask << 1 | 1;
144
+			}
145
+			$valueShift = $min;
146
+		}
147
+
148
+		/** @var int $val */
149
+		$val = 0;
150
+		/**
151
+		 * Now that we have our parameters set up, let's begin generating
152
+		 * random integers until one falls between $min and $max
153
+		 */
154
+		/** @psalm-suppress RedundantCondition */
155
+		do {
156
+			/**
157
+			 * The rejection probability is at most 0.5, so this corresponds
158
+			 * to a failure probability of 2^-128 for a working RNG
159
+			 */
160
+			if ($attempts > 128) {
161
+				throw new Exception(
162
+					'random_int: RNG is broken - too many rejections'
163
+				);
164
+			}
165
+
166
+			/**
167
+			 * Let's grab the necessary number of random bytes
168
+			 */
169
+			$randomByteString = random_bytes($bytes);
170
+
171
+			/**
172
+			 * Let's turn $randomByteString into an integer
173
+			 *
174
+			 * This uses bitwise operators (<< and |) to build an integer
175
+			 * out of the values extracted from ord()
176
+			 *
177
+			 * Example: [9F] | [6D] | [32] | [0C] =>
178
+			 *   159 + 27904 + 3276800 + 201326592 =>
179
+			 *   204631455
180
+			 */
181
+			$val &= 0;
182
+			for ($i = 0; $i < $bytes; ++$i) {
183
+				$val |= ord($randomByteString[$i]) << ($i * 8);
184
+			}
185
+			/** @var int $val */
186
+
187
+			/**
188
+			 * Apply mask
189
+			 */
190
+			$val &= $mask;
191
+			$val += $valueShift;
192
+
193
+			++$attempts;
194
+			/**
195
+			 * If $val overflows to a floating point number,
196
+			 * ... or is larger than $max,
197
+			 * ... or smaller than $min,
198
+			 * then try again.
199
+			 */
200
+		} while (!is_int($val) || $val > $max || $val < $min);
201
+
202
+		return (int) $val;
203
+	}
204 204
 }
Please login to merge, or discard this patch.
Braces   +29 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!is_callable('random_int')) {
3
+if (!is_callable('random_int'))
4
+{
4 5
     /**
5 6
      * Random_* Compatibility Library
6 7
      * for using the new PHP 7 random_* API in PHP 5 projects
@@ -50,19 +51,25 @@  discard block
 block discarded – undo
50 51
          * through.
51 52
          */
52 53
 
53
-        try {
54
+        try
55
+        {
54 56
             /** @var int $min */
55 57
             $min = RandomCompat_intval($min);
56
-        } catch (TypeError $ex) {
58
+        }
59
+        catch (TypeError $ex)
60
+        {
57 61
             throw new TypeError(
58 62
                 'random_int(): $min must be an integer'
59 63
             );
60 64
         }
61 65
 
62
-        try {
66
+        try
67
+        {
63 68
             /** @var int $max */
64 69
             $max = RandomCompat_intval($max);
65
-        } catch (TypeError $ex) {
70
+        }
71
+        catch (TypeError $ex)
72
+        {
66 73
             throw new TypeError(
67 74
                 'random_int(): $max must be an integer'
68 75
             );
@@ -73,13 +80,15 @@  discard block
 block discarded – undo
73 80
          * let's validate the logic then we can move forward with generating random
74 81
          * integers along a given range.
75 82
          */
76
-        if ($min > $max) {
83
+        if ($min > $max)
84
+        {
77 85
             throw new Error(
78 86
                 'Minimum value must be less than or equal to the maximum value'
79 87
             );
80 88
         }
81 89
 
82
-        if ($max === $min) {
90
+        if ($max === $min)
91
+        {
83 92
             return (int) $min;
84 93
         }
85 94
 
@@ -110,7 +119,8 @@  discard block
 block discarded – undo
110 119
         /**
111 120
          * Test for integer overflow:
112 121
          */
113
-        if (!is_int($range)) {
122
+        if (!is_int($range))
123
+        {
114 124
 
115 125
             /**
116 126
              * Still safely calculate wider ranges.
@@ -127,14 +137,18 @@  discard block
 block discarded – undo
127 137
             /** @var int $mask */
128 138
             $mask = ~0;
129 139
 
130
-        } else {
140
+        }
141
+        else
142
+        {
131 143
 
132 144
             /**
133 145
              * $bits is effectively ceil(log($range, 2)) without dealing with
134 146
              * type juggling
135 147
              */
136
-            while ($range > 0) {
137
-                if ($bits % 8 === 0) {
148
+            while ($range > 0)
149
+            {
150
+                if ($bits % 8 === 0)
151
+                {
138 152
                     ++$bytes;
139 153
                 }
140 154
                 ++$bits;
@@ -157,7 +171,8 @@  discard block
 block discarded – undo
157 171
              * The rejection probability is at most 0.5, so this corresponds
158 172
              * to a failure probability of 2^-128 for a working RNG
159 173
              */
160
-            if ($attempts > 128) {
174
+            if ($attempts > 128)
175
+            {
161 176
                 throw new Exception(
162 177
                     'random_int: RNG is broken - too many rejections'
163 178
                 );
@@ -179,7 +194,8 @@  discard block
 block discarded – undo
179 194
              *   204631455
180 195
              */
181 196
             $val &= 0;
182
-            for ($i = 0; $i < $bytes; ++$i) {
197
+            for ($i = 0; $i < $bytes; ++$i)
198
+            {
183 199
                 $val |= ord($randomByteString[$i]) << ($i * 8);
184 200
             }
185 201
             /** @var int $val */
Please login to merge, or discard this patch.
Sources/tasks/CreatePost-Notify.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
 	/**
21 21
 	 * Constants for reply types.
22
-	*/
22
+	 */
23 23
 	const NOTIFY_TYPE_REPLY_AND_MODIFY = 1;
24 24
 	const NOTIFY_TYPE_REPLY_AND_TOPIC_START_FOLLOWING = 2;
25 25
 	const NOTIFY_TYPE_ONLY_REPLIES = 3;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 	/**
29 29
 	 * Constants for frequencies.
30
-	*/
30
+	 */
31 31
 	const FREQUENCY_NOTHING = 0;
32 32
 	const FREQUENCY_EVERYTHING = 1;
33 33
 	const FREQUENCY_FIRST_UNREAD_MSG = 2;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	const FREQUENCY_WEEKLY_DIGEST = 4;
36 36
 
37 37
 	/**
38
-     * This handles notifications when a new post is created - new topic, reply, quotes and mentions.
38
+	 * This handles notifications when a new post is created - new topic, reply, quotes and mentions.
39 39
 	 * @return bool Always returns true
40 40
 	 */
41 41
 	public function execute()
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
 		if ($type == 'edit')
104 104
 		{
105 105
 			// Filter out members who have already been notified about this post's topic
106
-			$unnotified = array_filter($watched, function ($member)
106
+			$unnotified = array_filter($watched, function($member)
107 107
 			{
108 108
 				return empty($member['sent']);
109 109
 			});
Please login to merge, or discard this patch.
cron.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@
 block discarded – undo
281 281
 {
282 282
 	/**
283 283
 	 * Constants for notfication types.
284
-	*/
284
+	 */
285 285
 	const RECEIVE_NOTIFY_EMAIL = 0x02;
286 286
 	const RECEIVE_NOTIFY_ALERT = 0x01;
287 287
 
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -419,7 +419,7 @@
 block discarded – undo
419 419
 					$board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']);
420 420
 			}
421 421
 		}
422
-	else
422
+		else
423 423
 		foreach ($this_category as &$board)
424 424
 		{
425 425
 			if (!empty($moderators[$board['id']]))
Please login to merge, or discard this patch.
Sources/Subs-Editor.php 1 patch
Braces   -3 removed lines patch added patch discarded remove patch
@@ -332,7 +332,6 @@  discard block
 block discarded – undo
332 332
 					$replacement .= $precedingStyle . $extra_attr . $afterStyle;
333 333
 			}
334 334
 		}
335
-
336 335
 		elseif (preg_match('~</([A-Za-z]+)>~', $part, $matches) === 1)
337 336
 		{
338 337
 			// Is this the element that we've been waiting for to be closed?
@@ -592,7 +591,6 @@  discard block
 block discarded – undo
592 591
 							$parts[$i + 2] = str_repeat("\t", $listDepth) . '[/list]';
593 592
 							$parts[$i + 3] = '';
594 593
 						}
595
-
596 594
 						else
597 595
 						{
598 596
 							// We're in a list item.
@@ -631,7 +629,6 @@  discard block
 block discarded – undo
631 629
 							$parts[$i + 2] = '';
632 630
 							$parts[$i + 3] = '';
633 631
 						}
634
-
635 632
 						else
636 633
 						{
637 634
 							// Remove the trailing breaks from the list item.
Please login to merge, or discard this patch.
Sources/Subs.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2936,7 +2936,7 @@
 block discarded – undo
2936 2936
 		}
2937 2937
 
2938 2938
 		// Set proper extensions; do this post caching so cache doesn't become extension-specific
2939
-		foreach ($smileysto AS $ix => $file)
2939
+		foreach ($smileysto as $ix => $file)
2940 2940
 			// Need to use the default if user selection is disabled
2941 2941
 			if (empty($modSettings['smiley_sets_enable']))
2942 2942
 				$smileysto[$ix] = $file . $context['user']['smiley_set_default_ext'];
Please login to merge, or discard this patch.
Braces   -3 removed lines patch added patch discarded remove patch
@@ -302,7 +302,6 @@  discard block
 block discarded – undo
302 302
 		$condition = 'id_member IN ({array_int:members})';
303 303
 		$parameters['members'] = $members;
304 304
 	}
305
-
306 305
 	elseif ($members === null)
307 306
 		$condition = '1=1';
308 307
 
@@ -3764,7 +3763,6 @@  discard block
 block discarded – undo
3764 3763
 				if (!isset($minSeed) && isset($js_file['options']['seed']))
3765 3764
 					$minSeed = $js_file['options']['seed'];
3766 3765
 			}
3767
-
3768 3766
 			else
3769 3767
 				echo '
3770 3768
 	<script src="', $js_file['fileUrl'], '"', !empty($js_file['options']['async']) ? ' async' : '', !empty($js_file['options']['defer']) ? ' defer' : '', '></script>';
@@ -5917,7 +5915,6 @@  discard block
 block discarded – undo
5917 5915
 			$isWritable = true;
5918 5916
 			break;
5919 5917
 		}
5920
-
5921 5918
 		else
5922 5919
 			@chmod($file, $val);
5923 5920
 	}
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 			{
392 392
 				$val = 'CASE ';
393 393
 				foreach ($members as $k => $v)
394
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' ';
394
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' ';
395 395
 				$val = $val . ' END';
396 396
 				$type = 'raw';
397 397
 			}
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 				'type' => 'unparsed_commas_content',
1410 1410
 				'test' => '\d+,\d+\]',
1411 1411
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1412
-				'validate' => function (&$tag, &$data, $disabled)
1412
+				'validate' => function(&$tag, &$data, $disabled)
1413 1413
 				{
1414 1414
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1415 1415
 					if (empty($scheme))
@@ -5315,15 +5315,15 @@  discard block
 block discarded – undo
5315 5315
 
5316 5316
 	// UTF-8 occurences of MS special characters
5317 5317
 	$findchars_utf8 = array(
5318
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5319
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5320
-		"\xe2\x80\xa6",	// horizontal ellipsis
5321
-		"\xe2\x80\x98",	// left single curly quote
5322
-		"\xe2\x80\x99",	// right single curly quote
5323
-		"\xe2\x80\x9c",	// left double curly quote
5324
-		"\xe2\x80\x9d",	// right double curly quote
5325
-		"\xe2\x80\x93",	// en dash
5326
-		"\xe2\x80\x94",	// em dash
5318
+		"\xe2\x80\x9a", // single low-9 quotation mark
5319
+		"\xe2\x80\x9e", // double low-9 quotation mark
5320
+		"\xe2\x80\xa6", // horizontal ellipsis
5321
+		"\xe2\x80\x98", // left single curly quote
5322
+		"\xe2\x80\x99", // right single curly quote
5323
+		"\xe2\x80\x9c", // left double curly quote
5324
+		"\xe2\x80\x9d", // right double curly quote
5325
+		"\xe2\x80\x93", // en dash
5326
+		"\xe2\x80\x94", // em dash
5327 5327
 	);
5328 5328
 
5329 5329
 	// windows 1252 / iso equivalents
@@ -5341,15 +5341,15 @@  discard block
 block discarded – undo
5341 5341
 
5342 5342
 	// safe replacements
5343 5343
 	$replacechars = array(
5344
-		',',	// &sbquo;
5345
-		',,',	// &bdquo;
5346
-		'...',	// &hellip;
5347
-		"'",	// &lsquo;
5348
-		"'",	// &rsquo;
5349
-		'"',	// &ldquo;
5350
-		'"',	// &rdquo;
5351
-		'-',	// &ndash;
5352
-		'--',	// &mdash;
5344
+		',', // &sbquo;
5345
+		',,', // &bdquo;
5346
+		'...', // &hellip;
5347
+		"'", // &lsquo;
5348
+		"'", // &rsquo;
5349
+		'"', // &ldquo;
5350
+		'"', // &rdquo;
5351
+		'-', // &ndash;
5352
+		'--', // &mdash;
5353 5353
 	);
5354 5354
 
5355 5355
 	if ($context['utf8'])
@@ -6517,7 +6517,7 @@  discard block
 block discarded – undo
6517 6517
 			EXISTS (
6518 6518
 				SELECT bpv.id_board
6519 6519
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6520
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
6520
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
6521 6521
 					AND bpv.deny = 0
6522 6522
 					AND bpv.id_board = b.id_board
6523 6523
 			)';
@@ -6527,7 +6527,7 @@  discard block
 block discarded – undo
6527 6527
 			AND NOT EXISTS (
6528 6528
 				SELECT bpv.id_board
6529 6529
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6530
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
6530
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
6531 6531
 					AND bpv.deny = 1
6532 6532
 					AND bpv.id_board = b.id_board
6533 6533
 			)';
@@ -6787,8 +6787,8 @@  discard block
 block discarded – undo
6787 6787
 	$i = 0;
6788 6788
 	while (empty($done))
6789 6789
 	{
6790
-		if (strpos($format, '{'. --$i . '}') !== false)
6791
-			$replacements['{'. $i . '}'] = array_pop($list);
6790
+		if (strpos($format, '{' . --$i . '}') !== false)
6791
+			$replacements['{' . $i . '}'] = array_pop($list);
6792 6792
 		else
6793 6793
 			$done = true;
6794 6794
 	}
@@ -6798,8 +6798,8 @@  discard block
 block discarded – undo
6798 6798
 	$i = 0;
6799 6799
 	while (empty($done))
6800 6800
 	{
6801
-		if (strpos($format, '{'. ++$i . '}') !== false)
6802
-			$replacements['{'. $i . '}'] = array_shift($list);
6801
+		if (strpos($format, '{' . ++$i . '}') !== false)
6802
+			$replacements['{' . $i . '}'] = array_shift($list);
6803 6803
 		else
6804 6804
 			$done = true;
6805 6805
 	}
Please login to merge, or discard this patch.
other/install.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1702,8 +1702,7 @@
 block discarded – undo
1702 1702
 	updateStats('topic');
1703 1703
 
1704 1704
 	// This function is needed to do the updateStats('subject') call.
1705
-	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' :
1706
-		function($string)
1705
+	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string)
1707 1706
 		{
1708 1707
 			global $sourcedir;
1709 1708
 			if (function_exists('mb_strtolower'))
Please login to merge, or discard this patch.