@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | { |
326 | 326 | // PHP only supports $this inside anonymous functions since 5.4 |
327 | 327 | $minifier = $this; |
328 | - $callback = function ($match) use ($minifier) { |
|
328 | + $callback = function($match) use ($minifier) { |
|
329 | 329 | // check the second index here, because the first always contains a quote |
330 | 330 | if ($match[2] === '') { |
331 | 331 | /* |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | $count = count($minifier->extracted); |
341 | - $placeholder = $match[1].$count.$match[1]; |
|
342 | - $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1]; |
|
341 | + $placeholder = $match[1] . $count . $match[1]; |
|
342 | + $minifier->extracted[$placeholder] = $match[1] . $match[2] . $match[1]; |
|
343 | 343 | |
344 | 344 | return $placeholder; |
345 | 345 | }; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | * considered as escape-char (times 2) and to get it in the regex, |
357 | 357 | * escaped (times 2) |
358 | 358 | */ |
359 | - $this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback); |
|
359 | + $this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | protected function openFileForWriting($path) |
407 | 407 | { |
408 | 408 | if (($handler = @fopen($path, 'w')) === false) { |
409 | - throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.'); |
|
409 | + throw new IOException('The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.'); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | return $handler; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | protected function writeToFile($handler, $content, $path = '') |
425 | 425 | { |
426 | 426 | if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) { |
427 | - throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.'); |
|
427 | + throw new IOException('The file "' . $path . '" could not be written to. Check your disk space and file permissions.'); |
|
428 | 428 | } |
429 | 429 | } |
430 | 430 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | if (!empty($modSettings['search_simple_fulltext'])) |
208 | 208 | { |
209 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
209 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
210 | 210 | { |
211 | 211 | $language_ftx = $smcFunc['db_search_language'](); |
212 | 212 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // remove any indexed words that are used in the complex body search terms |
225 | 225 | $words['indexed_words'] = array_diff($words['indexed_words'], $words['complex_words']); |
226 | 226 | |
227 | - if($smcFunc['db_title'] == "PostgreSQL"){ |
|
227 | + if ($smcFunc['db_title'] == "PostgreSQL") { |
|
228 | 228 | $row = 0; |
229 | 229 | foreach ($words['indexed_words'] as $fulltextWord) { |
230 | 230 | $query_params['boolean_match'] .= ($row <> 0 ? '&' : ''); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | // if we have bool terms to search, add them in |
242 | 242 | if ($query_params['boolean_match']) { |
243 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
243 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
244 | 244 | { |
245 | 245 | $language_ftx = $smcFunc['db_search_language'](); |
246 | 246 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | } |
255 | 255 | |
256 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
256 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
257 | 257 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
258 | 258 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
259 | 259 | SELECT ' . implode(', ', $query_select) . ' |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | $time_string = str_replace(array('%I', '%H', '%S', '%r', '%R', '%T'), array('%l', '%k', '', '%l:%M %p', '%k:%M', '%l:%M'), $matches[0]); |
257 | 257 | |
258 | 258 | $js_time_string = str_replace( |
259 | - array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
260 | - array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
259 | + array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'), |
|
260 | + array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'), |
|
261 | 261 | $time_string |
262 | 262 | ); |
263 | 263 | |
@@ -1306,14 +1306,14 @@ discard block |
||
1306 | 1306 | if (isset($context['name']) && isset($context['email'])) |
1307 | 1307 | { |
1308 | 1308 | $context['posting_fields']['guestname'] = array( |
1309 | - 'dt' => '<span id="caption_guestname"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>', |
|
1309 | + 'dt' => '<span id="caption_guestname"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>', |
|
1310 | 1310 | 'dd' => '<input type="text" name="guestname" size="25" value="' . $context['name'] . '" class="input_text" required>', |
1311 | 1311 | ); |
1312 | 1312 | |
1313 | 1313 | if (empty($modSettings['guest_post_no_email'])) |
1314 | 1314 | { |
1315 | 1315 | $context['posting_fields']['email'] = array( |
1316 | - 'dt' => '<span id="caption_email"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>', |
|
1316 | + 'dt' => '<span id="caption_email"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>', |
|
1317 | 1317 | 'dd' => '<input type="email" name="email" size="25" value="' . $context['email'] . '" class="input_text" required>', |
1318 | 1318 | ); |
1319 | 1319 | } |
@@ -670,7 +670,7 @@ |
||
670 | 670 | // Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified! |
671 | 671 | // Because we insert into it through AJAX and we don't want to stop themers moving it around if they so wish so they can put it where they want it. |
672 | 672 | echo ' |
673 | - <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">'; |
|
673 | + <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '', '" id="modified_', $message['id'], '">'; |
|
674 | 674 | |
675 | 675 | if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
676 | 676 | echo |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $smcFunc['db_free_result']($request); |
166 | 166 | |
167 | 167 | $feed_meta['title'] = ' - ' . strip_tags($board_info['name']); |
168 | - $feed_meta['source'] .= '?board=' . $board . '.0' ; |
|
168 | + $feed_meta['source'] .= '?board=' . $board . '.0'; |
|
169 | 169 | |
170 | 170 | $query_this_board = 'b.id_board = ' . $board; |
171 | 171 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | foreach ($xml_data as $item) |
391 | 391 | { |
392 | - $link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); }); |
|
392 | + $link = array_filter($item['content'], function($e) { return ($e['tag'] == 'link'); }); |
|
393 | 393 | $link = array_pop($link); |
394 | 394 | |
395 | 395 | echo ' |
@@ -416,8 +416,8 @@ discard block |
||
416 | 416 | </div> |
417 | 417 | <div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
418 | 418 | <div class="attach-ui"> |
419 | - <a data-dz-remove class="button_submit cancel">', $txt['modify_cancel'] ,'</a> |
|
420 | - <a class="button_submit upload">', $txt['upload'] ,'</a> |
|
419 | + <a data-dz-remove class="button_submit cancel">', $txt['modify_cancel'], '</a> |
|
420 | + <a class="button_submit upload">', $txt['upload'], '</a> |
|
421 | 421 | </div> |
422 | 422 | </div> |
423 | 423 | </div> |
@@ -435,10 +435,10 @@ discard block |
||
435 | 435 | </dt> |
436 | 436 | <dd class="smalltext fallback"> |
437 | 437 | <div id="attachUpload" class="descbox"> |
438 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
439 | - <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
440 | - <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
441 | - <a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a> |
|
438 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
439 | + <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
440 | + <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
441 | + <a class="button_submit fileinput-button">', $txt['attach_add'], '</a> |
|
442 | 442 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
443 | 443 | <div class="fallback"> |
444 | 444 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="input_file fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | // Option to delete an event if user is editing one. |
546 | 546 | if ($context['make_event'] && !$context['event']['new']) |
547 | 547 | echo ' |
548 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
|
548 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">'; |
|
549 | 549 | |
550 | 550 | echo ' |
551 | 551 | </span> |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | });'; |
800 | 800 | |
801 | 801 | echo ' |
802 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
802 | + var oEditorID = "', $context['post_box_name'], '"; |
|
803 | 803 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
804 | 804 | </script>'; |
805 | 805 | |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | { |
832 | 832 | echo ' |
833 | 833 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
834 | - <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
|
834 | + <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li> |
|
835 | 835 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
836 | 836 | </ul>'; |
837 | 837 | } |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | <head> |
919 | 919 | <meta charset="', $context['character_set'], '"> |
920 | 920 | <title>', $txt['spell_check'], '</title> |
921 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
921 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
922 | 922 | <style> |
923 | 923 | body, td |
924 | 924 | { |
@@ -951,8 +951,8 @@ discard block |
||
951 | 951 | var spell_formname = window.opener.spell_formname; |
952 | 952 | var spell_fieldname = window.opener.spell_fieldname; |
953 | 953 | </script> |
954 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
955 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
954 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
955 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
956 | 956 | <script> |
957 | 957 | ', $context['spell_js'], ' |
958 | 958 | </script> |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | <head> |
995 | 995 | <meta charset="', $context['character_set'], '"> |
996 | 996 | <title>', $txt['retrieving_quote'], '</title> |
997 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
997 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
998 | 998 | </head> |
999 | 999 | <body> |
1000 | 1000 | ', $txt['retrieving_quote'], ' |
@@ -239,7 +239,7 @@ |
||
239 | 239 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
240 | 240 | $fts_language[$row['cfgname']] = $row['cfgname']; |
241 | 241 | |
242 | - $config_vars = array_merge ($config_vars, array( |
|
242 | + $config_vars = array_merge($config_vars, array( |
|
243 | 243 | '', |
244 | 244 | array('search_language', $txt['search_language'], 'db', 'select', $fts_language, 'pgFulltextSearch') |
245 | 245 | ) |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $version = $smcFunc['db_get_version'](); |
39 | 39 | // if we got a Beta Version |
40 | 40 | if (stripos($version, 'beta') !== false) |
41 | - $version = substr($version, 0, stripos($version, 'beta')).'.0'; |
|
41 | + $version = substr($version, 0, stripos($version, 'beta')) . '.0'; |
|
42 | 42 | // or RC |
43 | 43 | if (stripos($version, 'rc') !== false) |
44 | - $version = substr($version, 0, stripos($version, 'rc')).'.0'; |
|
44 | + $version = substr($version, 0, stripos($version, 'rc')) . '.0'; |
|
45 | 45 | |
46 | - if (version_compare($version,'9.5.0','>=')) |
|
46 | + if (version_compare($version, '9.5.0', '>=')) |
|
47 | 47 | $smcFunc['db_support_ignore'] = true; |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function smf_db_search_support($search_type) |
57 | 57 | { |
58 | - $supported_types = array('custom','fulltext'); |
|
58 | + $supported_types = array('custom', 'fulltext'); |
|
59 | 59 | |
60 | 60 | return in_array($search_type, $supported_types); |
61 | 61 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0) |
110 | 110 | { |
111 | 111 | $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string); |
112 | - if ($smcFunc['db_support_ignore']){ |
|
112 | + if ($smcFunc['db_support_ignore']) { |
|
113 | 113 | //pg style "INSERT INTO.... ON CONFLICT DO NOTHING" |
114 | - $db_string = $db_string.' ON CONFLICT DO NOTHING'; |
|
114 | + $db_string = $db_string . ' ON CONFLICT DO NOTHING'; |
|
115 | 115 | } |
116 | 116 | else |
117 | 117 | { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $language_ftx = $modSettings['search_language']; |
169 | 169 | else |
170 | 170 | { |
171 | - $request = $smcFunc['db_query']('',' |
|
171 | + $request = $smcFunc['db_query']('', ' |
|
172 | 172 | SELECT cfgname FROM pg_ts_config WHERE oid = current_setting({string:default_language})::regconfig', |
173 | 173 | array( |
174 | 174 | 'default_language' => 'default_text_search_config' |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | |
258 | 258 | case 'datetime': |
259 | 259 | 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) |
260 | - return 'str_to_date('. |
|
261 | - 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]). |
|
260 | + return 'str_to_date(' . |
|
261 | + 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]) . |
|
262 | 262 | ',\'%Y-%m-%d %h:%i:%s\')'; |
263 | 263 | else |
264 | 264 | smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | $connection |
826 | 826 | ); |
827 | 827 | |
828 | - if(!empty($keys) && (count($keys) > 0) && ($method === '' || $method === 'insert') && $returnmode > 0) |
|
828 | + if (!empty($keys) && (count($keys) > 0) && ($method === '' || $method === 'insert') && $returnmode > 0) |
|
829 | 829 | { |
830 | 830 | if ($returnmode == 1) |
831 | 831 | $return_var = smf_db_insert_id($table, $keys[0]) + count($insertRows) - 1; |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | $return_var = array(); |
835 | 835 | $count = count($insertRows); |
836 | 836 | $start = smf_db_insert_id($table, $keys[0]); |
837 | - for ($i = 0; $i < $count; $i++ ) |
|
837 | + for ($i = 0; $i < $count; $i++) |
|
838 | 838 | $return_var[] = $start + $i; |
839 | 839 | } |
840 | 840 | return $return_var; |