Passed
Pull Request — release-2.1 (#5093)
by 01
05:12
created
Sources/MessageIndex.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				' . (empty($sort_methods_table[$context['sort_by']]) ? '' : $sort_methods_table[$context['sort_by']]) . '
325 325
 				WHERE t.id_board = {int:current_board} '
326 326
 				. (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
327
-					AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') .'
327
+					AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
328 328
 				ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
329 329
 				LIMIT {int:maxindex}
330 330
 					OFFSET {int:start} ';
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 		SELECT
334 334
 			t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
335 335
 			' . ($user_info['is_guest'] ? '0' : 'COALESCE(lt.id_msg, COALESCE(lmr.id_msg, -1)) + 1') . ' AS new_from,
336
-			' . ( $enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in,
336
+			' . ($enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in,
337 337
 			'	: '') . '
338 338
 			t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time, t.id_redirect_topic,
339 339
 			ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})') . '
358 358
 			' . (!empty($message_index_tables) ? implode("\n\t\t\t\t", $message_index_tables) : '') . '
359 359
 			' . (!empty($message_index_wheres) ? ' WHERE ' . implode("\n\t\t\t\tAND ", $message_index_wheres) : '') . '
360
-		ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') ,
360
+		ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC'),
361 361
 		$message_index_parameters
362 362
 	);
363 363
 
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
 				foreach ($message['custom_fields']['above_member'] as $custom)
232 232
 					echo '
233
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
233
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
234 234
 
235 235
 				echo '
236 236
 						</ul>
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			if (!empty($message['custom_fields']['below_avatar']))
280 280
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
281 281
 					echo '
282
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
282
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
283 283
 
284 284
 			if (!$message['member']['is_guest'])
285 285
 				echo '
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 					foreach ($message['custom_fields']['icons'] as $custom)
323 323
 						echo '
324
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
324
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
325 325
 
326 326
 					echo '
327 327
 							</ol>
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 				if (!empty($message['custom_fields']['standard']))
386 386
 					foreach ($message['custom_fields']['standard'] as $custom)
387 387
 						echo '
388
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
388
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
389 389
 
390 390
 				// Are we showing the warning status?
391 391
 				if ($message['member']['can_see_warning'])
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 				if (!empty($message['custom_fields']['bottom_poster']))
397 397
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
398 398
 						echo '
399
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
399
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
400 400
 			}
401 401
 
402 402
 			// Done with the information about the poster... on to the post itself.
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 
498 498
 				foreach ($message['custom_fields']['above_signature'] as $custom)
499 499
 					echo '
500
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
500
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
501 501
 
502 502
 				echo '
503 503
 							</ul>
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
 				foreach ($message['custom_fields']['below_signature'] as $custom)
522 522
 					echo '
523
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
523
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
524 524
 
525 525
 				echo '
526 526
 							</ul>
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 	while ($message = $context['get_pmessage']('subject'))
657 657
 	{
658 658
 		echo '
659
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
659
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
660 660
 				<td class="table_icon pm_icon">
661 661
 					<script>
662 662
 						currentLabels[', $message['id'], '] = {';
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 				<td class="pm_time">', $message['time'], '</td>
681 681
 				<td class="pm_subject">
682 682
 					', ($context['display_mode'] != 0 && $context['current_pm'] == $message['id'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt="*">' : ''), '<a href="', ($context['display_mode'] == 0 || $context['current_pm'] == $message['id'] ? '' : ($scripturl . '?action=pm;pmid=' . $message['id'] . ';kstart;f=' . $context['folder'] . ';start=' . $context['start'] . ';sort=' . $context['sort_by'] . ($context['sort_direction'] == 'up' ? ';' : ';desc') . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''))), '#msg', $message['id'], '">', $message['subject'], $message['is_unread'] ? '&nbsp;<span class="new_posts">' . $txt['new'] . '</span>' : '', '</a>
683
-					<span class="pm_inline_time"><span class="generic_icons ', ($context['from_or_to']=='to' && count($message['recipients']['to'])>1) ? 'people' : 'members', '"></span> ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '  <span class="generic_icons time_online"></span> ', $message['time'], '</span>
683
+					<span class="pm_inline_time"><span class="generic_icons ', ($context['from_or_to'] == 'to' && count($message['recipients']['to']) > 1) ? 'people' : 'members', '"></span> ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '  <span class="generic_icons time_online"></span> ', $message['time'], '</span>
684 684
 				</td>
685 685
 				<td class="pm_from_to">
686 686
 					', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '
@@ -957,13 +957,13 @@  discard block
 block discarded – undo
957 957
 				// You can only reply if they are not a guest...
958 958
 				if (!$message['member']['is_guest'])
959 959
 					echo '
960
-					<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'], '
961
-					<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'];
960
+					<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'], '
961
+					<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'];
962 962
 
963 963
 				// This is for "forwarding" - even if the member is gone.
964 964
 				else
965 965
 					echo '
966
-					<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'];
966
+					<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'];
967 967
 			}
968 968
 
969 969
 			echo '
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '', empty($context['post_error']['messages']) ? ' hidden' : '', '" id="errors">
1064 1064
 					<dl>
1065 1065
 						<dt>
1066
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1066
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1067 1067
 						</dt>
1068 1068
 						<dd class="error" id="error_list">
1069 1069
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1120 1120
 					</dt>
1121 1121
 					<dd id="pm_subject">
1122
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1122
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1123 1123
 					</dd>
1124 1124
 				</dl>';
1125 1125
 
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
 		echo '
1473 1473
 		<div class="block righttext">
1474 1474
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1475
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1475
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1476 1476
 		</div>';
1477 1477
 
1478 1478
 	echo '
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 	if (!empty($context['rules']))
1637 1637
 		echo '
1638 1638
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1639
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1639
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1640 1640
 
1641 1641
 	echo '
1642 1642
 		</div>
@@ -1879,9 +1879,9 @@  discard block
 block discarded – undo
1879 1879
 
1880 1880
 		echo '
1881 1881
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1882
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1883
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1884
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1882
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1883
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1884
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1885 1885
 				</select>
1886 1886
 				<span id="labdiv', $k, '">
1887 1887
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1993,7 +1993,7 @@  discard block
 block discarded – undo
1993 1993
 			</div>
1994 1994
 			<ul class="quickbuttons">
1995 1995
 				<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>
1996
-				<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>
1996
+				<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>
1997 1997
 			</ul>
1998 1998
 		</div><!-- .windowbg -->';
1999 1999
 		}
Please login to merge, or discard this patch.
Sources/ManageLanguages.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 			'editlang' => array(
593 593
 				'header' => array(
594 594
 					'value' => '',
595
-				),'data' => array(
595
+				), 'data' => array(
596 596
 					'function' => function($rowData) use ($scripturl, $txt)
597 597
 					{
598 598
 						return sprintf('<a href="%1$s?action=admin;area=languages;sa=editlang;lid=%2$s" class="button">%3$s</a>', $scripturl, $rowData['id'], $txt['edit']);
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 					// Now create the string!
1270 1270
 					$final_saves[$entryKey] = array(
1271 1271
 						'find' => $entryValue['full'],
1272
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'],
1272
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'],
1273 1273
 					);
1274 1274
 				}
1275 1275
 			}
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 					// And save it
1292 1292
 					$final_saves[$entryKey] = array(
1293 1293
 						'find' => $entryValue['full'],
1294
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'],
1294
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'],
1295 1295
 					);
1296 1296
 				}
1297 1297
 
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 					$entryValue['entry'] = '\'\'';
1302 1302
 					$final_saves[$entryKey] = array(
1303 1303
 						'find' => $entryValue['full'],
1304
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n",
1304
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n",
1305 1305
 					);
1306 1306
 				}
1307 1307
 
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 					// And we know what to save now!
1330 1330
 					$final_saves[$entryKey] = array(
1331 1331
 						'find' => $entryValue['full'],
1332
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'],
1332
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'],
1333 1333
 					);
1334 1334
 				}
1335 1335
 				// Remove this entry only if it is allowed
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 					$entryValue['entry'] = '\'\'';
1339 1339
 					$final_saves[$entryKey] = array(
1340 1340
 						'find' => $entryValue['full'],
1341
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n",
1341
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n",
1342 1342
 					);
1343 1343
 				}
1344 1344
 
@@ -1369,8 +1369,8 @@  discard block
 block discarded – undo
1369 1369
 						continue;
1370 1370
 
1371 1371
 					$final_saves[$string_key] = array(
1372
-						'find' => "\s*\?".'>$',
1373
-						'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?".'>',
1372
+						'find' => "\s*\?" . '>$',
1373
+						'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?" . '>',
1374 1374
 						'is_regex' => true,
1375 1375
 					);
1376 1376
 				}
@@ -1387,8 +1387,8 @@  discard block
 block discarded – undo
1387 1387
 						$subKey = ctype_digit(trim($substring_key, '\'')) ? trim($substring_key, '\'') : '\'' . $substring_key . '\'';
1388 1388
 
1389 1389
 						$final_saves[$string_key . '[' . $substring_key . ']'] = array(
1390
-							'find' => "\s*\?".'>$',
1391
-							'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?".'>',
1390
+							'find' => "\s*\?" . '>$',
1391
+							'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?" . '>',
1392 1392
 							'is_regex' => true,
1393 1393
 						);
1394 1394
 					}
Please login to merge, or discard this patch.
Sources/Subs-Editor.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 		$lastlen = strlen($text = preg_replace($backToBackPattern, '', $text));
1113 1113
 
1114 1114
 	// Need to sort the tags by name length.
1115
-	uksort($valid_tags, function ($a, $b) {
1115
+	uksort($valid_tags, function($a, $b) {
1116 1116
 		return strlen($a) < strlen($b) ? 1 : -1;
1117 1117
 	});
1118 1118
 
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
 		}
1981 1981
 
1982 1982
 		// Set proper extensions; do this post caching so cache doesn't become extension-specific
1983
-		array_walk_recursive($context['smileys'], function (&$filename, $key)
1983
+		array_walk_recursive($context['smileys'], function(&$filename, $key)
1984 1984
 			{
1985 1985
 				global $context, $user_info, $modSettings;
1986 1986
 				if ($key == 'filename')
Please login to merge, or discard this patch.
Braces   +3 added lines, -5 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.
@@ -1112,7 +1109,8 @@  discard block
 block discarded – undo
1112 1109
 		$lastlen = strlen($text = preg_replace($backToBackPattern, '', $text));
1113 1110
 
1114 1111
 	// Need to sort the tags by name length.
1115
-	uksort($valid_tags, function ($a, $b) {
1112
+	uksort($valid_tags, function ($a, $b)
1113
+	{
1116 1114
 		return strlen($a) < strlen($b) ? 1 : -1;
1117 1115
 	});
1118 1116
 
@@ -1980,7 +1978,7 @@  discard block
 block discarded – undo
1980 1978
 
1981 1979
 		// Set proper extensions; do this post caching so cache doesn't become extension-specific
1982 1980
 		array_walk_recursive($context['smileys'], function (&$filename, $key)
1983
-			{
1981
+		{
1984 1982
 				global $context, $user_info, $modSettings;
1985 1983
 				if ($key == 'filename')
1986 1984
 					// Need to use the default if user selection is disabled
Please login to merge, or discard this patch.
Sources/ManageMembers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			// INET.
356 356
 			elseif ($param_info['type'] == 'inet')
357 357
 			{
358
-				if(count($search_params[$param_name]) === 1)
358
+				if (count($search_params[$param_name]) === 1)
359 359
 				{
360 360
 					$query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})';
361 361
 					$where_params[$param_name] = $search_params[$param_name][0];
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
 				elseif (count($search_params[$param_name]) === 2)
364 364
 				{
365 365
 					$query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})';
366
-					$where_params[$param_name.'_low'] = $search_params[$param_name]['low'];
367
-					$where_params[$param_name.'_high'] = $search_params[$param_name]['high'];
366
+					$where_params[$param_name . '_low'] = $search_params[$param_name]['low'];
367
+					$where_params[$param_name . '_high'] = $search_params[$param_name]['high'];
368 368
 				}
369 369
 				
370 370
 			}
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 	if (!empty($context['show_filter']) && !empty($context['available_filters']))
1013 1013
 		$listOptions['additional_rows'][] = array(
1014 1014
 			'position' => 'above_column_headers',
1015
-			'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_'.$context['current_filter']])) ? $txt['admin_browse_filter_type_'.$context['current_filter']] : $context['available_filters'][0]['desc']),
1015
+			'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_' . $context['current_filter']])) ? $txt['admin_browse_filter_type_' . $context['current_filter']] : $context['available_filters'][0]['desc']),
1016 1016
 			'class' => 'filter_row generic_list_wrapper smalltext',
1017 1017
 		);
1018 1018
 
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	$smcFunc['db_free_result']($result_boards);
136 136
 
137 137
 	// Run through the categories and boards (or only boards)....
138
-	for (reset($row_boards); key($row_boards)!==null; next($row_boards))
138
+	for (reset($row_boards); key($row_boards) !== null; next($row_boards))
139 139
 	{
140 140
 		$row_board = current($row_boards);
141 141
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 					$row_boards[$row_board['id_parent']]['id_msg'] = $row_board['id_msg'];
304 304
 					$row_boards[$row_board['id_parent']]['subject'] = $row_board['subject'];
305 305
 					$row_boards[$row_board['id_parent']]['poster_time'] = $row_board['poster_time'];
306
-					$row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : '') ;
306
+					$row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : '');
307 307
 					$row_boards[$row_board['id_parent']]['poster_name'] = $row_board['poster_name'];
308 308
 					$row_boards[$row_board['id_parent']]['real_name'] = $row_board['real_name'];
309 309
 					$row_boards[$row_board['id_parent']]['id_member'] = $row_board['id_member'];
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
 		// Set the last post in the root board 
370 370
 		if (!$isChild && !empty($row_board['poster_time'])
371
-			&& ( empty($this_category[$row_board['id_board']]['last_post']['timestamp'])
371
+			&& (empty($this_category[$row_board['id_board']]['last_post']['timestamp'])
372 372
 				|| $this_category[$row_board['id_board']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time'])
373 373
 				)
374 374
 			)
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	if ($boardIndexOptions['include_categories'])
399 399
 		foreach ($categories as &$category)
400 400
 		{
401
-			foreach ($category['boards'] as &$board )
401
+			foreach ($category['boards'] as &$board)
402 402
 			{
403 403
 				if (!empty($moderators[$board['id']]))
404 404
 				{
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			}
421 421
 		}
422 422
 	else
423
-		foreach ($this_category as &$board )
423
+		foreach ($this_category as &$board)
424 424
 		{
425 425
 			if (!empty($moderators[$board['id']]))
426 426
 			{
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 				$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']);
442 442
 		}
443 443
 
444
-	unset($category,$board);
444
+	unset($category, $board);
445 445
 
446 446
 	if ($boardIndexOptions['include_categories'])
447 447
 		sortCategories($categories);
Please login to merge, or discard this 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.
ssi_examples.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,9 @@
 block discarded – undo
89 89
 						<li><a href="#" onclick="showSSIBlock('ssi_quickSearch'); return false;">Quick Search Box</a></li>
90 90
 						<li><a href="#" onclick="showSSIBlock('ssi_recentAttachments'); return false;">Recent Attachments</a></li>
91 91
 					</ul>
92
-					<?php if ($user_info['is_admin']) { ?>
92
+					<?php if ($user_info['is_admin'])
93
+{
94
+?>
93 95
 					<h3>Advanced Functions <img class="help" title="Functions that require additional tweaking, not just copy and paste." src="<?php echo $settings['images_url']; ?>/helptopics.png" alt=""></h3>
94 96
 					<ul>
95 97
 						<li><a href="#" onclick="showSSIBlock('ssi_showPoll'); return false;">Show Single Poll</a></li>
Please login to merge, or discard this patch.
Sources/Subs-Admin.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	{
42 42
 		if (class_exists('Imagick'))
43 43
 		{
44
-			$temp = New Imagick;
44
+			$temp = new Imagick;
45 45
 			$temp2 = $temp->getVersion();
46 46
 			$im_version = $temp2['versionString'];
47 47
 			$extension_version = 'Imagick ' . phpversion('Imagick');
Please login to merge, or discard this patch.
Sources/Subs-Password.php 1 patch
Braces   +93 added lines, -45 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 namespace {
20 20
 
21
-	if (!defined('PASSWORD_DEFAULT')) {
21
+	if (!defined('PASSWORD_DEFAULT'))
22
+	{
22 23
 
23 24
 		define('PASSWORD_BCRYPT', 1);
24 25
 		define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
@@ -34,29 +35,37 @@  discard block
 block discarded – undo
34 35
 		 *
35 36
 		 * @return string|false The hashed password, or false on error.
36 37
 		 */
37
-		function password_hash($password, $algo, array $options = array()) {
38
-			if (!function_exists('crypt')) {
38
+		function password_hash($password, $algo, array $options = array())
39
+		{
40
+			if (!function_exists('crypt'))
41
+			{
39 42
 				trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING);
40 43
 				return null;
41 44
 			}
42
-			if (!is_string($password)) {
45
+			if (!is_string($password))
46
+			{
43 47
 				trigger_error("password_hash(): Password must be a string", E_USER_WARNING);
44 48
 				return null;
45 49
 			}
46
-			if (!is_int($algo)) {
50
+			if (!is_int($algo))
51
+			{
47 52
 				trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING);
48 53
 				return null;
49 54
 			}
50
-			if (PasswordCompat\binary\_strlen($password) > 72) {
55
+			if (PasswordCompat\binary\_strlen($password) > 72)
56
+			{
51 57
 				$password = PasswordCompat\binary\_substr($password, 0, 72);
52 58
 			}
53
-			switch ($algo) {
59
+			switch ($algo)
60
+			{
54 61
 				case PASSWORD_BCRYPT:
55 62
 					// Note that this is a C constant, but not exposed to PHP, so we don't define it here.
56 63
 					$cost = 10;
57
-					if (isset($options['cost'])) {
64
+					if (isset($options['cost']))
65
+					{
58 66
 						$cost = $options['cost'];
59
-						if ($cost < 4 || $cost > 31) {
67
+						if ($cost < 4 || $cost > 31)
68
+						{
60 69
 							trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
61 70
 							return null;
62 71
 						}
@@ -74,8 +83,10 @@  discard block
 block discarded – undo
74 83
 					return null;
75 84
 			}
76 85
 			$salt_requires_encoding = false;
77
-			if (isset($options['salt'])) {
78
-				switch (gettype($options['salt'])) {
86
+			if (isset($options['salt']))
87
+			{
88
+				switch (gettype($options['salt']))
89
+				{
79 90
 					case 'NULL':
80 91
 					case 'boolean':
81 92
 					case 'integer':
@@ -84,7 +95,8 @@  discard block
 block discarded – undo
84 95
 						$salt = (string) $options['salt'];
85 96
 						break;
86 97
 					case 'object':
87
-						if (method_exists($options['salt'], '__tostring')) {
98
+						if (method_exists($options['salt'], '__tostring'))
99
+						{
88 100
 							$salt = (string) $options['salt'];
89 101
 							break;
90 102
 						}
@@ -94,51 +106,70 @@  discard block
 block discarded – undo
94 106
 						trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
95 107
 						return null;
96 108
 				}
97
-				if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
109
+				if (PasswordCompat\binary\_strlen($salt) < $required_salt_len)
110
+				{
98 111
 					trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
99 112
 					return null;
100
-				} elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {
113
+				}
114
+				elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt))
115
+				{
101 116
 					$salt_requires_encoding = true;
102 117
 				}
103
-			} else {
118
+			}
119
+			else
120
+			{
104 121
 				$buffer = '';
105 122
 				$buffer_valid = false;
106
-				if (function_exists('random_bytes')) {
123
+				if (function_exists('random_bytes'))
124
+				{
107 125
 					$buffer = random_bytes($raw_salt_len);
108
-					if ($buffer) {
126
+					if ($buffer)
127
+					{
109 128
 						$buffer_valid = true;
110 129
 					}
111 130
 				}
112
-				if (!$buffer_valid && function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {
131
+				if (!$buffer_valid && function_exists('mcrypt_create_iv') && !defined('PHALANGER'))
132
+				{
113 133
 					$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);
114
-					if ($buffer) {
134
+					if ($buffer)
135
+					{
115 136
 						$buffer_valid = true;
116 137
 					}
117 138
 				}
118
-				if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {
139
+				if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes'))
140
+				{
119 141
 					$buffer = openssl_random_pseudo_bytes($raw_salt_len);
120
-					if ($buffer) {
142
+					if ($buffer)
143
+					{
121 144
 						$buffer_valid = true;
122 145
 					}
123 146
 				}
124
-				if (!$buffer_valid && @is_readable('/dev/urandom')) {
147
+				if (!$buffer_valid && @is_readable('/dev/urandom'))
148
+				{
125 149
 					$f = fopen('/dev/urandom', 'r');
126 150
 					$read = PasswordCompat\binary\_strlen($buffer);
127
-					while ($read < $raw_salt_len) {
151
+					while ($read < $raw_salt_len)
152
+					{
128 153
 						$buffer .= fread($f, $raw_salt_len - $read);
129 154
 						$read = PasswordCompat\binary\_strlen($buffer);
130 155
 					}
131 156
 					fclose($f);
132
-					if ($read >= $raw_salt_len) {
157
+					if ($read >= $raw_salt_len)
158
+					{
133 159
 						$buffer_valid = true;
134 160
 					}
135 161
 				}
136
-				if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) {
162
+				if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len)
163
+				{
137 164
 					$bl = PasswordCompat\binary\_strlen($buffer);
138
-					for ($i = 0; $i < $raw_salt_len; $i++) {
139
-						if ($i < $bl) {
165
+					for ($i = 0; $i < $raw_salt_len; $i++)
166
+					{
167
+						if ($i < $bl)
168
+						{
140 169
 							$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
141
-						} else {
170
+						}
171
+						else
172
+						{
142 173
 							$buffer .= chr(mt_rand(0, 255));
143 174
 						}
144 175
 					}
@@ -146,7 +177,8 @@  discard block
 block discarded – undo
146 177
 				$salt = $buffer;
147 178
 				$salt_requires_encoding = true;
148 179
 			}
149
-			if ($salt_requires_encoding) {
180
+			if ($salt_requires_encoding)
181
+			{
150 182
 				// encode string with the Base64 variant used by crypt
151 183
 				$base64_digits =
152 184
 					'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
@@ -162,7 +194,8 @@  discard block
 block discarded – undo
162 194
 
163 195
 			$ret = crypt($password, $hash);
164 196
 
165
-			if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) {
197
+			if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength)
198
+			{
166 199
 				return false;
167 200
 			}
168 201
 
@@ -185,13 +218,15 @@  discard block
 block discarded – undo
185 218
 		 *
186 219
 		 * @return array The array of information about the hash.
187 220
 		 */
188
-		function password_get_info($hash) {
221
+		function password_get_info($hash)
222
+		{
189 223
 			$return = array(
190 224
 				'algo' => 0,
191 225
 				'algoName' => 'unknown',
192 226
 				'options' => array(),
193 227
 			);
194
-			if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) {
228
+			if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60)
229
+			{
195 230
 				$return['algo'] = PASSWORD_BCRYPT;
196 231
 				$return['algoName'] = 'bcrypt';
197 232
 				list($cost) = sscanf($hash, "$2y$%d$");
@@ -211,15 +246,19 @@  discard block
 block discarded – undo
211 246
 		 *
212 247
 		 * @return boolean True if the password needs to be rehashed.
213 248
 		 */
214
-		function password_needs_rehash($hash, $algo, array $options = array()) {
249
+		function password_needs_rehash($hash, $algo, array $options = array())
250
+		{
215 251
 			$info = password_get_info($hash);
216
-			if ($info['algo'] != $algo) {
252
+			if ($info['algo'] != $algo)
253
+			{
217 254
 				return true;
218 255
 			}
219
-			switch ($algo) {
256
+			switch ($algo)
257
+			{
220 258
 				case PASSWORD_BCRYPT:
221 259
 					$cost = isset($options['cost']) ? $options['cost'] : 10;
222
-					if ($cost != $info['options']['cost']) {
260
+					if ($cost != $info['options']['cost'])
261
+					{
223 262
 						return true;
224 263
 					}
225 264
 					break;
@@ -235,21 +274,26 @@  discard block
 block discarded – undo
235 274
 		 *
236 275
 		 * @return boolean If the password matches the hash
237 276
 		 */
238
-		function password_verify($password, $hash) {
239
-			if (!function_exists('crypt')) {
277
+		function password_verify($password, $hash)
278
+		{
279
+			if (!function_exists('crypt'))
280
+			{
240 281
 				trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING);
241 282
 				return false;
242 283
 			}
243
-			if (PasswordCompat\binary\_strlen($password) > 72) {
284
+			if (PasswordCompat\binary\_strlen($password) > 72)
285
+			{
244 286
 				$password = PasswordCompat\binary\_substr($password, 0, 72);
245 287
 			}
246 288
 			$ret = crypt($password, $hash);
247
-			if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) {
289
+			if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13)
290
+			{
248 291
 				return false;
249 292
 			}
250 293
 
251 294
 			$status = 0;
252
-			for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) {
295
+			for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++)
296
+			{
253 297
 				$status |= (ord($ret[$i]) ^ ord($hash[$i]));
254 298
 			}
255 299
 
@@ -271,8 +315,10 @@  discard block
 block discarded – undo
271 315
 	 * @internal
272 316
 	 * @return int The number of bytes
273 317
 	 */
274
-	function _strlen($binary_string) {
275
-		if (function_exists('mb_strlen')) {
318
+	function _strlen($binary_string)
319
+	{
320
+		if (function_exists('mb_strlen'))
321
+		{
276 322
 			return mb_strlen($binary_string, '8bit');
277 323
 		}
278 324
 		return strlen($binary_string);
@@ -290,8 +336,10 @@  discard block
 block discarded – undo
290 336
 	 * @internal
291 337
 	 * @return string The substring
292 338
 	 */
293
-	function _substr($binary_string, $start, $length) {
294
-		if (function_exists('mb_substr')) {
339
+	function _substr($binary_string, $start, $length)
340
+	{
341
+		if (function_exists('mb_substr'))
342
+		{
295 343
 			return mb_substr($binary_string, $start, $length, '8bit');
296 344
 		}
297 345
 		return substr($binary_string, $start, $length);
Please login to merge, or discard this patch.