@@ -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}', |
@@ -1396,7 +1396,9 @@ |
||
1396 | 1396 | |
1397 | 1397 | // Figure out the filename we'll tell the browser. |
1398 | 1398 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
1399 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
1399 | + $included_desc = array_map(function ($datatype) use ($txt) |
|
1400 | + { |
|
1401 | +return $txt[$datatype]; }, $datatypes); |
|
1400 | 1402 | |
1401 | 1403 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
1402 | 1404 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | // Figure out the filename we'll tell the browser. |
461 | 461 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
462 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
462 | + $included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
463 | 463 | |
464 | 464 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
465 | 465 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -774,9 +774,9 @@ discard block |
||
774 | 774 | $xslt_variables = array(); |
775 | 775 | |
776 | 776 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
777 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
778 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
779 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
777 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
778 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
779 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
780 | 780 | |
781 | 781 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
782 | 782 | |
@@ -1682,14 +1682,14 @@ discard block |
||
1682 | 1682 | |
1683 | 1683 | if (!empty($context['export_css_header'])) |
1684 | 1684 | { |
1685 | - $stylesheet['css_js'] .= ' |
|
1685 | + $stylesheet['css_js'] .= ' |
|
1686 | 1686 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
1687 | 1687 | </style>'; |
1688 | 1688 | } |
1689 | 1689 | |
1690 | 1690 | if (!empty($context['export_javascript_vars'])) |
1691 | 1691 | { |
1692 | - $stylesheet['css_js'] .= ' |
|
1692 | + $stylesheet['css_js'] .= ' |
|
1693 | 1693 | <script><![CDATA['; |
1694 | 1694 | |
1695 | 1695 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | |
1726 | 1726 | if (!empty($context['export_javascript_inline']['standard'])) |
1727 | 1727 | { |
1728 | - $stylesheet['css_js'] .= ' |
|
1728 | + $stylesheet['css_js'] .= ' |
|
1729 | 1729 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
1730 | 1730 | </script>'; |
1731 | 1731 | } |
@@ -1737,7 +1737,7 @@ discard block |
||
1737 | 1737 | |
1738 | 1738 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
1739 | 1739 | |
1740 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
1740 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
1741 | 1741 | </script>'; |
1742 | 1742 | } |
1743 | 1743 | |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | $css_to_minify = array(); |
1819 | 1819 | $normal_css_files = array(); |
1820 | 1820 | |
1821 | - usort($context['css_files'], function ($a, $b) |
|
1821 | + usort($context['css_files'], function($a, $b) |
|
1822 | 1822 | { |
1823 | 1823 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
1824 | 1824 | }); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | $feed_meta = array( |
154 | 154 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
155 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
155 | + 'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
156 | 156 | 'author' => $mbname, |
157 | 157 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
158 | 158 | 'self' => '', // Unused, but can't be null. |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
641 | 641 | ), |
642 | 642 | $returnContext |
643 | - ) . $hidden_orig_link . '</span>' ; |
|
643 | + ) . $hidden_orig_link . '</span>'; |
|
644 | 644 | } |
645 | 645 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
646 | 646 | { |
@@ -152,7 +152,9 @@ |
||
152 | 152 | |
153 | 153 | $feed_meta = array( |
154 | 154 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
155 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
155 | + 'desc' => sentence_list(array_map(function ($datatype) use ($txt) |
|
156 | + { |
|
157 | +return $txt[$datatype]; }, array_keys($included))), |
|
156 | 158 | 'author' => $mbname, |
157 | 159 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
158 | 160 | 'self' => '', // Unused, but can't be null. |
@@ -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 | ), |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $class_name = $this->getImplementationClassKeyName(); |
185 | 185 | $class_name_txt_key = strtolower($class_name); |
186 | 186 | |
187 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
187 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
188 | 188 | $config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir'); |
189 | 189 | |
190 | 190 | if (!isset($context['settings_post_javascript'])) |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $context['settings_post_javascript'] .= ' |
194 | 194 | $("#cache_accelerator").change(function (e) { |
195 | 195 | var cache_type = e.currentTarget.value; |
196 | - $("#cachedir").prop("disabled", cache_type != "'. $class_name .'"); |
|
196 | + $("#cachedir").prop("disabled", cache_type != "'. $class_name . '"); |
|
197 | 197 | });'; |
198 | 198 | } |
199 | 199 |
@@ -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; |
@@ -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? |
@@ -2718,8 +2718,7 @@ discard block |
||
2718 | 2718 | $context['css_files_order'] = array(); |
2719 | 2719 | |
2720 | 2720 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2721 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2722 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2721 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2723 | 2722 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2724 | 2723 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2725 | 2724 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2833,8 +2832,7 @@ discard block |
||
2833 | 2832 | global $settings, $context, $modSettings; |
2834 | 2833 | |
2835 | 2834 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2836 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2837 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2835 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2838 | 2836 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2839 | 2837 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2840 | 2838 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -3577,8 +3575,7 @@ discard block |
||
3577 | 3575 | |
3578 | 3576 | // What accelerator we are going to try. |
3579 | 3577 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
3580 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
3581 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
3578 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
3582 | 3579 | |
3583 | 3580 | // Do some basic tests. |
3584 | 3581 | if (class_exists($fully_qualified_class_name)) |
@@ -3882,7 +3879,7 @@ discard block |
||
3882 | 3879 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
3883 | 3880 | |
3884 | 3881 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
3885 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
3882 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
3886 | 3883 | { |
3887 | 3884 | updateDbLastError(time()); |
3888 | 3885 | loadLanguage('Errors'); |