@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | log_error(sprintf($txt['smiley_set_dir_not_found'], $set_names[array_search($set, $context['smiley_sets'])])); |
501 | 501 | |
502 | 502 | $context['smiley_sets'] = array_filter($context['smiley_sets'], function($v) use ($set) |
503 | - { |
|
503 | + { |
|
504 | 504 | return $v != $set; |
505 | 505 | }); |
506 | 506 | } |
@@ -3493,7 +3493,6 @@ discard block |
||
3493 | 3493 | } |
3494 | 3494 | } |
3495 | 3495 | } |
3496 | - |
|
3497 | 3496 | elseif (($value == 'upload' && allowedTo('profile_upload_avatar')) || $downloadedExternalAvatar) |
3498 | 3497 | { |
3499 | 3498 | if ((isset($_FILES['attachment']['name']) && $_FILES['attachment']['name'] != '') || $downloadedExternalAvatar) |
@@ -926,7 +926,8 @@ discard block |
||
926 | 926 | $error_array[2] = null; |
927 | 927 | |
928 | 928 | if(empty($db_persist)) |
929 | - { // without pooling |
|
929 | + { |
|
930 | +// without pooling |
|
930 | 931 | if (empty($pg_error_data_prep)) |
931 | 932 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
932 | 933 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -937,7 +938,8 @@ discard block |
||
937 | 938 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
938 | 939 | } |
939 | 940 | else |
940 | - { //with pooling |
|
941 | + { |
|
942 | +//with pooling |
|
941 | 943 | $pg_error_data_prep = pg_prepare($db_connection, '', |
942 | 944 | 'INSERT INTO ' . $db_prefix . 'log_errors |
943 | 945 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -683,7 +683,7 @@ |
||
683 | 683 | foreach ($columns as $columnName => $type) |
684 | 684 | { |
685 | 685 | //check pk fiel |
686 | - IF (in_array($columnName, $keys)) |
|
686 | + if (in_array($columnName, $keys)) |
|
687 | 687 | { |
688 | 688 | $key_str .= ($count_pk > 0 ? ',' : ''); |
689 | 689 | $key_str .= $columnName; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | display_db_error(); |
76 | 76 | |
77 | 77 | // We need to escape ' and \ |
78 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
78 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
79 | 79 | |
80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
81 | 81 | set_error_handler( |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
911 | 911 | $error_array[2] = null; |
912 | 912 | |
913 | - if(empty($db_persist)) |
|
913 | + if (empty($db_persist)) |
|
914 | 914 | { // without pooling |
915 | 915 | if (empty($pg_error_data_prep)) |
916 | 916 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -67,8 +67,7 @@ |
||
67 | 67 | $sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8); |
68 | 68 | switch ($word[$i] === 's' ? 0 : mt_rand(0, 2)) |
69 | 69 | { |
70 | - case 0 : |
|
71 | - for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
70 | + case 0 : for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
72 | 71 | for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++) |
73 | 72 | $sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF))); |
74 | 73 | break; |
@@ -282,7 +282,7 @@ |
||
282 | 282 | '{db_prefix}log_notify', |
283 | 283 | array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'), |
284 | 284 | array($user_info['id'], $log['id_topic'], 0), |
285 | - array('id_member','id_topic', 'id_board') |
|
285 | + array('id_member', 'id_topic', 'id_board') |
|
286 | 286 | ); |
287 | 287 | } |
288 | 288 | else |
@@ -310,7 +310,7 @@ |
||
310 | 310 | { |
311 | 311 | /** |
312 | 312 | * Constants for notification types. |
313 | - */ |
|
313 | + */ |
|
314 | 314 | const RECEIVE_NOTIFY_EMAIL = 0x02; |
315 | 315 | const RECEIVE_NOTIFY_ALERT = 0x01; |
316 | 316 |
@@ -93,7 +93,6 @@ |
||
93 | 93 | if ($ts <= 0 || $ts % 15 != 0 || time() - $ts < 0 || time() - $ts > 20) |
94 | 94 | obExit_cron(); |
95 | 95 | } |
96 | - |
|
97 | 96 | else |
98 | 97 | $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; |
99 | 98 |
@@ -644,13 +644,13 @@ discard block |
||
644 | 644 | 'quickbuttons' => array( |
645 | 645 | 'edit' => array( |
646 | 646 | 'label' => $txt['draft_edit'], |
647 | - 'href' => $scripturl.'?action=post;'.(empty($row['id_topic']) ? 'board='.$row['id_board'] : 'topic='.$row['id_topic']).'.0;id_draft='.$row['id_draft'], |
|
647 | + 'href' => $scripturl . '?action=post;' . (empty($row['id_topic']) ? 'board=' . $row['id_board'] : 'topic=' . $row['id_topic']) . '.0;id_draft=' . $row['id_draft'], |
|
648 | 648 | 'icon' => 'modify_button' |
649 | 649 | ), |
650 | 650 | 'delete' => array( |
651 | 651 | 'label' => $txt['draft_delete'], |
652 | - 'href' => $scripturl.'?action=profile;u='.$context['member']['id'].';area=showdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
653 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'"', |
|
652 | + 'href' => $scripturl . '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
653 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '"', |
|
654 | 654 | 'class' => 'you_sure', |
655 | 655 | 'icon' => 'remove_button' |
656 | 656 | ), |
@@ -837,13 +837,13 @@ discard block |
||
837 | 837 | 'quickbuttons' => array( |
838 | 838 | 'edit' => array( |
839 | 839 | 'label' => $txt['draft_edit'], |
840 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;id_draft='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
840 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;id_draft=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
841 | 841 | 'icon' => 'modify_button' |
842 | 842 | ), |
843 | 843 | 'delete' => array( |
844 | 844 | 'label' => $txt['draft_delete'], |
845 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
846 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'?"', |
|
845 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
846 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '?"', |
|
847 | 847 | 'class' => 'you_sure', |
848 | 848 | 'icon' => 'remove_button' |
849 | 849 | ), |
@@ -355,8 +355,8 @@ |
||
355 | 355 | elseif (isset($_POST['delall']) && isset($filter)) |
356 | 356 | { |
357 | 357 | // ip need a different placeholder type |
358 | - $filter_type = $filter['variable'] == 'ip'? 'inet' : 'string'; |
|
359 | - $filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE'; |
|
358 | + $filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string'; |
|
359 | + $filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE'; |
|
360 | 360 | $smcFunc['db_query']('', ' |
361 | 361 | DELETE FROM {db_prefix}log_errors |
362 | 362 | WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}', |
@@ -163,7 +163,8 @@ |
||
163 | 163 | else |
164 | 164 | $context['help_text'] = $_GET['help']; |
165 | 165 | |
166 | - switch ($_GET['help']) { |
|
166 | + switch ($_GET['help']) |
|
167 | + { |
|
167 | 168 | case 'cal_short_months': |
168 | 169 | $context['help_text'] = sprintf($context['help_text'], $txt['months_short'][1], $txt['months_titles'][1]); |
169 | 170 | break; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | // Set a list of common functions. |
105 | 105 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
106 | 106 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
107 | - { |
|
107 | + { |
|
108 | 108 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
109 | 109 | return $string; |
110 | 110 | } : function($string) |
@@ -929,7 +929,6 @@ discard block |
||
929 | 929 | $user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) - |
930 | 930 | $tz_system->getOffset($time_system)) / 3600; |
931 | 931 | } |
932 | - |
|
933 | 932 | else |
934 | 933 | $user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset']; |
935 | 934 | } |
@@ -1657,7 +1656,6 @@ discard block |
||
1657 | 1656 | $time_user = new DateTime('now', $tz_user); |
1658 | 1657 | $profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600; |
1659 | 1658 | } |
1660 | - |
|
1661 | 1659 | else |
1662 | 1660 | { |
1663 | 1661 | // !!! Compatibility. |
@@ -2351,7 +2349,6 @@ discard block |
||
2351 | 2349 | loadLanguage('index+Modifications'); |
2352 | 2350 | $context['template_layers'] = array(); |
2353 | 2351 | } |
2354 | - |
|
2355 | 2352 | else |
2356 | 2353 | { |
2357 | 2354 | // Custom templates to load, or just default? |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | 'filename' => empty($user_settings['filename']) ? '' : $user_settings['filename'], |
815 | 815 | 'custom_dir' => !empty($user_settings['attachment_type']) && $user_settings['attachment_type'] == 1, |
816 | 816 | 'id_attach' => isset($user_settings['id_attach']) ? $user_settings['id_attach'] : 0, |
817 | - 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width']: 0, |
|
817 | + 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width'] : 0, |
|
818 | 818 | 'height' => isset($user_settings['attachment_height']) > 0 ? $user_settings['attachment_height'] : 0, |
819 | 819 | ), |
820 | 820 | 'smiley_set' => isset($user_settings['smiley_set']) ? $user_settings['smiley_set'] : '', |
@@ -2708,8 +2708,7 @@ discard block |
||
2708 | 2708 | $context['css_files_order'] = array(); |
2709 | 2709 | |
2710 | 2710 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2711 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2712 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2711 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2713 | 2712 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2714 | 2713 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2715 | 2714 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2823,8 +2822,7 @@ discard block |
||
2823 | 2822 | global $settings, $context, $modSettings, $boardurl; |
2824 | 2823 | |
2825 | 2824 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2826 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2827 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2825 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2828 | 2826 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2829 | 2827 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2830 | 2828 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -2927,7 +2925,7 @@ discard block |
||
2927 | 2925 | $elements[] = JavaScriptEscape($element); |
2928 | 2926 | } |
2929 | 2927 | |
2930 | - $value = '[' . implode(', ',$elements) . ']'; |
|
2928 | + $value = '[' . implode(', ', $elements) . ']'; |
|
2931 | 2929 | } |
2932 | 2930 | } |
2933 | 2931 | |
@@ -3608,8 +3606,7 @@ discard block |
||
3608 | 3606 | |
3609 | 3607 | // What accelerator we are going to try. |
3610 | 3608 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
3611 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
3612 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
3609 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
3613 | 3610 | |
3614 | 3611 | // Do some basic tests. |
3615 | 3612 | if (class_exists($fully_qualified_class_name)) |
@@ -3913,7 +3910,7 @@ discard block |
||
3913 | 3910 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
3914 | 3911 | |
3915 | 3912 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
3916 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
3913 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
3917 | 3914 | { |
3918 | 3915 | updateDbLastError(time()); |
3919 | 3916 | loadLanguage('Errors'); |