@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | 'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))', |
| 860 | 860 | ' $cachedir = $boarddir . \'/cache\';', |
| 861 | 861 | )), |
| 862 | - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
| 862 | + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
| 863 | 863 | ), |
| 864 | 864 | 'db_character_set' => array( |
| 865 | 865 | 'text' => implode("\n", array( |
@@ -958,8 +958,8 @@ discard block |
||
| 958 | 958 | 'boolean' => '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)', |
| 959 | 959 | 'NULL' => '(?i:NULL)', |
| 960 | 960 | // These use a PCRE subroutine to match nested arrays. |
| 961 | - 'array' => 'array\s*(\((?'.'>[^()]|(?1))*\))', |
|
| 962 | - 'object' => '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)', |
|
| 961 | + 'array' => 'array\s*(\((?' . '>[^()]|(?1))*\))', |
|
| 962 | + 'object' => '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)', |
|
| 963 | 963 | ); |
| 964 | 964 | |
| 965 | 965 | /* |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | ), |
| 993 | 993 | // Remove the code that redirects to the installer. |
| 994 | 994 | $neg_index-- => array( |
| 995 | - 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 995 | + 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 996 | 996 | 'placeholder' => '', |
| 997 | 997 | ), |
| 998 | 998 | ); |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | // Prevents warnings about constants that are already defined. |
| 1759 | 1759 | $settingsText = preg_replace_callback( |
| 1760 | 1760 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
| 1761 | - function ($matches) |
|
| 1761 | + function($matches) |
|
| 1762 | 1762 | { |
| 1763 | 1763 | return 'define(\'' . md5(mt_rand()) . '\''; |
| 1764 | 1764 | }, |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
| 1769 | 1769 | try |
| 1770 | 1770 | { |
| 1771 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
| 1771 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
| 1772 | 1772 | throw new ErrorException('eval error'); |
| 1773 | 1773 | |
| 1774 | 1774 | unset($mtime, $settingsFile, $settingsText); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | // Figure out the filename we'll tell the browser. |
| 470 | 470 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
| 471 | 471 | $included_desc = array_map( |
| 472 | - function ($datatype) use ($txt) |
|
| 472 | + function($datatype) use ($txt) |
|
| 473 | 473 | { |
| 474 | 474 | return $txt[$datatype]; |
| 475 | 475 | }, |
@@ -789,9 +789,9 @@ discard block |
||
| 789 | 789 | $xslt_variables = array(); |
| 790 | 790 | |
| 791 | 791 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
| 792 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
| 793 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
| 794 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
| 792 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
| 793 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
| 794 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
| 795 | 795 | |
| 796 | 796 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
| 797 | 797 | |
@@ -1696,14 +1696,14 @@ discard block |
||
| 1696 | 1696 | |
| 1697 | 1697 | if (!empty($context['export_css_header'])) |
| 1698 | 1698 | { |
| 1699 | - $stylesheet['css_js'] .= ' |
|
| 1699 | + $stylesheet['css_js'] .= ' |
|
| 1700 | 1700 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
| 1701 | 1701 | </style>'; |
| 1702 | 1702 | } |
| 1703 | 1703 | |
| 1704 | 1704 | if (!empty($context['export_javascript_vars'])) |
| 1705 | 1705 | { |
| 1706 | - $stylesheet['css_js'] .= ' |
|
| 1706 | + $stylesheet['css_js'] .= ' |
|
| 1707 | 1707 | <script><![CDATA['; |
| 1708 | 1708 | |
| 1709 | 1709 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1739,7 +1739,7 @@ discard block |
||
| 1739 | 1739 | |
| 1740 | 1740 | if (!empty($context['export_javascript_inline']['standard'])) |
| 1741 | 1741 | { |
| 1742 | - $stylesheet['css_js'] .= ' |
|
| 1742 | + $stylesheet['css_js'] .= ' |
|
| 1743 | 1743 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
| 1744 | 1744 | </script>'; |
| 1745 | 1745 | } |
@@ -1751,7 +1751,7 @@ discard block |
||
| 1751 | 1751 | |
| 1752 | 1752 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
| 1753 | 1753 | |
| 1754 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
| 1754 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
| 1755 | 1755 | </script>'; |
| 1756 | 1756 | } |
| 1757 | 1757 | |
@@ -1834,7 +1834,7 @@ discard block |
||
| 1834 | 1834 | |
| 1835 | 1835 | usort( |
| 1836 | 1836 | $context['css_files'], |
| 1837 | - function ($a, $b) |
|
| 1837 | + function($a, $b) |
|
| 1838 | 1838 | { |
| 1839 | 1839 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 1840 | 1840 | } |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | if (!function_exists('mb_encode_numericentity')) |
| 223 | 223 | return false; |
| 224 | 224 | |
| 225 | - $entity = mb_encode_numericentity($string, array(0x0,0x10FFFF,0x0,0xFFFFFF), $encoding); |
|
| 225 | + $entity = mb_encode_numericentity($string, array(0x0, 0x10FFFF, 0x0, 0xFFFFFF), $encoding); |
|
| 226 | 226 | |
| 227 | 227 | if (strpos($entity, '&#') !== 0) |
| 228 | 228 | return false; |
@@ -315,7 +315,7 @@ |
||
| 315 | 315 | |
| 316 | 316 | array_walk_recursive( |
| 317 | 317 | $_POST, |
| 318 | - function (&$value, $key) use ($context, $smcFunc) |
|
| 318 | + function(&$value, $key) use ($context, $smcFunc) |
|
| 319 | 319 | { |
| 320 | 320 | // Normalize Unicode characters. (Does nothing if not in UTF-8 mode.) |
| 321 | 321 | $value = $smcFunc['normalize']($value); |
@@ -256,7 +256,7 @@ |
||
| 256 | 256 | return array(); |
| 257 | 257 | |
| 258 | 258 | // preparse code does a few things which might mess with our parsing |
| 259 | - $body = htmlspecialchars_decode(preg_replace('~<br\s*/?'.'>~', "\n", str_replace(' ', ' ', $body)), ENT_QUOTES); |
|
| 259 | + $body = htmlspecialchars_decode(preg_replace('~<br\s*/?' . '>~', "\n", str_replace(' ', ' ', $body)), ENT_QUOTES); |
|
| 260 | 260 | |
| 261 | 261 | if (empty(self::$excluded_bbc_regex)) |
| 262 | 262 | self::setExcludedBbcRegex(); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | return false; |
| 93 | 93 | }, |
| 94 | 94 | 'utf8_version' => '8.0', |
| 95 | - 'utf8_version_check' => function (){ |
|
| 95 | + 'utf8_version_check' => function() { |
|
| 96 | 96 | global $db_connection; |
| 97 | 97 | $request = pg_query($db_connection, 'SELECT version()'); |
| 98 | 98 | list ($version) = pg_fetch_row($request); |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | $incontext['continue'] = 1; |
| 988 | 988 | |
| 989 | 989 | // Check Postgres setting |
| 990 | - if ( $db_type === 'postgresql') |
|
| 990 | + if ($db_type === 'postgresql') |
|
| 991 | 991 | { |
| 992 | 992 | load_database(); |
| 993 | 993 | $result = $smcFunc['db_query']('', ' |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | 'filename' => empty($user_settings['filename']) ? '' : $user_settings['filename'], |
| 854 | 854 | 'custom_dir' => !empty($user_settings['attachment_type']) && $user_settings['attachment_type'] == 1, |
| 855 | 855 | 'id_attach' => isset($user_settings['id_attach']) ? $user_settings['id_attach'] : 0, |
| 856 | - 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width']: 0, |
|
| 856 | + 'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width'] : 0, |
|
| 857 | 857 | 'height' => isset($user_settings['attachment_height']) > 0 ? $user_settings['attachment_height'] : 0, |
| 858 | 858 | ), |
| 859 | 859 | 'smiley_set' => isset($user_settings['smiley_set']) ? $user_settings['smiley_set'] : '', |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | ); |
| 2540 | 2540 | |
| 2541 | 2541 | // Add the JQuery library to the list of files to load. |
| 2542 | - $jQueryUrls = array ('cdn' => 'https://ajax.googleapis.com/ajax/libs/jquery/'. JQUERY_VERSION . '/jquery.min.js', 'jquery_cdn' => 'https://code.jquery.com/jquery-'. JQUERY_VERSION . '.min.js', 'microsoft_cdn' => 'https://ajax.aspnetcdn.com/ajax/jQuery/jquery-'. JQUERY_VERSION . '.min.js'); |
|
| 2542 | + $jQueryUrls = array('cdn' => 'https://ajax.googleapis.com/ajax/libs/jquery/' . JQUERY_VERSION . '/jquery.min.js', 'jquery_cdn' => 'https://code.jquery.com/jquery-' . JQUERY_VERSION . '.min.js', 'microsoft_cdn' => 'https://ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js'); |
|
| 2543 | 2543 | |
| 2544 | 2544 | if (isset($modSettings['jquery_source']) && array_key_exists($modSettings['jquery_source'], $jQueryUrls)) |
| 2545 | 2545 | loadJavaScriptFile($jQueryUrls[$modSettings['jquery_source']], array('external' => true, 'seed' => false), 'smf_jquery'); |
@@ -2780,8 +2780,7 @@ discard block |
||
| 2780 | 2780 | $context['css_files_order'] = array(); |
| 2781 | 2781 | |
| 2782 | 2782 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2783 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2784 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2783 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2785 | 2784 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2786 | 2785 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2787 | 2786 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2896,8 +2895,7 @@ discard block |
||
| 2896 | 2895 | global $settings, $context, $modSettings; |
| 2897 | 2896 | |
| 2898 | 2897 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2899 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2900 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2898 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2901 | 2899 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2902 | 2900 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2903 | 2901 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -3687,8 +3685,7 @@ discard block |
||
| 3687 | 3685 | |
| 3688 | 3686 | // What accelerator we are going to try. |
| 3689 | 3687 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
| 3690 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
| 3691 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3688 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3692 | 3689 | |
| 3693 | 3690 | // Do some basic tests. |
| 3694 | 3691 | if (class_exists($fully_qualified_class_name)) |
@@ -3992,7 +3989,7 @@ discard block |
||
| 3992 | 3989 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
| 3993 | 3990 | |
| 3994 | 3991 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
| 3995 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
| 3992 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
| 3996 | 3993 | { |
| 3997 | 3994 | updateDbLastError(time()); |
| 3998 | 3995 | loadLanguage('Errors'); |
@@ -871,7 +871,7 @@ |
||
| 871 | 871 | // Intercept cookie? |
| 872 | 872 | call_integration_hook('integrate_cookie', array($name, $value, $expire, $path, $domain, $secure, $httponly, $samesite)); |
| 873 | 873 | |
| 874 | - if(PHP_VERSION_ID < 70300) |
|
| 874 | + if (PHP_VERSION_ID < 70300) |
|
| 875 | 875 | return setcookie($name, $value, $expire, $path . ';samesite=' . $samesite, $domain, $secure, $httponly); |
| 876 | 876 | else |
| 877 | 877 | return setcookie($name, $value, array( |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | ), |
| 94 | 94 | 'ignore' => array( |
| 95 | 95 | 'label' => $report['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], |
| 96 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;ignore='.(int)!$report['ignore'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'], |
|
| 96 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;ignore=' . (int) !$report['ignore'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-ignore_token_var'] . '=' . $context['mod-report-ignore_token'], |
|
| 97 | 97 | 'javascript' => !$report['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '', |
| 98 | 98 | 'class' => 'you_sure', |
| 99 | 99 | 'icon' => 'ignore' |
| 100 | 100 | ), |
| 101 | 101 | 'close' => array( |
| 102 | 102 | 'label' => $context['view_closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], |
| 103 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;closed='.(int)!$report['closed'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'], |
|
| 103 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;closed=' . (int) !$report['closed'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-closed_token_var'] . '=' . $context['mod-report-closed_token'], |
|
| 104 | 104 | 'icon' => $context['view_closed'] ? 'folder' : 'close', |
| 105 | 105 | ), |
| 106 | 106 | ); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | if ($context['report_type'] == 'posts') |
| 110 | 110 | $context['reports'][$key]['quickbuttons']['delete'] = array( |
| 111 | 111 | 'label' => $txt['mc_reportedp_delete'], |
| 112 | - 'href' => $scripturl.'?action=deletemsg;topic='.$report['topic']['id'].'.0;msg='.$report['topic']['id_msg'].';modcenter;'.$context['session_var'].'='.$context['session_id'], |
|
| 113 | - 'javascript' => 'data-confirm="'.$txt['mc_reportedp_delete_confirm'].'"', |
|
| 112 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $report['topic']['id'] . '.0;msg=' . $report['topic']['id_msg'] . ';modcenter;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 113 | + 'javascript' => 'data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '"', |
|
| 114 | 114 | 'class' => 'you_sure', |
| 115 | 115 | 'icon' => 'delete', |
| 116 | 116 | 'show' => !$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])) |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // Ban reported member/post author link |
| 120 | 120 | if ($context['report_type'] == 'members') |
| 121 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add;u='.$report['user']['id'].';'.$context['session_var'].'='.$context['session_id']; |
|
| 121 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add;u=' . $report['user']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 122 | 122 | else |
| 123 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add'.(!empty($report['author']['id']) ? ';u='.$report['author']['id'] : ';msg='.$report['topic']['id_msg']).';'.$context['session_var'].'='.$context['session_id']; |
|
| 123 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add' . (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']) . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 124 | 124 | |
| 125 | 125 | $context['reports'][$key]['quickbuttons'] += array( |
| 126 | 126 | 'ban' => array( |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ), |
| 132 | 132 | 'quickmod' => array( |
| 133 | 133 | 'class' => 'inline_mod_check', |
| 134 | - 'content' => '<input type="checkbox" name="close[]" value="'.$report['id'].'">', |
|
| 134 | + 'content' => '<input type="checkbox" name="close[]" value="' . $report['id'] . '">', |
|
| 135 | 135 | 'show' => !$context['view_closed'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
| 136 | 136 | ) |
| 137 | 137 | ); |