Completed
Pull Request — release-2.1 (#6199)
by Mathias
09:23 queued 05:15
created
Sources/tasks/CreatePost-Notify.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
 	/**
21 21
 	 * Constants for reply types.
22
-	*/
22
+	 */
23 23
 	const NOTIFY_TYPE_REPLY_AND_MODIFY = 1;
24 24
 	const NOTIFY_TYPE_REPLY_AND_TOPIC_START_FOLLOWING = 2;
25 25
 	const NOTIFY_TYPE_ONLY_REPLIES = 3;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 	/**
29 29
 	 * Constants for frequencies.
30
-	*/
30
+	 */
31 31
 	const FREQUENCY_NOTHING = 0;
32 32
 	const FREQUENCY_EVERYTHING = 1;
33 33
 	const FREQUENCY_FIRST_UNREAD_MSG = 2;
Please login to merge, or discard this patch.
Braces   -1 removed lines patch added patch discarded remove patch
@@ -266,7 +266,6 @@
 block discarded – undo
266 266
 				$user_info = $real_user_info;
267 267
 				unset($real_user_info);
268 268
 			}
269
-
270 269
 			else
271 270
 				$user_info = null;
272 271
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		if ($type == 'edit')
119 119
 		{
120 120
 			// Filter out members who have already been notified about this post's topic
121
-			$unnotified = array_filter($watched, function ($member)
121
+			$unnotified = array_filter($watched, function($member)
122 122
 			{
123 123
 				return empty($member['sent']);
124 124
 			});
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 			if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id]))
205 205
 			{
206 206
 				$pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ?
207
-					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] :
208
-					(!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
207
+					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
209 208
 
210 209
 				$message_type = 'notification_' . $type;
211 210
 
@@ -224,8 +223,7 @@  discard block
 block discarded – undo
224 223
 			elseif ($type == 'topic')
225 224
 			{
226 225
 				$pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ?
227
-					$prefs[$member_id]['board_notify_' . $topicOptions['board']] :
228
-					(!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
226
+					$prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
229 227
 
230 228
 				$content_type = 'board';
231 229
 
Please login to merge, or discard this patch.
Sources/ManageErrors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -355,8 +355,8 @@
 block discarded – undo
355 355
 	elseif (isset($_POST['delall']) && isset($filter))
356 356
 	{
357 357
 		// ip need a different placeholder type
358
-		$filter_type = $filter['variable'] == 'ip'? 'inet' : 'string';
359
-		$filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE';
358
+		$filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string';
359
+		$filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE';
360 360
 		$smcFunc['db_query']('', '
361 361
 			DELETE FROM {db_prefix}log_errors
362 362
 			WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}',
Please login to merge, or discard this patch.
Sources/Subs.php 3 patches
Braces   +3 added lines, -9 removed lines patch added patch discarded remove patch
@@ -279,7 +279,6 @@  discard block
 block discarded – undo
279 279
 		$condition = 'id_member IN ({array_int:members})';
280 280
 		$parameters['members'] = $members;
281 281
 	}
282
-
283 282
 	elseif ($members === null)
284 283
 		$condition = '1=1';
285 284
 
@@ -382,11 +381,9 @@  discard block
 block discarded – undo
382 381
 				$val = $val . ' END';
383 382
 				$type = 'raw';
384 383
 			}
385
-
386 384
 			else
387 385
 				$val = alert_count($members, true);
388 386
 		}
389
-
390 387
 		elseif ($type == 'int' && ($val === '+' || $val === '-'))
391 388
 		{
392 389
 			$val = $var . ' ' . $val . ' 1';
@@ -2170,12 +2167,12 @@  discard block
 block discarded – undo
2170 2167
 			'tag' => 'cowsay',
2171 2168
 			'parameters' => array(
2172 2169
 				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2173
-					{
2170
+				{
2174 2171
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2175 2172
 					},
2176 2173
 				),
2177 2174
 				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2178
-					{
2175
+				{
2179 2176
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2180 2177
 					},
2181 2178
 				),
@@ -3273,7 +3270,7 @@  discard block
 block discarded – undo
3273 3270
 
3274 3271
 	// Replace away!
3275 3272
 	$message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements)
3276
-		{
3273
+	{
3277 3274
 			return $smileyPregReplacements[$matches[1]];
3278 3275
 		}, $message);
3279 3276
 }
@@ -4071,7 +4068,6 @@  discard block
 block discarded – undo
4071 4068
 				if (!isset($minSeed) && isset($js_file['options']['seed']))
4072 4069
 					$minSeed = $js_file['options']['seed'];
4073 4070
 			}
4074
-
4075 4071
 			else
4076 4072
 			{
4077 4073
 				echo '
@@ -6354,7 +6350,6 @@  discard block
 block discarded – undo
6354 6350
 			$isWritable = true;
6355 6351
 			break;
6356 6352
 		}
6357
-
6358 6353
 		else
6359 6354
 			@chmod($file, $val);
6360 6355
 	}
@@ -7286,7 +7281,6 @@  discard block
 block discarded – undo
7286 7281
 
7287 7282
             $length += array_length($value, $deep_count);
7288 7283
         }
7289
-
7290 7284
         else
7291 7285
             $length += strlen($value);
7292 7286
     }
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -7239,32 +7239,32 @@  discard block
 block discarded – undo
7239 7239
  */
7240 7240
 function truncate_array($array, $max_length = 1900, $deep = 3)
7241 7241
 {
7242
-    $array = (array) $array;
7242
+	$array = (array) $array;
7243 7243
 
7244
-    $curr_length = array_length($array, $deep);
7244
+	$curr_length = array_length($array, $deep);
7245 7245
 
7246
-    if ($curr_length <= $max_length)
7247
-        return $array;
7246
+	if ($curr_length <= $max_length)
7247
+		return $array;
7248 7248
 
7249
-    else
7250
-    {
7251
-        // Truncate each element's value to a reasonable length
7252
-        $param_max = floor($max_length / count($array));
7249
+	else
7250
+	{
7251
+		// Truncate each element's value to a reasonable length
7252
+		$param_max = floor($max_length / count($array));
7253 7253
 
7254
-        $current_deep = $deep - 1;
7254
+		$current_deep = $deep - 1;
7255 7255
 
7256
-        foreach ($array as $key => &$value)
7257
-        {
7258
-            if (is_array($value))
7259
-                if ($current_deep > 0)
7260
-                    $value = truncate_array($value, $current_deep);
7256
+		foreach ($array as $key => &$value)
7257
+		{
7258
+			if (is_array($value))
7259
+				if ($current_deep > 0)
7260
+					$value = truncate_array($value, $current_deep);
7261 7261
 
7262
-            else
7263
-                $value = substr($value, 0, $param_max - strlen($key) - 5);
7264
-        }
7262
+			else
7263
+				$value = substr($value, 0, $param_max - strlen($key) - 5);
7264
+		}
7265 7265
 
7266
-        return $array;
7267
-    }
7266
+		return $array;
7267
+	}
7268 7268
 }
7269 7269
 
7270 7270
 /**
@@ -7275,29 +7275,29 @@  discard block
 block discarded – undo
7275 7275
  */
7276 7276
 function array_length($array, $deep = 3)
7277 7277
 {
7278
-    // Work with arrays
7279
-    $array = (array) $array;
7280
-    $length = 0;
7278
+	// Work with arrays
7279
+	$array = (array) $array;
7280
+	$length = 0;
7281 7281
 
7282
-    $deep_count = $deep - 1;
7282
+	$deep_count = $deep - 1;
7283 7283
 
7284
-    foreach ($array as $value)
7285
-    {
7286
-        // Recursive?
7287
-        if (is_array($value))
7288
-        {
7289
-            // No can't do
7290
-            if ($deep_count <= 0)
7291
-                continue;
7284
+	foreach ($array as $value)
7285
+	{
7286
+		// Recursive?
7287
+		if (is_array($value))
7288
+		{
7289
+			// No can't do
7290
+			if ($deep_count <= 0)
7291
+				continue;
7292 7292
 
7293
-            $length += array_length($value, $deep_count);
7294
-        }
7293
+			$length += array_length($value, $deep_count);
7294
+		}
7295 7295
 
7296
-        else
7297
-            $length += strlen($value);
7298
-    }
7296
+		else
7297
+			$length += strlen($value);
7298
+	}
7299 7299
 
7300
-    return $length;
7300
+	return $length;
7301 7301
 }
7302 7302
 
7303 7303
 /**
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 			{
378 378
 				$val = 'CASE ';
379 379
 				foreach ($members as $k => $v)
380
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' ';
380
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' ';
381 381
 
382 382
 				$val = $val . ' END';
383 383
 				$type = 'raw';
@@ -1041,11 +1041,11 @@  discard block
 block discarded – undo
1041 1041
 			// Anything that isn't a specification, punctuation mark, or whitespace.
1042 1042
 			'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u',
1043 1043
 			// A series of punctuation marks (except %), possibly separated by whitespace.
1044
-			'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
1044
+			'~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u',
1045 1045
 			// Unwanted trailing punctuation and whitespace.
1046
-			'~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1046
+			'~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1047 1047
 			// Unwanted opening punctuation and whitespace.
1048
-			'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1048
+			'~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1049 1049
 		),
1050 1050
 		array(
1051 1051
 			'',
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
 							$width = !empty($width) ? ' width="' . $width . '"' : '';
1461 1461
 							$height = !empty($height) ? ' height="' . $height . '"' : '';
1462 1462
 
1463
-							$returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : '');
1463
+							$returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : '');
1464 1464
 						}
1465 1465
 						// Audio.
1466 1466
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
 							$width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;';
1469 1469
 							$height = !empty($height) ? 'height: ' . $height . 'px;' : '';
1470 1470
 
1471
-							$returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>';
1471
+							$returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>';
1472 1472
 						}
1473 1473
 						// Anything else.
1474 1474
 						else
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 				'type' => 'unparsed_commas_content',
1638 1638
 				'test' => '\d+,\d+\]',
1639 1639
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1640
-				'validate' => function (&$tag, &$data, $disabled)
1640
+				'validate' => function(&$tag, &$data, $disabled)
1641 1641
 				{
1642 1642
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1643 1643
 					if (empty($scheme))
@@ -2175,12 +2175,12 @@  discard block
 block discarded – undo
2175 2175
 		$codes[] = array(
2176 2176
 			'tag' => 'cowsay',
2177 2177
 			'parameters' => array(
2178
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2178
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2179 2179
 					{
2180 2180
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2181 2181
 					},
2182 2182
 				),
2183
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2183
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2184 2184
 					{
2185 2185
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2186 2186
 					},
@@ -3552,7 +3552,7 @@  discard block
 block discarded – undo
3552 3552
 		if ($fp != false)
3553 3553
 		{
3554 3554
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
3555
-			fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n");
3555
+			fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n");
3556 3556
 
3557 3557
 			// Read in the HTTP/1.1 or whatever.
3558 3558
 			$test = substr(fgets($fp, 11), -1);
@@ -4156,7 +4156,7 @@  discard block
 block discarded – undo
4156 4156
 	$toMinify = array();
4157 4157
 	$normal = array();
4158 4158
 
4159
-	uasort($context['css_files'], function ($a, $b)
4159
+	uasort($context['css_files'], function($a, $b)
4160 4160
 	{
4161 4161
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4162 4162
 	});
@@ -5452,7 +5452,7 @@  discard block
 block discarded – undo
5452 5452
 			{
5453 5453
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
5454 5454
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5455
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5455
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5456 5456
 				if ($keep_alive)
5457 5457
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n");
5458 5458
 				else
@@ -5462,7 +5462,7 @@  discard block
 block discarded – undo
5462 5462
 			{
5463 5463
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5464 5464
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5465
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5465
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5466 5466
 				if ($keep_alive)
5467 5467
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5468 5468
 				else
@@ -5710,13 +5710,13 @@  discard block
 block discarded – undo
5710 5710
 
5711 5711
 	// UTF-8 occurences of MS special characters
5712 5712
 	$findchars_utf8 = array(
5713
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5714
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5715
-		"\xe2\x80\xa6",	// horizontal ellipsis
5716
-		"\xe2\x80\x98",	// left single curly quote
5717
-		"\xe2\x80\x99",	// right single curly quote
5718
-		"\xe2\x80\x9c",	// left double curly quote
5719
-		"\xe2\x80\x9d",	// right double curly quote
5713
+		"\xe2\x80\x9a", // single low-9 quotation mark
5714
+		"\xe2\x80\x9e", // double low-9 quotation mark
5715
+		"\xe2\x80\xa6", // horizontal ellipsis
5716
+		"\xe2\x80\x98", // left single curly quote
5717
+		"\xe2\x80\x99", // right single curly quote
5718
+		"\xe2\x80\x9c", // left double curly quote
5719
+		"\xe2\x80\x9d", // right double curly quote
5720 5720
 	);
5721 5721
 
5722 5722
 	// windows 1252 / iso equivalents
@@ -5732,13 +5732,13 @@  discard block
 block discarded – undo
5732 5732
 
5733 5733
 	// safe replacements
5734 5734
 	$replacechars = array(
5735
-		',',	// &sbquo;
5736
-		',,',	// &bdquo;
5737
-		'...',	// &hellip;
5738
-		"'",	// &lsquo;
5739
-		"'",	// &rsquo;
5740
-		'"',	// &ldquo;
5741
-		'"',	// &rdquo;
5735
+		',', // &sbquo;
5736
+		',,', // &bdquo;
5737
+		'...', // &hellip;
5738
+		"'", // &lsquo;
5739
+		"'", // &rsquo;
5740
+		'"', // &ldquo;
5741
+		'"', // &rdquo;
5742 5742
 	);
5743 5743
 
5744 5744
 	if ($context['utf8'])
@@ -6923,7 +6923,7 @@  discard block
 block discarded – undo
6923 6923
 			EXISTS (
6924 6924
 				SELECT bpv.id_board
6925 6925
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6926
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
6926
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
6927 6927
 					AND bpv.deny = 0
6928 6928
 					AND bpv.id_board = b.id_board
6929 6929
 			)';
@@ -6933,7 +6933,7 @@  discard block
 block discarded – undo
6933 6933
 			AND NOT EXISTS (
6934 6934
 				SELECT bpv.id_board
6935 6935
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6936
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
6936
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
6937 6937
 					AND bpv.deny = 1
6938 6938
 					AND bpv.id_board = b.id_board
6939 6939
 			)';
@@ -7204,8 +7204,8 @@  discard block
 block discarded – undo
7204 7204
 	$i = 0;
7205 7205
 	while (empty($done))
7206 7206
 	{
7207
-		if (strpos($format, '{'. --$i . '}') !== false)
7208
-			$replacements['{'. $i . '}'] = array_pop($list);
7207
+		if (strpos($format, '{' . --$i . '}') !== false)
7208
+			$replacements['{' . $i . '}'] = array_pop($list);
7209 7209
 		else
7210 7210
 			$done = true;
7211 7211
 	}
@@ -7215,8 +7215,8 @@  discard block
 block discarded – undo
7215 7215
 	$i = 0;
7216 7216
 	while (empty($done))
7217 7217
 	{
7218
-		if (strpos($format, '{'. ++$i . '}') !== false)
7219
-			$replacements['{'. $i . '}'] = array_shift($list);
7218
+		if (strpos($format, '{' . ++$i . '}') !== false)
7219
+			$replacements['{' . $i . '}'] = array_shift($list);
7220 7220
 		else
7221 7221
 			$done = true;
7222 7222
 	}
Please login to merge, or discard this patch.
Sources/Profile-Export.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1396,7 +1396,9 @@
 block discarded – undo
1396 1396
 
1397 1397
 	// Figure out the filename we'll tell the browser.
1398 1398
 	$datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile');
1399
-	$included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
1399
+	$included_desc = array_map(function ($datatype) use ($txt)
1400
+	{
1401
+return $txt[$datatype]; }, $datatypes);
1400 1402
 
1401 1403
 	$dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc);
1402 1404
 	$dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename)))));
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 	// Figure out the filename we'll tell the browser.
461 461
 	$datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile');
462
-	$included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
462
+	$included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
463 463
 
464 464
 	$dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc);
465 465
 	$dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename)))));
@@ -774,9 +774,9 @@  discard block
 block discarded – undo
774 774
 	$xslt_variables = array();
775 775
 
776 776
 	// Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function.
777
-	$smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile';
778
-	$xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform';
779
-	$html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml';
777
+	$smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile';
778
+	$xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform';
779
+	$html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml';
780 780
 
781 781
 	require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php');
782 782
 
@@ -1682,14 +1682,14 @@  discard block
 block discarded – undo
1682 1682
 
1683 1683
 		if (!empty($context['export_css_header']))
1684 1684
 		{
1685
-			$stylesheet['css_js'] .=  '
1685
+			$stylesheet['css_js'] .= '
1686 1686
 			<style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]>
1687 1687
 			</style>';
1688 1688
 		}
1689 1689
 
1690 1690
 		if (!empty($context['export_javascript_vars']))
1691 1691
 		{
1692
-			$stylesheet['css_js'] .=  '
1692
+			$stylesheet['css_js'] .= '
1693 1693
 			<script><![CDATA[';
1694 1694
 
1695 1695
 			foreach ($context['export_javascript_vars'] as $var => $val)
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 
1726 1726
 		if (!empty($context['export_javascript_inline']['standard']))
1727 1727
 		{
1728
-			$stylesheet['css_js'] .=  '
1728
+			$stylesheet['css_js'] .= '
1729 1729
 			<script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]>
1730 1730
 			</script>';
1731 1731
 		}
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 
1738 1738
 			$stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer']));
1739 1739
 
1740
-			$stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]>
1740
+			$stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]>
1741 1741
 			</script>';
1742 1742
 		}
1743 1743
 
@@ -1818,7 +1818,7 @@  discard block
 block discarded – undo
1818 1818
 	$css_to_minify = array();
1819 1819
 	$normal_css_files = array();
1820 1820
 
1821
-	usort($context['css_files'], function ($a, $b)
1821
+	usort($context['css_files'], function($a, $b)
1822 1822
 	{
1823 1823
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
1824 1824
 	});
Please login to merge, or discard this patch.
Sources/Load.php 1 patch
Braces   +1 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	// Set a list of common functions.
105 105
 	$ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);';
106 106
 	$ent_check = empty($modSettings['disableEntityCheck']) ? function($string)
107
-		{
107
+	{
108 108
 			$string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string);
109 109
 			return $string;
110 110
 		} : function($string)
@@ -929,7 +929,6 @@  discard block
 block discarded – undo
929 929
 			$user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) -
930 930
 					$tz_system->getOffset($time_system)) / 3600;
931 931
 		}
932
-
933 932
 		else
934 933
 			$user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset'];
935 934
 	}
@@ -1658,7 +1657,6 @@  discard block
 block discarded – undo
1658 1657
 			$time_user = new DateTime('now', $tz_user);
1659 1658
 			$profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600;
1660 1659
 		}
1661
-
1662 1660
 		else
1663 1661
 		{
1664 1662
 			// !!! Compatibility.
@@ -2321,7 +2319,6 @@  discard block
 block discarded – undo
2321 2319
 		loadLanguage('index+Modifications');
2322 2320
 		$context['template_layers'] = array();
2323 2321
 	}
2324
-
2325 2322
 	else
2326 2323
 	{
2327 2324
 		// Custom templates to load, or just default?
@@ -2702,14 +2699,12 @@  discard block
 block discarded – undo
2702 2699
 				$fileUrl = $settings['default_theme_url'] . '/css/' . $fileName;
2703 2700
 				$filePath = $settings['default_theme_dir'] . '/css/' . $fileName;
2704 2701
 			}
2705
-
2706 2702
 			else
2707 2703
 			{
2708 2704
 				$fileUrl = false;
2709 2705
 				$filePath = false;
2710 2706
 			}
2711 2707
 		}
2712
-
2713 2708
 		else
2714 2709
 		{
2715 2710
 			$fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName;
@@ -2817,14 +2812,12 @@  discard block
 block discarded – undo
2817 2812
 				$fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName;
2818 2813
 				$filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName;
2819 2814
 			}
2820
-
2821 2815
 			else
2822 2816
 			{
2823 2817
 				$fileUrl = false;
2824 2818
 				$filePath = false;
2825 2819
 			}
2826 2820
 		}
2827
-
2828 2821
 		else
2829 2822
 		{
2830 2823
 			$fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName;
Please login to merge, or discard this patch.
Sources/tasks/ExportProfileData.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
 		$feed_meta = array(
154 154
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
155
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
155
+			'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
156 156
 			'author' => $mbname,
157 157
 			'source' => $scripturl . '?action=profile;u=' . $uid,
158 158
 			'self' => '', // Unused, but can't be null.
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 					'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"',
641 641
 				),
642 642
 				$returnContext
643
-			) . $hidden_orig_link . '</span>' ;
643
+			) . $hidden_orig_link . '</span>';
644 644
 		}
645 645
 		elseif (strpos($currentAttachment['mime_type'], 'video/') === 0)
646 646
 		{
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,9 @@
 block discarded – undo
152 152
 
153 153
 		$feed_meta = array(
154 154
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
155
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
155
+			'desc' => sentence_list(array_map(function ($datatype) use ($txt)
156
+			{
157
+return $txt[$datatype]; }, array_keys($included))),
156 158
 			'author' => $mbname,
157 159
 			'source' => $scripturl . '?action=profile;u=' . $uid,
158 160
 			'self' => '', // Unused, but can't be null.
Please login to merge, or discard this patch.
Themes/default/ModerationCenter.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -393,17 +393,17 @@  discard block
 block discarded – undo
393 393
 		$quickbuttons = array(
394 394
 			'approve' => array(
395 395
 				'label' => $txt['approve'],
396
-				'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'],
396
+				'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';approve=' . $item['id'],
397 397
 				'icon' => 'approve',
398 398
 			),
399 399
 			'delete' => array(
400 400
 				'label' => $txt['remove'],
401
-				'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'],
401
+				'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';delete=' . $item['id'],
402 402
 				'icon' => 'remove_button',
403 403
 				'show' => $item['can_delete']
404 404
 			),
405 405
 			'quickmod' => array(
406
-				'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>',
406
+				'content' => '<input type="checkbox" name="item[]" value="' . $item['id'] . '" checked>',
407 407
 				'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1
408 408
 			),
409 409
 		);
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 	$quickbuttons = array(
469 469
 		'delete' => array(
470 470
 			'label' => $txt['remove_message'],
471
-			'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'],
471
+			'href' => $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'],
472 472
 			'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"',
473 473
 			'class' => 'you_sure',
474 474
 			'icon' => 'remove_button',
Please login to merge, or discard this patch.
Sources/Profile-View.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			AND a.is_read = 0' : '') . (!empty($alertIDs) ? '
262 262
 			AND a.id_alert IN ({array_int:alertIDs})' : '') . '
263 263
 		ORDER BY id_alert DESC' . (!empty($limit) ? '
264
-		LIMIT {int:limit}' : '') . (!empty($offset) ?'
264
+		LIMIT {int:limit}' : '') . (!empty($offset) ? '
265 265
 		OFFSET {int:offset}' : ''),
266 266
 		array(
267 267
 			'id_member' => $memID,
@@ -1160,20 +1160,20 @@  discard block
 block discarded – undo
1160 1160
 		$context['posts'][$key]['quickbuttons'] = array(
1161 1161
 			'reply' => array(
1162 1162
 				'label' => $txt['reply'],
1163
-				'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'],
1163
+				'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'],
1164 1164
 				'icon' => 'reply_button',
1165 1165
 				'show' => $post['can_reply']
1166 1166
 			),
1167 1167
 			'quote' => array(
1168 1168
 				'label' => $txt['quote_action'],
1169
-				'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'],
1169
+				'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'],
1170 1170
 				'icon' => 'quote',
1171 1171
 				'show' => $post['can_quote']
1172 1172
 			),
1173 1173
 			'remove' => array(
1174 1174
 				'label' => $txt['remove'],
1175
-				'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';profile;u='.$context['member']['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'],
1176
-				'javascript' => 'data-confirm="'.$txt['remove_message'].'"',
1175
+				'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';profile;u=' . $context['member']['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'],
1176
+				'javascript' => 'data-confirm="' . $txt['remove_message'] . '"',
1177 1177
 				'class' => 'you_sure',
1178 1178
 				'icon' => 'remove_button',
1179 1179
 				'show' => $post['can_delete']
Please login to merge, or discard this patch.
Sources/ReportedContent.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 				),
94 94
 				'ignore' => array(
95 95
 					'label' => $report['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'],
96
-					'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;ignore='.(int)!$report['ignore'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'],
96
+					'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;ignore=' . (int) !$report['ignore'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-ignore_token_var'] . '=' . $context['mod-report-ignore_token'],
97 97
 					'javascript' => !$report['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '',
98 98
 					'class' => 'you_sure',
99 99
 					'icon' => 'ignore'
100 100
 				),
101 101
 				'close' => array(
102 102
 					'label' => $context['view_closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'],
103
-					'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;closed='.(int)!$report['closed'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'],
103
+					'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;closed=' . (int) !$report['closed'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-closed_token_var'] . '=' . $context['mod-report-closed_token'],
104 104
 					'icon' => $context['view_closed'] ? 'folder' : 'close',
105 105
 				),
106 106
 			);
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 			if ($context['report_type'] == 'posts')
110 110
 				$context['reports'][$key]['quickbuttons']['delete'] = array(
111 111
 					'label' => $txt['mc_reportedp_delete'],
112
-					'href' => $scripturl.'?action=deletemsg;topic='.$report['topic']['id'].'.0;msg='.$report['topic']['id_msg'].';modcenter;'.$context['session_var'].'='.$context['session_id'],
113
-					'javascript' => 'data-confirm="'.$txt['mc_reportedp_delete_confirm'].'"',
112
+					'href' => $scripturl . '?action=deletemsg;topic=' . $report['topic']['id'] . '.0;msg=' . $report['topic']['id_msg'] . ';modcenter;' . $context['session_var'] . '=' . $context['session_id'],
113
+					'javascript' => 'data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '"',
114 114
 					'class' => 'you_sure',
115 115
 					'icon' => 'delete',
116 116
 					'show' => !$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
 			// Ban reported member/post author link
120 120
 			if ($context['report_type'] == 'members')
121
-				$ban_link = $scripturl.'?action=admin;area=ban;sa=add;u='.$report['user']['id'].';'.$context['session_var'].'='.$context['session_id'];
121
+				$ban_link = $scripturl . '?action=admin;area=ban;sa=add;u=' . $report['user']['id'] . ';' . $context['session_var'] . '=' . $context['session_id'];
122 122
 			else
123
-				$ban_link = $scripturl.'?action=admin;area=ban;sa=add'.(!empty($report['author']['id']) ? ';u='.$report['author']['id'] : ';msg='.$report['topic']['id_msg']).';'.$context['session_var'].'='.$context['session_id'];
123
+				$ban_link = $scripturl . '?action=admin;area=ban;sa=add' . (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']) . ';' . $context['session_var'] . '=' . $context['session_id'];
124 124
 
125 125
 			$context['reports'][$key]['quickbuttons'] += array(
126 126
 				'ban' => array(
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 					'show' => !$report['closed'] && !empty($context['report_manage_bans']) && ($context['report_type'] == 'posts' || $context['report_type'] == 'members' && !empty($report['user']['id']))
131 131
 				),
132 132
 				'quickmod' => array(
133
-					'content' => '<input type="checkbox" name="close[]" value="'.$report['id'].'">',
133
+					'content' => '<input type="checkbox" name="close[]" value="' . $report['id'] . '">',
134 134
 					'show' => !$context['view_closed']
135 135
 				)
136 136
 			);
Please login to merge, or discard this patch.