Passed
Pull Request — release-2.1 (#5093)
by 01
05:42
created
Sources/Display.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -899,13 +899,13 @@
 block discarded – undo
899 899
 		if ($start_char === 'C')
900 900
 			$limit_seek = $limit;
901 901
 		else
902
-			$limit_seek  = $limit + 1;
902
+			$limit_seek = $limit + 1;
903 903
 
904 904
 		$request = $smcFunc['db_query']('', '
905 905
 			SELECT id_msg, id_member, approved
906 906
 			FROM {db_prefix}messages
907 907
 			WHERE id_topic = {int:current_topic}
908
-			AND id_msg '. $page_operator . ' {int:page_id}'. (!$modSettings['postmod_active'] || $approve_posts ? '' : '
908
+			AND id_msg '. $page_operator . ' {int:page_id}' . (!$modSettings['postmod_active'] || $approve_posts ? '' : '
909 909
 			AND (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . '
910 910
 			ORDER BY id_msg ' . ($ascending_seek ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : '
911 911
 			LIMIT {int:limit}'),
Please login to merge, or discard this patch.
Sources/Logging.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array The truncated array
25 25
  */
26
-function truncateArray($arr, $max_length=1900)
26
+function truncateArray($arr, $max_length = 1900)
27 27
 {
28 28
 	$curr_length = 0;
29 29
 	foreach ($arr as $key => $value)
30 30
 		if (is_array($value))
31 31
 			foreach ($value as $key2 => $value2)
32
-				$curr_length += strlen ($value2);
32
+				$curr_length += strlen($value2);
33 33
 		else
34
-			$curr_length += strlen ($value);
34
+			$curr_length += strlen($value);
35 35
 	if ($curr_length <= $max_length)
36 36
 		return $arr;
37 37
 	else
38 38
 	{
39 39
 		// Truncate each element's value to a reasonable length
40
-		$param_max = floor($max_length/count($arr));
40
+		$param_max = floor($max_length / count($arr));
41 41
 		foreach ($arr as $key => &$value)
42 42
 			if (is_array($value))
43 43
 				foreach ($value as $key2 => &$value2)
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	if (filemtime($cachedir . '/db_last_error.php') === $last_db_error_change)
208 208
 	{
209 209
 		// Write the change
210
-		$write_db_change =  '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>';
210
+		$write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>';
211 211
 		$written_bytes = file_put_contents($cachedir . '/db_last_error.php', $write_db_change, LOCK_EX);
212 212
 
213 213
 		// survey says ...
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br>
281 281
 	', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br>
282 282
 	', $txt['debug_hooks'], empty($context['debug']['hooks']) ? 0 : count($context['debug']['hooks']) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_hooks\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_hooks" style="display: none;"><em>' . implode('</em>, <em>', $context['debug']['hooks']), '</em></span>)', '<br>
283
-	',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">'. $txt['debug_show'] .'</a><span id="debug_instances" style="display: none;"><em>'. implode('</em>, <em>', array_keys($context['debug']['instances'])) .'</em></span>)'. '<br>') : ''),'
283
+	',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">' . $txt['debug_show'] . '</a><span id="debug_instances" style="display: none;"><em>' . implode('</em>, <em>', array_keys($context['debug']['instances'])) . '</em></span>)' . '<br>') : ''), '
284 284
 	', $txt['debug_files_included'], count($files), ' - ', round($total_size / 1024), $txt['debug_kb'], ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_include_info\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_include_info" style="display: none;"><em>', implode('</em>, <em>', $files), '</em></span>)<br>';
285 285
 
286 286
 	if (function_exists('memory_get_peak_usage'))
Please login to merge, or discard this patch.
Sources/Who.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 						'Jessica "Suki" Gonz&aacute;lez',
593 593
 						'Karl "RegularExpression" Benson',
594 594
 						'Matthew "Labradoodle-360" Kerle',
595
-						$user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge',
595
+						$user_info['is_admin'] ? 'Matt "Grudge" Wolf' : 'Grudge',
596 596
 						'Michael "Thantos" Miller',
597 597
 						'Norv',
598 598
 						'Peter "Arantor" Spicer',
@@ -824,13 +824,13 @@  discard block
 block discarded – undo
824 824
 			$credit_info = $smcFunc['json_decode']($row['credits'], true);
825 825
 
826 826
 			$copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' &copy; ' . $smcFunc['htmlspecialchars']($credit_info['copyright']);
827
-			$license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="'. $smcFunc['htmlspecialchars']($credit_info['licenseurl']) .'">'. $smcFunc['htmlspecialchars']($credit_info['license']) .'</a>' : $smcFunc['htmlspecialchars']($credit_info['license']));
827
+			$license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="' . $smcFunc['htmlspecialchars']($credit_info['licenseurl']) . '">' . $smcFunc['htmlspecialchars']($credit_info['license']) . '</a>' : $smcFunc['htmlspecialchars']($credit_info['license']));
828 828
 			$version = $txt['credits_version'] . ' ' . $row['version'];
829 829
 			$title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version;
830 830
 
831 831
 			// build this one out and stash it away
832 832
 			$mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>';
833
-			$mods[] = $mod_name . (!empty($license) ? ' | ' . $license  : '') . (!empty($copyright) ? ' | ' . $copyright  : '');
833
+			$mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : '');
834 834
 		}
835 835
 		cache_put_data('mods_credits', $mods, 86400);
836 836
 	}
Please login to merge, or discard this patch.
Sources/Subscriptions-PayPal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@
 block discarded – undo
236 236
 			$header = 'POST /cgi-bin/webscr HTTP/1.1' . "\r\n";
237 237
 			$header .= 'content-type: application/x-www-form-urlencoded' . "\r\n";
238 238
 			$header .= 'Host: www.' . (!empty($modSettings['paidsubs_test']) ? 'sandbox.' : '') . 'paypal.com' . "\r\n";
239
-			$header .= 'content-length: ' . strlen ($requestString) . "\r\n";
239
+			$header .= 'content-length: ' . strlen($requestString) . "\r\n";
240 240
 			$header .= 'connection: close' . "\r\n\r\n";
241 241
 
242 242
 			// Open the connection.
Please login to merge, or discard this patch.
Sources/Attachments.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		// Just send a generic message.
77 77
 		else
78 78
 			$this->setResponse(array(
79
-				'text' => $this->_sa == 'add' ? 'attach_error_title' :   'attached_file_deleted_error',
79
+				'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error',
80 80
 				'type' => 'error',
81 81
 				'data' => false,
82 82
 			));
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			// Gotta urlencode the filename.
411 411
 			if ($this->_attachResults)
412 412
 				foreach ($this->_attachResults as $k => $v)
413
-					$this->_attachResults[$k]['name'] =  urlencode($this->_attachResults[$k]['name']);
413
+					$this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']);
414 414
 
415 415
 			$this->_response = array(
416 416
 				'files' => $this->_attachResults ? $this->_attachResults : false,
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 			ob_start();
438 438
 
439 439
 		// Set the header.
440
-		header('content-type: application/json; charset='. $context['character_set'] .'');
440
+		header('content-type: application/json; charset=' . $context['character_set'] . '');
441 441
 
442 442
 		echo $smcFunc['json_encode']($this->_response ? $this->_response : array());
443 443
 
Please login to merge, or discard this patch.
Braces   -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,6 @@
 block discarded – undo
199 199
 			list ($context['attachments']['quantity'], $context['attachments']['total_size']) = $smcFunc['db_fetch_row']($request);
200 200
 			$smcFunc['db_free_result']($request);
201 201
 		}
202
-
203 202
 		else
204 203
 			$context['attachments'] = array(
205 204
 				'quantity' => 0,
Please login to merge, or discard this patch.
Sources/Subs-Post.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -704,7 +704,7 @@
 block discarded – undo
704 704
 					$mail_result = false;
705 705
 				}
706 706
 			}
707
-			catch(ErrorException $e)
707
+			catch (ErrorException $e)
708 708
 			{
709 709
 				log_error($e->getMessage(), 'general', $e->getFile(), $e->getLine());
710 710
 				log_error(sprintf($txt['mail_send_unable'], $to));
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,8 @@  discard block
 block discarded – undo
116 116
 	if (!$previewing && strpos($message, '[html]') !== false)
117 117
 	{
118 118
 		if (allowedTo('admin_forum'))
119
-			$message = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m) {
119
+			$message = preg_replace_callback('~\[html\](.+?)\[/html\]~is', function($m)
120
+			{
120 121
 				return '[html]' . strtr(un_htmlspecialchars($m[1]), array("\n" => '&#13;', '  ' => ' &#32;', '[' => '&#91;', ']' => '&#93;')) . '[/html]';
121 122
 			}, $message);
122 123
 
@@ -626,9 +627,10 @@  discard block
 block discarded – undo
626 627
 		foreach ($to_array as $to)
627 628
 		{
628 629
 			set_error_handler(function($errno, $errstr, $errfile, $errline)
629
-				{
630
+			{
630 631
 					// error was suppressed with the @-operator
631
-					if (0 === error_reporting()) {
632
+					if (0 === error_reporting())
633
+					{
632 634
 						return false;
633 635
 					}
634 636
 
@@ -1241,7 +1243,6 @@  discard block
 block discarded – undo
1241 1243
 
1242 1244
 		return array($charset, $string, 'base64');
1243 1245
 	}
1244
-
1245 1246
 	else
1246 1247
 		return array($charset, $string, '7bit');
1247 1248
 }
Please login to merge, or discard this patch.
proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
 		$max_age = $time - $cached['time'] + (5 * 86400);
141 141
 		header('content-type: ' . $cached['content_type']);
142 142
 		header('content-length: ' . $cached['size']);
143
-		header('cache-control: public, max-age=' . $max_age );
143
+		header('cache-control: public, max-age=' . $max_age);
144 144
 		header('last-modified: ' . gmdate('D, d M Y H:i:s', $cached['time']) . ' GMT');
145 145
 		header('etag: ' . $eTag);
146 146
 		echo base64_decode($cached['body']);
Please login to merge, or discard this patch.
Sources/Profile-View.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 	$smcFunc['db_free_result']($request);
252 252
 
253
-	if($withSender)
253
+	if ($withSender)
254 254
 	{
255 255
 		$senders = loadMemberData($senders);
256 256
 		foreach ($senders as $member)
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 	if (count($context['ip']) !== 2)
1897 1897
 		fatal_lang_error('invalid_tracking_ip', false);
1898 1898
 
1899
-	$ip_string = array('{inet:ip_address_low}','{inet:ip_address_high}');
1899
+	$ip_string = array('{inet:ip_address_low}', '{inet:ip_address_high}');
1900 1900
 	$fields = array(
1901 1901
 			'ip_address_low' => $context['ip']['low'],
1902 1902
 			'ip_address_high' => $context['ip']['high'],
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
 
1905 1905
 	$ip_var = $context['ip'];
1906 1906
 
1907
-	if ($context['ip']['low'] !==  $context['ip']['high'])
1907
+	if ($context['ip']['low'] !== $context['ip']['high'])
1908 1908
 		$context['ip'] = $context['ip']['low'] . ' - ' . $context['ip']['high'];
1909 1909
 	else
1910 1910
 		$context['ip'] = $context['ip']['low'];
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -461,7 +461,7 @@
 block discarded – undo
461 461
 		$fields = '';
462 462
 		foreach ($context['print_custom_fields']['below_signature'] as $field)
463 463
 			if (!empty($field['output_html']))
464
-				$fields .=  '
464
+				$fields .= '
465 465
 					<li>' . $field['output_html'] . '</li>';
466 466
 
467 467
 		if (!empty($fields))
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2192,10 +2192,10 @@  discard block
 block discarded – undo
2192 2192
  */
2193 2193
 function template_ignoreboards()
2194 2194
 {
2195
-    global $context, $txt, $scripturl;
2195
+	global $context, $txt, $scripturl;
2196 2196
 
2197
-    // The main containing header.
2198
-    echo '
2197
+	// The main containing header.
2198
+	echo '
2199 2199
 	<form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
2200 2200
 		<div class="cat_bar">
2201 2201
 			<h3 class="catbg profile_hd">
@@ -2207,34 +2207,34 @@  discard block
 block discarded – undo
2207 2207
 			<div class="flow_hidden boardslist">
2208 2208
 				<ul>';
2209 2209
 
2210
-    foreach ($context['categories'] as $category)
2211
-    {
2212
-        echo '
2210
+	foreach ($context['categories'] as $category)
2211
+	{
2212
+		echo '
2213 2213
 					<li>
2214 2214
 						<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'creator\'); return false;">', $category['name'], '</a>
2215 2215
             			<ul>';
2216 2216
 
2217
-        foreach ($category['boards'] as $board)
2218
-        {
2219
-            echo '
2217
+		foreach ($category['boards'] as $board)
2218
+		{
2219
+			echo '
2220 2220
 							<li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
2221 2221
 								<label for="ignore_brd', $board['id'], '"><input type="checkbox" id="brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked' : '', '> ', $board['name'], '</label>
2222 2222
 							</li>';
2223
-        }
2223
+		}
2224 2224
 
2225
-        echo '
2225
+		echo '
2226 2226
 						</ul>
2227 2227
 					</li>';
2228
-    }
2228
+	}
2229 2229
 
2230
-    echo '
2230
+	echo '
2231 2231
 				</ul>
2232 2232
     		</div><!-- .flow_hidden boardslist -->';
2233 2233
 
2234
-    // Show the standard "Save Settings" profile button.
2235
-    template_profile_save();
2234
+	// Show the standard "Save Settings" profile button.
2235
+	template_profile_save();
2236 2236
 
2237
-    echo '
2237
+	echo '
2238 2238
 		</div><!-- .windowbg -->
2239 2239
 	</form>
2240 2240
 	<br>';
Please login to merge, or discard this patch.