@@ -707,7 +707,6 @@ |
||
| 707 | 707 | $cache_level = array($txt['cache_off']); |
| 708 | 708 | $apis_names['none'] = $txt['cache_off']; |
| 709 | 709 | } |
| 710 | - |
|
| 711 | 710 | else |
| 712 | 711 | { |
| 713 | 712 | $txt['cache_settings_message'] = '<strong class="success">' . |
@@ -1638,7 +1638,7 @@ |
||
| 1638 | 1638 | $cacheAPIdir = $sourcedir . '/Cache'; |
| 1639 | 1639 | |
| 1640 | 1640 | $loadedApis = array(); |
| 1641 | - $apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER; |
|
| 1641 | + $apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER; |
|
| 1642 | 1642 | |
| 1643 | 1643 | $api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY); |
| 1644 | 1644 | |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | $class_name = $this->getImplementationClassKeyName(); |
| 132 | 132 | $class_name_txt_key = strtolower($class_name); |
| 133 | 133 | |
| 134 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
| 134 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
| 135 | 135 | $config_vars[] = array( |
| 136 | - 'cachedir_'. $class_name_txt_key, |
|
| 137 | - $txt['cachedir_'. $class_name_txt_key], |
|
| 136 | + 'cachedir_' . $class_name_txt_key, |
|
| 137 | + $txt['cachedir_' . $class_name_txt_key], |
|
| 138 | 138 | 'file', |
| 139 | 139 | 'text', |
| 140 | 140 | 36, |
| 141 | - 'cache_'. $class_name_txt_key .'_cachedir'); |
|
| 141 | + 'cache_' . $class_name_txt_key . '_cachedir'); |
|
| 142 | 142 | |
| 143 | 143 | if (!isset($context['settings_post_javascript'])) |
| 144 | 144 | $context['settings_post_javascript'] = ''; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $context['settings_post_javascript'] .= ' |
| 147 | 147 | $("#cache_accelerator").change(function (e) { |
| 148 | 148 | var cache_type = e.currentTarget.value; |
| 149 | - $("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'"); |
|
| 149 | + $("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '"); |
|
| 150 | 150 | });'; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -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; |
@@ -670,7 +670,7 @@ |
||
| 670 | 670 | foreach ($columns as $columnName => $type) |
| 671 | 671 | { |
| 672 | 672 | //check pk fiel |
| 673 | - IF (in_array($columnName, $keys)) |
|
| 673 | + if (in_array($columnName, $keys)) |
|
| 674 | 674 | { |
| 675 | 675 | $key_str .= ($count_pk > 0 ? ',' : ''); |
| 676 | 676 | $key_str .= $columnName; |
@@ -75,11 +75,11 @@ 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(function($errno, $errstr) { |
| 82 | - throw new ErrorException($errstr, $errno);}); |
|
| 82 | + throw new ErrorException($errstr, $errno); }); |
|
| 83 | 83 | try |
| 84 | 84 | { |
| 85 | 85 | if (!empty($db_options['persist'])) |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
| 939 | 939 | $error_array[2] = null; |
| 940 | 940 | |
| 941 | - if(empty($db_persist)) |
|
| 941 | + if (empty($db_persist)) |
|
| 942 | 942 | { // without pooling |
| 943 | 943 | if (empty($pg_error_data_prep)) |
| 944 | 944 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -78,7 +78,8 @@ discard block |
||
| 78 | 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 | - set_error_handler(function($errno, $errstr) { |
|
| 81 | + set_error_handler(function($errno, $errstr) |
|
| 82 | + { |
|
| 82 | 83 | throw new ErrorException($errstr, $errno);}); |
| 83 | 84 | try |
| 84 | 85 | { |
@@ -939,7 +940,8 @@ discard block |
||
| 939 | 940 | $error_array[2] = null; |
| 940 | 941 | |
| 941 | 942 | if(empty($db_persist)) |
| 942 | - { // without pooling |
|
| 943 | + { |
|
| 944 | +// without pooling |
|
| 943 | 945 | if (empty($pg_error_data_prep)) |
| 944 | 946 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
| 945 | 947 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -950,7 +952,8 @@ discard block |
||
| 950 | 952 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
| 951 | 953 | } |
| 952 | 954 | else |
| 953 | - { //with pooling |
|
| 955 | + { |
|
| 956 | +//with pooling |
|
| 954 | 957 | $pg_error_data_prep = pg_prepare($db_connection, '', |
| 955 | 958 | 'INSERT INTO ' . $db_prefix . 'log_errors |
| 956 | 959 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -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. |
@@ -2322,7 +2320,6 @@ discard block |
||
| 2322 | 2320 | loadLanguage('index+Modifications'); |
| 2323 | 2321 | $context['template_layers'] = array(); |
| 2324 | 2322 | } |
| 2325 | - |
|
| 2326 | 2323 | else |
| 2327 | 2324 | { |
| 2328 | 2325 | // 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'] : '', |
@@ -1755,7 +1755,7 @@ discard block |
||
| 1755 | 1755 | if (!empty($image)) |
| 1756 | 1756 | $memberContext[$user]['avatar'] = array( |
| 1757 | 1757 | 'name' => $profile['avatar'], |
| 1758 | - 'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "'. $profile['attachment_height'] . '">', |
|
| 1758 | + 'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "' . $profile['attachment_height'] . '">', |
|
| 1759 | 1759 | 'href' => $image, |
| 1760 | 1760 | 'url' => $image, |
| 1761 | 1761 | ); |
@@ -2720,8 +2720,7 @@ discard block |
||
| 2720 | 2720 | $context['css_files_order'] = array(); |
| 2721 | 2721 | |
| 2722 | 2722 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2723 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2724 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2723 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2725 | 2724 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2726 | 2725 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2727 | 2726 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2835,8 +2834,7 @@ discard block |
||
| 2835 | 2834 | global $settings, $context, $modSettings; |
| 2836 | 2835 | |
| 2837 | 2836 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2838 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2839 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2837 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2840 | 2838 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2841 | 2839 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2842 | 2840 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -3579,8 +3577,7 @@ discard block |
||
| 3579 | 3577 | |
| 3580 | 3578 | // What accelerator we are going to try. |
| 3581 | 3579 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
| 3582 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
| 3583 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3580 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3584 | 3581 | |
| 3585 | 3582 | // Do some basic tests. |
| 3586 | 3583 | if (class_exists($fully_qualified_class_name)) |
@@ -3884,7 +3881,7 @@ discard block |
||
| 3884 | 3881 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
| 3885 | 3882 | |
| 3886 | 3883 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
| 3887 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
| 3884 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
| 3888 | 3885 | { |
| 3889 | 3886 | updateDbLastError(time()); |
| 3890 | 3887 | loadLanguage('Errors'); |
@@ -280,7 +280,6 @@ discard block |
||
| 280 | 280 | $this_category[$row_board['id_board']]['board_class'] = 'on'; |
| 281 | 281 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts']; |
| 282 | 282 | } |
| 283 | - |
|
| 284 | 283 | else |
| 285 | 284 | { |
| 286 | 285 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts']; |
@@ -415,7 +414,6 @@ discard block |
||
| 415 | 414 | $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new'; |
| 416 | 415 | $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>'; |
| 417 | 416 | } |
| 418 | - |
|
| 419 | 417 | else |
| 420 | 418 | { |
| 421 | 419 | $this_last_post['href'] = ''; |
@@ -510,8 +508,7 @@ discard block |
||
| 510 | 508 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
| 511 | 509 | } |
| 512 | 510 | } |
| 513 | - |
|
| 514 | - else |
|
| 511 | + else |
|
| 515 | 512 | foreach ($this_category as &$board) |
| 516 | 513 | { |
| 517 | 514 | if (isset($boards_parsed_data_by_cat_id[$board['id_cat']][$board['id']])) |
@@ -195,8 +195,7 @@ |
||
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | 197 | $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? |
| 198 | - '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : |
|
| 199 | - $row_board['cat_name']); |
|
| 198 | + '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']); |
|
| 200 | 199 | |
| 201 | 200 | } |
| 202 | 201 | |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | clean_cache('data'); |
| 853 | 853 | |
| 854 | - cache_put_data('parsed_boards_descriptions_'. $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 854 | + cache_put_data('parsed_boards_descriptions_' . $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 855 | 855 | |
| 856 | 856 | if (empty($boardOptions['dont_log'])) |
| 857 | 857 | logAction('edit_board', array('board' => $board_id), 'admin'); |
@@ -1579,7 +1579,7 @@ discard block |
||
| 1579 | 1579 | $context['description_allowed_tags'] |
| 1580 | 1580 | ); |
| 1581 | 1581 | |
| 1582 | - cache_put_data('parsed_boards_descriptions_'. $category_id, $already_parsed_boards, 864000); |
|
| 1582 | + cache_put_data('parsed_boards_descriptions_' . $category_id, $already_parsed_boards, 864000); |
|
| 1583 | 1583 | |
| 1584 | 1584 | return $already_parsed_boards; |
| 1585 | 1585 | } |
@@ -455,7 +455,7 @@ |
||
| 455 | 455 | |
| 456 | 456 | elseif ($context['uninstalling']) |
| 457 | 457 | echo ' |
| 458 | - ', $txt['package_uninstall_done'] .' <br> |
|
| 458 | + ', $txt['package_uninstall_done'] . ' <br> |
|
| 459 | 459 | ', '<a href="', $context['keep_url'], '" class="button">', $txt['package_keep'], '</a>', '<a href="', $context['remove_url'], '" class="button">', $txt['package_delete2'], '</a>'; |
| 460 | 460 | |
| 461 | 461 | elseif ($context['install_finished']) |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | // Clean up tags with children |
| 367 | - foreach($bbcTagsChildren as $parent_tag => $children) |
|
| 368 | - foreach($children as $index => $child_tag) |
|
| 367 | + foreach ($bbcTagsChildren as $parent_tag => $children) |
|
| 368 | + foreach ($children as $index => $child_tag) |
|
| 369 | 369 | { |
| 370 | 370 | // Remove entries where parent and child tag is the same |
| 371 | 371 | if ($child_tag == $parent_tag) |
@@ -1888,25 +1888,25 @@ discard block |
||
| 1888 | 1888 | $fields = array(); |
| 1889 | 1889 | $new_sort = array(); |
| 1890 | 1890 | |
| 1891 | - while($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 1891 | + while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 1892 | 1892 | $fields[] = $row['id_field']; |
| 1893 | 1893 | $smcFunc['db_free_result']($request); |
| 1894 | 1894 | |
| 1895 | 1895 | $idx = array_search($context['fid'], $fields); |
| 1896 | 1896 | |
| 1897 | - if ($_GET['move'] == 'down' && count($fields) - 1 > $idx ) |
|
| 1897 | + if ($_GET['move'] == 'down' && count($fields) - 1 > $idx) |
|
| 1898 | 1898 | { |
| 1899 | - $new_sort = array_slice($fields ,0 ,$idx ,true); |
|
| 1899 | + $new_sort = array_slice($fields, 0, $idx, true); |
|
| 1900 | 1900 | $new_sort[] = $fields[$idx + 1]; |
| 1901 | 1901 | $new_sort[] = $fields[$idx]; |
| 1902 | - $new_sort += array_slice($fields ,$idx + 2 ,count($fields) ,true); |
|
| 1902 | + $new_sort += array_slice($fields, $idx + 2, count($fields), true); |
|
| 1903 | 1903 | } |
| 1904 | 1904 | elseif ($context['fid'] > 0 and $idx < count($fields)) |
| 1905 | 1905 | { |
| 1906 | - $new_sort = array_slice($fields ,0 ,($idx - 1) ,true); |
|
| 1906 | + $new_sort = array_slice($fields, 0, ($idx - 1), true); |
|
| 1907 | 1907 | $new_sort[] = $fields[$idx]; |
| 1908 | 1908 | $new_sort[] = $fields[$idx - 1]; |
| 1909 | - $new_sort += array_slice($fields ,($idx + 1) ,count($fields) ,true); |
|
| 1909 | + $new_sort += array_slice($fields, ($idx + 1), count($fields), true); |
|
| 1910 | 1910 | } |
| 1911 | 1911 | else |
| 1912 | 1912 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |