@@ -330,7 +330,7 @@ |
||
330 | 330 | WHERE t.id_board = {int:current_board} ' |
331 | 331 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
332 | 332 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
333 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
333 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
334 | 334 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
335 | 335 | LIMIT {int:maxindex} |
336 | 336 | OFFSET {int:start} '; |
@@ -756,7 +756,7 @@ |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | // Filter out any redundant separators before we start the loop |
759 | - $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
|
759 | + $context['config_vars'] = array_filter($context['config_vars'], function($v) use ($context) |
|
760 | 760 | { |
761 | 761 | static $config_vars, $prev; |
762 | 762 |
@@ -574,7 +574,7 @@ |
||
574 | 574 | $value['id'] = $key; |
575 | 575 | |
576 | 576 | $button = ' |
577 | - <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>'; |
|
577 | + <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . (!empty($value['icon']) ? '<span class="main_icons ' . $value['icon'] . '"></span>' : '') . '' . $txt[$value['text']] . '</a>'; |
|
578 | 578 | |
579 | 579 | if (!empty($value['sub_buttons'])) |
580 | 580 | { |
@@ -1931,7 +1931,7 @@ |
||
1931 | 1931 | <div class="floatright smalltext righttext"> |
1932 | 1932 | <div class="recipient_to">« <strong>', $txt['to'], ':</strong> ', implode(', ', $draft['recipients']['to']), ' »</div>'; |
1933 | 1933 | |
1934 | - if(!empty($draft['recipients']['bcc'])) |
|
1934 | + if (!empty($draft['recipients']['bcc'])) |
|
1935 | 1935 | echo' |
1936 | 1936 | <div class="pm_bbc">« <strong>', $txt['pm_bcc'], ':</strong> ', implode(', ', $draft['recipients']['bcc']), ' »</div>'; |
1937 | 1937 |
@@ -1241,7 +1241,7 @@ |
||
1241 | 1241 | // File Upload. |
1242 | 1242 | if ($context['can_post_attachment']) |
1243 | 1243 | { |
1244 | - $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function ($val) use ($smcFunc) |
|
1244 | + $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function($val) use ($smcFunc) |
|
1245 | 1245 | { |
1246 | 1246 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
1247 | 1247 | }, explode(',', $context['allowed_extensions']))); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | { |
405 | 405 | $val = 'CASE '; |
406 | 406 | foreach ($members as $k => $v) |
407 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
407 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
408 | 408 | |
409 | 409 | $val = $val . ' END'; |
410 | 410 | $type = 'raw'; |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1069 | 1069 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1070 | 1070 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1071 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1071 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1072 | 1072 | // Unwanted trailing punctuation and whitespace. |
1073 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1073 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1074 | 1074 | // Unwanted opening punctuation and whitespace. |
1075 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1075 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1076 | 1076 | ), |
1077 | 1077 | array( |
1078 | 1078 | '', |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
1480 | 1480 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
1481 | 1481 | |
1482 | - $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1482 | + $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1483 | 1483 | } |
1484 | 1484 | // Audio. |
1485 | 1485 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
1488 | 1488 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
1489 | 1489 | |
1490 | - $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>'; |
|
1490 | + $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>'; |
|
1491 | 1491 | } |
1492 | 1492 | // Anything else. |
1493 | 1493 | else |
@@ -1650,7 +1650,7 @@ discard block |
||
1650 | 1650 | 'type' => 'unparsed_commas_content', |
1651 | 1651 | 'test' => '\d+,\d+\]', |
1652 | 1652 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1653 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1653 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1654 | 1654 | { |
1655 | 1655 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1656 | 1656 | if (empty($scheme)) |
@@ -2188,7 +2188,7 @@ discard block |
||
2188 | 2188 | $codes[] = array( |
2189 | 2189 | 'tag' => 'cowsay', |
2190 | 2190 | 'parameters' => array( |
2191 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2191 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2192 | 2192 | { |
2193 | 2193 | static $css_added; |
2194 | 2194 | |
@@ -2205,7 +2205,7 @@ discard block |
||
2205 | 2205 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2206 | 2206 | }, |
2207 | 2207 | ), |
2208 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2208 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2209 | 2209 | { |
2210 | 2210 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2211 | 2211 | }, |
@@ -3577,7 +3577,7 @@ discard block |
||
3577 | 3577 | if ($fp != false) |
3578 | 3578 | { |
3579 | 3579 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3580 | - 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"); |
|
3580 | + 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"); |
|
3581 | 3581 | |
3582 | 3582 | // Read in the HTTP/1.1 or whatever. |
3583 | 3583 | $test = substr(fgets($fp, 11), -1); |
@@ -4178,7 +4178,7 @@ discard block |
||
4178 | 4178 | $toMinify = array(); |
4179 | 4179 | $normal = array(); |
4180 | 4180 | |
4181 | - usort($context['css_files'], function ($a, $b) |
|
4181 | + usort($context['css_files'], function($a, $b) |
|
4182 | 4182 | { |
4183 | 4183 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4184 | 4184 | }); |
@@ -5477,7 +5477,7 @@ discard block |
||
5477 | 5477 | { |
5478 | 5478 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5479 | 5479 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5480 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5480 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5481 | 5481 | if ($keep_alive) |
5482 | 5482 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5483 | 5483 | else |
@@ -5487,7 +5487,7 @@ discard block |
||
5487 | 5487 | { |
5488 | 5488 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5489 | 5489 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5490 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5490 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5491 | 5491 | if ($keep_alive) |
5492 | 5492 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5493 | 5493 | else |
@@ -5643,13 +5643,13 @@ discard block |
||
5643 | 5643 | |
5644 | 5644 | // UTF-8 occurences of MS special characters |
5645 | 5645 | $findchars_utf8 = array( |
5646 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
5647 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
5648 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
5649 | - "\xe2\x80\x98", // left single curly quote |
|
5650 | - "\xe2\x80\x99", // right single curly quote |
|
5651 | - "\xe2\x80\x9c", // left double curly quote |
|
5652 | - "\xe2\x80\x9d", // right double curly quote |
|
5646 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
5647 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
5648 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
5649 | + "\xe2\x80\x98", // left single curly quote |
|
5650 | + "\xe2\x80\x99", // right single curly quote |
|
5651 | + "\xe2\x80\x9c", // left double curly quote |
|
5652 | + "\xe2\x80\x9d", // right double curly quote |
|
5653 | 5653 | ); |
5654 | 5654 | |
5655 | 5655 | // windows 1252 / iso equivalents |
@@ -5665,13 +5665,13 @@ discard block |
||
5665 | 5665 | |
5666 | 5666 | // safe replacements |
5667 | 5667 | $replacechars = array( |
5668 | - ',', // ‚ |
|
5669 | - ',,', // „ |
|
5670 | - '...', // … |
|
5671 | - "'", // ‘ |
|
5672 | - "'", // ’ |
|
5673 | - '"', // “ |
|
5674 | - '"', // ” |
|
5668 | + ',', // ‚ |
|
5669 | + ',,', // „ |
|
5670 | + '...', // … |
|
5671 | + "'", // ‘ |
|
5672 | + "'", // ’ |
|
5673 | + '"', // “ |
|
5674 | + '"', // ” |
|
5675 | 5675 | ); |
5676 | 5676 | |
5677 | 5677 | if ($context['utf8']) |
@@ -6844,7 +6844,7 @@ discard block |
||
6844 | 6844 | EXISTS ( |
6845 | 6845 | SELECT bpv.id_board |
6846 | 6846 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
6847 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
6847 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
6848 | 6848 | AND bpv.deny = 0 |
6849 | 6849 | AND bpv.id_board = b.id_board |
6850 | 6850 | )'; |
@@ -6854,7 +6854,7 @@ discard block |
||
6854 | 6854 | AND NOT EXISTS ( |
6855 | 6855 | SELECT bpv.id_board |
6856 | 6856 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
6857 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
6857 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
6858 | 6858 | AND bpv.deny = 1 |
6859 | 6859 | AND bpv.id_board = b.id_board |
6860 | 6860 | )'; |
@@ -7125,8 +7125,8 @@ discard block |
||
7125 | 7125 | $i = 0; |
7126 | 7126 | while (empty($done)) |
7127 | 7127 | { |
7128 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7129 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7128 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7129 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7130 | 7130 | else |
7131 | 7131 | $done = true; |
7132 | 7132 | } |
@@ -7136,8 +7136,8 @@ discard block |
||
7136 | 7136 | $i = 0; |
7137 | 7137 | while (empty($done)) |
7138 | 7138 | { |
7139 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7140 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7139 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7140 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7141 | 7141 | else |
7142 | 7142 | $done = true; |
7143 | 7143 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | display_db_error(); |
74 | 74 | |
75 | 75 | // We need to escape ' and \ |
76 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
76 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
77 | 77 | |
78 | 78 | if (!empty($db_options['persist'])) |
79 | 79 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
926 | 926 | $error_array[2] = null; |
927 | 927 | |
928 | - if(empty($db_persist)) |
|
928 | + if (empty($db_persist)) |
|
929 | 929 | { // without pooling |
930 | 930 | if (empty($pg_error_data_prep)) |
931 | 931 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -1683,7 +1683,7 @@ discard block |
||
1683 | 1683 | // Prevents warnings about constants that are already defined. |
1684 | 1684 | $settingsText = preg_replace_callback( |
1685 | 1685 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
1686 | - function ($matches) |
|
1686 | + function($matches) |
|
1687 | 1687 | { |
1688 | 1688 | return 'define(\'' . md5(mt_rand()) . '\''; |
1689 | 1689 | }, |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
1694 | 1694 | try |
1695 | 1695 | { |
1696 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
1696 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
1697 | 1697 | throw new ErrorException('eval error'); |
1698 | 1698 | |
1699 | 1699 | unset($mtime, $settingsFile, $settingsText); |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | } |
1901 | 1901 | |
1902 | 1902 | // Everything is simpler if we convert heredocs to normal strings first. |
1903 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
1903 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
1904 | 1904 | { |
1905 | 1905 | foreach ($matches[0] as $mkey => $heredoc) |
1906 | 1906 | { |
@@ -1914,7 +1914,7 @@ discard block |
||
1914 | 1914 | } |
1915 | 1915 | |
1916 | 1916 | // Split before everything that could possibly delimit a comment or a string. |
1917 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
1917 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
1918 | 1918 | |
1919 | 1919 | $in_string = 0; |
1920 | 1920 | $in_comment = 0; |
@@ -282,7 +282,7 @@ |
||
282 | 282 | '{db_prefix}log_notify', |
283 | 283 | array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'), |
284 | 284 | array($user_info['id'], $log['id_topic'], 0), |
285 | - array('id_member','id_topic', 'id_board') |
|
285 | + array('id_member', 'id_topic', 'id_board') |
|
286 | 286 | ); |
287 | 287 | } |
288 | 288 | else |