Completed
Push — release-2.1 ( d322d4...5b3f1b )
by Colin
08:15
created
Sources/Subs-Post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -704,7 +704,7 @@
 block discarded – undo
704 704
 					$mail_result = false;
705 705
 				}
706 706
 			}
707
-			catch(ErrorException $e)
707
+			catch (ErrorException $e)
708 708
 			{
709 709
 				log_error($e->getMessage(), 'general', $e->getFile(), $e->getLine());
710 710
 				log_error(sprintf($txt['mail_send_unable'], $to));
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 				foreach ($message['custom_fields']['above_member'] as $custom)
233 233
 					echo '
234
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
234
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
235 235
 
236 236
 				echo '
237 237
 						</ul>
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			if (!empty($message['custom_fields']['below_avatar']))
281 281
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
282 282
 					echo '
283
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
283
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
284 284
 
285 285
 			if (!$message['member']['is_guest'])
286 286
 				echo '
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
 					foreach ($message['custom_fields']['icons'] as $custom)
324 324
 						echo '
325
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
325
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
326 326
 
327 327
 					echo '
328 328
 							</ol>
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 				if (!empty($message['custom_fields']['standard']))
387 387
 					foreach ($message['custom_fields']['standard'] as $custom)
388 388
 						echo '
389
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
389
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
390 390
 
391 391
 				// Are we showing the warning status?
392 392
 				if ($message['member']['can_see_warning'])
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 				if (!empty($message['custom_fields']['bottom_poster']))
398 398
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
399 399
 						echo '
400
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
400
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
401 401
 			}
402 402
 
403 403
 			// Done with the information about the poster... on to the post itself.
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
 				foreach ($message['custom_fields']['above_signature'] as $custom)
500 500
 					echo '
501
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
501
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
502 502
 
503 503
 				echo '
504 504
 							</ul>
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 
522 522
 				foreach ($message['custom_fields']['below_signature'] as $custom)
523 523
 					echo '
524
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
524
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
525 525
 
526 526
 				echo '
527 527
 							</ul>
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 	while ($message = $context['get_pmessage']('subject'))
658 658
 	{
659 659
 		echo '
660
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
660
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
661 661
 				<td class="table_icon">
662 662
 					<script>
663 663
 						currentLabels[', $message['id'], '] = {';
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
 				// You can only reply if they are not a guest...
947 947
 				if (!$message['member']['is_guest'])
948 948
 					echo '
949
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
950
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
949
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
950
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
951 951
 
952 952
 				// This is for "forwarding" - even if the member is gone.
953 953
 				else
954 954
 					echo '
955
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
955
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
956 956
 			}
957 957
 
958 958
 			echo '
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1055 1055
 					<dl>
1056 1056
 						<dt>
1057
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1057
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1058 1058
 						</dt>
1059 1059
 						<dd class="error" id="error_list">
1060 1060
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1111 1111
 					</dt>
1112 1112
 					<dd id="pm_subject">
1113
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1113
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1114 1114
 					</dd>
1115 1115
 				</dl>';
1116 1116
 
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 		echo '
1464 1464
 		<div class="padding">
1465 1465
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1466
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1466
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1467 1467
 		</div>';
1468 1468
 
1469 1469
 	echo '
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 	if (!empty($context['rules']))
1629 1629
 		echo '
1630 1630
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1631
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1631
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1632 1632
 
1633 1633
 	echo '
1634 1634
 		</div>
@@ -1871,9 +1871,9 @@  discard block
 block discarded – undo
1871 1871
 
1872 1872
 		echo '
1873 1873
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1874
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1875
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1876
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1874
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1875
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1876
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1877 1877
 				</select>
1878 1878
 				<span id="labdiv', $k, '">
1879 1879
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
 			</div>
1986 1986
 			<ul class="quickbuttons">
1987 1987
 				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li>
1988
-				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1988
+				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1989 1989
 			</ul>
1990 1990
 		</div><!-- .windowbg -->';
1991 1991
 		}
Please login to merge, or discard this patch.
proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
 		$max_age = $time - $cached['time'] + (5 * 86400);
141 141
 		header('content-type: ' . $cached['content_type']);
142 142
 		header('content-length: ' . $cached['size']);
143
-		header('cache-control: public, max-age=' . $max_age );
143
+		header('cache-control: public, max-age=' . $max_age);
144 144
 		header('last-modified: ' . gmdate('D, d M Y H:i:s', $cached['time']) . ' GMT');
145 145
 		header('etag: ' . $eTag);
146 146
 		echo base64_decode($cached['body']);
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		$fields = '';
465 465
 		foreach ($context['print_custom_fields']['below_signature'] as $field)
466 466
 			if (!empty($field['output_html']))
467
-				$fields .=  '
467
+				$fields .= '
468 468
 					<li>' . $field['output_html'] . '</li>';
469 469
 
470 470
 		if (!empty($fields))
@@ -3106,8 +3106,7 @@  discard block
 block discarded – undo
3106 3106
 			<div class="roundframe">
3107 3107
 				<div>
3108 3108
 		', !empty($context['tfa_backup']) ? '
3109
-					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3110
-			($modSettings['tfa_mode'] == 2 ? '
3109
+					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3111 3110
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3112 3111
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3113 3112
 									<div class="floatleft">
Please login to merge, or discard this patch.
Sources/Profile-View.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 	$smcFunc['db_free_result']($request);
252 252
 
253
-	if($withSender)
253
+	if ($withSender)
254 254
 	{
255 255
 		$senders = loadMemberData($senders);
256 256
 		foreach ($senders as $member)
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 	if (count($context['ip']) !== 2)
1897 1897
 		fatal_lang_error('invalid_tracking_ip', false);
1898 1898
 
1899
-	$ip_string = array('{inet:ip_address_low}','{inet:ip_address_high}');
1899
+	$ip_string = array('{inet:ip_address_low}', '{inet:ip_address_high}');
1900 1900
 	$fields = array(
1901 1901
 			'ip_address_low' => $context['ip']['low'],
1902 1902
 			'ip_address_high' => $context['ip']['high'],
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
 
1905 1905
 	$ip_var = $context['ip'];
1906 1906
 
1907
-	if ($context['ip']['low'] !==  $context['ip']['high'])
1907
+	if ($context['ip']['low'] !== $context['ip']['high'])
1908 1908
 		$context['ip'] = $context['ip']['low'] . ' - ' . $context['ip']['high'];
1909 1909
 	else
1910 1910
 		$context['ip'] = $context['ip']['low'];
Please login to merge, or discard this patch.
Sources/Profile-Modify.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 			);
1257 1257
 			if (empty($value))
1258 1258
 			{
1259
-				$deletes = array('id_theme' => 1 , 'variable' => $row['col_name'], 'id_member' => $memID);
1259
+				$deletes = array('id_theme' => 1, 'variable' => $row['col_name'], 'id_member' => $memID);
1260 1260
 				unset($user_profile[$memID]['options'][$row['col_name']]);
1261 1261
 			}
1262 1262
 			else
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 				array('id_theme', 'variable', 'id_member')
1285 1285
 			);
1286 1286
 		if (!empty($deletes))
1287
-			$smcFunc['db_query']('','
1287
+			$smcFunc['db_query']('', '
1288 1288
 				DELETE FROM {db_prefix}themes
1289 1289
 				WHERE id_theme = {int:id_theme} AND
1290 1290
 						variable = {string:variable} AND
Please login to merge, or discard this patch.
Sources/ManageMaintenance.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2303,7 +2303,7 @@
 block discarded – undo
2303 2303
 	if ($num > 0xFFFF)
2304 2304
 		return $matches[0];
2305 2305
 	else
2306
-		return fixchar__callback ($matches);
2306
+		return fixchar__callback($matches);
2307 2307
 }
2308 2308
 
2309 2309
 ?>
2310 2310
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/Class-Punycode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 }
137 137
                 if ($c === $n) {
138 138
                     $q = $delta;
139
-                    for ($k = static::BASE;; $k += static::BASE) {
139
+                    for ($k = static::BASE; ; $k += static::BASE) {
140 140
                         $t = $this->calculateThreshold($k, $bias);
141 141
                         if ($q < $t) {
142 142
                             break;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $oldi = $i;
225 225
             $w = 1;
226 226
 
227
-            for ($k = static::BASE;; $k += static::BASE) {
227
+            for ($k = static::BASE; ; $k += static::BASE) {
228 228
                 $digit = static::$decodeTable[$input[$pos++]];
229 229
                 $i = $i + ($digit * $w);
230 230
                 $t = $this->calculateThreshold($k, $bias);
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			{
387 387
 				$val = 'CASE ';
388 388
 				foreach ($members as $k => $v)
389
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' ';
389
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' ';
390 390
 				$val = $val . ' END';
391 391
 				$type = 'raw';
392 392
 			}
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			$unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400);
818 818
 		if (empty($unsupportedFormats))
819 819
 		{
820
-			foreach($strftimeFormatSubstitutions as $format => $substitution)
820
+			foreach ($strftimeFormatSubstitutions as $format => $substitution)
821 821
 			{
822 822
 				$value = @strftime('%' . $format);
823 823
 
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1183 1183
 				),
1184 1184
 				'content' => '$1',
1185
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1185
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1186 1186
 				{
1187 1187
 					$returnContext = '';
1188 1188
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 						}
1218 1218
 
1219 1219
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1220
-							$returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '"' . $alt . $title . ' id="thumb_'. $currentAttachment['id']. '" class="atc_img"></a>';
1220
+							$returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '"' . $alt . $title . ' id="thumb_' . $currentAttachment['id'] . '" class="atc_img"></a>';
1221 1221
 						else
1222 1222
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>';
1223 1223
 					}
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 				'type' => 'unparsed_content',
1247 1247
 				'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
1248 1248
 				// @todo Maybe this can be simplified?
1249
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1249
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1250 1250
 				{
1251 1251
 					if (!isset($disabled['code']))
1252 1252
 					{
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
 				'type' => 'unparsed_equals_content',
1284 1284
 				'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> ($2) <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
1285 1285
 				// @todo Maybe this can be simplified?
1286
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1286
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1287 1287
 				{
1288 1288
 					if (!isset($disabled['code']))
1289 1289
 					{
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 				'type' => 'unparsed_content',
1328 1328
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1329 1329
 				// @todo Should this respect guest_hideContacts?
1330
-				'validate' => function (&$tag, &$data, $disabled)
1330
+				'validate' => function(&$tag, &$data, $disabled)
1331 1331
 				{
1332 1332
 					$data = strtr($data, array('<br>' => ''));
1333 1333
 				},
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 				'type' => 'unparsed_commas_content',
1347 1347
 				'test' => '\d+,\d+\]',
1348 1348
 				'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
1349
-				'validate' => function (&$tag, &$data, $disabled)
1349
+				'validate' => function(&$tag, &$data, $disabled)
1350 1350
 				{
1351 1351
 					if (isset($disabled['url']))
1352 1352
 						$tag['content'] = '$1';
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 				'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]',
1363 1363
 				'before' => '<div $1>',
1364 1364
 				'after' => '</div>',
1365
-				'validate' => function (&$tag, &$data, $disabled)
1365
+				'validate' => function(&$tag, &$data, $disabled)
1366 1366
 				{
1367 1367
 					$class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"';
1368 1368
 
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1412 1412
 				),
1413 1413
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1414
-				'validate' => function (&$tag, &$data, $disabled)
1414
+				'validate' => function(&$tag, &$data, $disabled)
1415 1415
 				{
1416 1416
 					global $image_proxy_enabled, $user_info;
1417 1417
 
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 				'tag' => 'img',
1438 1438
 				'type' => 'unparsed_content',
1439 1439
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1440
-				'validate' => function (&$tag, &$data, $disabled)
1440
+				'validate' => function(&$tag, &$data, $disabled)
1441 1441
 				{
1442 1442
 					global $image_proxy_enabled, $user_info;
1443 1443
 
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 				'tag' => 'iurl',
1464 1464
 				'type' => 'unparsed_content',
1465 1465
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1466
-				'validate' => function (&$tag, &$data, $disabled)
1466
+				'validate' => function(&$tag, &$data, $disabled)
1467 1467
 				{
1468 1468
 					$data = strtr($data, array('<br>' => ''));
1469 1469
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 				'quoted' => 'optional',
1478 1478
 				'before' => '<a href="$1" class="bbc_link">',
1479 1479
 				'after' => '</a>',
1480
-				'validate' => function (&$tag, &$data, $disabled)
1480
+				'validate' => function(&$tag, &$data, $disabled)
1481 1481
 				{
1482 1482
 					if (substr($data, 0, 1) == '#')
1483 1483
 						$data = '#post_' . substr($data, 1);
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 				'tag' => 'php',
1564 1564
 				'type' => 'unparsed_content',
1565 1565
 				'content' => '<span class="phpcode">$1</span>',
1566
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1566
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1567 1567
 				{
1568 1568
 					if (!isset($disabled['php']))
1569 1569
 					{
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
 				'test' => '[1-7]\]',
1662 1662
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1663 1663
 				'after' => '</span>',
1664
-				'validate' => function (&$tag, &$data, $disabled)
1664
+				'validate' => function(&$tag, &$data, $disabled)
1665 1665
 				{
1666 1666
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1667 1667
 					$data = $sizes[$data] . 'em';
@@ -1699,7 +1699,7 @@  discard block
 block discarded – undo
1699 1699
 				'tag' => 'time',
1700 1700
 				'type' => 'unparsed_content',
1701 1701
 				'content' => '$1',
1702
-				'validate' => function (&$tag, &$data, $disabled)
1702
+				'validate' => function(&$tag, &$data, $disabled)
1703 1703
 				{
1704 1704
 					if (is_numeric($data))
1705 1705
 						$data = timeformat($data);
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 				'tag' => 'url',
1728 1728
 				'type' => 'unparsed_content',
1729 1729
 				'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>',
1730
-				'validate' => function (&$tag, &$data, $disabled)
1730
+				'validate' => function(&$tag, &$data, $disabled)
1731 1731
 				{
1732 1732
 					$data = strtr($data, array('<br>' => ''));
1733 1733
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1741,7 +1741,7 @@  discard block
 block discarded – undo
1741 1741
 				'quoted' => 'optional',
1742 1742
 				'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">',
1743 1743
 				'after' => '</a>',
1744
-				'validate' => function (&$tag, &$data, $disabled)
1744
+				'validate' => function(&$tag, &$data, $disabled)
1745 1745
 				{
1746 1746
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1747 1747
 					if (empty($scheme))
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 		{
1774 1774
 			if (isset($temp_bbc))
1775 1775
 				$bbc_codes = $temp_bbc;
1776
-			usort($codes, function ($a, $b) {
1776
+			usort($codes, function($a, $b) {
1777 1777
 				return strcmp($a['tag'], $b['tag']);
1778 1778
 			});
1779 1779
 			return $codes;
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 										# a run of Unicode domain name characters and a dot
1990 1990
 										[\p{L}\p{M}\p{N}\-.:@]+\.
1991 1991
 										# and then a TLD valid in the DNS or the reserved "local" TLD
1992
-										(?:'. $modSettings['tld_regex'] .'|local)
1992
+										(?:'. $modSettings['tld_regex'] . '|local)
1993 1993
 									)
1994 1994
 									# followed by a non-domain character or end of line
1995 1995
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -2057,7 +2057,7 @@  discard block
 block discarded – undo
2057 2057
 						)?
2058 2058
 						';
2059 2059
 
2060
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
2060
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
2061 2061
 							$url = array_shift($matches);
2062 2062
 
2063 2063
 							// If this isn't a clean URL, bail out
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
 								$fullUrl = $url;
2083 2083
 
2084 2084
 							// Make sure that $fullUrl really is valid
2085
-							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '' ) . $fullUrl) === false)
2085
+							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '') . $fullUrl) === false)
2086 2086
 								return $url;
2087 2087
 
2088 2088
 							return '[url=&quot;' . str_replace(array('[', ']'), array('&#91;', '&#93;'), $fullUrl) . '&quot;]' . $url . '[/url]';
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 			$look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2));
2147 2147
 
2148 2148
 			// A closing tag that doesn't match any open tags? Skip it.
2149
-			if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags)))
2149
+			if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags)))
2150 2150
 				continue;
2151 2151
 
2152 2152
 			$to_close = array();
@@ -2813,7 +2813,7 @@  discard block
 block discarded – undo
2813 2813
 		for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
2814 2814
 		{
2815 2815
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2816
-			$smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" class="smiley">';
2816
+			$smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" class="smiley">';
2817 2817
 
2818 2818
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2819 2819
 
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 
2831 2831
 	// Replace away!
2832 2832
 	$message = preg_replace_callback($smileyPregSearch,
2833
-		function ($matches) use ($smileyPregReplacements)
2833
+		function($matches) use ($smileyPregReplacements)
2834 2834
 		{
2835 2835
 			return $smileyPregReplacements[$matches[1]];
2836 2836
 		}, $message);
@@ -2927,13 +2927,13 @@  discard block
 block discarded – undo
2927 2927
 	{
2928 2928
 		if (defined('SID') && SID != '')
2929 2929
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
2930
-				function ($m) use ($scripturl)
2930
+				function($m) use ($scripturl)
2931 2931
 				{
2932
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2932
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
2933 2933
 				}, $setLocation);
2934 2934
 		else
2935 2935
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2936
-				function ($m) use ($scripturl)
2936
+				function($m) use ($scripturl)
2937 2937
 				{
2938 2938
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2939 2939
 				}, $setLocation);
@@ -3254,7 +3254,7 @@  discard block
 block discarded – undo
3254 3254
 
3255 3255
 	// Add a generic "Are you sure?" confirmation message.
3256 3256
 	addInlineJavaScript('
3257
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3257
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3258 3258
 
3259 3259
 	// Now add the capping code for avatars.
3260 3260
 	if (!empty($modSettings['avatar_max_width_external']) && !empty($modSettings['avatar_max_height_external']) && !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_css_resize')
@@ -3721,7 +3721,7 @@  discard block
 block discarded – undo
3721 3721
 	if (!empty($normal))
3722 3722
 		foreach ($normal as $nf)
3723 3723
 			echo '
3724
-	<link rel="stylesheet" href="', $nf ,'">';
3724
+	<link rel="stylesheet" href="', $nf, '">';
3725 3725
 
3726 3726
 	if ($db_show_debug === true)
3727 3727
 	{
@@ -3737,7 +3737,7 @@  discard block
 block discarded – undo
3737 3737
 	<style>';
3738 3738
 
3739 3739
 		foreach ($context['css_header'] as $css)
3740
-			echo $css .'
3740
+			echo $css . '
3741 3741
 	';
3742 3742
 
3743 3743
 		echo'
@@ -3781,7 +3781,7 @@  discard block
 block discarded – undo
3781 3781
 
3782 3782
 
3783 3783
 	// No namespaces, sorry!
3784
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3784
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3785 3785
 
3786 3786
 	// Temp path.
3787 3787
 	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
@@ -3961,7 +3961,7 @@  discard block
 block discarded – undo
3961 3961
 	else
3962 3962
 		$path = $modSettings['attachmentUploadDir'];
3963 3963
 
3964
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
3964
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
3965 3965
 }
3966 3966
 
3967 3967
 /**
@@ -4005,10 +4005,10 @@  discard block
 block discarded – undo
4005 4005
 		$valid_low = isValidIP($ip_parts[0]);
4006 4006
 		$valid_high = isValidIP($ip_parts[1]);
4007 4007
 		$count = 0;
4008
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
4008
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
4009 4009
 		$max = ($mode == ':' ? 'ffff' : '255');
4010 4010
 		$min = 0;
4011
-		if(!$valid_low)
4011
+		if (!$valid_low)
4012 4012
 		{
4013 4013
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
4014 4014
 			$valid_low = isValidIP($ip_parts[0]);
@@ -4022,7 +4022,7 @@  discard block
 block discarded – undo
4022 4022
 		}
4023 4023
 
4024 4024
 		$count = 0;
4025
-		if(!$valid_high)
4025
+		if (!$valid_high)
4026 4026
 		{
4027 4027
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
4028 4028
 			$valid_high = isValidIP($ip_parts[1]);
@@ -4035,7 +4035,7 @@  discard block
 block discarded – undo
4035 4035
 			}
4036 4036
 		}
4037 4037
 
4038
-		if($valid_high && $valid_low)
4038
+		if ($valid_high && $valid_low)
4039 4039
 		{
4040 4040
 			$ip_array['low'] = $ip_parts[0];
4041 4041
 			$ip_array['high'] = $ip_parts[1];
@@ -4217,7 +4217,7 @@  discard block
 block discarded – undo
4217 4217
 		addInlineJavaScript('
4218 4218
 	var user_menus = new smc_PopupMenu();
4219 4219
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
4220
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
4220
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
4221 4221
 		if ($context['allow_pm'])
4222 4222
 			addInlineJavaScript('
4223 4223
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4853,7 +4853,7 @@  discard block
 block discarded – undo
4853 4853
 		// No? try a fallback to $sourcedir
4854 4854
 		else
4855 4855
 		{
4856
-			$absPath = $sourcedir .'/'. $file;
4856
+			$absPath = $sourcedir . '/' . $file;
4857 4857
 
4858 4858
 			if (file_exists($absPath))
4859 4859
 				require_once($absPath);
@@ -5120,15 +5120,15 @@  discard block
 block discarded – undo
5120 5120
 
5121 5121
 	// UTF-8 occurences of MS special characters
5122 5122
 	$findchars_utf8 = array(
5123
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5124
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5125
-		"\xe2\x80\xa6",	// horizontal ellipsis
5126
-		"\xe2\x80\x98",	// left single curly quote
5127
-		"\xe2\x80\x99",	// right single curly quote
5128
-		"\xe2\x80\x9c",	// left double curly quote
5129
-		"\xe2\x80\x9d",	// right double curly quote
5130
-		"\xe2\x80\x93",	// en dash
5131
-		"\xe2\x80\x94",	// em dash
5123
+		"\xe2\x80\x9a", // single low-9 quotation mark
5124
+		"\xe2\x80\x9e", // double low-9 quotation mark
5125
+		"\xe2\x80\xa6", // horizontal ellipsis
5126
+		"\xe2\x80\x98", // left single curly quote
5127
+		"\xe2\x80\x99", // right single curly quote
5128
+		"\xe2\x80\x9c", // left double curly quote
5129
+		"\xe2\x80\x9d", // right double curly quote
5130
+		"\xe2\x80\x93", // en dash
5131
+		"\xe2\x80\x94", // em dash
5132 5132
 	);
5133 5133
 
5134 5134
 	// windows 1252 / iso equivalents
@@ -5146,15 +5146,15 @@  discard block
 block discarded – undo
5146 5146
 
5147 5147
 	// safe replacements
5148 5148
 	$replacechars = array(
5149
-		',',	// &sbquo;
5150
-		',,',	// &bdquo;
5151
-		'...',	// &hellip;
5152
-		"'",	// &lsquo;
5153
-		"'",	// &rsquo;
5154
-		'"',	// &ldquo;
5155
-		'"',	// &rdquo;
5156
-		'-',	// &ndash;
5157
-		'--',	// &mdash;
5149
+		',', // &sbquo;
5150
+		',,', // &bdquo;
5151
+		'...', // &hellip;
5152
+		"'", // &lsquo;
5153
+		"'", // &rsquo;
5154
+		'"', // &ldquo;
5155
+		'"', // &rdquo;
5156
+		'-', // &ndash;
5157
+		'--', // &mdash;
5158 5158
 	);
5159 5159
 
5160 5160
 	if ($context['utf8'])
@@ -5572,7 +5572,7 @@  discard block
 block discarded – undo
5572 5572
  */
5573 5573
 function inet_dtop($bin)
5574 5574
 {
5575
-	if(empty($bin))
5575
+	if (empty($bin))
5576 5576
 		return '';
5577 5577
 
5578 5578
 	global $db_type;
@@ -5603,28 +5603,28 @@  discard block
 block discarded – undo
5603 5603
  */
5604 5604
 function _safe_serialize($value)
5605 5605
 {
5606
-	if(is_null($value))
5606
+	if (is_null($value))
5607 5607
 		return 'N;';
5608 5608
 
5609
-	if(is_bool($value))
5610
-		return 'b:'. (int) $value .';';
5609
+	if (is_bool($value))
5610
+		return 'b:' . (int) $value . ';';
5611 5611
 
5612
-	if(is_int($value))
5613
-		return 'i:'. $value .';';
5612
+	if (is_int($value))
5613
+		return 'i:' . $value . ';';
5614 5614
 
5615
-	if(is_float($value))
5616
-		return 'd:'. str_replace(',', '.', $value) .';';
5615
+	if (is_float($value))
5616
+		return 'd:' . str_replace(',', '.', $value) . ';';
5617 5617
 
5618
-	if(is_string($value))
5619
-		return 's:'. strlen($value) .':"'. $value .'";';
5618
+	if (is_string($value))
5619
+		return 's:' . strlen($value) . ':"' . $value . '";';
5620 5620
 
5621
-	if(is_array($value))
5621
+	if (is_array($value))
5622 5622
 	{
5623 5623
 		$out = '';
5624
-		foreach($value as $k => $v)
5624
+		foreach ($value as $k => $v)
5625 5625
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5626 5626
 
5627
-		return 'a:'. count($value) .':{'. $out .'}';
5627
+		return 'a:' . count($value) . ':{' . $out . '}';
5628 5628
 	}
5629 5629
 
5630 5630
 	// safe_serialize cannot serialize resources or objects.
@@ -5666,7 +5666,7 @@  discard block
 block discarded – undo
5666 5666
 function _safe_unserialize($str)
5667 5667
 {
5668 5668
 	// Input  is not a string.
5669
-	if(empty($str) || !is_string($str))
5669
+	if (empty($str) || !is_string($str))
5670 5670
 		return false;
5671 5671
 
5672 5672
 	$stack = array();
@@ -5680,40 +5680,40 @@  discard block
 block discarded – undo
5680 5680
 	 *   3 - in array, expecting value or another array
5681 5681
 	 */
5682 5682
 	$state = 0;
5683
-	while($state != 1)
5683
+	while ($state != 1)
5684 5684
 	{
5685 5685
 		$type = isset($str[0]) ? $str[0] : '';
5686
-		if($type == '}')
5686
+		if ($type == '}')
5687 5687
 			$str = substr($str, 1);
5688 5688
 
5689
-		else if($type == 'N' && $str[1] == ';')
5689
+		else if ($type == 'N' && $str[1] == ';')
5690 5690
 		{
5691 5691
 			$value = null;
5692 5692
 			$str = substr($str, 2);
5693 5693
 		}
5694
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5694
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5695 5695
 		{
5696 5696
 			$value = $matches[1] == '1' ? true : false;
5697 5697
 			$str = substr($str, 4);
5698 5698
 		}
5699
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5699
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5700 5700
 		{
5701
-			$value = (int)$matches[1];
5701
+			$value = (int) $matches[1];
5702 5702
 			$str = $matches[2];
5703 5703
 		}
5704
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5704
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5705 5705
 		{
5706
-			$value = (float)$matches[1];
5706
+			$value = (float) $matches[1];
5707 5707
 			$str = $matches[3];
5708 5708
 		}
5709
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5709
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5710 5710
 		{
5711
-			$value = substr($matches[2], 0, (int)$matches[1]);
5712
-			$str = substr($matches[2], (int)$matches[1] + 2);
5711
+			$value = substr($matches[2], 0, (int) $matches[1]);
5712
+			$str = substr($matches[2], (int) $matches[1] + 2);
5713 5713
 		}
5714
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5714
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5715 5715
 		{
5716
-			$expectedLength = (int)$matches[1];
5716
+			$expectedLength = (int) $matches[1];
5717 5717
 			$str = $matches[2];
5718 5718
 		}
5719 5719
 
@@ -5721,10 +5721,10 @@  discard block
 block discarded – undo
5721 5721
 		else
5722 5722
 			return false;
5723 5723
 
5724
-		switch($state)
5724
+		switch ($state)
5725 5725
 		{
5726 5726
 			case 3: // In array, expecting value or another array.
5727
-				if($type == 'a')
5727
+				if ($type == 'a')
5728 5728
 				{
5729 5729
 					$stack[] = &$list;
5730 5730
 					$list[$key] = array();
@@ -5733,7 +5733,7 @@  discard block
 block discarded – undo
5733 5733
 					$state = 2;
5734 5734
 					break;
5735 5735
 				}
5736
-				if($type != '}')
5736
+				if ($type != '}')
5737 5737
 				{
5738 5738
 					$list[$key] = $value;
5739 5739
 					$state = 2;
@@ -5744,29 +5744,29 @@  discard block
 block discarded – undo
5744 5744
 				return false;
5745 5745
 
5746 5746
 			case 2: // in array, expecting end of array or a key
5747
-				if($type == '}')
5747
+				if ($type == '}')
5748 5748
 				{
5749 5749
 					// Array size is less than expected.
5750
-					if(count($list) < end($expected))
5750
+					if (count($list) < end($expected))
5751 5751
 						return false;
5752 5752
 
5753 5753
 					unset($list);
5754
-					$list = &$stack[count($stack)-1];
5754
+					$list = &$stack[count($stack) - 1];
5755 5755
 					array_pop($stack);
5756 5756
 
5757 5757
 					// Go to terminal state if we're at the end of the root array.
5758 5758
 					array_pop($expected);
5759 5759
 
5760
-					if(count($expected) == 0)
5760
+					if (count($expected) == 0)
5761 5761
 						$state = 1;
5762 5762
 
5763 5763
 					break;
5764 5764
 				}
5765 5765
 
5766
-				if($type == 'i' || $type == 's')
5766
+				if ($type == 'i' || $type == 's')
5767 5767
 				{
5768 5768
 					// Array size exceeds expected length.
5769
-					if(count($list) >= end($expected))
5769
+					if (count($list) >= end($expected))
5770 5770
 						return false;
5771 5771
 
5772 5772
 					$key = $value;
@@ -5779,7 +5779,7 @@  discard block
 block discarded – undo
5779 5779
 
5780 5780
 			// Expecting array or value.
5781 5781
 			case 0:
5782
-				if($type == 'a')
5782
+				if ($type == 'a')
5783 5783
 				{
5784 5784
 					$data = array();
5785 5785
 					$list = &$data;
@@ -5788,7 +5788,7 @@  discard block
 block discarded – undo
5788 5788
 					break;
5789 5789
 				}
5790 5790
 
5791
-				if($type != '}')
5791
+				if ($type != '}')
5792 5792
 				{
5793 5793
 					$data = $value;
5794 5794
 					$state = 1;
@@ -5801,7 +5801,7 @@  discard block
 block discarded – undo
5801 5801
 	}
5802 5802
 
5803 5803
 	// Trailing data in input.
5804
-	if(!empty($str))
5804
+	if (!empty($str))
5805 5805
 		return false;
5806 5806
 
5807 5807
 	return $data;
@@ -5855,7 +5855,7 @@  discard block
 block discarded – undo
5855 5855
 	// Set different modes.
5856 5856
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5857 5857
 
5858
-	foreach($chmodValues as $val)
5858
+	foreach ($chmodValues as $val)
5859 5859
 	{
5860 5860
 		// If it's writable, break out of the loop.
5861 5861
 		if (is_writable($file))
@@ -5890,13 +5890,13 @@  discard block
 block discarded – undo
5890 5890
 	$returnArray = @json_decode($json, $returnAsArray);
5891 5891
 
5892 5892
 	// PHP 5.3 so no json_last_error_msg()
5893
-	switch(json_last_error())
5893
+	switch (json_last_error())
5894 5894
 	{
5895 5895
 		case JSON_ERROR_NONE:
5896 5896
 			$jsonError = false;
5897 5897
 			break;
5898 5898
 		case JSON_ERROR_DEPTH:
5899
-			$jsonError =  'JSON_ERROR_DEPTH';
5899
+			$jsonError = 'JSON_ERROR_DEPTH';
5900 5900
 			break;
5901 5901
 		case JSON_ERROR_STATE_MISMATCH:
5902 5902
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5924,10 +5924,10 @@  discard block
 block discarded – undo
5924 5924
 		loadLanguage('Errors');
5925 5925
 
5926 5926
 		if (!empty($jsonDebug))
5927
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5927
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5928 5928
 
5929 5929
 		else
5930
-			log_error($txt['json_'. $jsonError], 'critical');
5930
+			log_error($txt['json_' . $jsonError], 'critical');
5931 5931
 
5932 5932
 		// Everyone expects an array.
5933 5933
 		return array();
@@ -6044,7 +6044,7 @@  discard block
 block discarded – undo
6044 6044
 		// Convert Punycode to Unicode
6045 6045
 		require_once($sourcedir . '/Class-Punycode.php');
6046 6046
 		$Punycode = new Punycode();
6047
-		$tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
6047
+		$tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
6048 6048
 	}
6049 6049
 	// Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update
6050 6050
 	else
@@ -6138,7 +6138,7 @@  discard block
 block discarded – undo
6138 6138
 	}
6139 6139
 
6140 6140
 	// This recursive function creates the index array from the strings
6141
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6141
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6142 6142
 	{
6143 6143
 		static $depth = 0;
6144 6144
 		$depth++;
@@ -6165,7 +6165,7 @@  discard block
 block discarded – undo
6165 6165
 	};
6166 6166
 
6167 6167
 	// This recursive function turns the index array into a regular expression
6168
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
6168
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
6169 6169
 	{
6170 6170
 		static $depth = 0;
6171 6171
 		$depth++;
@@ -6189,11 +6189,11 @@  discard block
 block discarded – undo
6189 6189
 
6190 6190
 				if (count(array_keys($value)) == 1)
6191 6191
 				{
6192
-					$new_key_array = explode('(?'.'>', $sub_regex);
6192
+					$new_key_array = explode('(?' . '>', $sub_regex);
6193 6193
 					$new_key .= $new_key_array[0];
6194 6194
 				}
6195 6195
 				else
6196
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
6196
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
6197 6197
 			}
6198 6198
 
6199 6199
 			if ($depth > 1)
@@ -6236,10 +6236,10 @@  discard block
 block discarded – undo
6236 6236
 	{
6237 6237
 		$regex = array();
6238 6238
 		while (!empty($index))
6239
-			$regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6239
+			$regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6240 6240
 	}
6241 6241
 	else
6242
-		$regex = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6242
+		$regex = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6243 6243
 
6244 6244
 	// Restore PHP's internal character encoding to whatever it was originally
6245 6245
 	if (!empty($current_encoding))
@@ -6461,7 +6461,7 @@  discard block
 block discarded – undo
6461 6461
 function sanitize_iri($iri)
6462 6462
 {
6463 6463
 	// Encode any non-ASCII characters (but not space or control characters of any sort)
6464
-	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) {
6464
+	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) {
6465 6465
 		return rawurlencode($matches[0]);
6466 6466
 	}, $iri);
6467 6467
 
@@ -6503,7 +6503,7 @@  discard block
 block discarded – undo
6503 6503
 	$unescaped = array(
6504 6504
 		'%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&',
6505 6505
 		'%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*',
6506
-		'%2B'=>'+', '%2C'=>',',	'%2F'=>'/', '%3A'=>':',
6506
+		'%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':',
6507 6507
 		'%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@',
6508 6508
 	);
6509 6509
 	$iri = strtr(rawurlencode($iri), $unescaped);
Please login to merge, or discard this patch.