Completed
Branch release-2.1 (e49a83)
by Michael
08:59
created
SSI.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
 
1558 1558
 		echo '
1559 1559
 				</dl>', ($return['allow_view_results'] ? '
1560
-				<strong>'. $txt['poll_total_voters'] .': '. $return['total_votes'] .'</strong>' : ''), '
1560
+				<strong>'. $txt['poll_total_voters'] . ': ' . $return['total_votes'] . '</strong>' : ''), '
1561 1561
 			</div>';
1562 1562
 	}
1563 1563
 }
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
 				$base .= (isset($txt[$base . $count])) ? $count : 'n';
2084 2084
 
2085 2085
 				echo '
2086
-						<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $news['message_id'] .';'. $context['session_var'] .'='. $context['session_id'], comma_format($count)), '</li>';
2086
+						<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $news['message_id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '</li>';
2087 2087
 			}
2088 2088
 
2089 2089
 			echo '
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
 			),
2288 2288
 			'file' => array(
2289 2289
 				'filename' => $filename,
2290
-				'filesize' => round($row['filesize'] /1024, 2) . $txt['kilobyte'],
2290
+				'filesize' => round($row['filesize'] / 1024, 2) . $txt['kilobyte'],
2291 2291
 				'downloads' => $row['downloads'],
2292 2292
 				'href' => $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $row['id_attach'],
2293 2293
 				'link' => '<img src="' . $settings['images_url'] . '/icons/clip.png" alt=""> <a href="' . $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $row['id_attach'] . '">' . $filename . '</a>',
Please login to merge, or discard this patch.
Sources/Subs-Db-mysqli.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 	
71 71
 	if ($connection) {
72 72
 		if (!empty($db_options['port']))
73
-			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', $db_options['port'] , null ,$flags);
73
+			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', $db_options['port'], null, $flags);
74 74
 		else
75
-			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd,'', 0, null, $flags);
75
+			$success = mysqli_real_connect($connection, $db_server, $db_user, $db_passwd, '', 0, null, $flags);
76 76
 	}
77 77
 
78 78
 	// Something's wrong, show an error if its fatal (which we assume it is)
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 						$replacement[$key] = 'null';
282 282
 					if (!isValidIP($value))
283 283
 						smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
284
-					$replacement[$key] =  sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value)));
284
+					$replacement[$key] = sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value)));
285 285
 				}
286 286
 
287 287
 				return implode(', ', $replacement);
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
  * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards.
869 869
  * @return string The escaped string
870 870
  */
871
-function smf_db_escape_wildcard_string($string, $translate_human_wildcards=false)
871
+function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false)
872 872
 {
873 873
 	$replacements = array(
874 874
 		'%' => '\%',
Please login to merge, or discard this patch.
Sources/ShowAttachments.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	}
72 72
 
73 73
 	// Use cache when possible.
74
-	if (($cache = cache_get_data('attachment_lookup_id-'. $attachId)) != null)
74
+	if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null)
75 75
 		list($file, $thumbFile) = $cache;
76 76
 
77 77
 	// Get the info from the DB.
78
-	if(empty($file) || empty($thumbFile) && !empty($file['id_thumb']))
78
+	if (empty($file) || empty($thumbFile) && !empty($file['id_thumb']))
79 79
 	{
80 80
 		// Do we have a hook wanting to use our attachment system? We use $attachRequest to prevent accidental usage of $request.
81 81
 		$attachRequest = null;
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		$file['filePath'] = getAttachmentFilename($file['filename'], $attachId, $file['id_folder'], false, $file['file_hash']);
145 145
 		// ensure variant attachment compatibility
146 146
 		$filePath = pathinfo($file['filePath']);
147
-		$file['filePath'] = !file_exists($file['filePath']) ? substr($file['filePath'], 0, -(strlen($filePath['extension'])+1)) : $file['filePath'];
148
-		$file['etag'] = '"'. md5_file($file['filePath']) .'"';
147
+		$file['filePath'] = !file_exists($file['filePath']) ? substr($file['filePath'], 0, -(strlen($filePath['extension']) + 1)) : $file['filePath'];
148
+		$file['etag'] = '"' . md5_file($file['filePath']) . '"';
149 149
 
150 150
 		// now get the thumbfile!
151 151
 		$thumbFile = array();
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 
172 172
 				// set filePath and ETag time
173 173
 				$thumbFile['filePath'] = getAttachmentFilename($thumbFile['filename'], $attachId, $thumbFile['id_folder'], false, $thumbFile['file_hash']);
174
-				$thumbFile['etag'] = '"'. md5_file($thumbFile['filePath']) .'"';
174
+				$thumbFile['etag'] = '"' . md5_file($thumbFile['filePath']) . '"';
175 175
 			}
176 176
 		}
177 177
 
178 178
 		// Cache it.
179
-		if(!empty($file) || !empty($thumbFile))
180
-			cache_put_data('attachment_lookup_id-'. $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900));
179
+		if (!empty($file) || !empty($thumbFile))
180
+			cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900));
181 181
 	}
182 182
 
183 183
 	// Update the download counter (unless it's a thumbnail).
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
 	if (!empty($modSettings['attachmentRecodeLineEndings']) && !isset($_REQUEST['image']) && in_array($file['fileext'], array('txt', 'css', 'htm', 'html', 'php', 'xml')))
290 290
 	{
291 291
 		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows') !== false)
292
-			$callback = function ($buffer)
292
+			$callback = function($buffer)
293 293
 			{
294 294
 				return preg_replace('~[\r]?\n~', "\r\n", $buffer);
295 295
 			};
296 296
 		elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false)
297
-			$callback = function ($buffer)
297
+			$callback = function($buffer)
298 298
 			{
299 299
 				return preg_replace('~[\r]?\n~', "\r", $buffer);
300 300
 			};
301 301
 		else
302
-			$callback = function ($buffer)
302
+			$callback = function($buffer)
303 303
 			{
304 304
 				return preg_replace('~[\r]?\n~', "\n", $buffer);
305 305
 			};
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
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 						'Shitiz &quot;Dragooon&quot; Garg',
591 591
 						'Karl &quot;RegularExpression&quot; Benson',
592 592
 						'Matthew &quot;Labradoodle-360&quot; Kerle',
593
-						$user_info['is_admin'] ? 'Matt &quot;Grudge&quot; Wolf': 'Grudge',
593
+						$user_info['is_admin'] ? 'Matt &quot;Grudge&quot; Wolf' : 'Grudge',
594 594
 						'Michael &quot;Thantos&quot; Miller',
595 595
 						'Norv',
596 596
 						'Peter "Arantor" Spicer',
@@ -813,13 +813,13 @@  discard block
 block discarded – undo
813 813
 			$credit_info = smf_json_decode($row['credits'], true);
814 814
 
815 815
 			$copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' &copy; ' . $smcFunc['htmlspecialchars']($credit_info['copyright']);
816
-			$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']));
816
+			$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']));
817 817
 			$version = $txt['credits_version'] . ' ' . $row['version'];
818 818
 			$title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version;
819 819
 
820 820
 			// build this one out and stash it away
821 821
 			$mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>';
822
-			$mods[] = $mod_name . (!empty($license) ? ' | ' . $license  : '') . (!empty($copyright) ? ' | ' . $copyright  : '');
822
+			$mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : '');
823 823
 		}
824 824
 		cache_put_data('mods_credits', $mods, 86400);
825 825
 	}
Please login to merge, or discard this patch.
Sources/Drafts.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 				locked = {int:locked},
86 86
 				is_sticky = {int:is_sticky}
87 87
 			WHERE id_draft = {int:id_draft}',
88
-			array (
88
+			array(
89 89
 				'id_topic' => $topic_id,
90 90
 				'id_board' => $board,
91 91
 				'poster_time' => time(),
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		DELETE FROM {db_prefix}user_drafts
412 412
 		WHERE id_draft IN ({array_int:id_draft})' . ($check ? '
413 413
 			AND  id_member = {int:id_member}' : ''),
414
-		array (
414
+		array(
415 415
 			'id_draft' => $id_draft,
416 416
 			'id_member' => empty($user_info['id']) ? -1 : $user_info['id'],
417 417
 		)
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 			$context['drafts'][] = array(
473 473
 				'subject' => censorText(shorten_subject(stripslashes($row['subject']), 24)),
474 474
 				'poster_time' => timeformat($row['poster_time']),
475
-				'link' => '<a href="' . $scripturl . '?action=post;board=' . $row['id_board'] . ';' . (!empty($row['id_topic']) ? 'topic='. $row['id_topic'] .'.0;' : '') . 'id_draft=' . $row['id_draft'] . '">' . $row['subject'] . '</a>',
475
+				'link' => '<a href="' . $scripturl . '?action=post;board=' . $row['id_board'] . ';' . (!empty($row['id_topic']) ? 'topic=' . $row['id_topic'] . '.0;' : '') . 'id_draft=' . $row['id_draft'] . '">' . $row['subject'] . '</a>',
476 476
 			);
477 477
 		// PM drafts
478 478
 		elseif ($draft_type === 1)
Please login to merge, or discard this patch.
Sources/ManagePaid.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 		'items_per_page' => $modSettings['defaultMaxListItems'],
263 263
 		'base_href' => $scripturl . '?action=admin;area=paidsubscribe;sa=view',
264 264
 		'get_items' => array(
265
-			'function' => function ($start, $items_per_page) use ($context)
265
+			'function' => function($start, $items_per_page) use ($context)
266 266
 			{
267 267
 				$subscriptions = array();
268 268
 				$counter = 0;
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 			},
282 282
 		),
283 283
 		'get_count' => array(
284
-			'function' => function () use ($context)
284
+			'function' => function() use ($context)
285 285
 			{
286 286
 				return count($context['subscriptions']);
287 287
 			},
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 					'style' => 'width: 35%;',
295 295
 				),
296 296
 				'data' => array(
297
-					'function' => function ($rowData) use ($scripturl)
297
+					'function' => function($rowData) use ($scripturl)
298 298
 					{
299 299
 						return sprintf('<a href="%1$s?action=admin;area=paidsubscribe;sa=viewsub;sid=%2$s">%3$s</a>', $scripturl, $rowData['id'], $rowData['name']);
300 300
 					},
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 					'value' => $txt['paid_cost'],
306 306
 				),
307 307
 				'data' => array(
308
-					'function' => function ($rowData) use ($txt)
308
+					'function' => function($rowData) use ($txt)
309 309
 					{
310 310
 						return $rowData['flexible'] ? '<em>' . $txt['flexible'] . '</em>' : $rowData['cost'] . ' / ' . $rowData['length'];
311 311
 					},
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 					'class' => 'centercol',
349 349
 				),
350 350
 				'data' => array(
351
-					'function' => function ($rowData) use ($txt)
351
+					'function' => function($rowData) use ($txt)
352 352
 					{
353 353
 						return '<span style="color: ' . ($rowData['active'] ? 'green' : 'red') . '">' . ($rowData['active'] ? $txt['yes'] : $txt['no']) . '</span>';
354 354
 					},
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			),
358 358
 			'modify' => array(
359 359
 				'data' => array(
360
-					'function' => function ($rowData) use ($txt, $scripturl)
360
+					'function' => function($rowData) use ($txt, $scripturl)
361 361
 					{
362 362
 						return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;sid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>';
363 363
 					},
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 			),
367 367
 			'delete' => array(
368 368
 				'data' => array(
369
-					'function' => function ($rowData) use ($scripturl, $txt)
369
+					'function' => function($rowData) use ($scripturl, $txt)
370 370
 					{
371 371
 						return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modify;delete;sid=' . $rowData['id'] . '">' . $txt['delete'] . '</a>';
372 372
 					},
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 					'style' => 'width: 20%;',
824 824
 				),
825 825
 				'data' => array(
826
-					'function' => function ($rowData) use ($scripturl, $txt)
826
+					'function' => function($rowData) use ($scripturl, $txt)
827 827
 					{
828 828
 						return $rowData['id_member'] == 0 ? $txt['guest'] : '<a href="' . $scripturl . '?action=profile;u=' . $rowData['id_member'] . '">' . $rowData['name'] . '</a>';
829 829
 					},
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 					'class' => 'centercol',
894 894
 				),
895 895
 				'data' => array(
896
-					'function' => function ($rowData) use ($scripturl, $txt)
896
+					'function' => function($rowData) use ($scripturl, $txt)
897 897
 					{
898 898
 						return '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $rowData['id'] . '">' . $txt['modify'] . '</a>';
899 899
 					},
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 					'class' => 'centercol',
907 907
 				),
908 908
 				'data' => array(
909
-					'function' => function ($rowData)
909
+					'function' => function($rowData)
910 910
 					{
911 911
 						return '<input type="checkbox" name="delsub[' . $rowData['id'] . ']" class="input_check">';
912 912
 					},
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 	{
1951 1951
 		while (($file = readdir($dh)) !== false)
1952 1952
 		{
1953
-			if (is_file($sourcedir .'/'. $file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches))
1953
+			if (is_file($sourcedir . '/' . $file) && preg_match('~^Subscriptions-([A-Za-z\d]+)\.php$~', $file, $matches))
1954 1954
 			{
1955 1955
 				// Check this is definitely a valid gateway!
1956 1956
 				$fp = fopen($sourcedir . '/' . $file, 'rb');
Please login to merge, or discard this patch.
Sources/PackageGet.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
 		{
182 182
 			collapsedDiv.show(\'slow\');
183 183
 			icon.removeClass(\'toggle_down\').addClass(\'toggle_up\');
184
-			icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) .');
184
+			icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) . ');
185 185
 		}
186 186
 
187 187
 		else
188 188
 		{
189 189
 			collapsedDiv.hide(\'slow\');
190 190
 			icon.removeClass(\'toggle_up\').addClass(\'toggle_down\');
191
-			icon.prop(\'title\', '. JavaScriptEscape($txt['show']) .');
191
+			icon.prop(\'title\', '. JavaScriptEscape($txt['show']) . ');
192 192
 		}
193 193
 
194 194
 	});', true);
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 
642 642
 	// Setup the correct template, even though I'll admit we ain't downloading ;)
643 643
 	$context['sub_template'] = 'downloaded';
644
-	$allowext = array('.zip','.tgz','.gz');
644
+	$allowext = array('.zip', '.tgz', '.gz');
645 645
 	// @todo Use FTP if the Packages directory is not writable.
646 646
 
647 647
 	// Check the file was even sent!
@@ -653,13 +653,13 @@  discard block
 block discarded – undo
653 653
 	// Make sure it has a sane filename.
654 654
 	$_FILES['package']['name'] = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $_FILES['package']['name']);
655 655
 	$extension = substr(strrchr(strtolower($_FILES['package']['name']), '.'), 0);
656
-	if(!in_array($extension, $allowext))
656
+	if (!in_array($extension, $allowext))
657 657
 	{
658 658
 		fatal_lang_error('package_upload_error_supports', false, array('zip, tgz, tar.gz'));
659 659
 	}
660 660
 	
661 661
 	// We only need the filename...
662
-	$extension = ($extension == '.gz') ? '.tar.gz' : $extension ;
662
+	$extension = ($extension == '.gz') ? '.tar.gz' : $extension;
663 663
 	$packageName = time() . $extension;
664 664
 
665 665
 	// Setup the destination and throw an error if the file is already there!
Please login to merge, or discard this patch.
Sources/RemoveTopic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -398,7 +398,7 @@
 block discarded – undo
398 398
 	}
399 399
 	$smcFunc['db_free_result']($request);
400 400
 
401
-	if($updateBoardCount)
401
+	if ($updateBoardCount)
402 402
 	{
403 403
 		// Decrease the posts/topics...
404 404
 		foreach ($adjustBoards as $stats)
Please login to merge, or discard this patch.
Sources/SplitTopics.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 		)
361 361
 	);
362 362
 	$context['messages'] = array();
363
-	for ($counter = 0; $row = $smcFunc['db_fetch_assoc']($request); $counter ++)
363
+	for ($counter = 0; $row = $smcFunc['db_fetch_assoc']($request); $counter++)
364 364
 	{
365 365
 		censorText($row['subject']);
366 366
 		censorText($row['body']);
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 			)
401 401
 		);
402 402
 		$context['messages'] = array();
403
-		for ($counter = 0; $row = $smcFunc['db_fetch_assoc']($request); $counter ++)
403
+		for ($counter = 0; $row = $smcFunc['db_fetch_assoc']($request); $counter++)
404 404
 		{
405 405
 			censorText($row['subject']);
406 406
 			censorText($row['body']);
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
 			$firstTopic = $row['id_topic'];
1099 1099
 
1100 1100
 		// Lowest topic id gets selected as surviving topic id. We need to store this board so we can adjust the topic count (This one will not have a redirect topic)
1101
-		if($row['id_topic'] < $lowestTopicId || empty($lowestTopicId) )
1101
+		if ($row['id_topic'] < $lowestTopicId || empty($lowestTopicId))
1102 1102
 		{
1103 1103
 			$lowestTopicId = $row['id_topic'];
1104 1104
 			$lowestTopicBoard = $row['id_board'];
@@ -1404,7 +1404,7 @@  discard block
 block discarded – undo
1404 1404
 			}
1405 1405
 
1406 1406
 			// Update subject search index
1407
-			updateStats('subject',$this_old_topic,$redirect_subject);
1407
+			updateStats('subject', $this_old_topic, $redirect_subject);
1408 1408
 		}
1409 1409
 	}
1410 1410
 
Please login to merge, or discard this patch.