Completed
Pull Request — development (#2514)
by Thorsten
13:19
created
sources/CurlFetchWebdata.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 	 * - Calls _setOptions to set the curl opts array values based on the defaults and user input
125 125
 	 *
126 126
 	 * @param string $url the site we are going to fetch
127
-	 * @param mixed[]|string $post_data data to send in the curl request as post data
127
+	 * @param string $post_data data to send in the curl request as post data
128 128
 	 */
129 129
 	public function get_url_data($url, $post_data = array())
130 130
 	{
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		$new_url_parse['query'] = isset($new_url_parse['query']) ? $new_url_parse['query'] : '';
223 223
 
224 224
 		// Build the new URL that was in the http header
225
-		return $new_url_parse['scheme'] . '://' . $new_url_parse['host'] . $new_url_parse['path'] . (!empty($new_url_parse['query']) ? '?' . $new_url_parse['query'] : '');
225
+		return $new_url_parse['scheme'].'://'.$new_url_parse['host'].$new_url_parse['path'].(!empty($new_url_parse['query']) ? '?'.$new_url_parse['query'] : '');
226 226
 	}
227 227
 
228 228
 	/**
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			// Build the post data, drop ones with leading @'s since those can be used to send files, we don't support that.
284 284
 			foreach ($post_data as $name => $value)
285 285
 			{
286
-				$postvars[] = $name . '=' . urlencode($value[0] == '@' ? '' : $value);
286
+				$postvars[] = $name.'='.urlencode($value[0] == '@' ? '' : $value);
287 287
 			}
288 288
 
289 289
 			return implode('&', $postvars);
Please login to merge, or discard this patch.
sources/database/Db-mysql.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
 	 * http://www.greywyvern.com/code/php/utf8_html.phps
333 333
 	 *
334 334
 	 * @param string $c
335
-	 * @return integer|false
335
+	 * @return integer
336 336
 	 */
337 337
 	private function _uniord($c)
338 338
 	{
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
 		// Select the database. Maybe.
67 67
 		if (empty($db_options['dont_select_db']))
68
-			$connection = @mysqli_connect((!empty($db_options['persist']) ? 'p:' : '') . $db_server, $db_user, $db_passwd, $db_name, $db_port);
68
+			$connection = @mysqli_connect((!empty($db_options['persist']) ? 'p:' : '').$db_server, $db_user, $db_passwd, $db_name, $db_port);
69 69
 		else
70
-			$connection = @mysqli_connect((!empty($db_options['persist']) ? 'p:' : '') . $db_server, $db_user, $db_passwd, '', $db_port);
70
+			$connection = @mysqli_connect((!empty($db_options['persist']) ? 'p:' : '').$db_server, $db_user, $db_passwd, '', $db_port);
71 71
 
72 72
 		// Something's wrong, show an error if its fatal (which we assume it is)
73 73
 		if (!$connection)
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function fix_prefix($db_prefix, $db_name)
109 109
 	{
110
-		$db_prefix = is_numeric(substr($db_prefix, 0, 1)) ? $db_name . '.' . $db_prefix : '`' . $db_name . '`.' . $db_prefix;
110
+		$db_prefix = is_numeric(substr($db_prefix, 0, 1)) ? $db_name.'.'.$db_prefix : '`'.$db_name.'`.'.$db_prefix;
111 111
 
112 112
 		return $db_prefix;
113 113
 	}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		{
154 154
 			// Add before LIMIT
155 155
 			if ($pos = strpos($db_string, 'LIMIT '))
156
-				$db_string = substr($db_string, 0, $pos) . "\t\t\tORDER BY null\n" . substr($db_string, $pos, strlen($db_string));
156
+				$db_string = substr($db_string, 0, $pos)."\t\t\tORDER BY null\n".substr($db_string, $pos, strlen($db_string));
157 157
 			else
158 158
 				// Append it.
159 159
 				$db_string .= "\n\t\t\tORDER BY null";
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 				$fail = true;
244 244
 
245 245
 			if (!empty($fail) && function_exists('log_error'))
246
-				$this->error_backtrace('Hacking attempt...', 'Hacking attempt...' . "\n" . $db_string, E_USER_ERROR, __FILE__, __LINE__);
246
+				$this->error_backtrace('Hacking attempt...', 'Hacking attempt...'."\n".$db_string, E_USER_ERROR, __FILE__, __LINE__);
247 247
 		}
248 248
 
249 249
 		if ($this->_unbuffered === false)
@@ -312,11 +312,11 @@  discard block
 block discarded – undo
312 312
 				if ($ord1 >= 240 && $ord1 <= 247)
313 313
 				{
314 314
 					// Replace it with the corresponding html entity
315
-					$entity = $this->_uniord(chr($ord[$i]) . chr($ord[$i + 1]) . chr($ord[$i + 2]) . chr($ord[$i + 3]));
315
+					$entity = $this->_uniord(chr($ord[$i]).chr($ord[$i + 1]).chr($ord[$i + 2]).chr($ord[$i + 3]));
316 316
 					if ($entity === false)
317 317
 						$result .= "\xEF\xBF\xBD";
318 318
 					else
319
-						$result .= '&#x' . dechex($entity) . ';';
319
+						$result .= '&#x'.dechex($entity).';';
320 320
 					$i += 3;
321 321
 				}
322 322
 				else
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 
516 516
 				// Let the admin know there is a command denied issue
517 517
 				if (function_exists('log_error'))
518
-					Errors::instance()->log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
518
+					Errors::instance()->log_error($txt['database_error'].': '.$query_error.(!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
519 519
 
520 520
 				return false;
521 521
 			}
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
 		// Log the error.
525 525
 		if ($query_errno != 1213 && $query_errno != 1205 && function_exists('log_error'))
526
-			Errors::instance()->log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
526
+			Errors::instance()->log_error($txt['database_error'].': '.$query_error.(!empty($modSettings['enableErrorQueryLogging']) ? "\n\n$db_string" : ''), 'database', $file, $line);
527 527
 
528 528
 		// Database error auto fixing ;).
529 529
 		if (function_exists('Cache::instance()->get') && (!isset($modSettings['autoFixDatabase']) || $modSettings['autoFixDatabase'] == '1'))
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 						{
552 552
 							// Now, it's still theoretically possible this could be an injection.  So backtick it!
553 553
 							if (trim($table) != '')
554
-								$fix_tables[] = '`' . strtr(trim($table), array('`' => '')) . '`';
554
+								$fix_tables[] = '`'.strtr(trim($table), array('`' => '')).'`';
555 555
 						}
556 556
 					}
557 557
 
@@ -561,13 +561,13 @@  discard block
 block discarded – undo
561 561
 				elseif ($query_errno == 1016)
562 562
 				{
563 563
 					if (preg_match('~\'([^\.\']+)~', $query_error, $match) != 0)
564
-						$fix_tables = array('`' . $match[1] . '`');
564
+						$fix_tables = array('`'.$match[1].'`');
565 565
 				}
566 566
 				// Indexes crashed.  Should be easy to fix!
567 567
 				elseif ($query_errno == 1034 || $query_errno == 1035)
568 568
 				{
569 569
 					preg_match('~\'([^\']+?)\'~', $query_error, $match);
570
-					$fix_tables = array('`' . $match[1] . '`');
570
+					$fix_tables = array('`'.$match[1].'`');
571 571
 				}
572 572
 			}
573 573
 
@@ -576,8 +576,8 @@  discard block
 block discarded – undo
576 576
 			{
577 577
 				// subs/Admin.subs.php for updateDbLastError(), subs/Mail.subs.php for sendmail().
578 578
 				// @todo this should go somewhere else, not into the db-mysql layer I think
579
-				require_once(SUBSDIR . '/Admin.subs.php');
580
-				require_once(SUBSDIR . '/Mail.subs.php');
579
+				require_once(SUBSDIR.'/Admin.subs.php');
580
+				require_once(SUBSDIR.'/Mail.subs.php');
581 581
 
582 582
 				// Make a note of the REPAIR...
583 583
 				Cache::instance()->put('db_last_error', time(), 600);
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
 				{
613 613
 					// Are we in SSI mode?  If so try that username and password first
614 614
 					if (ELK == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
615
-						$new_connection = @mysqli_connect((!empty($db_persist) ? 'p:' : '') . $db_server, $ssi_db_user, $ssi_db_passwd, $db_name);
615
+						$new_connection = @mysqli_connect((!empty($db_persist) ? 'p:' : '').$db_server, $ssi_db_user, $ssi_db_passwd, $db_name);
616 616
 
617 617
 					// Fall back to the regular username and password if need be
618 618
 					if (!$new_connection)
619
-						$new_connection = @mysqli_connect((!empty($db_persist) ? 'p:' : '') . $db_server, $db_user, $db_passwd, $db_name);
619
+						$new_connection = @mysqli_connect((!empty($db_persist) ? 'p:' : '').$db_server, $db_user, $db_passwd, $db_name);
620 620
 				}
621 621
 
622 622
 				if ($new_connection)
@@ -660,16 +660,16 @@  discard block
 block discarded – undo
660 660
 		// Show an error message, if possible.
661 661
 		$context['error_title'] = $txt['database_error'];
662 662
 		if (allowedTo('admin_forum'))
663
-			$context['error_message'] = nl2br($query_error) . '<br />' . $txt['file'] . ': ' . $file . '<br />' . $txt['line'] . ': ' . $line;
663
+			$context['error_message'] = nl2br($query_error).'<br />'.$txt['file'].': '.$file.'<br />'.$txt['line'].': '.$line;
664 664
 		else
665 665
 			$context['error_message'] = $txt['try_again'];
666 666
 
667 667
 		// Add database version that we know of, for the admin to know. (and ask for support)
668 668
 		if (allowedTo('admin_forum'))
669
-			$context['error_message'] .= '<br /><br />' . sprintf($txt['database_error_versions'], $modSettings['elkVersion']);
669
+			$context['error_message'] .= '<br /><br />'.sprintf($txt['database_error_versions'], $modSettings['elkVersion']);
670 670
 
671 671
 		if (allowedTo('admin_forum') && $db_show_debug === true)
672
-			$context['error_message'] .= '<br /><br />' . nl2br($db_string);
672
+			$context['error_message'] .= '<br /><br />'.nl2br($db_string);
673 673
 
674 674
 		// It's already been logged... don't log it again.
675 675
 		Errors::instance()->fatal_error($context['error_message'], false);
@@ -709,11 +709,11 @@  discard block
 block discarded – undo
709 709
 		{
710 710
 			// Are we restricting the length?
711 711
 			if (strpos($type, 'string-') !== false)
712
-				$insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName);
712
+				$insertData .= sprintf('SUBSTRING({string:%1$s}, 1, '.substr($type, 7).'), ', $columnName);
713 713
 			else
714 714
 				$insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName);
715 715
 		}
716
-		$insertData = substr($insertData, 0, -2) . ')';
716
+		$insertData = substr($insertData, 0, -2).')';
717 717
 
718 718
 		// Create an array consisting of only the columns.
719 719
 		$indexed_columns = array_keys($columns);
@@ -730,13 +730,13 @@  discard block
 block discarded – undo
730 730
 
731 731
 		// Do the insert.
732 732
 		$this->query('', '
733
-			' . $queryTitle . ' INTO ' . $table . '(`' . implode('`, `', $indexed_columns) . '`)
733
+			' . $queryTitle.' INTO '.$table.'(`'.implode('`, `', $indexed_columns).'`)
734 734
 			VALUES
735 735
 				' . implode(',
736 736
 				', $insertRows),
737 737
 			array(
738 738
 				'security_override' => true,
739
-				'db_error_skip' => $table === $db_prefix . 'log_errors',
739
+				'db_error_skip' => $table === $db_prefix.'log_errors',
740 740
 			),
741 741
 			$connection
742 742
 		);
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
 
792 792
 		$result = $this->query('', '
793 793
 			SELECT /*!40001 SQL_NO_CACHE */ *
794
-			FROM `' . $tableName . '`
795
-			LIMIT ' . $start . ', ' . $limit,
794
+			FROM `' . $tableName.'`
795
+			LIMIT ' . $start.', '.$limit,
796 796
 			array(
797 797
 				'security_override' => true,
798 798
 			)
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		}
812 812
 
813 813
 		// Start it off with the basic INSERT INTO.
814
-		$data = 'INSERT INTO `' . $tableName . '`' . $crlf . "\t" . '(`' . implode('`, `', $fields) . '`)' . $crlf . 'VALUES ';
814
+		$data = 'INSERT INTO `'.$tableName.'`'.$crlf."\t".'(`'.implode('`, `', $fields).'`)'.$crlf.'VALUES ';
815 815
 
816 816
 		// Loop through each row.
817 817
 		while ($row = $this->fetch_assoc($result))
@@ -827,14 +827,14 @@  discard block
 block discarded – undo
827 827
 				elseif (is_numeric($item) && (int) $item == $item)
828 828
 					$field_list[] = $item;
829 829
 				else
830
-					$field_list[] = '\'' . $this->escape_string($item) . '\'';
830
+					$field_list[] = '\''.$this->escape_string($item).'\'';
831 831
 			}
832 832
 
833
-			$data .= '(' . implode(', ', $field_list) . '),' . $crlf . "\t";
833
+			$data .= '('.implode(', ', $field_list).'),'.$crlf."\t";
834 834
 		}
835 835
 
836 836
 		$this->free_result($result);
837
-		$data = substr(trim($data), 0, -1) . ';' . $crlf . $crlf;
837
+		$data = substr(trim($data), 0, -1).';'.$crlf.$crlf;
838 838
 
839 839
 		$start += $limit;
840 840
 
@@ -858,10 +858,10 @@  discard block
 block discarded – undo
858 858
 		$crlf = "\r\n";
859 859
 
860 860
 		// Drop it if it exists.
861
-		$schema_create = 'DROP TABLE IF EXISTS `' . $tableName . '`;' . $crlf . $crlf;
861
+		$schema_create = 'DROP TABLE IF EXISTS `'.$tableName.'`;'.$crlf.$crlf;
862 862
 
863 863
 		// Start the create table...
864
-		$schema_create .= 'CREATE TABLE `' . $tableName . '` (' . $crlf;
864
+		$schema_create .= 'CREATE TABLE `'.$tableName.'` ('.$crlf;
865 865
 
866 866
 		// Find all the fields.
867 867
 		$result = $this->query('', '
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		while ($row = $this->fetch_assoc($result))
875 875
 		{
876 876
 			// Make the CREATE for this column.
877
-			$schema_create .= ' `' . $row['Field'] . '` ' . $row['Type'] . ($row['Null'] != 'YES' ? ' NOT NULL' : '');
877
+			$schema_create .= ' `'.$row['Field'].'` '.$row['Type'].($row['Null'] != 'YES' ? ' NOT NULL' : '');
878 878
 
879 879
 			// Add a default...?
880 880
 			if (!empty($row['Default']) || $row['Null'] !== 'YES')
@@ -889,12 +889,12 @@  discard block
 block discarded – undo
889 889
 					$type = strtolower($row['Type']);
890 890
 					$isNumericColumn = strpos($type, 'int') !== false || strpos($type, 'bool') !== false || strpos($type, 'bit') !== false || strpos($type, 'float') !== false || strpos($type, 'double') !== false || strpos($type, 'decimal') !== false;
891 891
 
892
-					$schema_create .= ' default ' . ($isNumericColumn ? $row['Default'] : '\'' . $this->escape_string($row['Default']) . '\'');
892
+					$schema_create .= ' default '.($isNumericColumn ? $row['Default'] : '\''.$this->escape_string($row['Default']).'\'');
893 893
 				}
894 894
 			}
895 895
 
896 896
 			// And now any extra information. (such as auto_increment.)
897
-			$schema_create .= ($row['Extra'] != '' ? ' ' . $row['Extra'] : '') . ',' . $crlf;
897
+			$schema_create .= ($row['Extra'] != '' ? ' '.$row['Extra'] : '').','.$crlf;
898 898
 		}
899 899
 		$this->free_result($result);
900 900
 
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 		while ($row = $this->fetch_assoc($result))
914 914
 		{
915 915
 			// Is this a primary key, unique index, or regular index?
916
-			$row['Key_name'] = $row['Key_name'] == 'PRIMARY' ? 'PRIMARY KEY' : (empty($row['Non_unique']) ? 'UNIQUE ' : ($row['Comment'] == 'FULLTEXT' || (isset($row['Index_type']) && $row['Index_type'] == 'FULLTEXT') ? 'FULLTEXT ' : 'KEY ')) . '`' . $row['Key_name'] . '`';
916
+			$row['Key_name'] = $row['Key_name'] == 'PRIMARY' ? 'PRIMARY KEY' : (empty($row['Non_unique']) ? 'UNIQUE ' : ($row['Comment'] == 'FULLTEXT' || (isset($row['Index_type']) && $row['Index_type'] == 'FULLTEXT') ? 'FULLTEXT ' : 'KEY ')).'`'.$row['Key_name'].'`';
917 917
 
918 918
 			// Is this the first column in the index?
919 919
 			if (empty($indexes[$row['Key_name']]))
@@ -921,9 +921,9 @@  discard block
 block discarded – undo
921 921
 
922 922
 			// A sub part, like only indexing 15 characters of a varchar.
923 923
 			if (!empty($row['Sub_part']))
924
-				$indexes[$row['Key_name']][$row['Seq_in_index']] = '`' . $row['Column_name'] . '`(' . $row['Sub_part'] . ')';
924
+				$indexes[$row['Key_name']][$row['Seq_in_index']] = '`'.$row['Column_name'].'`('.$row['Sub_part'].')';
925 925
 			else
926
-				$indexes[$row['Key_name']][$row['Seq_in_index']] = '`' . $row['Column_name'] . '`';
926
+				$indexes[$row['Key_name']][$row['Seq_in_index']] = '`'.$row['Column_name'].'`';
927 927
 		}
928 928
 		$this->free_result($result);
929 929
 
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 			// Ensure the columns are in proper order.
934 934
 			ksort($columns);
935 935
 
936
-			$schema_create .= ',' . $crlf . ' ' . $keyname . ' (' . implode(', ', $columns) . ')';
936
+			$schema_create .= ','.$crlf.' '.$keyname.' ('.implode(', ', $columns).')';
937 937
 		}
938 938
 
939 939
 		// Now just get the comment and type... (MyISAM, etc.)
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
 		$this->free_result($result);
949 949
 
950 950
 		// Probably MyISAM.... and it might have a comment.
951
-		$schema_create .= $crlf . ') ENGINE=' . (isset($row['Type']) ? $row['Type'] : $row['Engine']) . ($row['Comment'] != '' ? ' COMMENT="' . $row['Comment'] . '"' : '');
951
+		$schema_create .= $crlf.') ENGINE='.(isset($row['Type']) ? $row['Type'] : $row['Engine']).($row['Comment'] != '' ? ' COMMENT="'.$row['Comment'].'"' : '');
952 952
 
953 953
 		return $schema_create;
954 954
 	}
@@ -968,7 +968,7 @@  discard block
 block discarded – undo
968 968
 
969 969
 		$db_name_str = $db_name_str == false ? $db_name : $db_name_str;
970 970
 		$db_name_str = trim($db_name_str);
971
-		$filter = $filter == false ? '' : ' LIKE \'' . $filter . '\'';
971
+		$filter = $filter == false ? '' : ' LIKE \''.$filter.'\'';
972 972
 
973 973
 		$request = $this->query('', '
974 974
 			SHOW TABLES
@@ -1083,13 +1083,13 @@  discard block
 block discarded – undo
1083 1083
 		if (!empty($create))
1084 1084
 			$create = '(
1085 1085
 				' . implode('
1086
-				', $create) . ')';
1086
+				', $create).')';
1087 1087
 		else
1088 1088
 			$create = '';
1089 1089
 
1090 1090
 		$request = $this->query('', '
1091 1091
 			CREATE TABLE {raw:backup_table} {raw:create}
1092
-			ENGINE={raw:engine}' . (empty($charset) ? '' : ' CHARACTER SET {raw:charset}' . (empty($collate) ? '' : ' COLLATE {raw:collate}')) . '
1092
+			ENGINE={raw:engine}' . (empty($charset) ? '' : ' CHARACTER SET {raw:charset}'.(empty($collate) ? '' : ' COLLATE {raw:collate}')).'
1093 1093
 			SELECT *
1094 1094
 			FROM {raw:table}',
1095 1095
 			array(
Please login to merge, or discard this patch.
sources/Errors.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 	/**
84 84
 	 * Halts execution, optional displays an error message
85 85
 	 *
86
-	 * @param string|integer $error
86
+	 * @param integer $error
87 87
 	 */
88 88
 	protected function terminate($error = 0)
89 89
 	{
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 		$query_string = empty($_SERVER['QUERY_STRING']) ? (empty($_SERVER['REQUEST_URL']) ? '' : str_replace($scripturl, '', $_SERVER['REQUEST_URL'])) : $_SERVER['QUERY_STRING'];
134 134
 
135 135
 		// Don't log the session hash in the url twice, it's a waste.
136
-		$query_string = htmlspecialchars((ELK === 'SSI' ? '' : '?') . preg_replace(array('~;sesc=[^&;]+~', '~' . session_name() . '=' . session_id() . '[&;]~'), array(';sesc', ''), $query_string), ENT_COMPAT, 'UTF-8');
136
+		$query_string = htmlspecialchars((ELK === 'SSI' ? '' : '?').preg_replace(array('~;sesc=[^&;]+~', '~'.session_name().'='.session_id().'[&;]~'), array(';sesc', ''), $query_string), ENT_COMPAT, 'UTF-8');
137 137
 
138 138
 		// Just so we know what board error messages are from.
139 139
 		if (isset($_POST['board']) && !isset($_GET['board']))
140
-			$query_string .= ($query_string == '' ? 'board=' : ';board=') . $_POST['board'];
140
+			$query_string .= ($query_string == '' ? 'board=' : ';board=').$_POST['board'];
141 141
 
142 142
 		// What types of categories do we have?$other_error_types = array();
143 143
 		$known_error_types = array(
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		$err_line = isset($err_line) ? $err_line : $e->getLine();
338 338
 
339 339
 		// Logged !
340
-		$message = $this->log_error($this->error_name . ': ' . $this->error_string, $error_type, $err_file, $err_line);
340
+		$message = $this->log_error($this->error_name.': '.$this->error_string, $error_type, $err_file, $err_line);
341 341
 
342 342
 		// Display debug information?
343 343
 		$this->_displayDebug();
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			}
384 384
 
385 385
 			// Debugging!  This should look like a PHP error message.
386
-			echo '<br /><strong>', $this->error_name, '</strong>: ' . $this->error_string . '<ol>' . $this->error_text . '</ol>';
386
+			echo '<br /><strong>', $this->error_name, '</strong>: '.$this->error_string.'<ol>'.$this->error_text.'</ol>';
387 387
 		}
388 388
 	}
389 389
 
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
 				$function = $this->_debug_error_func($error_trace, $entry, $not_thrown, $key);
419 419
 				$entry['file'] = isset($entry['file']) ? str_replace($current_directory, '', str_replace('\\', '/', $entry['file'])) : '';
420 420
 
421
-				$this->error_text .= '<li><strong>' . htmlspecialchars($function) . '()</strong>' . (isset($entry['file'], $entry['line'])
422
-						? ' in <strong>' . $entry['file'] . '</strong> at line <strong>' . $entry['line'] . '</strong>'
423
-						: '') . "</li>\n";
421
+				$this->error_text .= '<li><strong>'.htmlspecialchars($function).'()</strong>'.(isset($entry['file'], $entry['line'])
422
+						? ' in <strong>'.$entry['file'].'</strong> at line <strong>'.$entry['line'].'</strong>'
423
+						: '')."</li>\n";
424 424
 			}
425 425
 		}
426 426
 	}
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 	{
440 440
 		// If from the error_handler, the stack is out of sync
441 441
 		if ($not_thrown)
442
-			$function = (isset($error_trace[$key + 1]['class']) ? $error_trace[$key + 1]['class'] . $error_trace[$key + 1]['type'] : '') . isset($error_trace[$key + 1]['function']) ? $error_trace[$key + 1]['function'] : '';
442
+			$function = (isset($error_trace[$key + 1]['class']) ? $error_trace[$key + 1]['class'].$error_trace[$key + 1]['type'] : '').isset($error_trace[$key + 1]['function']) ? $error_trace[$key + 1]['function'] : '';
443 443
 		else
444
-			$function = (isset($entry['class']) ? $entry['class'] . $entry['type'] : '') . $entry['function'];
444
+			$function = (isset($entry['class']) ? $entry['class'].$entry['type'] : '').$entry['function'];
445 445
 
446 446
 		return $function;
447 447
 	}
@@ -473,8 +473,8 @@  discard block
 block discarded – undo
473 473
 		// A little something for the template
474 474
 		$context['error_title'] = isset($context['error_title']) ? $context['error_title'] : $txt['error_occurred'];
475 475
 		$context['error_message'] = isset($context['error_message']) ? $context['error_message'] : $error_message;
476
-		$context['error_code'] = isset($error_code) ? 'id="' . htmlspecialchars($error_code) . '" ' : '';
477
-		$context['page_title'] = empty($context['page_title']) ? $context['error_title'] : $context['page_title'] ;
476
+		$context['error_code'] = isset($error_code) ? 'id="'.htmlspecialchars($error_code).'" ' : '';
477
+		$context['page_title'] = empty($context['page_title']) ? $context['error_title'] : $context['page_title'];
478 478
 
479 479
 		// Load the template and set the sub template.
480 480
 		loadTemplate('Errors');
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 
575 575
 			// Language files aren't loaded yet :'(
576 576
 			$db_error = $db->last_error($db->connection());
577
-			@mail($webmaster_email, $mbname . ': Database Error!', 'There has been a problem with the database!' . ($db_error == '' ? '' : "\n" . $db->db_title() . ' reported:' . "\n" . $db_error) . "\n\n" . 'This is a notice email to let you know that the system could not connect to the database, contact your host if this continues.');
577
+			@mail($webmaster_email, $mbname.': Database Error!', 'There has been a problem with the database!'.($db_error == '' ? '' : "\n".$db->db_title().' reported:'."\n".$db_error)."\n\n".'This is a notice email to let you know that the system could not connect to the database, contact your host if this continues.');
578 578
 		}
579 579
 
580 580
 		// What to do?  Language files haven't and can't be loaded yet...
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	{
632 632
 		// Don't cache this page!
633 633
 		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
634
-		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
634
+		header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
635 635
 		header('Cache-Control: no-cache');
636 636
 
637 637
 		// Send the right error codes.
Please login to merge, or discard this patch.
sources/subs/BBC/Codes.class.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -939,6 +939,9 @@
 block discarded – undo
939 939
 		return $this->parsing_codes[$char];
940 940
 	}
941 941
 
942
+	/**
943
+	 * @param string $code
944
+	 */
942 945
 	protected function getItemCodeTag($code)
943 946
 	{
944 947
 		return array(
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			array(
298 298
 				self::ATTR_TAG => 'code',
299 299
 				self::ATTR_TYPE => self::TYPE_UNPARSED_CONTENT,
300
-				self::ATTR_CONTENT => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return elkSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><pre class="bbc_code prettyprint">$1</pre>',
300
+				self::ATTR_CONTENT => '<div class="codeheader">'.$txt['code'].': <a href="javascript:void(0);" onclick="return elkSelectText(this);" class="codeoperation">'.$txt['code_select'].'</a></div><pre class="bbc_code prettyprint">$1</pre>',
301 301
 				self::ATTR_VALIDATE => $this->isDisabled('code') ? null : function(&$tag, &$data, $disabled) {
302 302
 					$data = tabToHtmlTab($data);
303 303
 				},
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			array(
309 309
 				self::ATTR_TAG => 'code',
310 310
 				self::ATTR_TYPE => self::TYPE_UNPARSED_EQUALS_CONTENT,
311
-				self::ATTR_CONTENT => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return elkSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><pre class="bbc_code prettyprint">$1</pre>',
311
+				self::ATTR_CONTENT => '<div class="codeheader">'.$txt['code'].': ($2) <a href="#" onclick="return elkSelectText(this);" class="codeoperation">'.$txt['code_select'].'</a></div><pre class="bbc_code prettyprint">$1</pre>',
312 312
 				self::ATTR_VALIDATE => $this->isDisabled('code') ? null : function(&$tag, &$data, $disabled) {
313 313
 					$data[0] = tabToHtmlTab($data[0]);
314 314
 				},
@@ -397,9 +397,9 @@  discard block
 block discarded – undo
397 397
 			array(
398 398
 				self::ATTR_TAG => 'ila',
399 399
 				self::ATTR_TYPE => self::TYPE_CLOSED,
400
-				self::ATTR_CONTENT => '<a href="' . $scripturl . '?action=dlattach;attach=$1;image"><img src="' . $scripturl . '?action=dlattach;attach=$1;thumb" alt="" class="bbc_img" /></a>',
400
+				self::ATTR_CONTENT => '<a href="'.$scripturl.'?action=dlattach;attach=$1;image"><img src="'.$scripturl.'?action=dlattach;attach=$1;thumb" alt="" class="bbc_img" /></a>',
401 401
 				self::ATTR_TEST => '(^\d+$)',
402
-				self::ATTR_DISABLED_CONTENT => '<a href="' . $scripturl . '?action=dlattach;attach=$1;image">(' . $scripturl . '?action=dlattach;attach=$1;image)</a>',
402
+				self::ATTR_DISABLED_CONTENT => '<a href="'.$scripturl.'?action=dlattach;attach=$1;image">('.$scripturl.'?action=dlattach;attach=$1;image)</a>',
403 403
 				self::ATTR_BLOCK_LEVEL => false,
404 404
 				self::ATTR_AUTOLINK => false,
405 405
 				self::ATTR_LENGTH => 3,
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
427 427
 					if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
428 428
 					{
429
-						$data = 'http://' . $data;
429
+						$data = 'http://'.$data;
430 430
 					}
431 431
 				},
432 432
 				self::ATTR_DISABLED_CONTENT => '($1)',
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
442 442
 					if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
443 443
 					{
444
-						$data = 'http://' . $data;
444
+						$data = 'http://'.$data;
445 445
 					}
446 446
 				},
447 447
 				self::ATTR_DISABLED_CONTENT => '($1)',
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 					//$data = removeBr($data);
458 458
 					if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
459 459
 					{
460
-						$data = 'http://' . $data;
460
+						$data = 'http://'.$data;
461 461
 					}
462 462
 				},
463 463
 				self::ATTR_BLOCK_LEVEL => false,
@@ -472,11 +472,11 @@  discard block
 block discarded – undo
472 472
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
473 473
 					if ($data[0] === '#')
474 474
 					{
475
-						$data = '#post_' . substr($data, 1);
475
+						$data = '#post_'.substr($data, 1);
476 476
 					}
477 477
 					elseif (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
478 478
 					{
479
-						$data = 'http://' . $data;
479
+						$data = 'http://'.$data;
480 480
 					}
481 481
 				},
482 482
 				self::ATTR_DISALLOW_CHILDREN => array(
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 				self::ATTR_TAG => 'member',
562 562
 				self::ATTR_TYPE => self::TYPE_UNPARSED_EQUALS,
563 563
 				self::ATTR_TEST => '[\d*]',
564
-				self::ATTR_BEFORE => '<span class="bbc_mention"><a href="' . $scripturl . '?action=profile;u=$1">@',
564
+				self::ATTR_BEFORE => '<span class="bbc_mention"><a href="'.$scripturl.'?action=profile;u=$1">@',
565 565
 				self::ATTR_AFTER => '</a></span>',
566 566
 				self::ATTR_DISABLED_BEFORE => '@',
567 567
 				self::ATTR_DISABLED_AFTER => '',
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 			array(
590 590
 				self::ATTR_TAG => 'quote',
591 591
 				self::ATTR_TYPE => self::TYPE_PARSED_CONTENT,
592
-				self::ATTR_BEFORE => '<div class="quoteheader">' . $txt['quote'] . '</div><blockquote>',
592
+				self::ATTR_BEFORE => '<div class="quoteheader">'.$txt['quote'].'</div><blockquote>',
593 593
 				self::ATTR_AFTER => '</blockquote>',
594 594
 				self::ATTR_BLOCK_LEVEL => true,
595 595
 				self::ATTR_AUTOLINK => true,
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 						self::PARAM_ATTR_QUOTED => self::OPTIONAL,
605 605
 					),
606 606
 				),
607
-				self::ATTR_BEFORE => '<div class="quoteheader">' . $txt['quote_from'] . ': {author}</div><blockquote>',
607
+				self::ATTR_BEFORE => '<div class="quoteheader">'.$txt['quote_from'].': {author}</div><blockquote>',
608 608
 				self::ATTR_AFTER => '</blockquote>',
609 609
 				self::ATTR_BLOCK_LEVEL => true,
610 610
 				self::ATTR_AUTOLINK => true,
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 			array(
614 614
 				self::ATTR_TAG => 'quote',
615 615
 				self::ATTR_TYPE => self::TYPE_PARSED_EQUALS,
616
-				self::ATTR_BEFORE => '<div class="quoteheader">' . $txt['quote_from'] . ': $1</div><blockquote>',
616
+				self::ATTR_BEFORE => '<div class="quoteheader">'.$txt['quote_from'].': $1</div><blockquote>',
617 617
 				self::ATTR_AFTER => '</blockquote>',
618 618
 				self::ATTR_QUOTED => self::OPTIONAL,
619 619
 				self::ATTR_PARSED_TAGS_ALLOWED => array(
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 						self::ATTR_VALIDATE => 'htmlTime',
640 640
 					),
641 641
 				),
642
-				self::ATTR_BEFORE => '<div class="quoteheader"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . ($modSettings['todayMod'] == 3 ? ' - ' : $txt['search_on']) . ' {date}</a></div><blockquote>',
642
+				self::ATTR_BEFORE => '<div class="quoteheader"><a href="'.$scripturl.'?{link}">'.$txt['quote_from'].': {author} '.($modSettings['todayMod'] == 3 ? ' - ' : $txt['search_on']).' {date}</a></div><blockquote>',
643 643
 				self::ATTR_AFTER => '</blockquote>',
644 644
 				self::ATTR_BLOCK_LEVEL => true,
645 645
 				self::ATTR_AUTOLINK => true,
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 				self::ATTR_PARAM => array(
652 652
 					'author' => array(self::PARAM_ATTR_MATCH => '(.{1,192}?)'),
653 653
 				),
654
-				self::ATTR_BEFORE => '<div class="quoteheader">' . $txt['quote_from'] . ': {author}</div><blockquote>',
654
+				self::ATTR_BEFORE => '<div class="quoteheader">'.$txt['quote_from'].': {author}</div><blockquote>',
655 655
 				self::ATTR_AFTER => '</blockquote>',
656 656
 				self::ATTR_BLOCK_LEVEL => true,
657 657
 				self::ATTR_AUTOLINK => true,
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 				self::ATTR_AFTER => '</span>',
684 684
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
685 685
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
686
-					$data = $sizes[(int) $data] . 'em';
686
+					$data = $sizes[(int) $data].'em';
687 687
 				},
688 688
 				self::ATTR_DISALLOW_PARENTS => array(
689 689
 					'size' => 1,
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 			array(
711 711
 				self::ATTR_TAG => 'spoiler',
712 712
 				self::ATTR_TYPE => self::TYPE_PARSED_CONTENT,
713
-				self::ATTR_BEFORE => '<span class="spoilerheader">' . $txt['spoiler'] . '</span><div class="spoiler"><div class="bbc_spoiler" style="display: none;">',
713
+				self::ATTR_BEFORE => '<span class="spoilerheader">'.$txt['spoiler'].'</span><div class="spoiler"><div class="bbc_spoiler" style="display: none;">',
714 714
 				self::ATTR_AFTER => '</div></div>',
715 715
 				self::ATTR_BLOCK_LEVEL => true,
716 716
 				self::ATTR_AUTOLINK => true,
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
822 822
 					if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
823 823
 					{
824
-						$data = 'http://' . $data;
824
+						$data = 'http://'.$data;
825 825
 					}
826 826
 				},
827 827
 				self::ATTR_BLOCK_LEVEL => false,
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 				self::ATTR_VALIDATE => function(&$tag, &$data, $disabled) {
837 837
 					if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
838 838
 					{
839
-						$data = 'http://' . $data;
839
+						$data = 'http://'.$data;
840 840
 					}
841 841
 				},
842 842
 				self::ATTR_DISALLOW_CHILDREN => array(
Please login to merge, or discard this patch.
sources/subs/Boards.subs.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2084,7 +2084,7 @@
 block discarded – undo
2084 2084
  * Count boards all or specific depending on argument, redirect boards excluded by default.
2085 2085
  *
2086 2086
  * @package Boards
2087
- * @param mixed[]|string $conditions is an associative array that holds the board or the cat IDs
2087
+ * @param string $conditions is an associative array that holds the board or the cat IDs
2088 2088
  *              'categories' => an array of category IDs (it accepts a single ID too)
2089 2089
  *              'boards' => an array of board IDs (it accepts a single ID too)
2090 2090
  *              if conditions is set to 'all' (not an array) all the boards are queried
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
  */
184 184
 function getMsgMemberID($messageID)
185 185
 {
186
-	require_once(SUBSDIR . '/Messages.subs.php');
186
+	require_once(SUBSDIR.'/Messages.subs.php');
187 187
 	$message_info = basicMessageInfo((int) $messageID, true);
188 188
 
189 189
 	return empty($message_info['id_member']) ? 0 : (int) $message_info['id_member'];
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
 		// Oops...?
272 272
 		else
273
-			trigger_error('modifyBoard(): The move_to value \'' . $boardOptions['move_to'] . '\' is incorrect', E_USER_ERROR);
273
+			trigger_error('modifyBoard(): The move_to value \''.$boardOptions['move_to'].'\' is incorrect', E_USER_ERROR);
274 274
 
275 275
 		// Get a list of children of this board.
276 276
 		$childList = array();
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		$childUpdates = array();
281 281
 		$levelDiff = $child_level - $boards[$board_id]['level'];
282 282
 		if ($levelDiff != 0)
283
-			$childUpdates[] = 'child_level = child_level ' . ($levelDiff > 0 ? '+ ' : '') . '{int:level_diff}';
283
+			$childUpdates[] = 'child_level = child_level '.($levelDiff > 0 ? '+ ' : '').'{int:level_diff}';
284 284
 		if ($id_cat != $boards[$board_id]['category'])
285 285
 			$childUpdates[] = 'id_cat = {int:category}';
286 286
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			$db->query('', '
290 290
 				UPDATE {db_prefix}boards
291 291
 				SET ' . implode(',
292
-					', $childUpdates) . '
292
+					', $childUpdates).'
293 293
 				WHERE id_board IN ({array_int:board_list})',
294 294
 				array(
295 295
 					'board_list' => $childList,
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 			UPDATE {db_prefix}boards
397 397
 			SET
398 398
 				' . implode(',
399
-				', $boardUpdates) . '
399
+				', $boardUpdates).'
400 400
 			WHERE id_board = {int:selected_board}',
401 401
 			array_merge($boardUpdateParameters, array(
402 402
 				'selected_board' => $board_id,
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 		)
634 634
 	);
635 635
 
636
-	require_once(SUBSDIR . '/Topic.subs.php');
636
+	require_once(SUBSDIR.'/Topic.subs.php');
637 637
 	removeTopics($topics, false);
638 638
 
639 639
 	// Delete the board's logs.
@@ -696,9 +696,9 @@  discard block
 block discarded – undo
696 696
 	);
697 697
 
698 698
 	// Latest message/topic might not be there anymore.
699
-	require_once(SUBSDIR . '/Messages.subs.php');
699
+	require_once(SUBSDIR.'/Messages.subs.php');
700 700
 	updateMessageStats();
701
-	require_once(SUBSDIR . '/Topic.subs.php');
701
+	require_once(SUBSDIR.'/Topic.subs.php');
702 702
 	updateTopicStats();
703 703
 	updateSettings(array(
704 704
 		'calendar_updated' => time(),
@@ -831,10 +831,10 @@  discard block
 block discarded – undo
831 831
 			IFNULL(b.id_board, 0) AS id_board, b.id_parent, b.name AS board_name, b.description, b.child_level,
832 832
 			b.board_order, b.count_posts, b.member_groups, b.id_theme, b.override_theme, b.id_profile, b.redirect,
833 833
 			b.num_posts, b.num_topics, b.deny_member_groups, c.id_cat, c.name AS cat_name, c.cat_order, c.can_collapse' . (!empty($query['select']) ?
834
-			$query['select'] : '') . '
834
+			$query['select'] : '').'
835 835
 		FROM {db_prefix}categories AS c
836 836
 			LEFT JOIN {db_prefix}boards AS b ON (b.id_cat = c.id_cat)' . (!empty($query['join']) ?
837
-			$query['join'] : '') . '
837
+			$query['join'] : '').'
838 838
 		ORDER BY c.cat_order, b.child_level, b.board_order',
839 839
 		array(
840 840
 		)
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 	// Leave out the boards that the user may be ignoring
1000 1000
 	if (isset($boardListOptions['ignore']))
1001 1001
 	{
1002
-		$select .= ',' . (!empty($boardListOptions['ignore']) ? 'b.id_board IN ({array_int:ignore_boards})' : '0') . ' AS is_ignored';
1002
+		$select .= ','.(!empty($boardListOptions['ignore']) ? 'b.id_board IN ({array_int:ignore_boards})' : '0').' AS is_ignored';
1003 1003
 		$where_parameters['ignore_boards'] = $boardListOptions['ignore'];
1004 1004
 	}
1005 1005
 
@@ -1026,11 +1026,11 @@  discard block
 block discarded – undo
1026 1026
 
1027 1027
 	// Bring all the options together and make the query
1028 1028
 	$request = $db->query('', '
1029
-		SELECT c.name AS cat_name, c.id_cat, b.id_board, b.name AS board_name, b.child_level' . $select . '
1029
+		SELECT c.name AS cat_name, c.id_cat, b.id_board, b.name AS board_name, b.child_level' . $select.'
1030 1030
 		FROM {db_prefix}boards AS b
1031
-			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)' . (empty($join) ? '' : implode(' ', $join)) . (empty($where) ? '' : '
1031
+			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)' . (empty($join) ? '' : implode(' ', $join)).(empty($where) ? '' : '
1032 1032
 		WHERE ' . implode('
1033
-			AND ', $where)) . '
1033
+			AND ', $where)).'
1034 1034
 		ORDER BY c.cat_order, b.board_order',
1035 1035
 		$where_parameters
1036 1036
 	);
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
 	return $db->fetchQueryCallback('
1413 1413
 		SELECT b.id_board
1414 1414
 		FROM {db_prefix}boards AS b
1415
-		WHERE ' . $user_info[in_array($see_board, $allowed_see) ? $see_board : $allowed_see[0]] . ($hide_recycle && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
1415
+		WHERE ' . $user_info[in_array($see_board, $allowed_see) ? $see_board : $allowed_see[0]].($hide_recycle && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
1416 1416
 			AND b.id_board != {int:recycle_board}' : ''),
1417 1417
 		array(
1418 1418
 			'recycle_board' => (int) $modSettings['recycle_board'],
@@ -1727,8 +1727,8 @@  discard block
 block discarded – undo
1727 1727
 	$request = $db->query('', '
1728 1728
 		SELECT b.id_board, b.num_posts
1729 1729
 		FROM {db_prefix}boards AS b
1730
-		WHERE ' . ($wanna_see_board ? '{query_wanna_see_board}' : '{query_see_board}') . '
1731
-			AND b.' . implode(' OR b.', $clauses) . (!empty($removals) ? '
1730
+		WHERE ' . ($wanna_see_board ? '{query_wanna_see_board}' : '{query_see_board}').'
1731
+			AND b.' . implode(' OR b.', $clauses).(!empty($removals) ? '
1732 1732
 			AND b.' . implode(' AND b.', $removals) : ''),
1733 1733
 		$clauseParameters
1734 1734
 	);
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 	);
1804 1804
 
1805 1805
 	if (!empty($params['sort_by']) && in_array($params['sort_by'], $allowed_sort))
1806
-		$sort_by = 'ORDER BY ' . $params['sort_by'];
1806
+		$sort_by = 'ORDER BY '.$params['sort_by'];
1807 1807
 	else
1808 1808
 		$sort_by = '';
1809 1809
 
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 	{
1830 1830
 		// id_board, name, id_profile => used in admin/Reports.controller.php
1831 1831
 		$request = $db->query('', '
1832
-			SELECT ' . $select . '
1832
+			SELECT ' . $select.'
1833 1833
 			FROM {db_prefix}boards AS b
1834 1834
 			' . $sort_by,
1835 1835
 			array()
@@ -1857,11 +1857,11 @@  discard block
 block discarded – undo
1857 1857
 			$security = $params['wanna_see_board'] ? '{query_wanna_see_board}' : '{query_see_board}';
1858 1858
 
1859 1859
 		$request = $db->query('', '
1860
-			SELECT ' . $select . '
1860
+			SELECT ' . $select.'
1861 1861
 			FROM {db_prefix}boards AS b
1862
-			WHERE ' . $security . (!empty($clauses) ? '
1863
-				AND b.' . implode(' OR b.', $clauses) : '') . ($params['include_recycle'] ? '' : '
1864
-				AND b.id_board != {int:recycle_board}') . ($params['include_redirects'] ? '' : '
1862
+			WHERE ' . $security.(!empty($clauses) ? '
1863
+				AND b.' . implode(' OR b.', $clauses) : '').($params['include_recycle'] ? '' : '
1864
+				AND b.id_board != {int:recycle_board}').($params['include_redirects'] ? '' : '
1865 1865
 				AND b.redirect = {string:empty_string}
1866 1866
 			' . $sort_by),
1867 1867
 			array_merge($clauseParameters, array(
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 	{
1949 1949
 		if (in_array($key, $knownInts))
1950 1950
 		{
1951
-			$set[] = $key . ' = ' . $key . ' + {int:' . $key . '}';
1951
+			$set[] = $key.' = '.$key.' + {int:'.$key.'}';
1952 1952
 			$params[$key] = $val;
1953 1953
 		}
1954 1954
 	}
@@ -1960,7 +1960,7 @@  discard block
 block discarded – undo
1960 1960
 		UPDATE {db_prefix}boards
1961 1961
 		SET
1962 1962
 			' . implode(',
1963
-			', $set) . '
1963
+			', $set).'
1964 1964
 		WHERE id_board = {int:id_board}',
1965 1965
 		$params
1966 1966
 	);
@@ -1992,7 +1992,7 @@  discard block
 block discarded – undo
1992 1992
 	{
1993 1993
 		if (in_array($key, $knownInts))
1994 1994
 		{
1995
-			$set[] = $key . ' = CASE WHEN {int:' . $key . '} > ' . $key . ' THEN 0 ELSE ' . $key . ' - {int:' . $key . '} END';
1995
+			$set[] = $key.' = CASE WHEN {int:'.$key.'} > '.$key.' THEN 0 ELSE '.$key.' - {int:'.$key.'} END';
1996 1996
 			$params[$key] = $val;
1997 1997
 		}
1998 1998
 	}
@@ -2004,7 +2004,7 @@  discard block
 block discarded – undo
2004 2004
 		UPDATE {db_prefix}boards
2005 2005
 		SET
2006 2006
 			' . implode(',
2007
-			', $set) . '
2007
+			', $set).'
2008 2008
 		WHERE id_board = {int:id_board}',
2009 2009
 		$params
2010 2010
 	);
@@ -2048,8 +2048,8 @@  discard block
 block discarded – undo
2048 2048
 			return array(
2049 2049
 				'id' => $row['id_board'],
2050 2050
 				'name' => $row['name'],
2051
-				'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
2052
-				'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0"><strong>' . $row['name'] . '</strong></a>',
2051
+				'href' => $scripturl.'?board='.$row['id_board'].'.0',
2052
+				'link' => '<a href="'.$scripturl.'?board='.$row['id_board'].'.0"><strong>'.$row['name'].'</strong></a>',
2053 2053
 				'new' => $row['board_read'] < $row['id_msg_updated'],
2054 2054
 				'checked' => 'checked="checked"',
2055 2055
 			);
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
 			LEFT JOIN {db_prefix}log_boards AS lb ON (lb.id_board = b.id_board AND lb.id_member = {int:current_member})
2065 2065
 		WHERE {query_see_board}
2066 2066
 			AND ln.id_board is null ' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
2067
-			AND b.id_board != {int:recycle_board}' : '') . '
2067
+			AND b.id_board != {int:recycle_board}' : '').'
2068 2068
 		ORDER BY ' . $sort,
2069 2069
 		array(
2070 2070
 			'selected_member' => $memID,
@@ -2076,8 +2076,8 @@  discard block
 block discarded – undo
2076 2076
 		$notification_boards[] = array(
2077 2077
 			'id' => $row['id_board'],
2078 2078
 			'name' => $row['name'],
2079
-			'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
2080
-			'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['name'] . '</a>',
2079
+			'href' => $scripturl.'?board='.$row['id_board'].'.0',
2080
+			'link' => '<a href="'.$scripturl.'?board='.$row['id_board'].'.0">'.$row['name'].'</a>',
2081 2081
 			'new' => $row['board_read'] < $row['id_msg_updated'],
2082 2082
 			'checked' => '',
2083 2083
 		);
@@ -2141,9 +2141,9 @@  discard block
 block discarded – undo
2141 2141
 		$request = $db->query('', '
2142 2142
 			SELECT COUNT(*)
2143 2143
 			FROM {db_prefix}boards AS b
2144
-			WHERE ' . ($params['wanna_see_board'] ? '{query_wanna_see_board}' : '{query_see_board}') . (!empty($clauses) ? '
2145
-				AND b.' . implode(' OR b.', $clauses) : '') . ($params['include_recycle'] ? '' : '
2146
-				AND b.id_board != {int:recycle_board}') . ($params['include_redirects'] ? '' : '
2144
+			WHERE ' . ($params['wanna_see_board'] ? '{query_wanna_see_board}' : '{query_see_board}').(!empty($clauses) ? '
2145
+				AND b.' . implode(' OR b.', $clauses) : '').($params['include_recycle'] ? '' : '
2146
+				AND b.id_board != {int:recycle_board}').($params['include_redirects'] ? '' : '
2147 2147
 				AND b.redirect = {string:empty_string}'),
2148 2148
 			array_merge($clauseParameters, array(
2149 2149
 				'recycle_board' => !empty($modSettings['recycle_board']) ? $modSettings['recycle_board'] : 0,
Please login to merge, or discard this patch.
sources/subs/DataValidator.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@
 block discarded – undo
265 265
 
266 266
 	/**
267 267
 	 * Return the validation data, all or a specific key
268
-	 * @param integer|string|null $key int or string
268
+	 * @param string $key int or string
269 269
 	 */
270 270
 	public function validation_data($key = null)
271 271
 	{
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 					// Were any parameters provided for the rule, e.g. min_length[6]
305 305
 					if (preg_match('~(.*)\[(.*)\]~', $rule, $match))
306 306
 					{
307
-						$validation_method = '_validate_' . $match[1];
307
+						$validation_method = '_validate_'.$match[1];
308 308
 						$validation_parameters = $match[2];
309 309
 						$validation_function = $match[1];
310 310
 						$validation_parameters_function = explode(',', $match[2]);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 					// Or just a predefined rule e.g. valid_email
313 313
 					else
314 314
 					{
315
-						$validation_method = '_validate_' . $rule;
315
+						$validation_method = '_validate_'.$rule;
316 316
 						$validation_function = $rule;
317 317
 					}
318 318
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 					// Were any parameters provided for the rule, e.g. Util::htmlspecialchars[ENT_QUOTES]
437 437
 					if (preg_match('~(.*)\[(.*)\]~', $rule, $match))
438 438
 					{
439
-						$sanitation_method = '_sanitation_' . $match[1];
439
+						$sanitation_method = '_sanitation_'.$match[1];
440 440
 						$sanitation_parameters = $match[2];
441 441
 						$sanitation_function = $match[1];
442 442
 						$sanitation_parameters_function = explode(',', defined($match[2]) ? constant($match[2]) : $match[2]);
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 					// Or just a predefined rule e.g. trim
445 445
 					else
446 446
 					{
447
-						$sanitation_method = '_sanitation_' . $rule;
447
+						$sanitation_method = '_sanitation_'.$rule;
448 448
 						$sanitation_function = $rule;
449 449
 					}
450 450
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 				$result = @eval('
1151 1151
 					if (false)
1152 1152
 					{
1153
-						' . preg_replace('~^(?:\s*<\\?(?:php)?|\\?>\s*$)~u', '', $input[$field]) . '
1153
+						' . preg_replace('~^(?:\s*<\\?(?:php)?|\\?>\s*$)~u', '', $input[$field]).'
1154 1154
 					}
1155 1155
 				');
1156 1156
 			}
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
 			// @todo should we force gmail.com or use $domain_name, force is safest but perhaps most confusing
1258 1258
 		}
1259 1259
 
1260
-		return $local_name . '@' . $domain_name;
1260
+		return $local_name.'@'.$domain_name;
1261 1261
 	}
1262 1262
 
1263 1263
 	/**
Please login to merge, or discard this patch.
sources/subs/Members.subs.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1436,7 +1436,7 @@
 block discarded – undo
1436 1436
  * Counts the number of members based on conditions
1437 1437
  *
1438 1438
  * @package Members
1439
- * @param string[]|string $query see prepareMembersByQuery
1439
+ * @param string $query see prepareMembersByQuery
1440 1440
  * @param mixed[] $query_params see prepareMembersByQuery
1441 1441
  * @param boolean $only_active see prepareMembersByQuery
1442 1442
  */
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
 		);
136 136
 
137 137
 		// Remove any cached data if enabled.
138
-		Cache::instance()->remove('user_settings-' . $user[0]);
138
+		Cache::instance()->remove('user_settings-'.$user[0]);
139 139
 	}
140 140
 
141 141
 	// Make these peoples' posts guest posts.
142 142
 	$db->query('', '
143 143
 		UPDATE {db_prefix}messages
144 144
 		SET id_member = {int:guest_id}' . (!empty($modSettings['deleteMembersRemovesEmail']) ? ',
145
-		poster_email = {string:blank_email}' : '') . '
145
+		poster_email = {string:blank_email}' : '').'
146 146
 		WHERE id_member IN ({array_int:users})',
147 147
 		array(
148 148
 			'guest_id' => 0,
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	);
353 353
 
354 354
 	// Delete personal messages.
355
-	require_once(SUBSDIR . '/PersonalMessage.subs.php');
355
+	require_once(SUBSDIR.'/PersonalMessage.subs.php');
356 356
 	deleteMessages(null, null, $users);
357 357
 
358 358
 	$db->query('', '
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	);
376 376
 
377 377
 	// Delete avatar.
378
-	require_once(SUBSDIR . '/ManageAttachments.subs.php');
378
+	require_once(SUBSDIR.'/ManageAttachments.subs.php');
379 379
 	removeAttachments(array('id_member' => $users));
380 380
 
381 381
 	// It's over, no more moderation for you.
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
 	loadLanguage('Login');
471 471
 
472 472
 	// We'll need some external functions.
473
-	require_once(SUBSDIR . '/Auth.subs.php');
474
-	require_once(SUBSDIR . '/Mail.subs.php');
473
+	require_once(SUBSDIR.'/Auth.subs.php');
474
+	require_once(SUBSDIR.'/Mail.subs.php');
475 475
 
476 476
 	// Put any errors in here.
477 477
 	$reg_errors = Error_Context::context($error_context, 0);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 
518 518
 		// Password isn't legal?
519 519
 		if ($passwordError != null)
520
-			$reg_errors->addError('profile_error_password_' . $passwordError);
520
+			$reg_errors->addError('profile_error_password_'.$passwordError);
521 521
 	}
522 522
 
523 523
 	// @todo move to controller
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 
622 622
 	if (isset($regOptions['memberGroup']))
623 623
 	{
624
-		require_once(SUBSDIR . '/Membergroups.subs.php');
624
+		require_once(SUBSDIR.'/Membergroups.subs.php');
625 625
 
626 626
 		// Make sure the id_group will be valid, if this is an administrator.
627 627
 		$regOptions['register_vars']['id_group'] = $regOptions['memberGroup'] == 1 && !allowedTo('admin_forum') ? 0 : $regOptions['memberGroup'];
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
 		'REALNAME' => $regOptions['register_vars']['real_name'],
715 715
 		'USERNAME' => $regOptions['username'],
716 716
 		'PASSWORD' => $regOptions['password'],
717
-		'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder',
718
-		'ACTIVATIONLINK' => $scripturl . '?action=register;sa=activate;u=' . $memberID . ';code=' . $validation_code,
719
-		'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=register;sa=activate;u=' . $memberID,
717
+		'FORGOTPASSWORDLINK' => $scripturl.'?action=reminder',
718
+		'ACTIVATIONLINK' => $scripturl.'?action=register;sa=activate;u='.$memberID.';code='.$validation_code,
719
+		'ACTIVATIONLINKWITHOUTCODE' => $scripturl.'?action=register;sa=activate;u='.$memberID,
720 720
 		'ACTIVATIONCODE' => $validation_code,
721 721
 		'OPENID' => !empty($regOptions['openid']) ? $regOptions['openid'] : '',
722
-		'COPPALINK' => $scripturl . '?action=register;sa=coppa;u=' . $memberID,
722
+		'COPPALINK' => $scripturl.'?action=register;sa=coppa;u='.$memberID,
723 723
 	);
724 724
 
725 725
 	// Administrative registrations are a bit different...
@@ -748,22 +748,22 @@  discard block
 block discarded – undo
748 748
 					'REALNAME' => $regOptions['register_vars']['real_name'],
749 749
 					'USERNAME' => $regOptions['username'],
750 750
 					'PASSWORD' => $regOptions['password'],
751
-					'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder',
751
+					'FORGOTPASSWORDLINK' => $scripturl.'?action=reminder',
752 752
 					'OPENID' => !empty($regOptions['openid']) ? $regOptions['openid'] : '',
753 753
 				);
754
-				$emaildata = loadEmailTemplate('register_' . ($regOptions['auth_method'] == 'openid' ? 'openid_' : '') . 'immediate', $replacements);
754
+				$emaildata = loadEmailTemplate('register_'.($regOptions['auth_method'] == 'openid' ? 'openid_' : '').'immediate', $replacements);
755 755
 				sendmail($regOptions['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
756 756
 			}
757 757
 
758 758
 			// Send admin their notification.
759
-			require_once(SUBSDIR . '/Notification.subs.php');
759
+			require_once(SUBSDIR.'/Notification.subs.php');
760 760
 			sendAdminNotifications('standard', $memberID, $regOptions['username']);
761 761
 		}
762 762
 		// Need to activate their account - or fall under COPPA.
763 763
 		elseif ($regOptions['require'] == 'activation' || $regOptions['require'] == 'coppa')
764 764
 		{
765 765
 
766
-			$emaildata = loadEmailTemplate('register_' . ($regOptions['auth_method'] == 'openid' ? 'openid_' : '') . ($regOptions['require'] == 'activation' ? 'activate' : 'coppa'), $replacements);
766
+			$emaildata = loadEmailTemplate('register_'.($regOptions['auth_method'] == 'openid' ? 'openid_' : '').($regOptions['require'] == 'activation' ? 'activate' : 'coppa'), $replacements);
767 767
 
768 768
 			sendmail($regOptions['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
769 769
 		}
@@ -774,16 +774,16 @@  discard block
 block discarded – undo
774 774
 				'REALNAME' => $regOptions['register_vars']['real_name'],
775 775
 				'USERNAME' => $regOptions['username'],
776 776
 				'PASSWORD' => $regOptions['password'],
777
-				'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder',
777
+				'FORGOTPASSWORDLINK' => $scripturl.'?action=reminder',
778 778
 				'OPENID' => !empty($regOptions['openid']) ? $regOptions['openid'] : '',
779 779
 			);
780 780
 
781
-			$emaildata = loadEmailTemplate('register_' . ($regOptions['auth_method'] == 'openid' ? 'openid_' : '') . 'pending', $replacements);
781
+			$emaildata = loadEmailTemplate('register_'.($regOptions['auth_method'] == 'openid' ? 'openid_' : '').'pending', $replacements);
782 782
 
783 783
 			sendmail($regOptions['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
784 784
 
785 785
 			// Admin gets informed here...
786
-			require_once(SUBSDIR . '/Notification.subs.php');
786
+			require_once(SUBSDIR.'/Notification.subs.php');
787 787
 			sendAdminNotifications('approval', $memberID, $regOptions['username']);
788 788
 		}
789 789
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 		SELECT id_member
872 872
 		FROM {db_prefix}members
873 873
 		WHERE ' . (empty($current_ID_MEMBER) ? '' : 'id_member != {int:current_member}
874
-			AND ') . '({raw:real_name} LIKE {string:check_name} OR {raw:member_name} LIKE {string:check_name})
874
+			AND ').'({raw:real_name} LIKE {string:check_name} OR {raw:member_name} LIKE {string:check_name})
875 875
 		LIMIT 1',
876 876
 		array(
877 877
 			'real_name' => defined('DB_CASE_SENSITIVE') ? 'LOWER(real_name)' : 'real_name',
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 			$profile_id = $board_info['profile'];
957 957
 		elseif ($board_id !== 0)
958 958
 		{
959
-			require_once(SUBSDIR . '/Boards.subs.php');
959
+			require_once(SUBSDIR.'/Boards.subs.php');
960 960
 			$board_data = fetchBoardsInfo(array('boards' => $board_id), array('selects' => 'permissions'));
961 961
 
962 962
 			if (empty($board_data))
@@ -1015,9 +1015,9 @@  discard block
 block discarded – undo
1015 1015
 	return $db->fetchQueryCallback('
1016 1016
 		SELECT mem.id_member
1017 1017
 		FROM {db_prefix}members AS mem' . ($include_moderators || $exclude_moderators ? '
1018
-			LEFT JOIN {db_prefix}moderators AS mods ON (mods.id_member = mem.id_member AND mods.id_board = {int:board_id})' : '') . '
1019
-		WHERE (' . ($include_moderators ? 'mods.id_member IS NOT NULL OR ' : '') . 'mem.id_group IN ({array_int:member_groups_allowed}) OR FIND_IN_SET({raw:member_group_allowed_implode}, mem.additional_groups) != 0 OR mem.id_post_group IN ({array_int:member_groups_allowed}))' . (empty($member_groups['denied']) ? '' : '
1020
-			AND NOT (' . ($exclude_moderators ? 'mods.id_member IS NOT NULL OR ' : '') . 'mem.id_group IN ({array_int:member_groups_denied}) OR FIND_IN_SET({raw:member_group_denied_implode}, mem.additional_groups) != 0 OR mem.id_post_group IN ({array_int:member_groups_denied}))'),
1018
+			LEFT JOIN {db_prefix}moderators AS mods ON (mods.id_member = mem.id_member AND mods.id_board = {int:board_id})' : '').'
1019
+		WHERE (' . ($include_moderators ? 'mods.id_member IS NOT NULL OR ' : '').'mem.id_group IN ({array_int:member_groups_allowed}) OR FIND_IN_SET({raw:member_group_allowed_implode}, mem.additional_groups) != 0 OR mem.id_post_group IN ({array_int:member_groups_allowed}))'.(empty($member_groups['denied']) ? '' : '
1020
+			AND NOT (' . ($exclude_moderators ? 'mods.id_member IS NOT NULL OR ' : '').'mem.id_group IN ({array_int:member_groups_denied}) OR FIND_IN_SET({raw:member_group_denied_implode}, mem.additional_groups) != 0 OR mem.id_post_group IN ({array_int:member_groups_denied}))'),
1021 1021
 		array(
1022 1022
 			'member_groups_allowed' => $member_groups['allowed'],
1023 1023
 			'member_groups_denied' => $member_groups['denied'],
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 	// Firstly, if email and username aren't passed find out the members email address and name.
1054 1054
 	if ($email === false && $membername === false)
1055 1055
 	{
1056
-		require_once(SUBSDIR . '/Members.subs.php');
1056
+		require_once(SUBSDIR.'/Members.subs.php');
1057 1057
 		$result = getBasicMemberData($memID);
1058 1058
 		$email = $result['email_address'];
1059 1059
 		$membername = $result['member_name'];
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 			WHERE m.id_member = {int:guest_id}
1070 1070
 				AND m.approved = {int:is_approved}
1071 1071
 				AND m.icon != {string:recycled_icon}' . (empty($email) ? '' : '
1072
-				AND m.poster_email = {string:email_address}') . (empty($membername) ? '' : '
1072
+				AND m.poster_email = {string:email_address}').(empty($membername) ? '' : '
1073 1073
 				AND m.poster_name = {string:member_name}'),
1074 1074
 			array(
1075 1075
 				'count_posts' => 0,
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 		list ($messageCount) = $db->fetch_row($request);
1084 1084
 		$db->free_result($request);
1085 1085
 
1086
-		updateMemberData($memID, array('posts' => 'posts + ' . $messageCount));
1086
+		updateMemberData($memID, array('posts' => 'posts + '.$messageCount));
1087 1087
 	}
1088 1088
 
1089 1089
 	$query_parts = array();
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 			mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name
1142 1142
 		FROM {db_prefix}members AS mem
1143 1143
 			LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)
1144
-		WHERE ' . ($where == '1' ? '1=1' : $where) . '
1144
+		WHERE ' . ($where == '1' ? '1=1' : $where).'
1145 1145
 		ORDER BY {raw:sort}
1146 1146
 		LIMIT {int:start}, {int:per_page}',
1147 1147
 		array_merge($where_params, array(
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
 		FROM {db_prefix}messages AS m
1253 1253
 			INNER JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
1254 1254
 		WHERE m.id_member != 0
1255
-			' . (!empty($duplicate_ids) ? 'AND m.id_member NOT IN ({array_int:duplicate_ids})' : '') . '
1255
+			' . (!empty($duplicate_ids) ? 'AND m.id_member NOT IN ({array_int:duplicate_ids})' : '').'
1256 1256
 			AND m.poster_ip IN ({array_string:ips})',
1257 1257
 		array(
1258 1258
 			'duplicate_ids' => $duplicate_ids,
@@ -1331,8 +1331,8 @@  discard block
 block discarded – undo
1331 1331
 			foreach ($ip as $id_var => $ip_var)
1332 1332
 			{
1333 1333
 				$ip_var = str_replace('*', '%', $ip_var);
1334
-				$ip_query[] = strpos($ip_var, '%') === false ? '= {string:ip_address_' . $id . '_' . $id_var . '}' : 'LIKE {string:ip_address_' . $id . '_' . $id_var . '}';
1335
-				$ip_params['ip_address_' . $id . '_' . $id_var] = $ip_var;
1334
+				$ip_query[] = strpos($ip_var, '%') === false ? '= {string:ip_address_'.$id.'_'.$id_var.'}' : 'LIKE {string:ip_address_'.$id.'_'.$id_var.'}';
1335
+				$ip_params['ip_address_'.$id.'_'.$id_var] = $ip_var;
1336 1336
 			}
1337 1337
 		}
1338 1338
 	}
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 	}
1347 1347
 	else
1348 1348
 	{
1349
-		$where = 'member_ip ' . implode(' OR member_ip', $ip_query);
1349
+		$where = 'member_ip '.implode(' OR member_ip', $ip_query);
1350 1350
 		if ($ip2 !== false)
1351 1351
 			$where .= '
1352 1352
 			OR member_ip2 ' . implode(' OR member_ip', $ip_query);
@@ -1408,10 +1408,10 @@  discard block
 block discarded – undo
1408 1408
 	$members = array();
1409 1409
 	$request = $db->query('', '
1410 1410
 		SELECT id_member' . ($details ? ', member_name, real_name, email_address, member_ip, date_registered, last_login,
1411
-				hide_email, posts, is_activated, real_name' : '') . '
1411
+				hide_email, posts, is_activated, real_name' : '').'
1412 1412
 		FROM {db_prefix}members
1413
-		WHERE ' . $query_where . (isset($query_params['start']) ? '
1414
-		LIMIT {int:start}, {int:limit}' : '') . (!empty($query_params['order']) ? '
1413
+		WHERE ' . $query_where.(isset($query_params['start']) ? '
1414
+		LIMIT {int:start}, {int:limit}' : '').(!empty($query_params['order']) ? '
1415 1415
 		ORDER BY {raw:order}' : ''),
1416 1416
 		$query_params
1417 1417
 	);
@@ -1484,8 +1484,8 @@  discard block
 block discarded – undo
1484 1484
 
1485 1485
 			foreach ($members['member_names'] as $key => $param)
1486 1486
 			{
1487
-				$mem_query[] = (defined('DB_CASE_SENSITIVE') ? 'LOWER(real_name)' : 'real_name') . ' LIKE {string:member_names_' . $key . '}';
1488
-				$members['member_names_' . $key] = defined('DB_CASE_SENSITIVE') ? strtolower($param) : $param;
1487
+				$mem_query[] = (defined('DB_CASE_SENSITIVE') ? 'LOWER(real_name)' : 'real_name').' LIKE {string:member_names_'.$key.'}';
1488
+				$members['member_names_'.$key] = defined('DB_CASE_SENSITIVE') ? strtolower($param) : $param;
1489 1489
 			}
1490 1490
 			return implode("\n\t\t\tOR ", $mem_query);
1491 1491
 		},
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 		SELECT id_member, real_name, lngfile
1569 1569
 		FROM {db_prefix}members
1570 1570
 		WHERE (id_group = {int:admin_group} OR FIND_IN_SET({int:admin_group}, additional_groups) != 0)
1571
-			' . (empty($id_admin) ? '' : 'AND id_member = {int:specific_admin}') . '
1571
+			' . (empty($id_admin) ? '' : 'AND id_member = {int:specific_admin}').'
1572 1572
 		ORDER BY real_name, lngfile',
1573 1573
 		array(
1574 1574
 			'admin_group' => 1,
@@ -1651,13 +1651,13 @@  discard block
 block discarded – undo
1651 1651
 	// Get some additional member info...
1652 1652
 	$request = $db->query('', '
1653 1653
 		SELECT id_member, member_name, real_name, email_address, hide_email, posts, id_theme' . (!empty($options['moderation']) ? ',
1654
-		member_ip, id_group, additional_groups, last_login, id_post_group' : '') . (!empty($options['authentication']) ? ',
1655
-		secret_answer, secret_question, openid_uri, is_activated, validation_code, passwd_flood' : '') . (!empty($options['preferences']) ? ',
1656
-		lngfile, mod_prefs, notify_types, signature' : '') . '
1654
+		member_ip, id_group, additional_groups, last_login, id_post_group' : '').(!empty($options['authentication']) ? ',
1655
+		secret_answer, secret_question, openid_uri, is_activated, validation_code, passwd_flood' : '').(!empty($options['preferences']) ? ',
1656
+		lngfile, mod_prefs, notify_types, signature' : '').'
1657 1657
 		FROM {db_prefix}members
1658 1658
 		WHERE id_member IN ({array_int:member_list})
1659 1659
 		' . (isset($options['sort']) ? '
1660
-		ORDER BY {raw:sort}' : '') . '
1660
+		ORDER BY {raw:sort}' : '').'
1661 1661
 		LIMIT {int:limit}',
1662 1662
 		array(
1663 1663
 			'member_list' => $member_ids,
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 		SELECT id_member, id_group
1726 1726
 		FROM {db_prefix}members
1727 1727
 		WHERE {raw:real_name} LIKE {string:name}' . ($flexible ? '
1728
-			OR {raw:member_name} LIKE {string:name}' : '') . '
1728
+			OR {raw:member_name} LIKE {string:name}' : '').'
1729 1729
 		LIMIT 1',
1730 1730
 		array(
1731 1731
 			'name' => Util::strtolower($name),
@@ -1765,7 +1765,7 @@  discard block
 block discarded – undo
1765 1765
 		SELECT id_member, real_name
1766 1766
 		FROM {db_prefix}members
1767 1767
 		WHERE {raw:real_name} LIKE {string:search}' . (!empty($buddies) ? '
1768
-			AND id_member IN ({array_int:buddy_list})' : '') . '
1768
+			AND id_member IN ({array_int:buddy_list})' : '').'
1769 1769
 			AND is_activated IN ({array_int:activation_status})
1770 1770
 		ORDER BY LENGTH(real_name), real_name
1771 1771
 		LIMIT {int:limit}',
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
 	$request = $db->query('', '
1857 1857
 		SELECT id_member, member_name, real_name, email_address, validation_code, lngfile
1858 1858
 		FROM {db_prefix}members
1859
-		WHERE is_activated = {int:activated_status}' . implode('', $query_cond) . '
1859
+		WHERE is_activated = {int:activated_status}' . implode('', $query_cond).'
1860 1860
 		ORDER BY {raw:order_by}' . $limit,
1861 1861
 		$conditions
1862 1862
 	);
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
 		UPDATE {db_prefix}members
1990 1990
 		SET validation_code = {string:validation_code}, is_activated = {int:not_activated}
1991 1991
 		WHERE is_activated = {int:activated_status}
1992
-			' . implode('', $query_cond) . '
1992
+			' . implode('', $query_cond).'
1993 1993
 			AND id_member = {int:selected_member}',
1994 1994
 		$conditions
1995 1995
 	);
@@ -2070,7 +2070,7 @@  discard block
 block discarded – undo
2070 2070
 		FROM {db_prefix}log_online AS lo
2071 2071
 			LEFT JOIN {db_prefix}members AS mem ON (lo.id_member = mem.id_member)
2072 2072
 			LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:regular_member} THEN mem.id_post_group ELSE mem.id_group END)' . (!empty($conditions) ? '
2073
-		WHERE ' . implode(' AND ', $conditions) : '') . '
2073
+		WHERE ' . implode(' AND ', $conditions) : '').'
2074 2074
 		ORDER BY {raw:sort_method} {raw:sort_direction}
2075 2075
 		LIMIT {int:offset}, {int:limit}',
2076 2076
 		array(
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 		FROM {db_prefix}log_group_requests AS lgr
2167 2167
 			INNER JOIN {db_prefix}members AS mem ON (mem.id_member = lgr.id_member)
2168 2168
 			INNER JOIN {db_prefix}membergroups AS mg ON (mg.id_group = lgr.id_group)
2169
-		WHERE ' . $where . '
2169
+		WHERE ' . $where.'
2170 2170
 			AND lgr.id_request IN ({array_int:request_list})
2171 2171
 		ORDER BY mem.lngfile',
2172 2172
 		array(
@@ -2366,12 +2366,12 @@  discard block
 block discarded – undo
2366 2366
 		return '1=1';
2367 2367
 	else
2368 2368
 	{
2369
-		require_once(SUBSDIR . '/Boards.subs.php');
2369
+		require_once(SUBSDIR.'/Boards.subs.php');
2370 2370
 
2371 2371
 		$boards_mod = boardsModerated($id_member);
2372
-		$mod_query = empty($boards_mod) ? '' : ' OR b.id_board IN (' . implode(',', $boards_mod) . ')';
2372
+		$mod_query = empty($boards_mod) ? '' : ' OR b.id_board IN ('.implode(',', $boards_mod).')';
2373 2373
 
2374
-		return '((FIND_IN_SET(' . implode(', b.member_groups) != 0 OR FIND_IN_SET(', $groups) . ', b.member_groups) != 0)' . (!empty($modSettings['deny_boards_access']) ? ' AND (FIND_IN_SET(' . implode(', b.deny_member_groups) = 0 AND FIND_IN_SET(', $groups) . ', b.deny_member_groups) = 0)' : '') . $mod_query . ')';
2374
+		return '((FIND_IN_SET('.implode(', b.member_groups) != 0 OR FIND_IN_SET(', $groups).', b.member_groups) != 0)'.(!empty($modSettings['deny_boards_access']) ? ' AND (FIND_IN_SET('.implode(', b.deny_member_groups) = 0 AND FIND_IN_SET(', $groups).', b.deny_member_groups) = 0)' : '').$mod_query.')';
2375 2375
 	}
2376 2376
 }
2377 2377
 
@@ -2480,33 +2480,33 @@  discard block
 block discarded – undo
2480 2480
 		// Doing an increment?
2481 2481
 		if ($type == 'int' && ($val === '+' || $val === '-'))
2482 2482
 		{
2483
-			$val = $var . ' ' . $val . ' 1';
2483
+			$val = $var.' '.$val.' 1';
2484 2484
 			$type = 'raw';
2485 2485
 		}
2486 2486
 
2487 2487
 		// Ensure posts, personal_messages, and unread_messages don't overflow or underflow.
2488 2488
 		if (in_array($var, array('posts', 'personal_messages', 'unread_messages')))
2489 2489
 		{
2490
-			if (preg_match('~^' . $var . ' (\+ |- |\+ -)([\d]+)~', $val, $match))
2490
+			if (preg_match('~^'.$var.' (\+ |- |\+ -)([\d]+)~', $val, $match))
2491 2491
 			{
2492 2492
 				if ($match[1] != '+ ')
2493
-					$val = 'CASE WHEN ' . $var . ' <= ' . abs($match[2]) . ' THEN 0 ELSE ' . $val . ' END';
2493
+					$val = 'CASE WHEN '.$var.' <= '.abs($match[2]).' THEN 0 ELSE '.$val.' END';
2494 2494
 				$type = 'raw';
2495 2495
 			}
2496 2496
 		}
2497 2497
 
2498
-		$setString .= ' ' . $var . ' = {' . $type . ':p_' . $var . '},';
2499
-		$parameters['p_' . $var] = $val;
2498
+		$setString .= ' '.$var.' = {'.$type.':p_'.$var.'},';
2499
+		$parameters['p_'.$var] = $val;
2500 2500
 	}
2501 2501
 
2502 2502
 	$db->query('', '
2503 2503
 		UPDATE {db_prefix}members
2504
-		SET' . substr($setString, 0, -1) . '
2504
+		SET' . substr($setString, 0, -1).'
2505 2505
 		WHERE ' . $condition,
2506 2506
 		$parameters
2507 2507
 	);
2508 2508
 
2509
-	require_once(SUBSDIR . '/Membergroups.subs.php');
2509
+	require_once(SUBSDIR.'/Membergroups.subs.php');
2510 2510
 	updatePostGroupStats($members, array_keys($data));
2511 2511
 
2512 2512
 	$cache = Cache::instance();
@@ -2521,12 +2521,12 @@  discard block
 block discarded – undo
2521 2521
 		{
2522 2522
 			if ($cache->checkLevel(3))
2523 2523
 			{
2524
-				$cache->remove('member_data-profile-' . $member);
2525
-				$cache->remove('member_data-normal-' . $member);
2526
-				$cache->remove('member_data-minimal-' . $member);
2524
+				$cache->remove('member_data-profile-'.$member);
2525
+				$cache->remove('member_data-normal-'.$member);
2526
+				$cache->remove('member_data-minimal-'.$member);
2527 2527
 			}
2528 2528
 
2529
-			$cache->remove('user_settings-' . $member);
2529
+			$cache->remove('user_settings-'.$member);
2530 2530
 		}
2531 2531
 	}
2532 2532
 }
@@ -2554,7 +2554,7 @@  discard block
 block discarded – undo
2554 2554
 	);
2555 2555
 	$ips = array();
2556 2556
 	while ($row = $db->fetch_assoc($request))
2557
-		$ips[$row['member_ip']][] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['display_name'] . '</a>';
2557
+		$ips[$row['member_ip']][] = '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['display_name'].'</a>';
2558 2558
 	$db->free_result($request);
2559 2559
 
2560 2560
 	ksort($ips);
Please login to merge, or discard this patch.
sources/subs/Notifications.class.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -52,6 +52,9 @@
 block discarded – undo
52 52
 	 */
53 53
 	protected $_protect_id = true;
54 54
 
55
+	/**
56
+	 * @param Database $db
57
+	 */
55 58
 	public function __construct($db)
56 59
 	{
57 60
 		parent::__construct($db);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function send()
86 86
 	{
87
-		Elk_Autoloader::getInstance()->register(SUBSDIR . '/MentionType', '\\ElkArte\\sources\\subs\\MentionType');
87
+		Elk_Autoloader::getInstance()->register(SUBSDIR.'/MentionType', '\\ElkArte\\sources\\subs\\MentionType');
88 88
 
89 89
 		$this->_notification_frequencies = array(
90 90
 			// 0 is for no notifications, so we start from 1 the counting, that saves a +1 later
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 		$obj = new $class($this->_db);
155 155
 		$obj->setTask($task);
156 156
 
157
-		require_once(SUBSDIR . '/Notification.subs.php');
158
-		require_once(SUBSDIR . '/Mail.subs.php');
157
+		require_once(SUBSDIR.'/Notification.subs.php');
158
+		require_once(SUBSDIR.'/Mail.subs.php');
159 159
 		$notification_frequencies = filterNotificationMethods($this->_notification_frequencies, $class::getType());
160 160
 
161 161
 		// Cleanup the list of members to notify,
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		// The member 0 is the "default" setting
298 298
 		$query_members[] = 0;
299 299
 
300
-		require_once(SUBSDIR . '/Notification.subs.php');
300
+		require_once(SUBSDIR.'/Notification.subs.php');
301 301
 		$preferences = getUsersNotificationsPreferences($notification_type, $query_members);
302 302
 
303 303
 		$notification_types = array();
Please login to merge, or discard this patch.
sources/subs/Package.subs.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * @param bool $single_file = false
31 31
  * @param bool $overwrite = false
32 32
  * @param string[]|null $files_to_extract = null
33
- * @return string|false
33
+ * @return string
34 34
  */
35 35
 function read_tgz_file($gzfilename, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)
36 36
 {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
  * @param bool $single_file = false,
80 80
  * @param bool $overwrite = false,
81 81
  * @param string[]|null $files_to_extract = null
82
- * @return string|false
82
+ * @return string
83 83
  */
84 84
 function read_tgz_data($data, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)
85 85
 {
Please login to merge, or discard this patch.
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
  */
82 82
 function read_tgz_data($data, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)
83 83
 {
84
-	require_once(SUBSDIR . '/UnTgz.class.php');
84
+	require_once(SUBSDIR.'/UnTgz.class.php');
85 85
 	$untgz = new UnTgz($data, $destination, $single_file, $overwrite, $files_to_extract);
86 86
 
87 87
 	// Choose the right method for the file
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
  */
109 109
 function read_zip_data($data, $destination, $single_file = false, $overwrite = false, $files_to_extract = null)
110 110
 {
111
-	require_once(SUBSDIR . '/UnZip.class.php');
111
+	require_once(SUBSDIR.'/UnZip.class.php');
112 112
 	$unzip = new UnZip($data, $destination, $single_file, $overwrite, $files_to_extract);
113 113
 
114 114
 	return $unzip->read_zip_data();
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		return false;
139 139
 
140 140
 	// See if the file is where its supposed to be
141
-	fputs($fid, 'HEAD ' . $a_url['path'] . ' HTTP/1.0' . "\r\n" . 'Host: ' . $a_url['host'] . "\r\n\r\n");
141
+	fputs($fid, 'HEAD '.$a_url['path'].' HTTP/1.0'."\r\n".'Host: '.$a_url['host']."\r\n\r\n");
142 142
 	$head = fread($fid, 1024);
143 143
 	fclose($fid);
144 144
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	$db = database();
162 162
 
163 163
 	// First, check that the database is valid, installed.list is still king.
164
-	$install_file = implode('', file(BOARDDIR . '/packages/installed.list'));
164
+	$install_file = implode('', file(BOARDDIR.'/packages/installed.list'));
165 165
 	if (trim($install_file) == '')
166 166
 	{
167 167
 		$db->query('', '
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
 	else
231 231
 	{
232 232
 		// It must be in the package directory then
233
-		if (!file_exists(BOARDDIR . '/packages/' . $gzfilename))
233
+		if (!file_exists(BOARDDIR.'/packages/'.$gzfilename))
234 234
 			return 'package_get_error_not_found';
235 235
 
236 236
 		// Make sure an package.xml file is available
237
-		if (is_file(BOARDDIR . '/packages/' . $gzfilename))
238
-			$packageInfo = read_tgz_file(BOARDDIR . '/packages/' . $gzfilename, '*/package-info.xml', true);
239
-		elseif (file_exists(BOARDDIR . '/packages/' . $gzfilename . '/package-info.xml'))
240
-			$packageInfo = file_get_contents(BOARDDIR . '/packages/' . $gzfilename . '/package-info.xml');
237
+		if (is_file(BOARDDIR.'/packages/'.$gzfilename))
238
+			$packageInfo = read_tgz_file(BOARDDIR.'/packages/'.$gzfilename, '*/package-info.xml', true);
239
+		elseif (file_exists(BOARDDIR.'/packages/'.$gzfilename.'/package-info.xml'))
240
+			$packageInfo = file_get_contents(BOARDDIR.'/packages/'.$gzfilename.'/package-info.xml');
241 241
 		else
242 242
 			return 'package_get_error_missing_xml';
243 243
 	}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	if (empty($packageInfo))
247 247
 	{
248 248
 		// Perhaps they are trying to install a theme, lets tell them nicely this is the wrong function
249
-		$packageInfo = read_tgz_file(BOARDDIR . '/packages/' . $gzfilename, '*/theme_info.xml', true);
249
+		$packageInfo = read_tgz_file(BOARDDIR.'/packages/'.$gzfilename, '*/theme_info.xml', true);
250 250
 		if (!empty($packageInfo))
251 251
 			return 'package_get_error_is_theme';
252 252
 		else
@@ -355,24 +355,24 @@  discard block
 block discarded – undo
355 355
 						'function' => function($rowData) {
356 356
 							global $txt;
357 357
 
358
-							return $txt['package_restore_permissions_action_' . $rowData['result']];
358
+							return $txt['package_restore_permissions_action_'.$rowData['result']];
359 359
 						},
360 360
 						'class' => 'smalltext',
361 361
 					),
362 362
 				),
363 363
 			),
364 364
 			'form' => array(
365
-				'href' => !empty($chmodOptions['destination_url']) ? $chmodOptions['destination_url'] : $scripturl . '?action=admin;area=packages;sa=perms;restore;' . $context['session_var'] . '=' . $context['session_id'],
365
+				'href' => !empty($chmodOptions['destination_url']) ? $chmodOptions['destination_url'] : $scripturl.'?action=admin;area=packages;sa=perms;restore;'.$context['session_var'].'='.$context['session_id'],
366 366
 			),
367 367
 			'additional_rows' => array(
368 368
 				array(
369 369
 					'position' => 'below_table_data',
370
-					'value' => '<input type="submit" name="restore_perms" value="' . $txt['package_restore_permissions_restore'] . '" class="right_submit" />',
370
+					'value' => '<input type="submit" name="restore_perms" value="'.$txt['package_restore_permissions_restore'].'" class="right_submit" />',
371 371
 					'class' => 'category_header',
372 372
 				),
373 373
 				array(
374 374
 					'position' => 'after_title',
375
-					'value' => '<span class="smalltext">' . $txt['package_restore_permissions_desc'] . '</span>',
375
+					'value' => '<span class="smalltext">'.$txt['package_restore_permissions_desc'].'</span>',
376 376
 				),
377 377
 			),
378 378
 		);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 		// Work out what columns and the like to show.
381 381
 		if (!empty($_POST['restore_perms']))
382 382
 		{
383
-			$listOptions['additional_rows'][1]['value'] = sprintf($txt['package_restore_permissions_action_done'], $scripturl . '?action=admin;area=packages;sa=perms;' . $context['session_var'] . '=' . $context['session_id']);
383
+			$listOptions['additional_rows'][1]['value'] = sprintf($txt['package_restore_permissions_action_done'], $scripturl.'?action=admin;area=packages;sa=perms;'.$context['session_var'].'='.$context['session_id']);
384 384
 			unset($listOptions['columns']['check'], $listOptions['form'], $listOptions['additional_rows'][0]);
385 385
 
386 386
 			$context['sub_template'] = 'show_list';
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'cur_perms' => substr(sprintf('%o', $file_permissions), -4),
586 586
 			'new_perms' => isset($new_permissions) ? substr(sprintf('%o', $new_permissions), -4) : '',
587 587
 			'result' => isset($result) ? $result : '',
588
-			'writable_message' => '<span class="' . (@is_writable($file) ? 'success' : 'alert') . '">' . (@is_writable($file) ? $txt['package_file_perms_writable'] : $txt['package_file_perms_not_writable']) . '</span>',
588
+			'writable_message' => '<span class="'.(@is_writable($file) ? 'success' : 'alert').'">'.(@is_writable($file) ? $txt['package_file_perms_writable'] : $txt['package_file_perms_not_writable']).'</span>',
589 589
 		);
590 590
 	}
591 591
 
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	$return = array();
864 864
 
865 865
 	$temp_auto = 0;
866
-	$temp_path = BOARDDIR . '/packages/temp/' . (isset($context['base_path']) ? $context['base_path'] : '');
866
+	$temp_path = BOARDDIR.'/packages/temp/'.(isset($context['base_path']) ? $context['base_path'] : '');
867 867
 
868 868
 	$context['readmes'] = array();
869 869
 	$context['licences'] = array();
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 			// Allow for translated readme and license files.
885 885
 			if ($actionType == 'readme' || $actionType == 'license')
886 886
 			{
887
-				$type = $actionType . 's';
887
+				$type = $actionType.'s';
888 888
 				if ($action->exists('@lang'))
889 889
 				{
890 890
 					// Auto-select the language based on either request variable or current language.
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 			// @todo Make sure the file actually exists?  Might not work when testing?
921 921
 			if ($action->exists('@type') && $action->fetch('@type') == 'inline')
922 922
 			{
923
-				$filename = $temp_path . '$auto_' . $temp_auto++ . (in_array($actionType, array('readme', 'redirect', 'license')) ? '.txt' : ($actionType == 'code' || $actionType == 'database' ? '.php' : '.mod'));
923
+				$filename = $temp_path.'$auto_'.$temp_auto++.(in_array($actionType, array('readme', 'redirect', 'license')) ? '.txt' : ($actionType == 'code' || $actionType == 'database' ? '.php' : '.mod'));
924 924
 				package_put_contents($filename, $action->fetch('.'));
925 925
 				$filename = strtr($filename, array($temp_path => ''));
926 926
 			}
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 			if (substr($actionType, 0, 6) != 'remove')
1003 1003
 			{
1004 1004
 				$this_action['unparsed_destination'] = $action->fetch('@destination');
1005
-				$this_action['destination'] = parse_path($action->fetch('@destination')) . '/' . basename($this_action['filename']);
1005
+				$this_action['destination'] = parse_path($action->fetch('@destination')).'/'.basename($this_action['filename']);
1006 1006
 			}
1007 1007
 			else
1008 1008
 			{
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 				if ($action->exists('@from'))
1017 1017
 					$this_action['source'] = parse_path($action->fetch('@from'));
1018 1018
 				else
1019
-					$this_action['source'] = $temp_path . $this_action['filename'];
1019
+					$this_action['source'] = $temp_path.$this_action['filename'];
1020 1020
 			}
1021 1021
 
1022 1022
 			// Check if these things can be done. (chmod's etc.)
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 	{
1294 1294
 		// Adjust for those wild cards
1295 1295
 		if (strpos($for, '*') !== false)
1296
-			$for = str_replace('*', '0', $for) . '-' . str_replace('*', '999', $for);
1296
+			$for = str_replace('*', '0', $for).'-'.str_replace('*', '999', $for);
1297 1297
 
1298 1298
 		// If we have a range, grab the lower value, done this way so it looks normal-er to the user e.g. 1.0 vs 1.0.99
1299 1299
 		if (strpos($for, '-') !== false)
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 	{
1335 1335
 		// Wild card spotted?
1336 1336
 		if (strpos($for, '*') !== false)
1337
-			$for = str_replace('*', '0dev0', $for) . '-' . str_replace('*', '999', $for);
1337
+			$for = str_replace('*', '0dev0', $for).'-'.str_replace('*', '999', $for);
1338 1338
 
1339 1339
 		// Do we have a range?
1340 1340
 		if (strpos($for, '-') !== false)
@@ -1442,8 +1442,8 @@  discard block
 block discarded – undo
1442 1442
 		'EXTDIR' => EXTDIR,
1443 1443
 		'AVATARSDIR' => $modSettings['avatar_directory'],
1444 1444
 		'THEMEDIR' => $settings['default_theme_dir'],
1445
-		'IMAGESDIR' => $settings['default_theme_dir'] . '/' . basename($settings['default_images_url']),
1446
-		'LANGUAGEDIR' => $settings['default_theme_dir'] . '/languages',
1445
+		'IMAGESDIR' => $settings['default_theme_dir'].'/'.basename($settings['default_images_url']),
1446
+		'LANGUAGEDIR' => $settings['default_theme_dir'].'/languages',
1447 1447
 		'SMILEYDIR' => $modSettings['smileys_dir'],
1448 1448
 	);
1449 1449
 
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
 		if ($delete_dir && isset($package_ftp))
1519 1519
 		{
1520 1520
 			$ftp_file = strtr($dir, array($_SESSION['pack_ftp']['root'] => ''));
1521
-			if (!is_writable($dir . '/'))
1521
+			if (!is_writable($dir.'/'))
1522 1522
 				$package_ftp->chmod($ftp_file, 0777);
1523 1523
 			$package_ftp->unlink($ftp_file);
1524 1524
 		}
@@ -1659,24 +1659,24 @@  discard block
 block discarded – undo
1659 1659
 			continue;
1660 1660
 
1661 1661
 		if (isset($package_ftp))
1662
-			$ftp_file = strtr($destination . '/' . $entryname, array($_SESSION['pack_ftp']['root'] => ''));
1662
+			$ftp_file = strtr($destination.'/'.$entryname, array($_SESSION['pack_ftp']['root'] => ''));
1663 1663
 
1664
-		if (is_file($source . '/' . $entryname))
1664
+		if (is_file($source.'/'.$entryname))
1665 1665
 		{
1666
-			if (isset($package_ftp) && !file_exists($destination . '/' . $entryname))
1666
+			if (isset($package_ftp) && !file_exists($destination.'/'.$entryname))
1667 1667
 				$package_ftp->create_file($ftp_file);
1668
-			elseif (!file_exists($destination . '/' . $entryname))
1669
-				@touch($destination . '/' . $entryname);
1668
+			elseif (!file_exists($destination.'/'.$entryname))
1669
+				@touch($destination.'/'.$entryname);
1670 1670
 		}
1671 1671
 
1672
-		package_chmod($destination . '/' . $entryname);
1672
+		package_chmod($destination.'/'.$entryname);
1673 1673
 
1674
-		if (is_dir($source . '/' . $entryname))
1675
-			copytree($source . '/' . $entryname, $destination . '/' . $entryname);
1676
-		elseif (file_exists($destination . '/' . $entryname))
1677
-			package_put_contents($destination . '/' . $entryname, package_get_contents($source . '/' . $entryname));
1674
+		if (is_dir($source.'/'.$entryname))
1675
+			copytree($source.'/'.$entryname, $destination.'/'.$entryname);
1676
+		elseif (file_exists($destination.'/'.$entryname))
1677
+			package_put_contents($destination.'/'.$entryname, package_get_contents($source.'/'.$entryname));
1678 1678
 		else
1679
-			copy($source . '/' . $entryname, $destination . '/' . $entryname);
1679
+			copy($source.'/'.$entryname, $destination.'/'.$entryname);
1680 1680
 	}
1681 1681
 
1682 1682
 	closedir($current_dir);
@@ -1694,7 +1694,7 @@  discard block
 block discarded – undo
1694 1694
 {
1695 1695
 	$data = array();
1696 1696
 
1697
-	$dir = @dir($path . $sub_path);
1697
+	$dir = @dir($path.$sub_path);
1698 1698
 	if (!$dir)
1699 1699
 		return array();
1700 1700
 
@@ -1703,12 +1703,12 @@  discard block
 block discarded – undo
1703 1703
 		if ($entry == '.' || $entry == '..')
1704 1704
 			continue;
1705 1705
 
1706
-		if (is_dir($path . $sub_path . '/' . $entry))
1707
-			$data = array_merge($data, listtree($path, $sub_path . '/' . $entry));
1706
+		if (is_dir($path.$sub_path.'/'.$entry))
1707
+			$data = array_merge($data, listtree($path, $sub_path.'/'.$entry));
1708 1708
 		else
1709 1709
 			$data[] = array(
1710
-				'filename' => $sub_path == '' ? $entry : $sub_path . '/' . $entry,
1711
-				'size' => filesize($path . $sub_path . '/' . $entry),
1710
+				'filename' => $sub_path == '' ? $entry : $sub_path.'/'.$entry,
1711
+				'size' => filesize($path.$sub_path.'/'.$entry),
1712 1712
 				'skipped' => false,
1713 1713
 			);
1714 1714
 	}
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
 			// If this filename is relative, if so take a guess at what it should be.
1769 1769
 			$real_filename = $filename;
1770 1770
 			if (strpos($filename, 'themes') === 0)
1771
-				$real_filename = BOARDDIR . '/' . $filename;
1771
+				$real_filename = BOARDDIR.'/'.$filename;
1772 1772
 
1773 1773
 			if (strpos($real_filename, $theme['theme_dir']) === 0)
1774 1774
 			{
@@ -1794,10 +1794,10 @@  discard block
 block discarded – undo
1794 1794
 			foreach ($template_changes[1] as $index => $template_file)
1795 1795
 			{
1796 1796
 				// What, it exists and we haven't already got it?! Lordy, get it in!
1797
-				if (file_exists($theme['theme_dir'] . '/' . $template_file) && (!isset($template_changes[$id]) || !in_array($template_file, $template_changes[$id])))
1797
+				if (file_exists($theme['theme_dir'].'/'.$template_file) && (!isset($template_changes[$id]) || !in_array($template_file, $template_changes[$id])))
1798 1798
 				{
1799 1799
 					// Now let's add it to the "todo" list.
1800
-					$custom_themes_add[$long_changes[1][$index]][$id] = $theme['theme_dir'] . '/' . $template_file;
1800
+					$custom_themes_add[$long_changes[1][$index]][$id] = $theme['theme_dir'].'/'.$template_file;
1801 1801
 				}
1802 1802
 			}
1803 1803
 		}
@@ -1819,9 +1819,9 @@  discard block
 block discarded – undo
1819 1819
 		{
1820 1820
 			if ($working_file[0] != '/' && $working_file[1] != ':')
1821 1821
 			{
1822
-				trigger_error('parseModification(): The filename \'' . $working_file . '\' is not a full path!', E_USER_WARNING);
1822
+				trigger_error('parseModification(): The filename \''.$working_file.'\' is not a full path!', E_USER_WARNING);
1823 1823
 
1824
-				$working_file = BOARDDIR . '/' . $working_file;
1824
+				$working_file = BOARDDIR.'/'.$working_file;
1825 1825
 			}
1826 1826
 
1827 1827
 			// Doesn't exist - give an error or what?
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 							if ($search['position'] === 'before')
1928 1928
 								$actual_operation['searches'][$i]['search'] .= $search['add'];
1929 1929
 							elseif ($search['position'] === 'after')
1930
-								$actual_operation['searches'][$i]['search'] = $search['add'] . $search['search'];
1930
+								$actual_operation['searches'][$i]['search'] = $search['add'].$search['search'];
1931 1931
 						}
1932 1932
 
1933 1933
 						// ...and the search subject is now the replacement.
@@ -1968,19 +1968,19 @@  discard block
 block discarded – undo
1968 1968
 					}
1969 1969
 
1970 1970
 					// Shuzzup.  This is done so we can safely use a regular expression. ($0 is bad!!)
1971
-					$actual_operation['searches'][$i]['preg_replace'] = strtr($search['add'], array('$' => '[$PACK' . 'AGE1$]', '\\' => '[$PACK' . 'AGE2$]'));
1971
+					$actual_operation['searches'][$i]['preg_replace'] = strtr($search['add'], array('$' => '[$PACK'.'AGE1$]', '\\' => '[$PACK'.'AGE2$]'));
1972 1972
 
1973 1973
 					// Before, so the replacement comes after the search subject :P
1974 1974
 					if ($search['position'] === 'before')
1975 1975
 					{
1976
-						$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
1977
-						$actual_operation['searches'][$i]['preg_replace'] = '$1' . $actual_operation['searches'][$i]['preg_replace'];
1976
+						$actual_operation['searches'][$i]['preg_search'] = '('.$actual_operation['searches'][$i]['preg_search'].')';
1977
+						$actual_operation['searches'][$i]['preg_replace'] = '$1'.$actual_operation['searches'][$i]['preg_replace'];
1978 1978
 					}
1979 1979
 
1980 1980
 					// After, after what?
1981 1981
 					elseif ($search['position'] === 'after')
1982 1982
 					{
1983
-						$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
1983
+						$actual_operation['searches'][$i]['preg_search'] = '('.$actual_operation['searches'][$i]['preg_search'].')';
1984 1984
 						$actual_operation['searches'][$i]['preg_replace'] .= '$1';
1985 1985
 					}
1986 1986
 
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 					}
2000 2000
 
2001 2001
 					// Testing 1, 2, 3...
2002
-					$failed = preg_match('~' . $actual_operation['searches'][$i]['preg_search'] . '~s', $working_data) === 0;
2002
+					$failed = preg_match('~'.$actual_operation['searches'][$i]['preg_search'].'~s', $working_data) === 0;
2003 2003
 
2004 2004
 					// Nope, search pattern not found.
2005 2005
 					if ($failed && $actual_operation['error'] === 'fatal')
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 						continue;
2043 2043
 
2044 2044
 					// Finally, we're doing some replacements.
2045
-					$working_data = preg_replace('~' . $actual_operation['searches'][$i]['preg_search'] . '~s', $actual_operation['searches'][$i]['preg_replace'], $working_data, 1);
2045
+					$working_data = preg_replace('~'.$actual_operation['searches'][$i]['preg_search'].'~s', $actual_operation['searches'][$i]['preg_replace'], $working_data, 1);
2046 2046
 
2047 2047
 					$actions[] = array(
2048 2048
 						'type' => 'replace',
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 			}
2061 2061
 
2062 2062
 			// Fix any little helper symbols ;).
2063
-			$working_data = strtr($working_data, array('[$PACK' . 'AGE1$]' => '$', '[$PACK' . 'AGE2$]' => '\\'));
2063
+			$working_data = strtr($working_data, array('[$PACK'.'AGE1$]' => '$', '[$PACK'.'AGE2$]' => '\\'));
2064 2064
 
2065 2065
 			package_chmod($working_file);
2066 2066
 
@@ -2077,9 +2077,9 @@  discard block
 block discarded – undo
2077 2077
 			{
2078 2078
 				// No, no, not Settings.php!
2079 2079
 				if (basename($working_file) == 'Settings.php')
2080
-					@copy($working_file, dirname($working_file) . '/Settings_bak.php');
2080
+					@copy($working_file, dirname($working_file).'/Settings_bak.php');
2081 2081
 				else
2082
-					@copy($working_file, $working_file . '~');
2082
+					@copy($working_file, $working_file.'~');
2083 2083
 			}
2084 2084
 
2085 2085
 			// Always call this, even if in testing, because it won't really be written in testing mode.
@@ -2427,16 +2427,16 @@  discard block
 block discarded – undo
2427 2427
 	$base_files = array('index.php', 'SSI.php', 'agreement.txt', 'ssi_examples.php', 'ssi_examples.shtml', 'subscriptions.php', 'email_imap_cron.php', 'emailpost.php', 'emailtopic.php');
2428 2428
 	foreach ($base_files as $file)
2429 2429
 	{
2430
-		if (file_exists(BOARDDIR . '/' . $file))
2431
-			$files[realpath(BOARDDIR . '/' . $file)] = array(
2432
-				empty($_REQUEST['use_full_paths']) ? $file : BOARDDIR . '/' . $file,
2433
-				stat(BOARDDIR . '/' . $file)
2430
+		if (file_exists(BOARDDIR.'/'.$file))
2431
+			$files[realpath(BOARDDIR.'/'.$file)] = array(
2432
+				empty($_REQUEST['use_full_paths']) ? $file : BOARDDIR.'/'.$file,
2433
+				stat(BOARDDIR.'/'.$file)
2434 2434
 			);
2435 2435
 	}
2436 2436
 
2437 2437
 	// Root directory where most of our files reside
2438 2438
 	$dirs = array(
2439
-		SOURCEDIR => empty($_REQUEST['use_full_paths']) ? 'sources/' : strtr(SOURCEDIR . '/', '\\', '/')
2439
+		SOURCEDIR => empty($_REQUEST['use_full_paths']) ? 'sources/' : strtr(SOURCEDIR.'/', '\\', '/')
2440 2440
 	);
2441 2441
 
2442 2442
 	// Find all installed theme directories
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
 		)
2452 2452
 	);
2453 2453
 	while ($row = $db->fetch_assoc($request))
2454
-		$dirs[$row['value']] = empty($_REQUEST['use_full_paths']) ? 'themes/' . basename($row['value']) . '/' : strtr($row['value'] . '/', '\\', '/');
2454
+		$dirs[$row['value']] = empty($_REQUEST['use_full_paths']) ? 'themes/'.basename($row['value']).'/' : strtr($row['value'].'/', '\\', '/');
2455 2455
 	$db->free_result($request);
2456 2456
 
2457 2457
 	// While we have directory's to check
@@ -2469,42 +2469,42 @@  discard block
 block discarded – undo
2469 2469
 			if (preg_match('~^(\.{1,2}|CVS|backup.*|help|images|.*\~)$~', $entry) != 0)
2470 2470
 				continue;
2471 2471
 
2472
-			$filepath = realpath($dir . '/' . $entry);
2472
+			$filepath = realpath($dir.'/'.$entry);
2473 2473
 			if (isset($files[$filepath]))
2474 2474
 				continue;
2475 2475
 
2476
-			$stat = stat($dir . '/' . $entry);
2476
+			$stat = stat($dir.'/'.$entry);
2477 2477
 
2478 2478
 			// If this is a directory, add it to the dir stack for processing
2479 2479
 			if ($stat['mode'] & 040000)
2480 2480
 			{
2481
-				$files[$filepath] = array($dest . $entry . '/', $stat);
2482
-				$dirs[$dir . '/' . $entry] = $dest . $entry . '/';
2481
+				$files[$filepath] = array($dest.$entry.'/', $stat);
2482
+				$dirs[$dir.'/'.$entry] = $dest.$entry.'/';
2483 2483
 			}
2484 2484
 			else
2485
-				$files[$filepath] = array($dest . $entry, $stat);
2485
+				$files[$filepath] = array($dest.$entry, $stat);
2486 2486
 		}
2487 2487
 
2488 2488
 		$listing->close();
2489 2489
 	}
2490 2490
 
2491 2491
 	// Make sure we have a backup directory and its writable
2492
-	if (!file_exists(BOARDDIR . '/packages/backups'))
2493
-		mktree(BOARDDIR . '/packages/backups', 0777);
2492
+	if (!file_exists(BOARDDIR.'/packages/backups'))
2493
+		mktree(BOARDDIR.'/packages/backups', 0777);
2494 2494
 
2495
-	if (!is_writable(BOARDDIR . '/packages/backups'))
2496
-		package_chmod(BOARDDIR . '/packages/backups');
2495
+	if (!is_writable(BOARDDIR.'/packages/backups'))
2496
+		package_chmod(BOARDDIR.'/packages/backups');
2497 2497
 
2498 2498
 	// Name the output file, yyyy-mm-dd_before_package_name.tar.gz
2499
-	$output_file = BOARDDIR . '/packages/backups/' . strftime('%Y-%m-%d_') . preg_replace('~[$\\\\/:<>|?*"\']~', '', $id);
2500
-	$output_ext = '.tar' . (function_exists('gzopen') ? '.gz' : '');
2499
+	$output_file = BOARDDIR.'/packages/backups/'.strftime('%Y-%m-%d_').preg_replace('~[$\\\\/:<>|?*"\']~', '', $id);
2500
+	$output_ext = '.tar'.(function_exists('gzopen') ? '.gz' : '');
2501 2501
 
2502
-	if (file_exists($output_file . $output_ext))
2502
+	if (file_exists($output_file.$output_ext))
2503 2503
 	{
2504 2504
 		$i = 2;
2505
-		while (file_exists($output_file . '_' . $i . $output_ext))
2505
+		while (file_exists($output_file.'_'.$i.$output_ext))
2506 2506
 			$i++;
2507
-		$output_file = $output_file . '_' . $i . $output_ext;
2507
+		$output_file = $output_file.'_'.$i.$output_ext;
2508 2508
 	}
2509 2509
 	else
2510 2510
 		$output_file .= $output_ext;
@@ -2564,7 +2564,7 @@  discard block
 block discarded – undo
2564 2564
 			$checksum += ord($current[$i]);
2565 2565
 
2566 2566
 		// Write out the file header (insert the checksum we just computed)
2567
-		$fwrite($output, substr($current, 0, 148) . pack('a8', decoct($checksum)) . substr($current, 156, 511));
2567
+		$fwrite($output, substr($current, 0, 148).pack('a8', decoct($checksum)).substr($current, 156, 511));
2568 2568
 
2569 2569
 		// If this is a directory entry all that's needed is the header
2570 2570
 		if ($stat['size'] == 0)
@@ -2577,7 +2577,7 @@  discard block
 block discarded – undo
2577 2577
 		fclose($fp);
2578 2578
 
2579 2579
 		// Pad the output so its on 512 boundary's
2580
-		$fwrite($output, pack('a' . (512 - $stat['size'] % 512), ''));
2580
+		$fwrite($output, pack('a'.(512 - $stat['size'] % 512), ''));
2581 2581
 	}
2582 2582
 
2583 2583
 	$fwrite($output, pack('a1024', ''));
@@ -2612,12 +2612,12 @@  discard block
 block discarded – undo
2612 2612
 	elseif ($match[1] == 'ftp')
2613 2613
 	{
2614 2614
 		// Establish a connection and attempt to enable passive mode.
2615
-		$ftp = new Ftp_Connection(($match[2] ? 'ssl://' : '') . $match[3], empty($match[5]) ? 21 : $match[5], 'anonymous', $webmaster_email);
2615
+		$ftp = new Ftp_Connection(($match[2] ? 'ssl://' : '').$match[3], empty($match[5]) ? 21 : $match[5], 'anonymous', $webmaster_email);
2616 2616
 		if ($ftp->error !== false || !$ftp->passive())
2617 2617
 			return false;
2618 2618
 
2619 2619
 		// I want that one *points*!
2620
-		fwrite($ftp->connection, 'RETR ' . $match[6] . "\r\n");
2620
+		fwrite($ftp->connection, 'RETR '.$match[6]."\r\n");
2621 2621
 
2622 2622
 		// Since passive mode worked (or we would have returned already!) open the connection.
2623 2623
 		$fp = @fsockopen($ftp->pasv['ip'], $ftp->pasv['port'], $err, $err, 5);
@@ -2656,7 +2656,7 @@  discard block
 block discarded – undo
2656 2656
 		if (empty($fp))
2657 2657
 		{
2658 2658
 			// Open the socket on the port we want...
2659
-			$fp = @fsockopen(($match[2] ? 'ssl://' : '') . $match[3], empty($match[5]) ? ($match[2] ? 443 : 80) : $match[5], $err, $err, 5);
2659
+			$fp = @fsockopen(($match[2] ? 'ssl://' : '').$match[3], empty($match[5]) ? ($match[2] ? 443 : 80) : $match[5], $err, $err, 5);
2660 2660
 			if (!$fp)
2661 2661
 				return false;
2662 2662
 		}
@@ -2670,25 +2670,25 @@  discard block
 block discarded – undo
2670 2670
 		// I want this, from there, and I'm not going to be bothering you for more (probably.)
2671 2671
 		if (empty($post_data))
2672 2672
 		{
2673
-			fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
2674
-			fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
2675
-			fwrite($fp, 'User-Agent: PHP/ELK' . "\r\n");
2673
+			fwrite($fp, 'GET '.($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '').' HTTP/1.0'."\r\n");
2674
+			fwrite($fp, 'Host: '.$match[3].(empty($match[5]) ? ($match[2] ? ':443' : '') : ':'.$match[5])."\r\n");
2675
+			fwrite($fp, 'User-Agent: PHP/ELK'."\r\n");
2676 2676
 			if ($keep_alive)
2677
-				fwrite($fp, 'Connection: Keep-Alive' . "\r\n\r\n");
2677
+				fwrite($fp, 'Connection: Keep-Alive'."\r\n\r\n");
2678 2678
 			else
2679
-				fwrite($fp, 'Connection: close' . "\r\n\r\n");
2679
+				fwrite($fp, 'Connection: close'."\r\n\r\n");
2680 2680
 		}
2681 2681
 		else
2682 2682
 		{
2683
-			fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
2684
-			fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
2685
-			fwrite($fp, 'User-Agent: PHP/ELK' . "\r\n");
2683
+			fwrite($fp, 'POST '.($match[6] !== '/' ? $match[6] : '').' HTTP/1.0'."\r\n");
2684
+			fwrite($fp, 'Host: '.$match[3].(empty($match[5]) ? ($match[2] ? ':443' : '') : ':'.$match[5])."\r\n");
2685
+			fwrite($fp, 'User-Agent: PHP/ELK'."\r\n");
2686 2686
 			if ($keep_alive)
2687
-				fwrite($fp, 'Connection: Keep-Alive' . "\r\n");
2687
+				fwrite($fp, 'Connection: Keep-Alive'."\r\n");
2688 2688
 			else
2689
-				fwrite($fp, 'Connection: close' . "\r\n");
2690
-			fwrite($fp, 'Content-Type: application/x-www-form-urlencoded' . "\r\n");
2691
-			fwrite($fp, 'Content-Length: ' . strlen($post_data) . "\r\n\r\n");
2689
+				fwrite($fp, 'Connection: close'."\r\n");
2690
+			fwrite($fp, 'Content-Type: application/x-www-form-urlencoded'."\r\n");
2691
+			fwrite($fp, 'Content-Length: '.strlen($post_data)."\r\n\r\n");
2692 2692
 			fwrite($fp, $post_data);
2693 2693
 		}
2694 2694
 
@@ -2757,7 +2757,7 @@  discard block
 block discarded – undo
2757 2757
 
2758 2758
 if (!function_exists('crc32_compat'))
2759 2759
 {
2760
-	require_once(SUBSDIR . '/Compat.subs.php');
2760
+	require_once(SUBSDIR.'/Compat.subs.php');
2761 2761
 }
2762 2762
 
2763 2763
 /**
@@ -2791,7 +2791,7 @@  discard block
 block discarded – undo
2791 2791
 		FROM {db_prefix}log_packages
2792 2792
 		WHERE package_id = {string:current_package}
2793 2793
 			AND install_state != {int:not_installed}
2794
-			' . (!empty($install_id) ? ' AND id_install = {int:install_id} ' : '') . '
2794
+			' . (!empty($install_id) ? ' AND id_install = {int:install_id} ' : '').'
2795 2795
 		ORDER BY time_installed DESC
2796 2796
 		LIMIT 1',
2797 2797
 		array(
@@ -2945,7 +2945,7 @@  discard block
 block discarded – undo
2945 2945
 		return false;
2946 2946
 
2947 2947
 	foreach ($servers as $server)
2948
-		if (preg_match('~^' . preg_quote($server) . '~', $remote_url) == 0)
2948
+		if (preg_match('~^'.preg_quote($server).'~', $remote_url) == 0)
2949 2949
 			return true;
2950 2950
 
2951 2951
 	return false;
Please login to merge, or discard this patch.