Passed
Push — release-2.1 ( 3ec600...391b74 )
by Mathias
08:28 queued 14s
created
Sources/Class-Punycode.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				}
242 242
 				if ($c === $n) {
243 243
 					$q = $delta;
244
-					for ($k = static::BASE;; $k += static::BASE) {
244
+					for ($k = static::BASE; ; $k += static::BASE) {
245 245
 						$t = $this->calculateThreshold($k, $bias);
246 246
 						if ($q < $t) {
247 247
 							break;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 			$oldi = $i;
345 345
 			$w = 1;
346 346
 
347
-			for ($k = static::BASE;; $k += static::BASE)
347
+			for ($k = static::BASE; ; $k += static::BASE)
348 348
 			{
349 349
 				if (!isset($input[$pos]) || !isset(static::$decodeTable[$input[$pos]]))
350 350
 					return false;
Please login to merge, or discard this patch.
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -157,12 +157,14 @@  discard block
 block discarded – undo
157 157
 		}
158 158
 
159 159
 		$parts = explode('.', $preprocessed);
160
-		foreach ($parts as $p => &$part) {
160
+		foreach ($parts as $p => &$part)
161
+		{
161 162
 			$part = $this->encodePart($part);
162 163
 
163 164
 			$validation_status = $this->validateLabel($part, true);
164 165
 
165
-			switch ($validation_status) {
166
+			switch ($validation_status)
167
+			{
166 168
 				case self::IDNA_ERROR_LABEL_TOO_LONG:
167 169
 				case self::IDNA_ERROR_LEADING_HYPHEN:
168 170
 				case self::IDNA_ERROR_TRAILING_HYPHEN:
@@ -215,13 +217,16 @@  discard block
 block discarded – undo
215 217
 		$h = $b = count($codePoints['basic']);
216 218
 
217 219
 		$output = '';
218
-		foreach ($codePoints['basic'] as $code) {
220
+		foreach ($codePoints['basic'] as $code)
221
+		{
219 222
 			$output .= $this->codePointToChar($code);
220 223
 		}
221
-		if ($input === $output) {
224
+		if ($input === $output)
225
+		{
222 226
 			return $output;
223 227
 		}
224
-		if ($b > 0) {
228
+		if ($b > 0)
229
+		{
225 230
 			$output .= static::DELIMITER;
226 231
 		}
227 232
 
@@ -230,20 +235,26 @@  discard block
 block discarded – undo
230 235
 
231 236
 		$i = 0;
232 237
 		$length = mb_strlen($input, $this->encoding);
233
-		while ($h < $length) {
238
+		while ($h < $length)
239
+		{
234 240
 			$m = $codePoints['nonBasic'][$i++];
235 241
 			$delta = $delta + ($m - $n) * ($h + 1);
236 242
 			$n = $m;
237 243
 
238
-			foreach ($codePoints['all'] as $c) {
239
-				if ($c < $n || $c < static::INITIAL_N) {
244
+			foreach ($codePoints['all'] as $c)
245
+			{
246
+				if ($c < $n || $c < static::INITIAL_N)
247
+				{
240 248
 					$delta++;
241 249
 				}
242
-				if ($c === $n) {
250
+				if ($c === $n)
251
+				{
243 252
 					$q = $delta;
244
-					for ($k = static::BASE;; $k += static::BASE) {
253
+					for ($k = static::BASE;; $k += static::BASE)
254
+					{
245 255
 						$t = $this->calculateThreshold($k, $bias);
246
-						if ($q < $t) {
256
+						if ($q < $t)
257
+						{
247 258
 							break;
248 259
 						}
249 260
 
@@ -530,7 +541,8 @@  discard block
 block discarded – undo
530 541
 
531 542
 		$labels = explode('.', $domain);
532 543
 
533
-		foreach ($labels as $l => $label) {
544
+		foreach ($labels as $l => $label)
545
+		{
534 546
 			$label = preg_replace('/[' . $regexes['ignored'] . ']/u', '', $label);
535 547
 
536 548
 			$label = utf8_normalize_c(strtr($label, $maps));
Please login to merge, or discard this patch.
other/update_version_numbers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
 
122 122
 $files = array_unique(array_merge($always_update, array_filter(
123 123
 	explode("\n", shell_exec('git diff --name-only v' . $prev_version . '...HEAD')),
124
-	function ($filename)
124
+	function($filename)
125 125
 	{
126 126
 		return file_exists($filename) && strpos(mime_content_type($filename), 'text/') === 0;
127 127
 	}
Please login to merge, or discard this patch.
other/upgrade.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1092,7 +1092,7 @@
 block discarded – undo
1092 1092
 	// PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable.  Lets borrow some code from the RFC that intends to fix this
1093 1093
 	// https://wiki.php.net/rfc/improve_unserialize_error_handling
1094 1094
 	try {
1095
-    	set_error_handler(static function ($severity, $message, $file, $line) {
1095
+		set_error_handler(static function ($severity, $message, $file, $line) {
1096 1096
 			throw new \ErrorException($message, 0, $severity, $file, $line);
1097 1097
 		});
1098 1098
 		$ser_test = @unserialize($modSettings['attachmentUploadDir']);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 	// An array already?
1122 1122
 	elseif (is_array($modSettings['attachmentUploadDir']))
1123 1123
 	{
1124
-		foreach($modSettings['attachmentUploadDir'] AS $dir)
1124
+		foreach($modSettings['attachmentUploadDir'] as $dir)
1125 1125
 			if (!empty($dir) && !is_dir($dir))
1126 1126
 				$attdr_problem_found = true;
1127 1127
 	}
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 	{
1131 1131
 		if (is_array($ser_test))
1132 1132
 		{
1133
-			foreach($ser_test AS $dir)
1133
+			foreach($ser_test as $dir)
1134 1134
 			{
1135 1135
 				if (!empty($dir) && !is_dir($dir))
1136 1136
 					$attdr_problem_found = true;
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 	{
1148 1148
 		if (is_array($json_test))
1149 1149
 		{
1150
-			foreach($json_test AS $dir)
1150
+			foreach($json_test as $dir)
1151 1151
 			{
1152 1152
 				if (!is_dir($dir))
1153 1153
 					$attdr_problem_found = true;
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 		$to = explode('/', $lang_dir);
547 547
 		$relPath = $to;
548 548
 
549
-		foreach($from as $depth => $dir)
549
+		foreach ($from as $depth => $dir)
550 550
 		{
551 551
 			if ($dir === $to[$depth])
552 552
 				array_shift($relPath);
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
 	// PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable.  Lets borrow some code from the RFC that intends to fix this
1109 1109
 	// https://wiki.php.net/rfc/improve_unserialize_error_handling
1110 1110
 	try {
1111
-    	set_error_handler(static function ($severity, $message, $file, $line) {
1111
+    	set_error_handler(static function($severity, $message, $file, $line) {
1112 1112
 			throw new \ErrorException($message, 0, $severity, $file, $line);
1113 1113
 		});
1114 1114
 		$ser_test = @unserialize($modSettings['attachmentUploadDir']);
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
 	// An array already?
1138 1138
 	elseif (is_array($modSettings['attachmentUploadDir']))
1139 1139
 	{
1140
-		foreach($modSettings['attachmentUploadDir'] AS $dir)
1140
+		foreach ($modSettings['attachmentUploadDir'] AS $dir)
1141 1141
 			if (!empty($dir) && !is_dir($dir))
1142 1142
 				$attdr_problem_found = true;
1143 1143
 	}
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 	{
1147 1147
 		if (is_array($ser_test))
1148 1148
 		{
1149
-			foreach($ser_test AS $dir)
1149
+			foreach ($ser_test AS $dir)
1150 1150
 			{
1151 1151
 				if (!empty($dir) && !is_dir($dir))
1152 1152
 					$attdr_problem_found = true;
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 	{
1164 1164
 		if (is_array($json_test))
1165 1165
 		{
1166
-			foreach($json_test AS $dir)
1166
+			foreach ($json_test AS $dir)
1167 1167
 			{
1168 1168
 				if (!is_dir($dir))
1169 1169
 					$attdr_problem_found = true;
@@ -3163,94 +3163,94 @@  discard block
 block discarded – undo
3163 3163
 		// Translation table for the character sets not native for MySQL.
3164 3164
 		$translation_tables = array(
3165 3165
 			'windows-1255' => array(
3166
-				'0x81' => '\'\'',		'0x8A' => '\'\'',		'0x8C' => '\'\'',
3167
-				'0x8D' => '\'\'',		'0x8E' => '\'\'',		'0x8F' => '\'\'',
3168
-				'0x90' => '\'\'',		'0x9A' => '\'\'',		'0x9C' => '\'\'',
3169
-				'0x9D' => '\'\'',		'0x9E' => '\'\'',		'0x9F' => '\'\'',
3170
-				'0xCA' => '\'\'',		'0xD9' => '\'\'',		'0xDA' => '\'\'',
3171
-				'0xDB' => '\'\'',		'0xDC' => '\'\'',		'0xDD' => '\'\'',
3172
-				'0xDE' => '\'\'',		'0xDF' => '\'\'',		'0xFB' => '0xD792',
3173
-				'0xFC' => '0xE282AC',		'0xFF' => '0xD6B2',		'0xC2' => '0xFF',
3174
-				'0x80' => '0xFC',		'0xE2' => '0xFB',		'0xA0' => '0xC2A0',
3175
-				'0xA1' => '0xC2A1',		'0xA2' => '0xC2A2',		'0xA3' => '0xC2A3',
3176
-				'0xA5' => '0xC2A5',		'0xA6' => '0xC2A6',		'0xA7' => '0xC2A7',
3177
-				'0xA8' => '0xC2A8',		'0xA9' => '0xC2A9',		'0xAB' => '0xC2AB',
3178
-				'0xAC' => '0xC2AC',		'0xAD' => '0xC2AD',		'0xAE' => '0xC2AE',
3179
-				'0xAF' => '0xC2AF',		'0xB0' => '0xC2B0',		'0xB1' => '0xC2B1',
3180
-				'0xB2' => '0xC2B2',		'0xB3' => '0xC2B3',		'0xB4' => '0xC2B4',
3181
-				'0xB5' => '0xC2B5',		'0xB6' => '0xC2B6',		'0xB7' => '0xC2B7',
3182
-				'0xB8' => '0xC2B8',		'0xB9' => '0xC2B9',		'0xBB' => '0xC2BB',
3183
-				'0xBC' => '0xC2BC',		'0xBD' => '0xC2BD',		'0xBE' => '0xC2BE',
3184
-				'0xBF' => '0xC2BF',		'0xD7' => '0xD7B3',		'0xD1' => '0xD781',
3185
-				'0xD4' => '0xD7B0',		'0xD5' => '0xD7B1',		'0xD6' => '0xD7B2',
3186
-				'0xE0' => '0xD790',		'0xEA' => '0xD79A',		'0xEC' => '0xD79C',
3187
-				'0xED' => '0xD79D',		'0xEE' => '0xD79E',		'0xEF' => '0xD79F',
3188
-				'0xF0' => '0xD7A0',		'0xF1' => '0xD7A1',		'0xF2' => '0xD7A2',
3189
-				'0xF3' => '0xD7A3',		'0xF5' => '0xD7A5',		'0xF6' => '0xD7A6',
3190
-				'0xF7' => '0xD7A7',		'0xF8' => '0xD7A8',		'0xF9' => '0xD7A9',
3191
-				'0x82' => '0xE2809A',	'0x84' => '0xE2809E',	'0x85' => '0xE280A6',
3192
-				'0x86' => '0xE280A0',	'0x87' => '0xE280A1',	'0x89' => '0xE280B0',
3193
-				'0x8B' => '0xE280B9',	'0x93' => '0xE2809C',	'0x94' => '0xE2809D',
3194
-				'0x95' => '0xE280A2',	'0x97' => '0xE28094',	'0x99' => '0xE284A2',
3195
-				'0xC0' => '0xD6B0',		'0xC1' => '0xD6B1',		'0xC3' => '0xD6B3',
3196
-				'0xC4' => '0xD6B4',		'0xC5' => '0xD6B5',		'0xC6' => '0xD6B6',
3197
-				'0xC7' => '0xD6B7',		'0xC8' => '0xD6B8',		'0xC9' => '0xD6B9',
3198
-				'0xCB' => '0xD6BB',		'0xCC' => '0xD6BC',		'0xCD' => '0xD6BD',
3199
-				'0xCE' => '0xD6BE',		'0xCF' => '0xD6BF',		'0xD0' => '0xD780',
3200
-				'0xD2' => '0xD782',		'0xE3' => '0xD793',		'0xE4' => '0xD794',
3201
-				'0xE5' => '0xD795',		'0xE7' => '0xD797',		'0xE9' => '0xD799',
3202
-				'0xFD' => '0xE2808E',	'0xFE' => '0xE2808F',	'0x92' => '0xE28099',
3203
-				'0x83' => '0xC692',		'0xD3' => '0xD783',		'0x88' => '0xCB86',
3204
-				'0x98' => '0xCB9C',		'0x91' => '0xE28098',	'0x96' => '0xE28093',
3205
-				'0xBA' => '0xC3B7',		'0x9B' => '0xE280BA',	'0xAA' => '0xC397',
3206
-				'0xA4' => '0xE282AA',	'0xE1' => '0xD791',		'0xE6' => '0xD796',
3207
-				'0xE8' => '0xD798',		'0xEB' => '0xD79B',		'0xF4' => '0xD7A4',
3166
+				'0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'',
3167
+				'0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'',
3168
+				'0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'',
3169
+				'0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'',
3170
+				'0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'',
3171
+				'0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'',
3172
+				'0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792',
3173
+				'0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF',
3174
+				'0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0',
3175
+				'0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3',
3176
+				'0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7',
3177
+				'0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB',
3178
+				'0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE',
3179
+				'0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1',
3180
+				'0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4',
3181
+				'0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7',
3182
+				'0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB',
3183
+				'0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE',
3184
+				'0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781',
3185
+				'0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2',
3186
+				'0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C',
3187
+				'0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F',
3188
+				'0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2',
3189
+				'0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6',
3190
+				'0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9',
3191
+				'0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6',
3192
+				'0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0',
3193
+				'0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D',
3194
+				'0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2',
3195
+				'0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3',
3196
+				'0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6',
3197
+				'0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9',
3198
+				'0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD',
3199
+				'0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780',
3200
+				'0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794',
3201
+				'0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799',
3202
+				'0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099',
3203
+				'0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86',
3204
+				'0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093',
3205
+				'0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397',
3206
+				'0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796',
3207
+				'0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4',
3208 3208
 				'0xFA' => '0xD7AA',
3209 3209
 			),
3210 3210
 			'windows-1253' => array(
3211
-				'0x81' => '\'\'',			'0x88' => '\'\'',			'0x8A' => '\'\'',
3212
-				'0x8C' => '\'\'',			'0x8D' => '\'\'',			'0x8E' => '\'\'',
3213
-				'0x8F' => '\'\'',			'0x90' => '\'\'',			'0x98' => '\'\'',
3214
-				'0x9A' => '\'\'',			'0x9C' => '\'\'',			'0x9D' => '\'\'',
3215
-				'0x9E' => '\'\'',			'0x9F' => '\'\'',			'0xAA' => '\'\'',
3216
-				'0xD2' => '0xE282AC',			'0xFF' => '0xCE92',			'0xCE' => '0xCE9E',
3217
-				'0xB8' => '0xCE88',		'0xBA' => '0xCE8A',		'0xBC' => '0xCE8C',
3218
-				'0xBE' => '0xCE8E',		'0xBF' => '0xCE8F',		'0xC0' => '0xCE90',
3219
-				'0xC8' => '0xCE98',		'0xCA' => '0xCE9A',		'0xCC' => '0xCE9C',
3220
-				'0xCD' => '0xCE9D',		'0xCF' => '0xCE9F',		'0xDA' => '0xCEAA',
3221
-				'0xE8' => '0xCEB8',		'0xEA' => '0xCEBA',		'0xEC' => '0xCEBC',
3222
-				'0xEE' => '0xCEBE',		'0xEF' => '0xCEBF',		'0xC2' => '0xFF',
3223
-				'0xBD' => '0xC2BD',		'0xED' => '0xCEBD',		'0xB2' => '0xC2B2',
3224
-				'0xA0' => '0xC2A0',		'0xA3' => '0xC2A3',		'0xA4' => '0xC2A4',
3225
-				'0xA5' => '0xC2A5',		'0xA6' => '0xC2A6',		'0xA7' => '0xC2A7',
3226
-				'0xA8' => '0xC2A8',		'0xA9' => '0xC2A9',		'0xAB' => '0xC2AB',
3227
-				'0xAC' => '0xC2AC',		'0xAD' => '0xC2AD',		'0xAE' => '0xC2AE',
3228
-				'0xB0' => '0xC2B0',		'0xB1' => '0xC2B1',		'0xB3' => '0xC2B3',
3229
-				'0xB5' => '0xC2B5',		'0xB6' => '0xC2B6',		'0xB7' => '0xC2B7',
3230
-				'0xBB' => '0xC2BB',		'0xE2' => '0xCEB2',		'0x80' => '0xD2',
3231
-				'0x82' => '0xE2809A',	'0x84' => '0xE2809E',	'0x85' => '0xE280A6',
3232
-				'0x86' => '0xE280A0',	'0xA1' => '0xCE85',		'0xA2' => '0xCE86',
3233
-				'0x87' => '0xE280A1',	'0x89' => '0xE280B0',	'0xB9' => '0xCE89',
3234
-				'0x8B' => '0xE280B9',	'0x91' => '0xE28098',	'0x99' => '0xE284A2',
3235
-				'0x92' => '0xE28099',	'0x93' => '0xE2809C',	'0x94' => '0xE2809D',
3236
-				'0x95' => '0xE280A2',	'0x96' => '0xE28093',	'0x97' => '0xE28094',
3237
-				'0x9B' => '0xE280BA',	'0xAF' => '0xE28095',	'0xB4' => '0xCE84',
3238
-				'0xC1' => '0xCE91',		'0xC3' => '0xCE93',		'0xC4' => '0xCE94',
3239
-				'0xC5' => '0xCE95',		'0xC6' => '0xCE96',		'0x83' => '0xC692',
3240
-				'0xC7' => '0xCE97',		'0xC9' => '0xCE99',		'0xCB' => '0xCE9B',
3241
-				'0xD0' => '0xCEA0',		'0xD1' => '0xCEA1',		'0xD3' => '0xCEA3',
3242
-				'0xD4' => '0xCEA4',		'0xD5' => '0xCEA5',		'0xD6' => '0xCEA6',
3243
-				'0xD7' => '0xCEA7',		'0xD8' => '0xCEA8',		'0xD9' => '0xCEA9',
3244
-				'0xDB' => '0xCEAB',		'0xDC' => '0xCEAC',		'0xDD' => '0xCEAD',
3245
-				'0xDE' => '0xCEAE',		'0xDF' => '0xCEAF',		'0xE0' => '0xCEB0',
3246
-				'0xE1' => '0xCEB1',		'0xE3' => '0xCEB3',		'0xE4' => '0xCEB4',
3247
-				'0xE5' => '0xCEB5',		'0xE6' => '0xCEB6',		'0xE7' => '0xCEB7',
3248
-				'0xE9' => '0xCEB9',		'0xEB' => '0xCEBB',		'0xF0' => '0xCF80',
3249
-				'0xF1' => '0xCF81',		'0xF2' => '0xCF82',		'0xF3' => '0xCF83',
3250
-				'0xF4' => '0xCF84',		'0xF5' => '0xCF85',		'0xF6' => '0xCF86',
3251
-				'0xF7' => '0xCF87',		'0xF8' => '0xCF88',		'0xF9' => '0xCF89',
3252
-				'0xFA' => '0xCF8A',		'0xFB' => '0xCF8B',		'0xFC' => '0xCF8C',
3253
-				'0xFD' => '0xCF8D',		'0xFE' => '0xCF8E',
3211
+				'0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'',
3212
+				'0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'',
3213
+				'0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'',
3214
+				'0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'',
3215
+				'0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'',
3216
+				'0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E',
3217
+				'0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C',
3218
+				'0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90',
3219
+				'0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C',
3220
+				'0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA',
3221
+				'0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC',
3222
+				'0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF',
3223
+				'0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2',
3224
+				'0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4',
3225
+				'0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7',
3226
+				'0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB',
3227
+				'0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE',
3228
+				'0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3',
3229
+				'0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7',
3230
+				'0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2',
3231
+				'0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6',
3232
+				'0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86',
3233
+				'0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89',
3234
+				'0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2',
3235
+				'0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D',
3236
+				'0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094',
3237
+				'0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84',
3238
+				'0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94',
3239
+				'0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692',
3240
+				'0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B',
3241
+				'0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3',
3242
+				'0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6',
3243
+				'0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9',
3244
+				'0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD',
3245
+				'0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0',
3246
+				'0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4',
3247
+				'0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7',
3248
+				'0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80',
3249
+				'0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83',
3250
+				'0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86',
3251
+				'0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89',
3252
+				'0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C',
3253
+				'0xFD' => '0xCF8D', '0xFE' => '0xCF8E',
3254 3254
 			),
3255 3255
 		);
3256 3256
 
@@ -3268,7 +3268,7 @@  discard block
 block discarded – undo
3268 3268
 		db_extend();
3269 3269
 		$queryTables = $smcFunc['db_list_tables'](false, $db_prefix . '%');
3270 3270
 
3271
-		$queryTables = array_values(array_filter($queryTables, function($v){
3271
+		$queryTables = array_values(array_filter($queryTables, function($v) {
3272 3272
 			return stripos($v, 'backup_') !== 0;
3273 3273
 		}));
3274 3274
 
@@ -3514,7 +3514,7 @@  discard block
 block discarded – undo
3514 3514
 			// This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8)
3515 3515
 			$new_string = preg_replace_callback(
3516 3516
 				'~\bs:(\d+):"(.*?)";(?=$|[bidsaO]:|[{}}]|N;)~s',
3517
-				function ($matches)
3517
+				function($matches)
3518 3518
 				{
3519 3519
 					return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';
3520 3520
 				},
Please login to merge, or discard this patch.
Braces   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@  discard block
 block discarded – undo
41 41
 	'mysql' => array(
42 42
 		'name' => 'MySQL',
43 43
 		'version' => '5.6.0',
44
-		'version_check' => function() {
44
+		'version_check' => function()
45
+		{
45 46
 			global $db_connection;
46 47
 			if (!function_exists('mysqli_fetch_row'))
47 48
 				return false;
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
 	'postgresql' => array(
53 54
 		'name' => 'PostgreSQL',
54 55
 		'version' => '9.6',
55
-		'version_check' => function() {
56
+		'version_check' => function()
57
+		{
56 58
 			if (!function_exists('pg_version'))
57 59
 				return false;
58 60
 			$version = pg_version();
@@ -1107,22 +1109,30 @@  discard block
 block discarded – undo
1107 1109
 
1108 1110
 	// PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable.  Lets borrow some code from the RFC that intends to fix this
1109 1111
 	// https://wiki.php.net/rfc/improve_unserialize_error_handling
1110
-	try {
1111
-    	set_error_handler(static function ($severity, $message, $file, $line) {
1112
+	try
1113
+	{
1114
+    	set_error_handler(static function ($severity, $message, $file, $line)
1115
+    	{
1112 1116
 			throw new \ErrorException($message, 0, $severity, $file, $line);
1113 1117
 		});
1114 1118
 		$ser_test = @unserialize($modSettings['attachmentUploadDir']);
1115
-	} catch (\Throwable $e) {
1119
+	}
1120
+	catch (\Throwable $e)
1121
+	{
1116 1122
 		$ser_test = false;
1117 1123
 	}
1118
-	finally {
1124
+	finally
1125
+	{
1119 1126
 	 	restore_error_handler();
1120 1127
 	}
1121 1128
 
1122 1129
 	// Json is simple, it can be caught.
1123
-	try {
1130
+	try
1131
+	{
1124 1132
 		$json_test = @json_decode($modSettings['attachmentUploadDir'], true);
1125
-	} catch (\Throwable $e) {
1133
+	}
1134
+	catch (\Throwable $e)
1135
+	{
1126 1136
 		$json_test = null;
1127 1137
 	}
1128 1138
 
@@ -3268,7 +3278,8 @@  discard block
 block discarded – undo
3268 3278
 		db_extend();
3269 3279
 		$queryTables = $smcFunc['db_list_tables'](false, $db_prefix . '%');
3270 3280
 
3271
-		$queryTables = array_values(array_filter($queryTables, function($v){
3281
+		$queryTables = array_values(array_filter($queryTables, function($v)
3282
+		{
3272 3283
 			return stripos($v, 'backup_') !== 0;
3273 3284
 		}));
3274 3285
 
Please login to merge, or discard this patch.
Sources/PersonalMessage.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3309,7 +3309,7 @@  discard block
 block discarded – undo
3309 3309
 		// Deleting an existing label?
3310 3310
 		elseif (isset($_POST['delete'], $_POST['delete_label']))
3311 3311
 		{
3312
-			foreach ($_POST['delete_label'] AS $label => $dummy)
3312
+			foreach ($_POST['delete_label'] as $label => $dummy)
3313 3313
 			{
3314 3314
 				if (array_key_exists($label, $the_labels))
3315 3315
 				{
@@ -3353,7 +3353,7 @@  discard block
 block discarded – undo
3353 3353
 		if (!empty($labels_to_add))
3354 3354
 		{
3355 3355
 			$inserts = array();
3356
-			foreach ($labels_to_add AS $label)
3356
+			foreach ($labels_to_add as $label)
3357 3357
 				$inserts[] = array($user_info['id'], $label);
3358 3358
 
3359 3359
 			$smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array());
@@ -3362,7 +3362,7 @@  discard block
 block discarded – undo
3362 3362
 		// Update existing labels as needed
3363 3363
 		if (!empty($label_updates))
3364 3364
 		{
3365
-			foreach ($label_updates AS $id => $name)
3365
+			foreach ($label_updates as $id => $name)
3366 3366
 			{
3367 3367
 				$smcFunc['db_query']('', '
3368 3368
 					UPDATE {db_prefix}pm_labels
Please login to merge, or discard this patch.
Sources/Errors.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
 
220 220
 	// Send a custom header if we have a custom message.
221 221
 	if (isset($_REQUEST['js']) || isset($_REQUEST['xml']) || isset($_RQEUEST['ajax']))
222
-		header('X-SMF-errormsg: ' .  $error_message);
222
+		header('X-SMF-errormsg: ' . $error_message);
223 223
 
224 224
 	// If we have no theme stuff we can't have the language file...
225 225
 	if (empty($context['theme_loaded']))
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -348,7 +348,8 @@
 block discarded – undo
348 348
 
349 349
 	$message = $txt[$e->getMessage()] ?? $e->getMessage();
350 350
 
351
-	if (!empty($modSettings['enableErrorLogging'])) {
351
+	if (!empty($modSettings['enableErrorLogging']))
352
+	{
352 353
 		log_error($message, 'general', $e->getFile(), $e->getLine());
353 354
 	}
354 355
 
Please login to merge, or discard this patch.
Sources/Subs-Charset.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 	$combining_classes = utf8_combining_classes();
550 550
 
551 551
 	// Replace characters with decomposed forms.
552
-	for ($i=0; $i < count($chars); $i++)
552
+	for ($i = 0; $i < count($chars); $i++)
553 553
 	{
554 554
 		// Hangul characters.
555 555
 		// See "Hangul Syllable Decomposition" in the Unicode standard, ch. 3.12.
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 		{
585 585
 			$temp = $chars[$i];
586 586
 			$chars[$i] = $chars[$i - 1];
587
-			$chars[$i -1] = $temp;
587
+			$chars[$i - 1] = $temp;
588 588
 
589 589
 			// Backtrack and check again.
590 590
 			if ($i > 1)
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 
825 825
 	// Use placeholders to preserve known emoji from further processing.
826 826
 	// Regex source is https://unicode.org/reports/tr51/#EBNF_and_Regex
827
-	$string  = preg_replace_callback(
827
+	$string = preg_replace_callback(
828 828
 		'/' .
829 829
 		// Flag emojis
830 830
 		'[' . $prop_classes['Regional_Indicator'] . ']{2}' .
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 			')?' .
854 854
 		')*' .
855 855
 		'/u',
856
-		function ($matches) use (&$placeholders)
856
+		function($matches) use (&$placeholders)
857 857
 		{
858 858
 			// Skip lone ASCII characters that are not actully part of an emoji sequence.
859 859
 			// This can happen because the digits 0-9 and the '*' and '#' characters are
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 		// Use placeholders for sanctioned variation selectors.
885 885
 		$string = preg_replace_callback(
886 886
 			$patterns,
887
-			function ($matches) use (&$placeholders)
887
+			function($matches) use (&$placeholders)
888 888
 			{
889 889
 				$placeholders[$matches[0]] = "\xEE\xB3\x9B" . md5($matches[0]) . "\xEE\xB3\x9C";
890 890
 				return $placeholders[$matches[0]];
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 			// Do the thing.
965 965
 			$string = preg_replace_callback(
966 966
 				'/' . $pattern . '/u',
967
-				function ($matches) use ($placeholders)
967
+				function($matches) use ($placeholders)
968 968
 				{
969 969
 					return strtr($matches[0], $placeholders);
970 970
 				},
Please login to merge, or discard this patch.
Sources/RemoveTopic.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -569,9 +569,11 @@
 block discarded – undo
569 569
 	updateSettings(array(
570 570
 		'calendar_updated' => time(),
571 571
 	));
572
-	if (!empty($cache_enable) && $cache_enable >= 3) {
572
+	if (!empty($cache_enable) && $cache_enable >= 3)
573
+	{
573 574
 		cache_put_data('board-' . $recycle_board, null);
574
-		foreach ($adjustBoards as $stats) {
575
+		foreach ($adjustBoards as $stats)
576
+		{
575 577
 			cache_put_data('board-' . $stats['id_board'], null);
576 578
 		}
577 579
 	}
Please login to merge, or discard this patch.
Sources/tasks/UpdateUnicode.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		if (!@touch($this->temp_dir . DIRECTORY_SEPARATOR . 'lock'))
417 417
 			return true;
418 418
 
419
-		register_shutdown_function(function () {
419
+		register_shutdown_function(function() {
420 420
 			if (file_exists($this->temp_dir . DIRECTORY_SEPARATOR . 'lock'))
421 421
 				unlink($this->temp_dir . DIRECTORY_SEPARATOR . 'lock');
422 422
 		});
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 					$func_code = rtrim($func_code);
903 903
 
904 904
 					$func_code .= $nextline . implode(' .' . $nextline, array_map(
905
-						function ($v)
905
+						function($v)
906 906
 						{
907 907
 							return var_export($v, true);
908 908
 						},
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 			}
1834 1834
 		}
1835 1835
 		// This sort works decently well to ensure widely used scripts are ranked before rare scripts.
1836
-		uasort($this->funcs['utf8_regex_joining_type']['data'], function ($a, $b)
1836
+		uasort($this->funcs['utf8_regex_joining_type']['data'], function($a, $b)
1837 1837
 		{
1838 1838
 			if ($a['stats']['age'] == $b['stats']['age'])
1839 1839
 			{
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
 			}
1922 1922
 		}
1923 1923
 		// Again, sort commonly used scripts before rare scripts.
1924
-		uasort($this->funcs['utf8_regex_indic']['data'], function ($a, $b)
1924
+		uasort($this->funcs['utf8_regex_indic']['data'], function($a, $b)
1925 1925
 		{
1926 1926
 			if ($a['stats']['age'] == $b['stats']['age'])
1927 1927
 			{
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -416,7 +416,8 @@
 block discarded – undo
416 416
 		if (!@touch($this->temp_dir . DIRECTORY_SEPARATOR . 'lock'))
417 417
 			return true;
418 418
 
419
-		register_shutdown_function(function () {
419
+		register_shutdown_function(function ()
420
+		{
420 421
 			if (file_exists($this->temp_dir . DIRECTORY_SEPARATOR . 'lock'))
421 422
 				unlink($this->temp_dir . DIRECTORY_SEPARATOR . 'lock');
422 423
 		});
Please login to merge, or discard this patch.
Sources/Reports.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -419,7 +419,7 @@
 block discarded – undo
419 419
 
420 420
 	$board_names = array_reduce(
421 421
 		$boards,
422
-		function (array $accumulator, array $board)
422
+		function(array $accumulator, array $board)
423 423
 		{
424 424
 			$accumulator[$board['profile']][] = $board['name'];
425 425
 
Please login to merge, or discard this patch.