Completed
Push — release-2.1 ( 3c29ac...c0ce3f )
by Mathias
07:06
created
Sources/Reports.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	// Build the reports button array.
113 113
 	$context['report_buttons'] = array(
114 114
 		'generate_reports' => array('text' => 'generate_reports', 'image' => 'print.png', 'url' => $scripturl . '?action=admin;area=reports', 'active' => true),
115
-		'print' => array('text' => 'print', 'image' => 'print.png', 'url' => $scripturl . '?action=admin;area=reports;rt=' . $context['report_type']. ';st=print', 'custom' => 'target="_blank"'),
115
+		'print' => array('text' => 'print', 'image' => 'print.png', 'url' => $scripturl . '?action=admin;area=reports;rt=' . $context['report_type'] . ';st=print', 'custom' => 'target="_blank"'),
116 116
 	);
117 117
 
118 118
 	// Allow mods to add additional buttons here
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	$request = $smcFunc['db_query']('', '
345 345
 		SELECT id_board, id_group
346 346
 		FROM {db_prefix}moderator_groups
347
-		WHERE ' . $board_clause .' AND ' . $group_clause,
347
+		WHERE ' . $board_clause . ' AND ' . $group_clause,
348 348
 		array(
349 349
 		)
350 350
 	);
Please login to merge, or discard this patch.
Sources/ScheduledTasks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -384,7 +384,7 @@
 block discarded – undo
384 384
 	clean_cache();
385 385
 
386 386
 	// If warning decrement is enabled and we have people who have not had a new warning in 24 hours, lower their warning level.
387
-	list (, , $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']);
387
+	list (,, $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']);
388 388
 	if ($modSettings['warning_decrement'])
389 389
 	{
390 390
 		// Find every member who has a warning level...
Please login to merge, or discard this patch.
Sources/DbSearch-postgresql.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 	$version = $smcFunc['db_get_version']();
38 38
 	// if we got a Beta Version
39 39
 	if (stripos($version, 'beta') !== false)
40
-		$version = substr($version, 0, stripos($version, 'beta')).'.0';
40
+		$version = substr($version, 0, stripos($version, 'beta')) . '.0';
41 41
 	// or RC
42 42
 	if (stripos($version, 'rc') !== false)
43
-		$version = substr($version, 0, stripos($version, 'rc')).'.0';
43
+		$version = substr($version, 0, stripos($version, 'rc')) . '.0';
44 44
 
45
-	if (version_compare($version,'9.5.0','>='))
45
+	if (version_compare($version, '9.5.0', '>='))
46 46
 		$smcFunc['db_support_ignore'] = true;
47 47
 }
48 48
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function smf_db_search_support($search_type)
56 56
 {
57
-	$supported_types = array('custom','fulltext');
57
+	$supported_types = array('custom', 'fulltext');
58 58
 
59 59
 	return in_array($search_type, $supported_types);
60 60
 }
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 	if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0)
109 109
 	{
110 110
 		$db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string);
111
-		if ($smcFunc['db_support_ignore']){
111
+		if ($smcFunc['db_support_ignore']) {
112 112
 			//pg style "INSERT INTO.... ON CONFLICT DO NOTHING"
113
-			$db_string = $db_string.' ON CONFLICT DO NOTHING';
113
+			$db_string = $db_string . ' ON CONFLICT DO NOTHING';
114 114
 		}
115 115
 		else
116 116
 		{
Please login to merge, or discard this patch.
Sources/ManageBans.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 					'value' => $txt['ban_added'],
184 184
 				),
185 185
 				'data' => array(
186
-					'function' => function ($rowData) use ($context)
186
+					'function' => function($rowData) use ($context)
187 187
 					{
188 188
 						return timeformat($rowData['ban_time'], empty($context['ban_time_format']) ? true : $context['ban_time_format']);
189 189
 					},
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 					'value' => $txt['ban_expires'],
199 199
 				),
200 200
 				'data' => array(
201
-					'function' => function ($rowData) use ($txt)
201
+					'function' => function($rowData) use ($txt)
202 202
 					{
203 203
 						// This ban never expires...whahaha.
204 204
 						if ($rowData['expire_time'] === null)
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 							'style' => 'width: 60%;text-align: left;',
402 402
 						),
403 403
 						'data' => array(
404
-							'function' => function ($ban_item) use ($txt)
404
+							'function' => function($ban_item) use ($txt)
405 405
 							{
406 406
 								if (in_array($ban_item['type'], array('ip', 'hostname', 'email')))
407 407
 									return '<strong>' . $txt[$ban_item['type']] . ':</strong>&nbsp;' . $ban_item[$ban_item['type']];
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 							'style' => 'width: 15%; text-align: center;',
430 430
 						),
431 431
 						'data' => array(
432
-							'function' => function ($ban_item) use ($txt, $context, $scripturl)
432
+							'function' => function($ban_item) use ($txt, $context, $scripturl)
433 433
 							{
434 434
 								return '<a href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $context['ban_group_id'] . ';bi=' . $ban_item['id'] . '">' . $txt['ban_edit_trigger'] . '</a>';
435 435
 							},
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 			}
555 555
 
556 556
 			// We come from the mod center.
557
-			elseif(isset($_GET['msg']) && !empty($_GET['msg']))
557
+			elseif (isset($_GET['msg']) && !empty($_GET['msg']))
558 558
 			{
559 559
 				$request = $smcFunc['db_query']('', '
560 560
 					SELECT poster_name, poster_ip, poster_email
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
 	if (empty($ban_info['cannot']['access']) && empty($ban_info['cannot']['register']) && empty($ban_info['cannot']['post']) && empty($ban_info['cannot']['login']))
1430 1430
 		$context['ban_errors'][] = 'ban_unknown_restriction_type';
1431 1431
 
1432
-	if(!empty($ban_info['id']))
1432
+	if (!empty($ban_info['id']))
1433 1433
 	{
1434 1434
 		// Verify the ban group exists.
1435 1435
 		$request = $smcFunc['db_query']('', '
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 		$smcFunc['db_free_result']($request);
1448 1448
 	}
1449 1449
 
1450
-	if(!empty($ban_info['name']))
1450
+	if (!empty($ban_info['name']))
1451 1451
 	{
1452 1452
 		// Make sure the name does not already exist (Of course, if it exists in the ban group we are editing, proceed.)
1453 1453
 		$request = $smcFunc['db_query']('', '
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
 	if (empty($ban_info['cannot']['access']) && empty($ban_info['cannot']['register']) && empty($ban_info['cannot']['post']) && empty($ban_info['cannot']['login']))
1517 1517
 		$context['ban_errors'][] = 'ban_unknown_restriction_type';
1518 1518
 
1519
-	if(!empty($ban_info['name']))
1519
+	if (!empty($ban_info['name']))
1520 1520
 	{
1521 1521
 		// Check whether a ban with this name already exists.
1522 1522
 		$request = $smcFunc['db_query']('', '
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 	if ($context['selected_entity'] === 'ip')
1796 1796
 	{
1797 1797
 		$listOptions['columns']['banned_entity']['data'] = array(
1798
-			'function' => function ($rowData)
1798
+			'function' => function($rowData)
1799 1799
 			{
1800 1800
 				return range2ip(
1801 1801
 					$rowData['ip_low']
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 	elseif ($context['selected_entity'] === 'hostname')
1813 1813
 	{
1814 1814
 		$listOptions['columns']['banned_entity']['data'] = array(
1815
-			'function' => function ($rowData) use ($smcFunc)
1815
+			'function' => function($rowData) use ($smcFunc)
1816 1816
 			{
1817 1817
 				return strtr($smcFunc['htmlspecialchars']($rowData['hostname']), array('%' => '*'));
1818 1818
 			},
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
 	elseif ($context['selected_entity'] === 'email')
1826 1826
 	{
1827 1827
 		$listOptions['columns']['banned_entity']['data'] = array(
1828
-			'function' => function ($rowData) use ($smcFunc)
1828
+			'function' => function($rowData) use ($smcFunc)
1829 1829
 			{
1830 1830
 				return strtr($smcFunc['htmlspecialchars']($rowData['email_address']), array('%' => '*'));
1831 1831
 			},
@@ -2032,7 +2032,7 @@  discard block
 block discarded – undo
2032 2032
 					'value' => $txt['ban_log_date'],
2033 2033
 				),
2034 2034
 				'data' => array(
2035
-					'function' => function ($rowData)
2035
+					'function' => function($rowData)
2036 2036
 					{
2037 2037
 						return timeformat($rowData['log_time']);
2038 2038
 					},
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
 	$log_entries = array();
2123 2123
 	while ($row = $smcFunc['db_fetch_assoc']($request))
2124 2124
 	{
2125
-		$row['ip'] = $row['ip'] === null? $dash : inet_dtop($row['ip']);
2125
+		$row['ip'] = $row['ip'] === null ? $dash : inet_dtop($row['ip']);
2126 2126
 		$log_entries[] = $row;
2127 2127
 	}
2128 2128
 	$smcFunc['db_free_result']($request);
@@ -2170,7 +2170,7 @@  discard block
 block discarded – undo
2170 2170
 	if ($low == $high)
2171 2171
 	    return $low;
2172 2172
 	else
2173
-	    return $low . '-'.$high;
2173
+	    return $low . '-' . $high;
2174 2174
 }
2175 2175
 
2176 2176
 /**
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
 		$request = $smcFunc['db_query']('', '
2287 2287
 			SELECT mem.id_member, mem.is_activated
2288 2288
 			FROM {db_prefix}members AS mem
2289
-			WHERE ' . implode( ' OR ', $queryPart),
2289
+			WHERE ' . implode(' OR ', $queryPart),
2290 2290
 			$queryValues
2291 2291
 		);
2292 2292
 		while ($row = $smcFunc['db_fetch_assoc']($request))
Please login to merge, or discard this patch.
Sources/ManageSettings.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 					'class' => 'centercol',
1324 1324
 				),
1325 1325
 				'data' => array(
1326
-					'function' => function ($rowData)
1326
+					'function' => function($rowData)
1327 1327
 					{
1328 1328
 						$isChecked = $rowData['disabled'] ? '' : ' checked';
1329 1329
 						$onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : '';
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 					'class' => 'centercol',
1340 1340
 				),
1341 1341
 				'data' => array(
1342
-					'function' => function ($rowData)
1342
+					'function' => function($rowData)
1343 1343
 					{
1344 1344
 						$isChecked = $rowData['on_register'] && !$rowData['disabled'] ? ' checked' : '';
1345 1345
 						$isDisabled = $rowData['can_show_register'] ? '' : ' disabled';
@@ -1386,15 +1386,15 @@  discard block
 block discarded – undo
1386 1386
 					'value' => $txt['custom_profile_fieldorder'],
1387 1387
 				),
1388 1388
 				'data' => array(
1389
-					'function' => function ($rowData) use ($context, $txt, $scripturl)
1389
+					'function' => function($rowData) use ($context, $txt, $scripturl)
1390 1390
 					{
1391
-						$return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br />';
1391
+						$return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br />';
1392 1392
 
1393 1393
 						if ($rowData['field_order'] > 1)
1394
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_up'] .'"></span></a>';
1394
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_up'] . '"></span></a>';
1395 1395
 
1396 1396
 						if ($rowData['field_order'] < $context['custFieldsMaxOrder'])
1397
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_down'] .'"></span></a>';
1397
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_down'] . '"></span></a>';
1398 1398
 
1399 1399
 						$return .= '</p>';
1400 1400
 
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
 					'value' => $txt['custom_profile_fieldname'],
1413 1413
 				),
1414 1414
 				'data' => array(
1415
-					'function' => function ($rowData) use ($scripturl)
1415
+					'function' => function($rowData) use ($scripturl)
1416 1416
 					{
1417 1417
 						return sprintf('<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>', $scripturl, $rowData['id_field'], $rowData['field_name'], $rowData['field_desc']);
1418 1418
 					},
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
 					'value' => $txt['custom_profile_fieldtype'],
1429 1429
 				),
1430 1430
 				'data' => array(
1431
-					'function' => function ($rowData) use ($txt)
1431
+					'function' => function($rowData) use ($txt)
1432 1432
 					{
1433 1433
 						$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
1434 1434
 						return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
@@ -1446,7 +1446,7 @@  discard block
 block discarded – undo
1446 1446
 					'value' => $txt['custom_profile_active'],
1447 1447
 				),
1448 1448
 				'data' => array(
1449
-					'function' => function ($rowData) use ($txt)
1449
+					'function' => function($rowData) use ($txt)
1450 1450
 					{
1451 1451
 						return $rowData['active'] ? $txt['yes'] : $txt['no'];
1452 1452
 					},
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 					'value' => $txt['custom_profile_placement'],
1464 1464
 				),
1465 1465
 				'data' => array(
1466
-					'function' => function ($rowData)
1466
+					'function' => function($rowData)
1467 1467
 					{
1468 1468
 						global $txt, $context;
1469 1469
 
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
 			redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler
1699 1699
 
1700 1700
 		// All good, proceed.
1701
-		$smcFunc['db_query']('','
1701
+		$smcFunc['db_query']('', '
1702 1702
 			UPDATE {db_prefix}custom_fields
1703 1703
 			SET field_order = {int:old_order}
1704 1704
 			WHERE field_order = {int:new_order}',
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 				'old_order' => $context['field']['order'],
1708 1708
 			)
1709 1709
 		);
1710
-		$smcFunc['db_query']('','
1710
+		$smcFunc['db_query']('', '
1711 1711
 			UPDATE {db_prefix}custom_fields
1712 1712
 			SET field_order = {int:new_order}
1713 1713
 			WHERE id_field = {int:id_field}',
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 			$smcFunc['db_free_result']($request);
1810 1810
 
1811 1811
 			$unique = false;
1812
-			for ($i = 0; !$unique && $i < 9; $i ++)
1812
+			for ($i = 0; !$unique && $i < 9; $i++)
1813 1813
 			{
1814 1814
 				if (!in_array($col_name, $current_fields))
1815 1815
 					$unique = true;
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 		);
1983 1983
 
1984 1984
 		// Re-arrange the order.
1985
-		$smcFunc['db_query']('','
1985
+		$smcFunc['db_query']('', '
1986 1986
 			UPDATE {db_prefix}custom_fields
1987 1987
 			SET field_order = field_order - 1
1988 1988
 			WHERE field_order > {int:current_order}',
@@ -2246,7 +2246,7 @@  discard block
 block discarded – undo
2246 2246
 	$context['token_check'] = 'noti-admin';
2247 2247
 
2248 2248
 	// Specify our action since we'll want to post back here instead of the profile
2249
-	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id'];
2249
+	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id'];
2250 2250
 
2251 2251
 	loadTemplate('Profile');
2252 2252
 	loadLanguage('Profile');
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.
Sources/Search.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
 	// Remove the phrase parts and extract the words.
661 661
 	$wordArray = preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), ' ', $search_params['search']);
662
-	$wordArray = explode(' ',  $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES));
662
+	$wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES));
663 663
 
664 664
 	// A minus sign in front of a word excludes the word.... so...
665 665
 	$excludedWords = array();
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 						SELECT
1105 1105
 							{int:id_search},
1106 1106
 							t.id_topic,
1107
-							' . $relevance. ',
1107
+							' . $relevance . ',
1108 1108
 							' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ',
1109 1109
 							1
1110 1110
 						FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : '
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 						if (empty($subject_query['where']))
1340 1340
 							continue;
1341 1341
 
1342
-						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( '
1342
+						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ('
1343 1343
 							INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics
1344 1344
 								(' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . '
1345 1345
 							SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 					}
1569 1569
 					$main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance';
1570 1570
 
1571
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( '
1571
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ('
1572 1572
 						INSERT IGNORE INTO ' . '{db_prefix}log_search_results
1573 1573
 							(' . implode(', ', array_keys($main_query['select'])) . ')') : '') . '
1574 1574
 						SELECT
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 					$relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance';
1637 1637
 
1638 1638
 					$usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts));
1639
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( '
1639
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ('
1640 1640
 						INSERT IGNORE INTO {db_prefix}log_search_results
1641 1641
 							(id_search, id_topic, relevance, id_msg, num_matches)') : '') . '
1642 1642
 						SELECT
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
 		$query = trim($query, "\*+");
2103 2103
 		$query = strtr($smcFunc['htmlspecialchars']($query), array('\\\'' => '\''));
2104 2104
 
2105
-		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m)
2105
+		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m)
2106 2106
 		{
2107 2107
 			return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>";
2108 2108
 		}, $body_highlighted);
Please login to merge, or discard this patch.
Sources/Likes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public function get($property = '')
168 168
 	{
169 169
 		// All properties inside Likes are protected, thus, an underscore is used.
170
-		$property = '_'. $property;
170
+		$property = '_' . $property;
171 171
 		return property_exists($this, $property) ? $this->$property : false;
172 172
 	}
173 173
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 
572 572
 			// Nope?  then just do a redirect to whatever URL was provided.
573 573
 			else
574
-				redirectexit(!empty($this->_validLikes['redirect']) ? $this->_validLikes['redirect'] .';error='. $this->_error : '');
574
+				redirectexit(!empty($this->_validLikes['redirect']) ? $this->_validLikes['redirect'] . ';error=' . $this->_error : '');
575 575
 
576 576
 			return;
577 577
 		}
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 			if (in_array($this->_sa, $generic))
589 589
 			{
590 590
 				$context['sub_template'] = 'generic';
591
-				$context['data'] = isset($txt['like_'. $this->_data]) ? $txt['like_'. $this->_data] : $this->_data;
591
+				$context['data'] = isset($txt['like_' . $this->_data]) ? $txt['like_' . $this->_data] : $this->_data;
592 592
 			}
593 593
 
594 594
 			// Directly pass the current called sub-action and the data generated by its associated Method.
Please login to merge, or discard this patch.
Sources/Display.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			COALESCE(mem.real_name, ms.poster_name) AS topic_started_name, ms.poster_time AS topic_started_time,
160 160
 			' . ($user_info['is_guest'] ? 't.id_last_msg + 1' : 'COALESCE(lt.id_msg, lmr.id_msg, -1) + 1') . ' AS new_from
161 161
 			' . (!empty($board_info['recycle']) ? ', id_previous_board, id_previous_topic' : '') . '
162
-			' . (!empty($topic_selects) ? (', '. implode(', ', $topic_selects)) : '') . '
162
+			' . (!empty($topic_selects) ? (', ' . implode(', ', $topic_selects)) : '') . '
163 163
 			' . (!$user_info['is_guest'] ? ', COALESCE(lt.unwatched, 0) as unwatched' : '') . '
164 164
 		FROM {db_prefix}topics AS t
165 165
 			INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			WHERE INSTR(lo.url, {string:in_url_string}) > 0 OR lo.session = {string:session}',
389 389
 			array(
390 390
 				'reg_id_group' => 0,
391
-				'in_url_string' => '"topic":'.$topic,
391
+				'in_url_string' => '"topic":' . $topic,
392 392
 				'session' => $user_info['is_guest'] ? 'ip' . $user_info['ip'] : session_id(),
393 393
 			)
394 394
 		);
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
 		$context['links'] = array(
458 458
 			'first' => $_REQUEST['start'] >= $context['messages_per_page'] ? $scripturl . '?topic=' . $topic . '.0' : '',
459 459
 			'prev' => $_REQUEST['start'] >= $context['messages_per_page'] ? $scripturl . '?topic=' . $topic . '.' . ($_REQUEST['start'] - $context['messages_per_page']) : '',
460
-			'next' => $_REQUEST['start'] + $context['messages_per_page'] < $context['total_visible_posts'] ? $scripturl . '?topic=' . $topic. '.' . ($_REQUEST['start'] + $context['messages_per_page']) : '',
461
-			'last' => $_REQUEST['start'] + $context['messages_per_page'] < $context['total_visible_posts'] ? $scripturl . '?topic=' . $topic. '.' . (floor($context['total_visible_posts'] / $context['messages_per_page']) * $context['messages_per_page']) : '',
460
+			'next' => $_REQUEST['start'] + $context['messages_per_page'] < $context['total_visible_posts'] ? $scripturl . '?topic=' . $topic . '.' . ($_REQUEST['start'] + $context['messages_per_page']) : '',
461
+			'last' => $_REQUEST['start'] + $context['messages_per_page'] < $context['total_visible_posts'] ? $scripturl . '?topic=' . $topic . '.' . (floor($context['total_visible_posts'] / $context['messages_per_page']) * $context['messages_per_page']) : '',
462 462
 			'up' => $scripturl . '?board=' . $board . '.0'
463 463
 		);
464 464
 	}
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 				id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, modified_reason, body,
1038 1038
 				smileys_enabled, poster_name, poster_email, approved, likes,
1039 1039
 				id_msg_modified < {int:new_from} AS is_read
1040
-				' . (!empty($msg_selects) ? (', '. implode(', ', $msg_selects)) : '') . '
1040
+				' . (!empty($msg_selects) ? (', ' . implode(', ', $msg_selects)) : '') . '
1041 1041
 			FROM {db_prefix}messages
1042 1042
 				' . (!empty($msg_tables) ? implode("\n\t", $msg_tables) : '') . '
1043 1043
 			WHERE id_msg IN ({array_int:message_list})
@@ -1681,17 +1681,17 @@  discard block
 block discarded – undo
1681 1681
 	if (!empty($modSettings['attachmentRecodeLineEndings']) && !isset($_REQUEST['image']) && in_array($file_ext, array('txt', 'css', 'htm', 'html', 'php', 'xml')))
1682 1682
 	{
1683 1683
 		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows') !== false)
1684
-			$callback = function ($buffer)
1684
+			$callback = function($buffer)
1685 1685
 			{
1686 1686
 				return preg_replace('~[\r]?\n~', "\r\n", $buffer);
1687 1687
 			};
1688 1688
 		elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false)
1689
-			$callback = function ($buffer)
1689
+			$callback = function($buffer)
1690 1690
 			{
1691 1691
 				return preg_replace('~[\r]?\n~', "\r", $buffer);
1692 1692
 			};
1693 1693
 		else
1694
-			$callback = function ($buffer)
1694
+			$callback = function($buffer)
1695 1695
 			{
1696 1696
 				return preg_replace('~[\r]?\n~', "\n", $buffer);
1697 1697
 			};
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 		list($subname) = $smcFunc['db_fetch_row']($request);
1773 1773
 		$smcFunc['db_free_result']($request);
1774 1774
 		$_SESSION['split_selection'][$topic] = $messages;
1775
-		redirectexit('action=splittopics;sa=selectTopics;topic=' . $topic . '.0;subname_enc=' .urlencode($subname) . ';' . $context['session_var'] . '=' . $context['session_id']);
1775
+		redirectexit('action=splittopics;sa=selectTopics;topic=' . $topic . '.0;subname_enc=' . urlencode($subname) . ';' . $context['session_var'] . '=' . $context['session_id']);
1776 1776
 	}
1777 1777
 
1778 1778
 	// Allowed to delete any message?
Please login to merge, or discard this patch.