@@ -340,7 +340,7 @@ |
||
| 340 | 340 | WHERE t.id_board = {int:current_board} ' |
| 341 | 341 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
| 342 | 342 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
| 343 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
| 343 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
| 344 | 344 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
| 345 | 345 | LIMIT {int:maxindex} |
| 346 | 346 | OFFSET {int:start} '; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ); |
| 92 | 92 | foreach (array('action', 'sa', 'type', 'board', 'boards', 'c', 'u', 'limit', 'offset') as $var) |
| 93 | 93 | if (isset($_GET[$var])) |
| 94 | - $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';' ) . $var . '=' . $_GET[$var]; |
|
| 94 | + $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';') . $var . '=' . $_GET[$var]; |
|
| 95 | 95 | |
| 96 | 96 | // Handle the cases where a board, boards, or category is asked for. |
| 97 | 97 | $query_this_board = 1; |
@@ -303,17 +303,17 @@ discard block |
||
| 303 | 303 | * namespaces, which could cause it to mangle the XML horrifically |
| 304 | 304 | * during processing. |
| 305 | 305 | */ |
| 306 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/' . $subaction; |
|
| 306 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/' . $subaction; |
|
| 307 | 307 | |
| 308 | 308 | // Allow mods to add extra namespaces and tags to the feed/channel |
| 309 | 309 | $namespaces = array( |
| 310 | 310 | 'rss' => array(), |
| 311 | - 'rss2' => array('atom' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 312 | - 'atom' => array('' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 311 | + 'rss2' => array('atom' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 312 | + 'atom' => array('' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 313 | 313 | 'rdf' => array( |
| 314 | - '' => 'htt'.'p:/'.'/purl.o'.'rg/rss/1.0/', |
|
| 315 | - 'rdf' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/02/22-rdf-syntax-ns#', |
|
| 316 | - 'dc' => 'htt'.'p:/'.'/purl.o'.'rg/dc/elements/1.1/', |
|
| 314 | + '' => 'htt' . 'p:/' . '/purl.o' . 'rg/rss/1.0/', |
|
| 315 | + 'rdf' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/02/22-rdf-syntax-ns#', |
|
| 316 | + 'dc' => 'htt' . 'p:/' . '/purl.o' . 'rg/dc/elements/1.1/', |
|
| 317 | 317 | ), |
| 318 | 318 | 'smf' => array( |
| 319 | 319 | 'smf' => $smf_ns, |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | m.id_msg, m.id_topic, m.id_board, m.id_member, m.poster_email, m.poster_ip, |
| 2128 | 2128 | m.poster_time, m.subject, m.modified_time, m.modified_name, m.modified_reason, m.body, |
| 2129 | 2129 | m.likes, m.approved, m.smileys_enabled |
| 2130 | - FROM {db_prefix}messages AS m' . ($modSettings['postmod_active'] && !$show_all ?' |
|
| 2130 | + FROM {db_prefix}messages AS m' . ($modSettings['postmod_active'] && !$show_all ? ' |
|
| 2131 | 2131 | INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)' : '') . ' |
| 2132 | 2132 | WHERE m.id_member = {int:uid} |
| 2133 | 2133 | AND m.id_msg > {int:start_after} |
@@ -2202,7 +2202,7 @@ |
||
| 2202 | 2202 | function($a, $b) |
| 2203 | 2203 | { |
| 2204 | 2204 | if ($a['filesize'] == $b['filesize']) |
| 2205 | - return 0; |
|
| 2205 | + return 0; |
|
| 2206 | 2206 | |
| 2207 | 2207 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
| 2208 | 2208 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $feed_meta = array( |
| 205 | 205 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 206 | 206 | 'desc' => sentence_list(array_map( |
| 207 | - function ($datatype) use ($txt) |
|
| 207 | + function($datatype) use ($txt) |
|
| 208 | 208 | { |
| 209 | 209 | return $txt[$datatype]; |
| 210 | 210 | }, |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
| 727 | 727 | ), |
| 728 | 728 | $returnContext |
| 729 | - ) . $hidden_orig_link . '</span>' ; |
|
| 729 | + ) . $hidden_orig_link . '</span>'; |
|
| 730 | 730 | } |
| 731 | 731 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
| 732 | 732 | { |
@@ -1277,7 +1277,7 @@ |
||
| 1277 | 1277 | if ($context['can_post_attachment']) |
| 1278 | 1278 | { |
| 1279 | 1279 | $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map( |
| 1280 | - function ($val) use ($smcFunc) |
|
| 1280 | + function($val) use ($smcFunc) |
|
| 1281 | 1281 | { |
| 1282 | 1282 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
| 1283 | 1283 | }, |
@@ -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 | } |
@@ -1716,7 +1716,7 @@ |
||
| 1716 | 1716 | { |
| 1717 | 1717 | usort( |
| 1718 | 1718 | $fallbacks[$tzid], |
| 1719 | - function ($a, $b) |
|
| 1719 | + function($a, $b) |
|
| 1720 | 1720 | { |
| 1721 | 1721 | return $a['ts'] > $b['ts']; |
| 1722 | 1722 | } |
@@ -1840,7 +1840,7 @@ |
||
| 1840 | 1840 | // Make sure this is an array of integers |
| 1841 | 1841 | $excluded_groups = array_filter( |
| 1842 | 1842 | (array) $excluded_groups, |
| 1843 | - function ($v) |
|
| 1843 | + function($v) |
|
| 1844 | 1844 | { |
| 1845 | 1845 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
| 1846 | 1846 | } |
@@ -758,7 +758,7 @@ |
||
| 758 | 758 | // Filter out any redundant separators before we start the loop |
| 759 | 759 | $context['config_vars'] = array_filter( |
| 760 | 760 | $context['config_vars'], |
| 761 | - function ($v) use ($context) |
|
| 761 | + function($v) use ($context) |
|
| 762 | 762 | { |
| 763 | 763 | static $config_vars, $prev; |
| 764 | 764 | |
@@ -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'] : '', |
@@ -2471,7 +2471,7 @@ discard block |
||
| 2471 | 2471 | ); |
| 2472 | 2472 | |
| 2473 | 2473 | // Add the JQuery library to the list of files to load. |
| 2474 | - $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'); |
|
| 2474 | + $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'); |
|
| 2475 | 2475 | |
| 2476 | 2476 | if (isset($modSettings['jquery_source']) && array_key_exists($modSettings['jquery_source'], $jQueryUrls)) |
| 2477 | 2477 | loadJavaScriptFile($jQueryUrls[$modSettings['jquery_source']], array('external' => true, 'seed' => false), 'smf_jquery'); |
@@ -2712,8 +2712,7 @@ discard block |
||
| 2712 | 2712 | $context['css_files_order'] = array(); |
| 2713 | 2713 | |
| 2714 | 2714 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2715 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2716 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2715 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2717 | 2716 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2718 | 2717 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2719 | 2718 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2828,8 +2827,7 @@ discard block |
||
| 2828 | 2827 | global $settings, $context, $modSettings; |
| 2829 | 2828 | |
| 2830 | 2829 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2831 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2832 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2830 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2833 | 2831 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2834 | 2832 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2835 | 2833 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -2934,7 +2932,7 @@ discard block |
||
| 2934 | 2932 | $elements[] = JavaScriptEscape($element); |
| 2935 | 2933 | } |
| 2936 | 2934 | |
| 2937 | - $value = '[' . implode(', ',$elements) . ']'; |
|
| 2935 | + $value = '[' . implode(', ', $elements) . ']'; |
|
| 2938 | 2936 | } |
| 2939 | 2937 | } |
| 2940 | 2938 | |
@@ -3615,8 +3613,7 @@ discard block |
||
| 3615 | 3613 | |
| 3616 | 3614 | // What accelerator we are going to try. |
| 3617 | 3615 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
| 3618 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
| 3619 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3616 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3620 | 3617 | |
| 3621 | 3618 | // Do some basic tests. |
| 3622 | 3619 | if (class_exists($fully_qualified_class_name)) |
@@ -3920,7 +3917,7 @@ discard block |
||
| 3920 | 3917 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
| 3921 | 3918 | |
| 3922 | 3919 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
| 3923 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
| 3920 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
| 3924 | 3921 | { |
| 3925 | 3922 | updateDbLastError(time()); |
| 3926 | 3923 | loadLanguage('Errors'); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // Set a list of common functions. |
| 108 | 108 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 109 | 109 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 110 | - { |
|
| 110 | + { |
|
| 111 | 111 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', (string) $string); |
| 112 | 112 | return $string; |
| 113 | 113 | } : function($string) |
@@ -2422,7 +2422,6 @@ discard block |
||
| 2422 | 2422 | loadLanguage('index+Modifications'); |
| 2423 | 2423 | $context['template_layers'] = array(); |
| 2424 | 2424 | } |
| 2425 | - |
|
| 2426 | 2425 | else |
| 2427 | 2426 | { |
| 2428 | 2427 | // Custom templates to load, or just default? |