Completed
Push — release-2.1 ( 64d581...84b0cc )
by Rick
06:44 queued 10s
created
Sources/PersonalMessage.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 					FROM {db_prefix}pm_recipients AS pmr' . ($context['display_mode'] == 2 ? '
620 620
 						INNER JOIN {db_prefix}personal_messages AS pm ON (pm.id_pm = pmr.id_pm)' : '') . $labelJoin . '
621 621
 					WHERE pmr.id_member = {int:current_member}
622
-						AND pmr.deleted = {int:not_deleted}' . $labelQuery .  $labelQuery2 . '
622
+						AND pmr.deleted = {int:not_deleted}' . $labelQuery . $labelQuery2 . '
623 623
 						AND pmr.id_pm ' . ($descending ? '>' : '<') . ' {int:id_pm}',
624 624
 					array(
625 625
 						'current_member' => $user_info['id'],
@@ -682,12 +682,12 @@  discard block
 block discarded – undo
682 682
 				INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm
683 683
 					AND pmr.id_member = {int:current_member}
684 684
 					AND pmr.deleted = {int:deleted_by}
685
-					' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? ( '
685
+					' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? ('
686 686
 				LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '') . '
687 687
 				WHERE ' . ($context['folder'] == 'sent' ? 'pm.id_member_from = {int:current_member}
688 688
 					AND pm.deleted_by_sender = {int:deleted_by}' : '1=1') . (empty($pmsg) ? '' : '
689 689
 					AND pm.id_pm = {int:pmsg}') . $labelQuery2 . '
690
-				GROUP BY pm.id_pm_head'.($_GET['sort'] != 'pm.id_pm' ? ','.$_GET['sort'] : '').'
690
+				GROUP BY pm.id_pm_head'.($_GET['sort'] != 'pm.id_pm' ? ',' . $_GET['sort'] : '') . '
691 691
 				ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? '
692 692
 				LIMIT ' . $_GET['start'] . ', ' . $maxPerPage : ''),
693 693
 				array(
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 				INNER JOIN {db_prefix}pm_recipients AS pmr ON (pmr.id_pm = pm.id_pm
712 712
 					AND pmr.id_member = {int:current_member}
713 713
 					AND pmr.deleted = {int:is_deleted}
714
-					' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? ( '
714
+					' . $labelQuery . ')') . $labelJoin . ($context['sort_by'] == 'name' ? ('
715 715
 				LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = {raw:pm_member})') : '') . '
716 716
 			WHERE ' . ($context['folder'] == 'sent' ? 'pm.id_member_from = {raw:current_member}
717 717
 				AND pm.deleted_by_sender = {int:is_deleted}' : '1=1') . (empty($pmsg) ? '' : '
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 					)
849 849
 				);
850 850
 
851
-				while($row2 = $smcFunc['db_fetch_assoc']($request2))
851
+				while ($row2 = $smcFunc['db_fetch_assoc']($request2))
852 852
 				{
853 853
 					$l_id = $row2['id_label'];
854 854
 					if (isset($context['labels'][$l_id]))
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 					)
1627 1627
 				);
1628 1628
 
1629
-				while($row2 = $smcFunc['db_fetch_assoc']($request2))
1629
+				while ($row2 = $smcFunc['db_fetch_assoc']($request2))
1630 1630
 				{
1631 1631
 					$l_id = $row2['id_label'];
1632 1632
 					if (isset($context['labels'][$l_id]))
@@ -3723,7 +3723,7 @@  discard block
 block discarded – undo
3723 3723
 	// Editing a specific one?
3724 3724
 	if (isset($_GET['add']))
3725 3725
 	{
3726
-		$context['rid'] = isset($_GET['rid']) && isset($context['rules'][$_GET['rid']])? (int) $_GET['rid'] : 0;
3726
+		$context['rid'] = isset($_GET['rid']) && isset($context['rules'][$_GET['rid']]) ? (int) $_GET['rid'] : 0;
3727 3727
 		$context['sub_template'] = 'add_rule';
3728 3728
 
3729 3729
 		// Current rule information...
@@ -3764,7 +3764,7 @@  discard block
 block discarded – undo
3764 3764
 	elseif (isset($_GET['save']))
3765 3765
 	{
3766 3766
 		checkSession();
3767
-		$context['rid'] = isset($_GET['rid']) && isset($context['rules'][$_GET['rid']])? (int) $_GET['rid'] : 0;
3767
+		$context['rid'] = isset($_GET['rid']) && isset($context['rules'][$_GET['rid']]) ? (int) $_GET['rid'] : 0;
3768 3768
 
3769 3769
 		// Name is easy!
3770 3770
 		$ruleName = $smcFunc['htmlspecialchars'](trim($_POST['rule_name']));
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1098 1098
 				),
1099 1099
 				'content' => '$1',
1100
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1100
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1101 1101
 				{
1102 1102
 					$returnContext = '';
1103 1103
 
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 						}
1133 1133
 
1134 1134
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1135
-							$returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '" alt="' . $currentAttachment['name'] . '" id="thumb_'. $currentAttachment['id']. '"></a>';
1135
+							$returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '" alt="' . $currentAttachment['name'] . '" id="thumb_' . $currentAttachment['id'] . '"></a>';
1136 1136
 						else
1137 1137
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image" alt="' . $currentAttachment['name'] . '"' . $width . $height . '/>';
1138 1138
 					}
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 				'type' => 'unparsed_content',
1162 1162
 				'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>',
1163 1163
 				// @todo Maybe this can be simplified?
1164
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1164
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1165 1165
 				{
1166 1166
 					if (!isset($disabled['code']))
1167 1167
 					{
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 				'type' => 'unparsed_equals_content',
1199 1199
 				'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>',
1200 1200
 				// @todo Maybe this can be simplified?
1201
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1201
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1202 1202
 				{
1203 1203
 					if (!isset($disabled['code']))
1204 1204
 					{
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				'type' => 'unparsed_content',
1243 1243
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1244 1244
 				// @todo Should this respect guest_hideContacts?
1245
-				'validate' => function (&$tag, &$data, $disabled)
1245
+				'validate' => function(&$tag, &$data, $disabled)
1246 1246
 				{
1247 1247
 					$data = strtr($data, array('<br>' => ''));
1248 1248
 				},
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 				'type' => 'unparsed_commas_content',
1262 1262
 				'test' => '\d+,\d+\]',
1263 1263
 				'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
1264
-				'validate' => function (&$tag, &$data, $disabled)
1264
+				'validate' => function(&$tag, &$data, $disabled)
1265 1265
 				{
1266 1266
 					if (isset($disabled['url']))
1267 1267
 						$tag['content'] = '$1';
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1307 1307
 				),
1308 1308
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1309
-				'validate' => function (&$tag, &$data, $disabled)
1309
+				'validate' => function(&$tag, &$data, $disabled)
1310 1310
 				{
1311 1311
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1312 1312
 
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 				'tag' => 'img',
1330 1330
 				'type' => 'unparsed_content',
1331 1331
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1332
-				'validate' => function (&$tag, &$data, $disabled)
1332
+				'validate' => function(&$tag, &$data, $disabled)
1333 1333
 				{
1334 1334
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1335 1335
 
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 				'tag' => 'iurl',
1353 1353
 				'type' => 'unparsed_content',
1354 1354
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1355
-				'validate' => function (&$tag, &$data, $disabled)
1355
+				'validate' => function(&$tag, &$data, $disabled)
1356 1356
 				{
1357 1357
 					$data = strtr($data, array('<br>' => ''));
1358 1358
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 				'quoted' => 'optional',
1367 1367
 				'before' => '<a href="$1" class="bbc_link">',
1368 1368
 				'after' => '</a>',
1369
-				'validate' => function (&$tag, &$data, $disabled)
1369
+				'validate' => function(&$tag, &$data, $disabled)
1370 1370
 				{
1371 1371
 					if (substr($data, 0, 1) == '#')
1372 1372
 						$data = '#post_' . substr($data, 1);
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
 				'tag' => 'php',
1447 1447
 				'type' => 'unparsed_content',
1448 1448
 				'content' => '<span class="phpcode">$1</span>',
1449
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1449
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1450 1450
 				{
1451 1451
 					if (!isset($disabled['php']))
1452 1452
 					{
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
 				'test' => '[1-7]\]',
1545 1545
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1546 1546
 				'after' => '</span>',
1547
-				'validate' => function (&$tag, &$data, $disabled)
1547
+				'validate' => function(&$tag, &$data, $disabled)
1548 1548
 				{
1549 1549
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1550 1550
 					$data = $sizes[$data] . 'em';
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
 				'tag' => 'time',
1583 1583
 				'type' => 'unparsed_content',
1584 1584
 				'content' => '$1',
1585
-				'validate' => function (&$tag, &$data, $disabled)
1585
+				'validate' => function(&$tag, &$data, $disabled)
1586 1586
 				{
1587 1587
 					if (is_numeric($data))
1588 1588
 						$data = timeformat($data);
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 				'tag' => 'url',
1611 1611
 				'type' => 'unparsed_content',
1612 1612
 				'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>',
1613
-				'validate' => function (&$tag, &$data, $disabled)
1613
+				'validate' => function(&$tag, &$data, $disabled)
1614 1614
 				{
1615 1615
 					$data = strtr($data, array('<br>' => ''));
1616 1616
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
 				'quoted' => 'optional',
1625 1625
 				'before' => '<a href="$1" class="bbc_link" target="_blank">',
1626 1626
 				'after' => '</a>',
1627
-				'validate' => function (&$tag, &$data, $disabled)
1627
+				'validate' => function(&$tag, &$data, $disabled)
1628 1628
 				{
1629 1629
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1630 1630
 					if (empty($scheme))
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 		{
1651 1651
 			if (isset($temp_bbc))
1652 1652
 				$bbc_codes = $temp_bbc;
1653
-			usort($codes, function ($a, $b) {
1653
+			usort($codes, function($a, $b) {
1654 1654
 				return strcmp($a['tag'], $b['tag']);
1655 1655
 			});
1656 1656
 			return $codes;
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 										# a run of Unicode domain name characters and a dot
1891 1891
 										[\p{L}\p{M}\p{N}\-.:@]+\.
1892 1892
 										# and then a TLD valid in the DNS or the reserved "local" TLD
1893
-										(?:'. $modSettings['tld_regex'] .'|local)
1893
+										(?:'. $modSettings['tld_regex'] . '|local)
1894 1894
 									)
1895 1895
 									# followed by a non-domain character or end of line
1896 1896
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
 						)?
1959 1959
 						';
1960 1960
 
1961
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
1961
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
1962 1962
 							$url = array_shift($matches);
1963 1963
 
1964 1964
 							$scheme = parse_url($url, PHP_URL_SCHEME);
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
 		for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
2688 2688
 		{
2689 2689
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2690
-			$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">';
2690
+			$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">';
2691 2691
 
2692 2692
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2693 2693
 
@@ -2704,7 +2704,7 @@  discard block
 block discarded – undo
2704 2704
 
2705 2705
 	// Replace away!
2706 2706
 	$message = preg_replace_callback($smileyPregSearch,
2707
-		function ($matches) use ($smileyPregReplacements)
2707
+		function($matches) use ($smileyPregReplacements)
2708 2708
 		{
2709 2709
 			return $smileyPregReplacements[$matches[1]];
2710 2710
 		}, $message);
@@ -2770,13 +2770,13 @@  discard block
 block discarded – undo
2770 2770
 	{
2771 2771
 		if (defined('SID') && SID != '')
2772 2772
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
2773
-				function ($m) use ($scripturl)
2773
+				function($m) use ($scripturl)
2774 2774
 				{
2775
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2775
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
2776 2776
 				}, $setLocation);
2777 2777
 		else
2778 2778
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2779
-				function ($m) use ($scripturl)
2779
+				function($m) use ($scripturl)
2780 2780
 				{
2781 2781
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2782 2782
 				}, $setLocation);
@@ -3099,7 +3099,7 @@  discard block
 block discarded – undo
3099 3099
 
3100 3100
 	// Add a generic "Are you sure?" confirmation message.
3101 3101
 	addInlineJavaScript('
3102
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3102
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3103 3103
 
3104 3104
 	// Now add the capping code for avatars.
3105 3105
 	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')
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
 
3464 3464
 		else
3465 3465
 			echo '
3466
-	<script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>';
3466
+	<script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>';
3467 3467
 	}
3468 3468
 
3469 3469
 	// Inline JavaScript - Actually useful some times!
@@ -3541,14 +3541,14 @@  discard block
 block discarded – undo
3541 3541
 
3542 3542
 		else
3543 3543
 			echo '
3544
-	<link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">';
3544
+	<link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">';
3545 3545
 	}
3546 3546
 
3547 3547
 	// Print the rest after the minified files.
3548 3548
 	if (!empty($normal))
3549 3549
 		foreach ($normal as $nf)
3550 3550
 			echo '
3551
-	<link rel="stylesheet" href="', $nf ,'">';
3551
+	<link rel="stylesheet" href="', $nf, '">';
3552 3552
 
3553 3553
 	if ($db_show_debug === true)
3554 3554
 	{
@@ -3564,7 +3564,7 @@  discard block
 block discarded – undo
3564 3564
 	<style>';
3565 3565
 
3566 3566
 		foreach ($context['css_header'] as $css)
3567
-			echo $css .'
3567
+			echo $css . '
3568 3568
 	';
3569 3569
 
3570 3570
 		echo'
@@ -3594,7 +3594,7 @@  discard block
 block discarded – undo
3594 3594
 		return false;
3595 3595
 
3596 3596
 	// Did we already did this?
3597
-	$toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400);
3597
+	$toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400);
3598 3598
 
3599 3599
 	// Already done?
3600 3600
 	if (!empty($toCache))
@@ -3602,25 +3602,25 @@  discard block
 block discarded – undo
3602 3602
 
3603 3603
 	// Yep, need a bunch of files.
3604 3604
 	require_once($sourcedir . '/minify/src/Minify.php');
3605
-	require_once($sourcedir . '/minify/src/'. strtoupper($type) .'.php');
3605
+	require_once($sourcedir . '/minify/src/' . strtoupper($type) . '.php');
3606 3606
 	require_once($sourcedir . '/minify/src/Exception.php');
3607 3607
 	require_once($sourcedir . '/minify/src/Converter.php');
3608 3608
 
3609 3609
 	// No namespaces, sorry!
3610
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3610
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3611 3611
 
3612 3612
 	// Temp path.
3613
-	$cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/';
3613
+	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
3614 3614
 
3615 3615
 	// What kind of file are we going to create?
3616
-	$toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type;
3616
+	$toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type;
3617 3617
 
3618 3618
 	// File has to exists, if it isn't try to create it.
3619 3619
 	if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate))
3620 3620
 	{
3621 3621
 		loadLanguage('Errors');
3622 3622
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3623
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3623
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3624 3624
 
3625 3625
 		// The process failed so roll back to print each individual file.
3626 3626
 		return $data;
@@ -3655,14 +3655,14 @@  discard block
 block discarded – undo
3655 3655
 	{
3656 3656
 		loadLanguage('Errors');
3657 3657
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3658
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3658
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3659 3659
 
3660 3660
 		// The process failed so roll back to print each individual file.
3661 3661
 		return $data;
3662 3662
 	}
3663 3663
 
3664 3664
 	// And create a long lived cache entry.
3665
-	cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400);
3665
+	cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400);
3666 3666
 
3667 3667
 	return true;
3668 3668
 }
@@ -3719,7 +3719,7 @@  discard block
 block discarded – undo
3719 3719
 	else
3720 3720
 		$path = $modSettings['attachmentUploadDir'];
3721 3721
 
3722
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
3722
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
3723 3723
 }
3724 3724
 
3725 3725
 /**
@@ -3763,10 +3763,10 @@  discard block
 block discarded – undo
3763 3763
 		$valid_low = isValidIP($ip_parts[0]);
3764 3764
 		$valid_high = isValidIP($ip_parts[1]);
3765 3765
 		$count = 0;
3766
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3766
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
3767 3767
 		$max = ($mode == ':' ? 'ffff' : '255');
3768 3768
 		$min = 0;
3769
-		if(!$valid_low)
3769
+		if (!$valid_low)
3770 3770
 		{
3771 3771
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3772 3772
 			$valid_low = isValidIP($ip_parts[0]);
@@ -3780,7 +3780,7 @@  discard block
 block discarded – undo
3780 3780
 		}
3781 3781
 
3782 3782
 		$count = 0;
3783
-		if(!$valid_high)
3783
+		if (!$valid_high)
3784 3784
 		{
3785 3785
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3786 3786
 			$valid_high = isValidIP($ip_parts[1]);
@@ -3793,7 +3793,7 @@  discard block
 block discarded – undo
3793 3793
 			}
3794 3794
 		}
3795 3795
 
3796
-		if($valid_high && $valid_low)
3796
+		if ($valid_high && $valid_low)
3797 3797
 		{
3798 3798
 			$ip_array['low'] = $ip_parts[0];
3799 3799
 			$ip_array['high'] = $ip_parts[1];
@@ -4066,7 +4066,7 @@  discard block
 block discarded – undo
4066 4066
 		addInlineJavaScript('
4067 4067
 	var user_menus = new smc_PopupMenu();
4068 4068
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
4069
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
4069
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
4070 4070
 		if ($context['allow_pm'])
4071 4071
 			addInlineJavaScript('
4072 4072
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4694,7 +4694,7 @@  discard block
 block discarded – undo
4694 4694
 		// No? try a fallback to $sourcedir
4695 4695
 		else
4696 4696
 		{
4697
-			$absPath = $sourcedir .'/'. $file;
4697
+			$absPath = $sourcedir . '/' . $file;
4698 4698
 
4699 4699
 			if (file_exists($absPath))
4700 4700
 				require_once($absPath);
@@ -4775,15 +4775,15 @@  discard block
 block discarded – undo
4775 4775
 
4776 4776
 	// UTF-8 occurences of MS special characters
4777 4777
 	$findchars_utf8 = array(
4778
-		"\xe2\80\x9a",	// single low-9 quotation mark
4779
-		"\xe2\80\x9e",	// double low-9 quotation mark
4780
-		"\xe2\80\xa6",	// horizontal ellipsis
4781
-		"\xe2\x80\x98",	// left single curly quote
4782
-		"\xe2\x80\x99",	// right single curly quote
4783
-		"\xe2\x80\x9c",	// left double curly quote
4784
-		"\xe2\x80\x9d",	// right double curly quote
4785
-		"\xe2\x80\x93",	// en dash
4786
-		"\xe2\x80\x94",	// em dash
4778
+		"\xe2\80\x9a", // single low-9 quotation mark
4779
+		"\xe2\80\x9e", // double low-9 quotation mark
4780
+		"\xe2\80\xa6", // horizontal ellipsis
4781
+		"\xe2\x80\x98", // left single curly quote
4782
+		"\xe2\x80\x99", // right single curly quote
4783
+		"\xe2\x80\x9c", // left double curly quote
4784
+		"\xe2\x80\x9d", // right double curly quote
4785
+		"\xe2\x80\x93", // en dash
4786
+		"\xe2\x80\x94", // em dash
4787 4787
 	);
4788 4788
 
4789 4789
 	// windows 1252 / iso equivalents
@@ -4801,15 +4801,15 @@  discard block
 block discarded – undo
4801 4801
 
4802 4802
 	// safe replacements
4803 4803
 	$replacechars = array(
4804
-		',',	// &sbquo;
4805
-		',,',	// &bdquo;
4806
-		'...',	// &hellip;
4807
-		"'",	// &lsquo;
4808
-		"'",	// &rsquo;
4809
-		'"',	// &ldquo;
4810
-		'"',	// &rdquo;
4811
-		'-',	// &ndash;
4812
-		'--',	// &mdash;
4804
+		',', // &sbquo;
4805
+		',,', // &bdquo;
4806
+		'...', // &hellip;
4807
+		"'", // &lsquo;
4808
+		"'", // &rsquo;
4809
+		'"', // &ldquo;
4810
+		'"', // &rdquo;
4811
+		'-', // &ndash;
4812
+		'--', // &mdash;
4813 4813
 	);
4814 4814
 
4815 4815
 	if ($context['utf8'])
@@ -5095,7 +5095,7 @@  discard block
 block discarded – undo
5095 5095
  */
5096 5096
 function inet_dtop($bin)
5097 5097
 {
5098
-	if(empty($bin))
5098
+	if (empty($bin))
5099 5099
 		return '';
5100 5100
 
5101 5101
 	global $db_type;
@@ -5126,28 +5126,28 @@  discard block
 block discarded – undo
5126 5126
  */
5127 5127
 function _safe_serialize($value)
5128 5128
 {
5129
-	if(is_null($value))
5129
+	if (is_null($value))
5130 5130
 		return 'N;';
5131 5131
 
5132
-	if(is_bool($value))
5133
-		return 'b:'. (int) $value .';';
5132
+	if (is_bool($value))
5133
+		return 'b:' . (int) $value . ';';
5134 5134
 
5135
-	if(is_int($value))
5136
-		return 'i:'. $value .';';
5135
+	if (is_int($value))
5136
+		return 'i:' . $value . ';';
5137 5137
 
5138
-	if(is_float($value))
5139
-		return 'd:'. str_replace(',', '.', $value) .';';
5138
+	if (is_float($value))
5139
+		return 'd:' . str_replace(',', '.', $value) . ';';
5140 5140
 
5141
-	if(is_string($value))
5142
-		return 's:'. strlen($value) .':"'. $value .'";';
5141
+	if (is_string($value))
5142
+		return 's:' . strlen($value) . ':"' . $value . '";';
5143 5143
 
5144
-	if(is_array($value))
5144
+	if (is_array($value))
5145 5145
 	{
5146 5146
 		$out = '';
5147
-		foreach($value as $k => $v)
5147
+		foreach ($value as $k => $v)
5148 5148
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5149 5149
 
5150
-		return 'a:'. count($value) .':{'. $out .'}';
5150
+		return 'a:' . count($value) . ':{' . $out . '}';
5151 5151
 	}
5152 5152
 
5153 5153
 	// safe_serialize cannot serialize resources or objects.
@@ -5189,7 +5189,7 @@  discard block
 block discarded – undo
5189 5189
 function _safe_unserialize($str)
5190 5190
 {
5191 5191
 	// Input  is not a string.
5192
-	if(empty($str) || !is_string($str))
5192
+	if (empty($str) || !is_string($str))
5193 5193
 		return false;
5194 5194
 
5195 5195
 	$stack = array();
@@ -5203,40 +5203,40 @@  discard block
 block discarded – undo
5203 5203
 	 *   3 - in array, expecting value or another array
5204 5204
 	 */
5205 5205
 	$state = 0;
5206
-	while($state != 1)
5206
+	while ($state != 1)
5207 5207
 	{
5208 5208
 		$type = isset($str[0]) ? $str[0] : '';
5209
-		if($type == '}')
5209
+		if ($type == '}')
5210 5210
 			$str = substr($str, 1);
5211 5211
 
5212
-		else if($type == 'N' && $str[1] == ';')
5212
+		else if ($type == 'N' && $str[1] == ';')
5213 5213
 		{
5214 5214
 			$value = null;
5215 5215
 			$str = substr($str, 2);
5216 5216
 		}
5217
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5217
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5218 5218
 		{
5219 5219
 			$value = $matches[1] == '1' ? true : false;
5220 5220
 			$str = substr($str, 4);
5221 5221
 		}
5222
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5222
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5223 5223
 		{
5224
-			$value = (int)$matches[1];
5224
+			$value = (int) $matches[1];
5225 5225
 			$str = $matches[2];
5226 5226
 		}
5227
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5227
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5228 5228
 		{
5229
-			$value = (float)$matches[1];
5229
+			$value = (float) $matches[1];
5230 5230
 			$str = $matches[3];
5231 5231
 		}
5232
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5232
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5233 5233
 		{
5234
-			$value = substr($matches[2], 0, (int)$matches[1]);
5235
-			$str = substr($matches[2], (int)$matches[1] + 2);
5234
+			$value = substr($matches[2], 0, (int) $matches[1]);
5235
+			$str = substr($matches[2], (int) $matches[1] + 2);
5236 5236
 		}
5237
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5237
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5238 5238
 		{
5239
-			$expectedLength = (int)$matches[1];
5239
+			$expectedLength = (int) $matches[1];
5240 5240
 			$str = $matches[2];
5241 5241
 		}
5242 5242
 
@@ -5244,10 +5244,10 @@  discard block
 block discarded – undo
5244 5244
 		else
5245 5245
 			return false;
5246 5246
 
5247
-		switch($state)
5247
+		switch ($state)
5248 5248
 		{
5249 5249
 			case 3: // In array, expecting value or another array.
5250
-				if($type == 'a')
5250
+				if ($type == 'a')
5251 5251
 				{
5252 5252
 					$stack[] = &$list;
5253 5253
 					$list[$key] = array();
@@ -5256,7 +5256,7 @@  discard block
 block discarded – undo
5256 5256
 					$state = 2;
5257 5257
 					break;
5258 5258
 				}
5259
-				if($type != '}')
5259
+				if ($type != '}')
5260 5260
 				{
5261 5261
 					$list[$key] = $value;
5262 5262
 					$state = 2;
@@ -5267,29 +5267,29 @@  discard block
 block discarded – undo
5267 5267
 				return false;
5268 5268
 
5269 5269
 			case 2: // in array, expecting end of array or a key
5270
-				if($type == '}')
5270
+				if ($type == '}')
5271 5271
 				{
5272 5272
 					// Array size is less than expected.
5273
-					if(count($list) < end($expected))
5273
+					if (count($list) < end($expected))
5274 5274
 						return false;
5275 5275
 
5276 5276
 					unset($list);
5277
-					$list = &$stack[count($stack)-1];
5277
+					$list = &$stack[count($stack) - 1];
5278 5278
 					array_pop($stack);
5279 5279
 
5280 5280
 					// Go to terminal state if we're at the end of the root array.
5281 5281
 					array_pop($expected);
5282 5282
 
5283
-					if(count($expected) == 0)
5283
+					if (count($expected) == 0)
5284 5284
 						$state = 1;
5285 5285
 
5286 5286
 					break;
5287 5287
 				}
5288 5288
 
5289
-				if($type == 'i' || $type == 's')
5289
+				if ($type == 'i' || $type == 's')
5290 5290
 				{
5291 5291
 					// Array size exceeds expected length.
5292
-					if(count($list) >= end($expected))
5292
+					if (count($list) >= end($expected))
5293 5293
 						return false;
5294 5294
 
5295 5295
 					$key = $value;
@@ -5302,7 +5302,7 @@  discard block
 block discarded – undo
5302 5302
 
5303 5303
 			// Expecting array or value.
5304 5304
 			case 0:
5305
-				if($type == 'a')
5305
+				if ($type == 'a')
5306 5306
 				{
5307 5307
 					$data = array();
5308 5308
 					$list = &$data;
@@ -5311,7 +5311,7 @@  discard block
 block discarded – undo
5311 5311
 					break;
5312 5312
 				}
5313 5313
 
5314
-				if($type != '}')
5314
+				if ($type != '}')
5315 5315
 				{
5316 5316
 					$data = $value;
5317 5317
 					$state = 1;
@@ -5324,7 +5324,7 @@  discard block
 block discarded – undo
5324 5324
 	}
5325 5325
 
5326 5326
 	// Trailing data in input.
5327
-	if(!empty($str))
5327
+	if (!empty($str))
5328 5328
 		return false;
5329 5329
 
5330 5330
 	return $data;
@@ -5378,7 +5378,7 @@  discard block
 block discarded – undo
5378 5378
 	// Set different modes.
5379 5379
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5380 5380
 
5381
-	foreach($chmodValues as $val)
5381
+	foreach ($chmodValues as $val)
5382 5382
 	{
5383 5383
 		// If it's writable, break out of the loop.
5384 5384
 		if (is_writable($file))
@@ -5416,13 +5416,13 @@  discard block
 block discarded – undo
5416 5416
 	$returnArray = @json_decode($json, $returnAsArray);
5417 5417
 
5418 5418
 	// PHP 5.3 so no json_last_error_msg()
5419
-	switch(json_last_error())
5419
+	switch (json_last_error())
5420 5420
 	{
5421 5421
 		case JSON_ERROR_NONE:
5422 5422
 			$jsonError = false;
5423 5423
 			break;
5424 5424
 		case JSON_ERROR_DEPTH:
5425
-			$jsonError =  'JSON_ERROR_DEPTH';
5425
+			$jsonError = 'JSON_ERROR_DEPTH';
5426 5426
 			break;
5427 5427
 		case JSON_ERROR_STATE_MISMATCH:
5428 5428
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5450,10 +5450,10 @@  discard block
 block discarded – undo
5450 5450
 		loadLanguage('Errors');
5451 5451
 
5452 5452
 		if (!empty($jsonDebug))
5453
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5453
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5454 5454
 
5455 5455
 		else
5456
-			log_error($txt['json_'. $jsonError], 'critical');
5456
+			log_error($txt['json_' . $jsonError], 'critical');
5457 5457
 
5458 5458
 		// Everyone expects an array.
5459 5459
 		return array();
@@ -5557,7 +5557,7 @@  discard block
 block discarded – undo
5557 5557
 		});
5558 5558
 
5559 5559
 		// Convert Punycode to Unicode
5560
-		$tlds = array_map(function ($input) {
5560
+		$tlds = array_map(function($input) {
5561 5561
 			$prefix = 'xn--';
5562 5562
 			$safe_char = 0xFFFC;
5563 5563
 			$base = 36;
@@ -5573,7 +5573,7 @@  discard block
 block discarded – undo
5573 5573
 
5574 5574
 			foreach ($enco_parts as $encoded)
5575 5575
 			{
5576
-				if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0)
5576
+				if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0)
5577 5577
 				{
5578 5578
 					$output_parts[] = $encoded;
5579 5579
 					continue;
@@ -5584,7 +5584,7 @@  discard block
 block discarded – undo
5584 5584
 				$idx = 0;
5585 5585
 				$char = 0x80;
5586 5586
 				$decoded = array();
5587
-				$output='';
5587
+				$output = '';
5588 5588
 				$delim_pos = strrpos($encoded, '-');
5589 5589
 
5590 5590
 				if ($delim_pos > strlen($prefix))
@@ -5600,7 +5600,7 @@  discard block
 block discarded – undo
5600 5600
 
5601 5601
 				for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len)
5602 5602
 				{
5603
-					for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base)
5603
+					for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base)
5604 5604
 					{
5605 5605
 						$cp = ord($encoded{$enco_idx++});
5606 5606
 						$digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base));
@@ -5641,15 +5641,15 @@  discard block
 block discarded – undo
5641 5641
 
5642 5642
 					// 2 bytes
5643 5643
 					elseif ($v < (1 << 11))
5644
-						$output .= chr(192+($v >> 6)) . chr(128+($v & 63));
5644
+						$output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
5645 5645
 
5646 5646
 					// 3 bytes
5647 5647
 					elseif ($v < (1 << 16))
5648
-						$output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5648
+						$output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5649 5649
 
5650 5650
 					// 4 bytes
5651 5651
 					elseif ($v < (1 << 21))
5652
-						$output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5652
+						$output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5653 5653
 
5654 5654
 					//  'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k
5655 5655
 					else
@@ -5756,7 +5756,7 @@  discard block
 block discarded – undo
5756 5756
 	}
5757 5757
 
5758 5758
 	// This recursive function creates the index array from the strings
5759
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5759
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5760 5760
 	{
5761 5761
 		static $depth = 0;
5762 5762
 		$depth++;
@@ -5783,7 +5783,7 @@  discard block
 block discarded – undo
5783 5783
 	};
5784 5784
 
5785 5785
 	// This recursive function turns the index array into a regular expression
5786
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
5786
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
5787 5787
 	{
5788 5788
 		static $depth = 0;
5789 5789
 		$depth++;
@@ -5806,9 +5806,9 @@  discard block
 block discarded – undo
5806 5806
 				$sub_regex = $index_to_regex($value, $delim);
5807 5807
 
5808 5808
 				if (count(array_keys($value)) == 1)
5809
-					$new_key .= explode('(?'.'>', $sub_regex)[0];
5809
+					$new_key .= explode('(?' . '>', $sub_regex)[0];
5810 5810
 				else
5811
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
5811
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
5812 5812
 			}
5813 5813
 
5814 5814
 			if ($depth > 1)
@@ -5848,7 +5848,7 @@  discard block
 block discarded – undo
5848 5848
 		$index = $add_string_to_index($string, $index);
5849 5849
 
5850 5850
 	while (!empty($index))
5851
-		$regexes[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
5851
+		$regexes[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
5852 5852
 
5853 5853
 	// Restore PHP's internal character encoding to whatever it was originally
5854 5854
 	if (!empty($current_encoding))
Please login to merge, or discard this patch.
Sources/ManageSmileys.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					'class' => 'centercol',
394 394
 				),
395 395
 				'data' => array(
396
-					'function' => function ($rowData)
396
+					'function' => function($rowData)
397 397
 					{
398 398
 						return $rowData['selected'] ? '<span class="generic_icons valid"></span>' : '';
399 399
 					},
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 					'class' => 'centercol',
454 454
 				),
455 455
 				'data' => array(
456
-					'function' => function ($rowData)
456
+					'function' => function($rowData)
457 457
 					{
458 458
 						return $rowData['selected'] ? '' : sprintf('<input type="checkbox" name="smiley_set[%1$d]" class="input_check">', $rowData['id']);
459 459
 					},
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 						'value' => $txt['smileys_location'],
998 998
 					),
999 999
 					'data' => array(
1000
-						'function' => function ($rowData) use ($txt)
1000
+						'function' => function($rowData) use ($txt)
1001 1001
 						{
1002 1002
 							if (empty($rowData['hidden']))
1003 1003
 								return $txt['smileys_location_form'];
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 						'value' => $txt['smileys_description'],
1018 1018
 					),
1019 1019
 					'data' => array(
1020
-						'function' => function ($rowData) use ($context, $txt, $modSettings, $smcFunc)
1020
+						'function' => function($rowData) use ($context, $txt, $modSettings, $smcFunc)
1021 1021
 						{
1022 1022
 							if (empty($modSettings['smileys_dir']) || !is_dir($modSettings['smileys_dir']))
1023 1023
 								return $smcFunc['htmlspecialchars']($rowData['description']);
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
 				'action' => $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.')))
1558 1558
 			);
1559 1559
 
1560
-			$file =  $packagesdir . '/temp/' . $base_path . $action['filename'];
1560
+			$file = $packagesdir . '/temp/' . $base_path . $action['filename'];
1561 1561
 			if (isset($action['filename']) && (!file_exists($file) || !is_writable(dirname($action['destination']))))
1562 1562
 			{
1563 1563
 				$context['has_failure'] = true;
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
 		{
1602 1602
 			updateSettings(array(
1603 1603
 				'smiley_sets_known' => $modSettings['smiley_sets_known'] . ',' . basename($action['action']),
1604
-				'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' .  (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''),
1604
+				'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' . (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''),
1605 1605
 			));
1606 1606
 		}
1607 1607
 
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 			'{db_prefix}log_packages',
1614 1614
 			array(
1615 1615
 				'filename' => 'string', 'name' => 'string', 'package_id' => 'string', 'version' => 'string',
1616
-				'id_member_installed' => 'int', 'member_installed' => 'string','time_installed' => 'int',
1616
+				'id_member_installed' => 'int', 'member_installed' => 'string', 'time_installed' => 'int',
1617 1617
 				'install_state' => 'int', 'failed_steps' => 'string', 'themes_installed' => 'string',
1618 1618
 				'member_removed' => 'int', 'db_changes' => 'string', 'credits' => 'string',
1619 1619
 			),
@@ -1862,7 +1862,7 @@  discard block
 block discarded – undo
1862 1862
 		'columns' => array(
1863 1863
 			'icon' => array(
1864 1864
 				'data' => array(
1865
-					'function' => function ($rowData) use ($settings, $smcFunc)
1865
+					'function' => function($rowData) use ($settings, $smcFunc)
1866 1866
 					{
1867 1867
 						$images_url = $settings[file_exists(sprintf('%1$s/images/post/%2$s.png', $settings['theme_dir'], $rowData['filename'])) ? 'actual_images_url' : 'default_images_url'];
1868 1868
 						return sprintf('<img src="%1$s/post/%2$s.png" alt="%3$s">', $images_url, $rowData['filename'], $smcFunc['htmlspecialchars']($rowData['title']));
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 					'value' => $txt['icons_board'],
1897 1897
 				),
1898 1898
 				'data' => array(
1899
-					'function' => function ($rowData) use ($txt)
1899
+					'function' => function($rowData) use ($txt)
1900 1900
 					{
1901 1901
 						return empty($rowData['board_name']) ? $txt['icons_edit_icons_all_boards'] : $rowData['board_name'];
1902 1902
 					},
Please login to merge, or discard this patch.
Sources/ManageErrors.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,42 +42,42 @@  discard block
 block discarded – undo
42 42
 
43 43
 	// You can filter by any of the following columns:
44 44
 	$filters = array(
45
-		'id_member' => array (
45
+		'id_member' => array(
46 46
 			'txt' => $txt['username'],
47 47
 			'operator' => '=',
48 48
 			'datatype' => 'int',
49 49
 		),
50
-		'ip' => array (
50
+		'ip' => array(
51 51
 			'txt' => $txt['ip_address'],
52 52
 			'operator' => '=',
53 53
 			'datatype' => 'inet',
54 54
 		),
55
-		'session' => array (
55
+		'session' => array(
56 56
 			'txt' => $txt['session'],
57 57
 			'operator' => 'LIKE',
58 58
 			'datatype' => 'string',
59 59
 		),
60
-		'url' => array (
60
+		'url' => array(
61 61
 			'txt' => $txt['error_url'],
62 62
 			'operator' => 'LIKE',
63 63
 			'datatype' => 'string',
64 64
 		),
65
-		'message' => array (
65
+		'message' => array(
66 66
 			'txt' => $txt['error_message'],
67 67
 			'operator' => 'LIKE',
68 68
 			'datatype' => 'string',
69 69
 		),
70
-		'error_type' => array (
70
+		'error_type' => array(
71 71
 			'txt' => $txt['error_type'],
72 72
 			'operator' => 'LIKE',
73 73
 			'datatype' => 'string',
74 74
 		),
75
-		'file' => array (
75
+		'file' => array(
76 76
 			'txt' => $txt['file'],
77 77
 			'operator' => 'LIKE',
78 78
 			'datatype' => 'string',
79 79
 		),
80
-		'line' => array (
80
+		'line' => array(
81 81
 			'txt' => $txt['line'],
82 82
 			'operator' => '=',
83 83
 			'datatype' => 'int',
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	$result = $smcFunc['db_query']('', '
104 104
 		SELECT COUNT(*)
105 105
 		FROM {db_prefix}log_errors' . (isset($filter) ? '
106
-		WHERE ' . $filter['variable'] . ' '.$filters[$_GET['filter']]['operator'].' {'.$filters[$_GET['filter']]['datatype'].':filter}' : ''),
106
+		WHERE ' . $filter['variable'] . ' ' . $filters[$_GET['filter']]['operator'] . ' {' . $filters[$_GET['filter']]['datatype'] . ':filter}' : ''),
107 107
 		array(
108 108
 			'filter' => isset($filter) ? $filter['value']['sql'] : '',
109 109
 		)
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	$request = $smcFunc['db_query']('', '
147 147
 		SELECT id_error, id_member, ip, url, log_time, message, session, error_type, file, line
148 148
 		FROM {db_prefix}log_errors' . (isset($filter) ? '
149
-		WHERE ' . $filter['variable'] . ' '.$filters[$_GET['filter']]['operator'].' {'.$filters[$_GET['filter']]['datatype'].':filter}' : '') . '
149
+		WHERE ' . $filter['variable'] . ' ' . $filters[$_GET['filter']]['operator'] . ' {' . $filters[$_GET['filter']]['datatype'] . ':filter}' : '') . '
150 150
 		ORDER BY id_error ' . ($context['sort_direction'] == 'down' ? 'DESC' : '') . '
151 151
 		LIMIT {int:start}, {int:max}',
152 152
 		array(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	$context['errors'] = array();
159 159
 	$members = array();
160 160
 
161
-	for ($i = 0; $row = $smcFunc['db_fetch_assoc']($request); $i ++)
161
+	for ($i = 0; $row = $smcFunc['db_fetch_assoc']($request); $i++)
162 162
 	{
163 163
 		$search_message = preg_replace('~&lt;span class=&quot;remove&quot;&gt;(.+?)&lt;/span&gt;~', '%', $smcFunc['db_escape_wildcard_string']($row['message']));
164 164
 		if ($search_message == $filter['value']['sql'])
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			'id' => $row['id_error'],
185 185
 			'error_type' => array(
186 186
 				'type' => $row['error_type'],
187
-				'name' => isset($txt['errortype_'.$row['error_type']]) ? $txt['errortype_'.$row['error_type']] : $row['error_type'],
187
+				'name' => isset($txt['errortype_' . $row['error_type']]) ? $txt['errortype_' . $row['error_type']] : $row['error_type'],
188 188
 			),
189 189
 			'file' => array(),
190 190
 		);
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	// We don't want to slice off too many so lets make sure we stop at the last one
413 413
 	$max = min($max, max(array_keys($file_data)));
414 414
 
415
-	$file_data = array_slice($file_data, $min-1, $max - $min);
415
+	$file_data = array_slice($file_data, $min - 1, $max - $min);
416 416
 
417 417
 	$context['file_data'] = array(
418 418
 		'contents' => $file_data,
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 							<div id="live_news" class="floatleft">
34 34
 								<div class="cat_bar">
35 35
 									<h3 class="catbg">
36
-										<a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['live'], '
36
+										<a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['live'], '
37 37
 									</h3>
38 38
 								</div>
39 39
 								<div class="windowbg nopadding">
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 								<tbody>
506 506
 									<tr class="windowbg">
507 507
 										<td class="half_table">
508
-											<a href="#" id="Tasks-link">', $txt['dvc_tasks'] ,'</a>
508
+											<a href="#" id="Tasks-link">', $txt['dvc_tasks'], '</a>
509 509
 										</td>
510 510
 										<td class="quarter_table">
511 511
 											<em id="yourTasks">??</em>
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 				echo '
769 769
 							<div class="cat_bar">
770 770
 								<h3 class="', !empty($config_var['class']) ? $config_var['class'] : 'catbg', '"', !empty($config_var['force_div_id']) ? ' id="' . $config_var['force_div_id'] . '"' : '', '>
771
-									', ($config_var['help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $config_var['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : ''), '
771
+									', ($config_var['help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=' . $config_var['help'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : ''), '
772 772
 									', $config_var['label'], '
773 773
 								</h3>
774 774
 							</div>';
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 				// Show the [?] button.
831 831
 				if ($config_var['help'])
832 832
 					echo '
833
-							<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ';
833
+							<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ';
834 834
 
835 835
 				echo '
836 836
 										<a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 					$max = isset($config_var['max']) ? ' max="' . $config_var['max'] . '"' : '';
935 935
 
936 936
 					echo '
937
-											<input type="', $type ,'"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '" value="', $config_var['value'], '"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_text"', $min . $max . $step, '>';
937
+											<input type="', $type, '"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '" value="', $config_var['value'], '"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_text"', $min . $max . $step, '>';
938 938
 				}
939 939
 
940 940
 				echo isset($config_var['postinput']) ? '
@@ -1126,13 +1126,13 @@  discard block
 block discarded – undo
1126 1126
 
1127 1127
 	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1128 1128
 		echo '
1129
-												<option value="', $order ,'"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_'. $name], '</option>';
1129
+												<option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>';
1130 1130
 
1131 1131
 	echo '
1132 1132
 											</select>
1133 1133
 										</dd>
1134 1134
 										<dt>
1135
-											<a id="field_show_enclosed" href="', $scripturl, '?action=helpadmin;help=field_show_enclosed" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
1135
+											<a id="field_show_enclosed" href="', $scripturl, '?action=helpadmin;help=field_show_enclosed" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
1136 1136
 											<strong><label for="enclose">', $txt['custom_edit_enclose'], ':</label></strong><br>
1137 1137
 											<span class="smalltext">', $txt['custom_edit_enclose_desc'], '</span>
1138 1138
 										</dt>
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 											<input type="checkbox" name="bbc" id="bbc_dd"', $context['field']['bbc'] ? ' checked' : '', ' class="input_check">
1178 1178
 										</dd>
1179 1179
 										<dt id="options_dt">
1180
-											<a href="', $scripturl, '?action=helpadmin;help=customoptions" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
1180
+											<a href="', $scripturl, '?action=helpadmin;help=customoptions" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
1181 1181
 											<strong><label for="options_dd">', $txt['custom_edit_options'], ':</label></strong><br>
1182 1182
 											<span class="smalltext">', $txt['custom_edit_options_desc'], '</span>
1183 1183
 										</dt>
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 									<legend>', $txt['custom_edit_advanced'], '</legend>
1207 1207
 									<dl class="settings">
1208 1208
 										<dt id="mask_dt">
1209
-											<a id="custom_mask" href="', $scripturl, '?action=helpadmin;help=custom_mask" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>
1209
+											<a id="custom_mask" href="', $scripturl, '?action=helpadmin;help=custom_mask" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>
1210 1210
 											<strong><label for="mask">', $txt['custom_edit_mask'], ':</label></strong><br>
1211 1211
 											<span class="smalltext">', $txt['custom_edit_mask_desc'], '</span>
1212 1212
 										</dt>
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 			{
1323 1323
 				echo '
1324 1324
 							<li>
1325
-								<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']';
1325
+								<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']';
1326 1326
 
1327 1327
 				if ($result['help'])
1328 1328
 					echo '
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
 					<div id="admincenter">
1403 1403
 						<div id="section_header" class="cat_bar">
1404 1404
 							<h3 class="catbg">',
1405
-								$context['error_search'] ? $txt['errors_list'] : $txt['errors_fixing'] , '
1405
+								$context['error_search'] ? $txt['errors_list'] : $txt['errors_fixing'], '
1406 1406
 							</h3>
1407 1407
 						</div>
1408 1408
 						<div class="windowbg">';
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 			{
1556 1556
 				echo '
1557 1557
 								<tr class="windowbg">
1558
-									<td class="equal_table">', $key,  '</td>
1558
+									<td class="equal_table">', $key, '</td>
1559 1559
 									<td colspan="2">', $setting, '</td>
1560 1560
 								</tr>';
1561 1561
 			}
Please login to merge, or discard this patch.