@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - $unnotified = array_filter($this->members['watching'], function ($member) { |
|
177 | + $unnotified = array_filter($this->members['watching'], function($member) { |
|
178 | 178 | return empty($member['sent']); |
179 | 179 | }); |
180 | 180 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->members['mentioned'] = array_intersect_key($this->members['mentioned'], $unnotified); |
188 | 188 | |
189 | 189 | // Notifications about modified posts only go to members who were mentioned or quoted |
190 | - $this->members['watching'] = $type == 'edit' ? array(): $unnotified; |
|
190 | + $this->members['watching'] = $type == 'edit' ? array() : $unnotified; |
|
191 | 191 | |
192 | 192 | // If this post has no quotes or mentions, just delete any obsolete alerts and bail out. |
193 | 193 | if (empty($this->members['quoted']) && empty($this->members['mentioned'])) |
@@ -500,8 +500,7 @@ discard block |
||
500 | 500 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($this->prefs[$member_id])) |
501 | 501 | { |
502 | 502 | $pref = !empty($this->prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
503 | - $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
504 | - (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
503 | + $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
505 | 504 | |
506 | 505 | $message_type = 'notification_' . $type; |
507 | 506 | |
@@ -520,8 +519,7 @@ discard block |
||
520 | 519 | elseif ($type == 'topic') |
521 | 520 | { |
522 | 521 | $pref = !empty($this->prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
523 | - $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
524 | - (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
522 | + $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
525 | 523 | |
526 | 524 | $content_type = 'board'; |
527 | 525 |
@@ -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 | { |
@@ -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 | } |
@@ -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 | } |
@@ -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', |
@@ -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'); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | { |
379 | 379 | $val = 'CASE '; |
380 | 380 | foreach ($members as $k => $v) |
381 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
381 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
382 | 382 | |
383 | 383 | $val = $val . ' END'; |
384 | 384 | $type = 'raw'; |
@@ -1045,11 +1045,11 @@ discard block |
||
1045 | 1045 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1046 | 1046 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1047 | 1047 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1048 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1048 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1049 | 1049 | // Unwanted trailing punctuation and whitespace. |
1050 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1050 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1051 | 1051 | // Unwanted opening punctuation and whitespace. |
1052 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1052 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1053 | 1053 | ), |
1054 | 1054 | array( |
1055 | 1055 | '', |
@@ -1447,7 +1447,7 @@ discard block |
||
1447 | 1447 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>'; |
1448 | 1448 | else |
1449 | 1449 | { |
1450 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1450 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1451 | 1451 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1452 | 1452 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1453 | 1453 | } |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1459 | 1459 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1460 | 1460 | |
1461 | - $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1461 | + $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1462 | 1462 | } |
1463 | 1463 | // Audio. |
1464 | 1464 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1467 | 1467 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1468 | 1468 | |
1469 | - $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1469 | + $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1470 | 1470 | } |
1471 | 1471 | // Anything else. |
1472 | 1472 | else |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | 'type' => 'unparsed_commas_content', |
1636 | 1636 | 'test' => '\d+,\d+\]', |
1637 | 1637 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1638 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1638 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1639 | 1639 | { |
1640 | 1640 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1641 | 1641 | if (empty($scheme)) |
@@ -1748,8 +1748,8 @@ discard block |
||
1748 | 1748 | else |
1749 | 1749 | $url = get_proxied_url($url); |
1750 | 1750 | |
1751 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
1752 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
1751 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
1752 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
1753 | 1753 | |
1754 | 1754 | $data = isset($disabled[$tag['tag']]) ? $url : '<img src="' . $url . '"' . $alt . $title . $params['{width}'] . $params['{height}'] . ' class="bbc_img' . (!empty($params['{width}']) || !empty($params['{height}']) ? ' resized' : '') . '" loading="lazy">'; |
1755 | 1755 | }, |
@@ -2166,12 +2166,12 @@ discard block |
||
2166 | 2166 | $codes[] = array( |
2167 | 2167 | 'tag' => 'cowsay', |
2168 | 2168 | 'parameters' => array( |
2169 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2169 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2170 | 2170 | { |
2171 | 2171 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2172 | 2172 | }, |
2173 | 2173 | ), |
2174 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2174 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2175 | 2175 | { |
2176 | 2176 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2177 | 2177 | }, |
@@ -3843,7 +3843,7 @@ discard block |
||
3843 | 3843 | if ($fp != false) |
3844 | 3844 | { |
3845 | 3845 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3846 | - fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3846 | + fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3847 | 3847 | |
3848 | 3848 | // Read in the HTTP/1.1 or whatever. |
3849 | 3849 | $test = substr(fgets($fp, 11), -1); |
@@ -4459,7 +4459,7 @@ discard block |
||
4459 | 4459 | |
4460 | 4460 | uasort( |
4461 | 4461 | $context['css_files'], |
4462 | - function ($a, $b) |
|
4462 | + function($a, $b) |
|
4463 | 4463 | { |
4464 | 4464 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4465 | 4465 | } |
@@ -5761,7 +5761,7 @@ discard block |
||
5761 | 5761 | { |
5762 | 5762 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5763 | 5763 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5764 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5764 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5765 | 5765 | if ($keep_alive) |
5766 | 5766 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5767 | 5767 | else |
@@ -5771,7 +5771,7 @@ discard block |
||
5771 | 5771 | { |
5772 | 5772 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5773 | 5773 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5774 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5774 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5775 | 5775 | if ($keep_alive) |
5776 | 5776 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5777 | 5777 | else |
@@ -6020,13 +6020,13 @@ discard block |
||
6020 | 6020 | |
6021 | 6021 | // UTF-8 occurences of MS special characters |
6022 | 6022 | $findchars_utf8 = array( |
6023 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
6024 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
6025 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
6026 | - "\xe2\x80\x98", // left single curly quote |
|
6027 | - "\xe2\x80\x99", // right single curly quote |
|
6028 | - "\xe2\x80\x9c", // left double curly quote |
|
6029 | - "\xe2\x80\x9d", // right double curly quote |
|
6023 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
6024 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
6025 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
6026 | + "\xe2\x80\x98", // left single curly quote |
|
6027 | + "\xe2\x80\x99", // right single curly quote |
|
6028 | + "\xe2\x80\x9c", // left double curly quote |
|
6029 | + "\xe2\x80\x9d", // right double curly quote |
|
6030 | 6030 | ); |
6031 | 6031 | |
6032 | 6032 | // windows 1252 / iso equivalents |
@@ -6042,13 +6042,13 @@ discard block |
||
6042 | 6042 | |
6043 | 6043 | // safe replacements |
6044 | 6044 | $replacechars = array( |
6045 | - ',', // ‚ |
|
6046 | - ',,', // „ |
|
6047 | - '...', // … |
|
6048 | - "'", // ‘ |
|
6049 | - "'", // ’ |
|
6050 | - '"', // “ |
|
6051 | - '"', // ” |
|
6045 | + ',', // ‚ |
|
6046 | + ',,', // „ |
|
6047 | + '...', // … |
|
6048 | + "'", // ‘ |
|
6049 | + "'", // ’ |
|
6050 | + '"', // “ |
|
6051 | + '"', // ” |
|
6052 | 6052 | ); |
6053 | 6053 | |
6054 | 6054 | if ($context['utf8']) |
@@ -6409,7 +6409,7 @@ discard block |
||
6409 | 6409 | // We don't want abbreviations like '+03' or '-11'. |
6410 | 6410 | $abbrs = array_filter( |
6411 | 6411 | $tzvalue['abbrs'], |
6412 | - function ($abbr) |
|
6412 | + function($abbr) |
|
6413 | 6413 | { |
6414 | 6414 | return !strspn($abbr, '+-'); |
6415 | 6415 | } |
@@ -7384,7 +7384,7 @@ discard block |
||
7384 | 7384 | EXISTS ( |
7385 | 7385 | SELECT bpv.id_board |
7386 | 7386 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7387 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7387 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7388 | 7388 | AND bpv.deny = 0 |
7389 | 7389 | AND bpv.id_board = b.id_board |
7390 | 7390 | )'; |
@@ -7394,7 +7394,7 @@ discard block |
||
7394 | 7394 | AND NOT EXISTS ( |
7395 | 7395 | SELECT bpv.id_board |
7396 | 7396 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7397 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7397 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7398 | 7398 | AND bpv.deny = 1 |
7399 | 7399 | AND bpv.id_board = b.id_board |
7400 | 7400 | )'; |
@@ -7703,8 +7703,8 @@ discard block |
||
7703 | 7703 | $i = 0; |
7704 | 7704 | while (empty($done)) |
7705 | 7705 | { |
7706 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7707 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7706 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7707 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7708 | 7708 | else |
7709 | 7709 | $done = true; |
7710 | 7710 | } |
@@ -7714,8 +7714,8 @@ discard block |
||
7714 | 7714 | $i = 0; |
7715 | 7715 | while (empty($done)) |
7716 | 7716 | { |
7717 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7718 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7717 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7718 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7719 | 7719 | else |
7720 | 7720 | $done = true; |
7721 | 7721 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | global $context, $scripturl, $txt, $settings, $options, $modSettings; |
278 | 278 | |
279 | 279 | echo ' |
280 | - <div class="windowbg" id="msg', $message['id'],'"> |
|
280 | + <div class="windowbg" id="msg', $message['id'], '"> |
|
281 | 281 | <div class="post_wrapper"> |
282 | 282 | <div class="poster">'; |
283 | 283 | |
@@ -1946,7 +1946,7 @@ discard block |
||
1946 | 1946 | <div class="floatright smalltext righttext"> |
1947 | 1947 | <div class="recipient_to">« <strong>', $txt['to'], ':</strong> ', implode(', ', $draft['recipients']['to']), ' »</div>'; |
1948 | 1948 | |
1949 | - if(!empty($draft['recipients']['bcc'])) |
|
1949 | + if (!empty($draft['recipients']['bcc'])) |
|
1950 | 1950 | echo' |
1951 | 1951 | <div class="pm_bbc">« <strong>', $txt['pm_bcc'], ':</strong> ', implode(', ', $draft['recipients']['bcc']), ' »</div>'; |
1952 | 1952 |