@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | if ($c === $n) { |
| 138 | 138 | $q = $delta; |
| 139 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 139 | + for ($k = static::BASE; ; $k += static::BASE) { |
|
| 140 | 140 | $t = $this->calculateThreshold($k, $bias); |
| 141 | 141 | if ($q < $t) { |
| 142 | 142 | break; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $oldi = $i; |
| 225 | 225 | $w = 1; |
| 226 | 226 | |
| 227 | - for ($k = static::BASE;; $k += static::BASE) { |
|
| 227 | + for ($k = static::BASE; ; $k += static::BASE) { |
|
| 228 | 228 | $digit = static::$decodeTable[$input[$pos++]]; |
| 229 | 229 | $i = $i + ($digit * $w); |
| 230 | 230 | $t = $this->calculateThreshold($k, $bias); |
@@ -181,14 +181,14 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | collapsedDiv.show(\'slow\'); |
| 183 | 183 | icon.removeClass(\'toggle_down\').addClass(\'toggle_up\'); |
| 184 | - icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) .'); |
|
| 184 | + icon.prop(\'title\', '. JavaScriptEscape($txt['hide']) . '); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | else |
| 188 | 188 | { |
| 189 | 189 | collapsedDiv.hide(\'slow\'); |
| 190 | 190 | icon.removeClass(\'toggle_up\').addClass(\'toggle_down\'); |
| 191 | - icon.prop(\'title\', '. JavaScriptEscape($txt['show']) .'); |
|
| 191 | + icon.prop(\'title\', '. JavaScriptEscape($txt['show']) . '); |
|
| 192 | 192 | } |
| 193 | 193 | });', true); |
| 194 | 194 | } |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | // Setup the correct template, even though I'll admit we ain't downloading ;) |
| 643 | 643 | $context['sub_template'] = 'downloaded'; |
| 644 | - $allowext = array('.zip','.tgz','.gz'); |
|
| 644 | + $allowext = array('.zip', '.tgz', '.gz'); |
|
| 645 | 645 | // @todo Use FTP if the Packages directory is not writable. |
| 646 | 646 | |
| 647 | 647 | // Check the file was even sent! |
@@ -653,13 +653,13 @@ discard block |
||
| 653 | 653 | // Make sure it has a sane filename. |
| 654 | 654 | $_FILES['package']['name'] = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $_FILES['package']['name']); |
| 655 | 655 | $extension = substr(strrchr(strtolower($_FILES['package']['name']), '.'), 0); |
| 656 | - if(!in_array($extension, $allowext)) |
|
| 656 | + if (!in_array($extension, $allowext)) |
|
| 657 | 657 | { |
| 658 | 658 | fatal_lang_error('package_upload_error_supports', false, array('zip, tgz, tar.gz')); |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // We only need the filename... |
| 662 | - $extension = ($extension == '.gz') ? '.tar.gz' : $extension ; |
|
| 662 | + $extension = ($extension == '.gz') ? '.tar.gz' : $extension; |
|
| 663 | 663 | $packageName = time() . $extension; |
| 664 | 664 | |
| 665 | 665 | // Setup the destination and throw an error if the file is already there! |
@@ -454,7 +454,7 @@ |
||
| 454 | 454 | break; |
| 455 | 455 | } |
| 456 | 456 | $binMask = str_pad($binMask, 32, '0'); |
| 457 | - $binMask = pack("H*" , $binMask); |
|
| 457 | + $binMask = pack("H*", $binMask); |
|
| 458 | 458 | |
| 459 | 459 | return ($ip_address & $binMask) == $cidr_network; |
| 460 | 460 | } |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | WHERE table_name = {string:cur_table} |
| 571 | 571 | AND (data_type = \'character varying\' or data_type = \'text\')', |
| 572 | 572 | array( |
| 573 | - 'cur_table' => $db_prefix.$cur_table, |
|
| 573 | + 'cur_table' => $db_prefix . $cur_table, |
|
| 574 | 574 | ) |
| 575 | 575 | ); |
| 576 | 576 | else |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | WHERE i.indrelid = {string:cur_table}::regclass |
| 596 | 596 | AND i.indisprimary', |
| 597 | 597 | array( |
| 598 | - 'cur_table' => $db_prefix.$cur_table, |
|
| 598 | + 'cur_table' => $db_prefix . $cur_table, |
|
| 599 | 599 | ) |
| 600 | 600 | ); |
| 601 | 601 | else |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | global $smcFunc; |
| 225 | 225 | |
| 226 | - $result = $smcFunc['db_query']('',' |
|
| 226 | + $result = $smcFunc['db_query']('', ' |
|
| 227 | 227 | SELECT DISTINCT id_search |
| 228 | 228 | FROM {db_prefix}log_search_results |
| 229 | 229 | WHERE id_msg = {int:id_msg}', |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if (count($id_searchs) < 1) |
| 240 | 240 | return; |
| 241 | 241 | |
| 242 | - $smcFunc['db_query']('',' |
|
| 242 | + $smcFunc['db_query']('', ' |
|
| 243 | 243 | DELETE FROM {db_prefix}log_search_results |
| 244 | 244 | WHERE id_search in ({array_int:id_searchs})', |
| 245 | 245 | array( |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | ) |
| 248 | 248 | ); |
| 249 | 249 | |
| 250 | - $smcFunc['db_query']('',' |
|
| 250 | + $smcFunc['db_query']('', ' |
|
| 251 | 251 | DELETE FROM {db_prefix}log_search_topics |
| 252 | 252 | WHERE id_search in ({array_int:id_searchs})', |
| 253 | 253 | array( |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | ) |
| 256 | 256 | ); |
| 257 | 257 | |
| 258 | - $smcFunc['db_query']('',' |
|
| 258 | + $smcFunc['db_query']('', ' |
|
| 259 | 259 | DELETE FROM {db_prefix}log_search_messages |
| 260 | 260 | WHERE id_search in ({array_int:id_searchs})', |
| 261 | 261 | array( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * @var array Which databases support this method? |
| 35 | 35 | */ |
| 36 | - protected $supported_databases = array('mysql','postgresql'); |
|
| 36 | + protected $supported_databases = array('mysql', 'postgresql'); |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The constructor function |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $query_where = array(); |
| 177 | 177 | $query_params = $search_data['params']; |
| 178 | 178 | |
| 179 | - if( $smcFunc['db_title'] == "PostgreSQL") |
|
| 179 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
| 180 | 180 | $modSettings['search_simple_fulltext'] = true; |
| 181 | 181 | |
| 182 | 182 | if ($query_params['id_search']) |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | // if we have bool terms to search, add them in |
| 257 | 257 | if ($query_params['boolean_match']) |
| 258 | 258 | { |
| 259 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
| 259 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
| 260 | 260 | { |
| 261 | 261 | $language_ftx = $smcFunc['db_search_language'](); |
| 262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
| 271 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
| 272 | 272 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
| 273 | 273 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
| 274 | 274 | SELECT ' . implode(', ', $query_select) . ' |
@@ -1229,8 +1229,8 @@ |
||
| 1229 | 1229 | continue; |
| 1230 | 1230 | |
| 1231 | 1231 | $final_saves[$string_key] = array( |
| 1232 | - 'find' => "\n\n?".'>', |
|
| 1233 | - 'replace' => "\n$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?".'>', |
|
| 1232 | + 'find' => "\n\n?" . '>', |
|
| 1233 | + 'replace' => "\n$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?" . '>', |
|
| 1234 | 1234 | ); |
| 1235 | 1235 | } |
| 1236 | 1236 | } |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | case 'datetime': |
| 256 | 256 | if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1) |
| 257 | - return 'str_to_date('. |
|
| 258 | - sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]). |
|
| 257 | + return 'str_to_date(' . |
|
| 258 | + sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5], $datetime_matches[6]) . |
|
| 259 | 259 | ',\'%Y-%m-%d %h:%i:%s\')'; |
| 260 | 260 | else |
| 261 | 261 | smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $old_pos = 0; |
| 407 | 407 | $pos = -1; |
| 408 | 408 | // Remove the string escape for better runtime |
| 409 | - $db_string_1 = str_replace('\\\'','',$db_string); |
|
| 409 | + $db_string_1 = str_replace('\\\'', '', $db_string); |
|
| 410 | 410 | while (true) |
| 411 | 411 | { |
| 412 | 412 | $pos = strpos($db_string_1, '\'', $pos + 1); |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | { |
| 788 | 788 | $count = count($insertRows); |
| 789 | 789 | $ai = 0; |
| 790 | - for($i = 0; $i < $count; $i++) |
|
| 790 | + for ($i = 0; $i < $count; $i++) |
|
| 791 | 791 | { |
| 792 | 792 | $old_id = $smcFunc['db_insert_id'](); |
| 793 | 793 | |
@@ -813,13 +813,13 @@ discard block |
||
| 813 | 813 | $count2 = count($indexed_columns); |
| 814 | 814 | for ($x = 0; $x < $count2; $x++) |
| 815 | 815 | { |
| 816 | - $where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x]; |
|
| 816 | + $where_string += key($indexed_columns[$x]) . ' = ' . $insertRows[$i][$x]; |
|
| 817 | 817 | if (($x + 1) < $count2) |
| 818 | 818 | $where_string += ' AND '; |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | - $request = $smcFunc['db_query']('',' |
|
| 822 | - SELECT `'. $keys[0] . '` FROM ' . $table .' |
|
| 821 | + $request = $smcFunc['db_query']('', ' |
|
| 822 | + SELECT `'. $keys[0] . '` FROM ' . $table . ' |
|
| 823 | 823 | WHERE ' . $where_string . ' LIMIT 1', |
| 824 | 824 | array() |
| 825 | 825 | ); |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $return_var = array(); |
| 849 | 849 | $count = count($insertRows); |
| 850 | 850 | $start = smf_db_insert_id($table, $keys[0]); |
| 851 | - for ($i = 0; $i < $count; $i++ ) |
|
| 851 | + for ($i = 0; $i < $count; $i++) |
|
| 852 | 852 | $return_var[] = $start + $i; |
| 853 | 853 | } |
| 854 | 854 | return $return_var; |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssis', |
| 986 | 986 | $error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6], |
| 987 | 987 | $error_array[7], $error_array[8], $error_array[9]); |
| 988 | - mysqli_stmt_execute ($mysql_error_data_prep); |
|
| 988 | + mysqli_stmt_execute($mysql_error_data_prep); |
|
| 989 | 989 | } |
| 990 | 990 | |
| 991 | 991 | /** |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | */ |
| 1000 | 1000 | function smf_db_custom_order($field, $array_values, $desc = false) |
| 1001 | 1001 | { |
| 1002 | - $return = 'CASE '. $field . ' '; |
|
| 1002 | + $return = 'CASE ' . $field . ' '; |
|
| 1003 | 1003 | $count = count($array_values); |
| 1004 | 1004 | $then = ($desc ? ' THEN -' : ' THEN '); |
| 1005 | 1005 | |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | $smcFunc['db_free_result']($result_boards); |
| 87 | 87 | |
| 88 | 88 | // Run through the categories and boards (or only boards).... |
| 89 | - for (reset($row_boards); key($row_boards)!==null; next($row_boards)) |
|
| 89 | + for (reset($row_boards); key($row_boards) !== null; next($row_boards)) |
|
| 90 | 90 | { |
| 91 | 91 | $row_board = current($row_boards); |
| 92 | 92 | |