@@ -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); |
@@ -2917,7 +2917,7 @@ discard block |
||
2917 | 2917 | $string = preg_split('/(.)/su', $string, 0, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
2918 | 2918 | |
2919 | 2919 | // Replace characters with decomposed forms. |
2920 | - for ($i=0; $i < count($string); $i++) |
|
2920 | + for ($i = 0; $i < count($string); $i++) |
|
2921 | 2921 | { |
2922 | 2922 | // Hangul characters. |
2923 | 2923 | if ($string[$i] >= "\xEA\xB0\x80" && $string[$i] <= "\xED\x9E\xA3") |
@@ -2951,7 +2951,7 @@ discard block |
||
2951 | 2951 | { |
2952 | 2952 | $temp = $string[$i]; |
2953 | 2953 | $string[$i] = $string[$i - 1]; |
2954 | - $string[$i -1] = $temp; |
|
2954 | + $string[$i - 1] = $temp; |
|
2955 | 2955 | |
2956 | 2956 | // Backtrack and check again. |
2957 | 2957 | if ($i > 1) |
@@ -3262,7 +3262,7 @@ discard block |
||
3262 | 3262 | |
3263 | 3263 | Regex source is https://unicode.org/reports/tr51/#EBNF_and_Regex |
3264 | 3264 | */ |
3265 | - $string = mb_ereg_replace_callback( |
|
3265 | + $string = mb_ereg_replace_callback( |
|
3266 | 3266 | '\p{Regional_Indicator}\p{Regional_Indicator}' . |
3267 | 3267 | '|' . |
3268 | 3268 | '\p{Emoji}' . |
@@ -3283,7 +3283,7 @@ discard block |
||
3283 | 3283 | '[\x{E0020}-\x{E007E}]+\x{E007F}' . |
3284 | 3284 | ')?' . |
3285 | 3285 | ')*', |
3286 | - function ($matches) use (&$placeholders) |
|
3286 | + function($matches) use (&$placeholders) |
|
3287 | 3287 | { |
3288 | 3288 | // Skip lone ASCII characters that are not actully part of an emoji sequence. |
3289 | 3289 | // This can happen because the digits 0-9 and the '*' and '#' characters are |
@@ -3658,7 +3658,7 @@ discard block |
||
3658 | 3658 | // Do the thing. |
3659 | 3659 | $temp = @mb_ereg_replace_callback( |
3660 | 3660 | $pattern, |
3661 | - function ($matches) use ($placeholders) |
|
3661 | + function($matches) use ($placeholders) |
|
3662 | 3662 | { |
3663 | 3663 | return strtr($matches[0], $placeholders); |
3664 | 3664 | }, |
@@ -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 | '', |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | elseif (!empty($context['character_set']) && is_callable('mb_decode_numericentity')) |
1140 | 1140 | { |
1141 | 1141 | // Get whatever the default replacement character is for this encoding. |
1142 | - $substitute = mb_decode_numericentity('�', array(0xFFFD,0xFFFD,0,0xFFFF), $context['character_set']); |
|
1142 | + $substitute = mb_decode_numericentity('�', array(0xFFFD, 0xFFFD, 0, 0xFFFF), $context['character_set']); |
|
1143 | 1143 | } |
1144 | 1144 | else |
1145 | 1145 | $substitute = '?'; |
@@ -1624,7 +1624,7 @@ discard block |
||
1624 | 1624 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">'; |
1625 | 1625 | else |
1626 | 1626 | { |
1627 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1627 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1628 | 1628 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1629 | 1629 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1630 | 1630 | } |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1636 | 1636 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1637 | 1637 | |
1638 | - $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>' : ''); |
|
1638 | + $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>' : ''); |
|
1639 | 1639 | } |
1640 | 1640 | // Audio. |
1641 | 1641 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1643,7 +1643,7 @@ discard block |
||
1643 | 1643 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1644 | 1644 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1645 | 1645 | |
1646 | - $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>'; |
|
1646 | + $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>'; |
|
1647 | 1647 | } |
1648 | 1648 | // Anything else. |
1649 | 1649 | else |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | 'type' => 'unparsed_commas_content', |
1813 | 1813 | 'test' => '\d+,\d+\]', |
1814 | 1814 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1815 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1815 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1816 | 1816 | { |
1817 | 1817 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1818 | 1818 | if (empty($scheme)) |
@@ -1925,8 +1925,8 @@ discard block |
||
1925 | 1925 | else |
1926 | 1926 | $url = get_proxied_url($url); |
1927 | 1927 | |
1928 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
1929 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
1928 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
1929 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
1930 | 1930 | |
1931 | 1931 | $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">'; |
1932 | 1932 | }, |
@@ -2343,12 +2343,12 @@ discard block |
||
2343 | 2343 | $codes[] = array( |
2344 | 2344 | 'tag' => 'cowsay', |
2345 | 2345 | 'parameters' => array( |
2346 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2346 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2347 | 2347 | { |
2348 | 2348 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2349 | 2349 | }, |
2350 | 2350 | ), |
2351 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2351 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2352 | 2352 | { |
2353 | 2353 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2354 | 2354 | }, |
@@ -4073,7 +4073,7 @@ discard block |
||
4073 | 4073 | if ($fp != false) |
4074 | 4074 | { |
4075 | 4075 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
4076 | - 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"); |
|
4076 | + 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"); |
|
4077 | 4077 | |
4078 | 4078 | // Read in the HTTP/1.1 or whatever. |
4079 | 4079 | $test = substr(fgets($fp, 11), -1); |
@@ -4669,7 +4669,7 @@ discard block |
||
4669 | 4669 | |
4670 | 4670 | uasort( |
4671 | 4671 | $context['css_files'], |
4672 | - function ($a, $b) |
|
4672 | + function($a, $b) |
|
4673 | 4673 | { |
4674 | 4674 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4675 | 4675 | } |
@@ -5966,7 +5966,7 @@ discard block |
||
5966 | 5966 | { |
5967 | 5967 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5968 | 5968 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5969 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5969 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5970 | 5970 | if ($keep_alive) |
5971 | 5971 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5972 | 5972 | else |
@@ -5976,7 +5976,7 @@ discard block |
||
5976 | 5976 | { |
5977 | 5977 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5978 | 5978 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5979 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5979 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5980 | 5980 | if ($keep_alive) |
5981 | 5981 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5982 | 5982 | else |
@@ -6225,13 +6225,13 @@ discard block |
||
6225 | 6225 | |
6226 | 6226 | // UTF-8 occurences of MS special characters |
6227 | 6227 | $findchars_utf8 = array( |
6228 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
6229 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
6230 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
6231 | - "\xe2\x80\x98", // left single curly quote |
|
6232 | - "\xe2\x80\x99", // right single curly quote |
|
6233 | - "\xe2\x80\x9c", // left double curly quote |
|
6234 | - "\xe2\x80\x9d", // right double curly quote |
|
6228 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
6229 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
6230 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
6231 | + "\xe2\x80\x98", // left single curly quote |
|
6232 | + "\xe2\x80\x99", // right single curly quote |
|
6233 | + "\xe2\x80\x9c", // left double curly quote |
|
6234 | + "\xe2\x80\x9d", // right double curly quote |
|
6235 | 6235 | ); |
6236 | 6236 | |
6237 | 6237 | // windows 1252 / iso equivalents |
@@ -6247,13 +6247,13 @@ discard block |
||
6247 | 6247 | |
6248 | 6248 | // safe replacements |
6249 | 6249 | $replacechars = array( |
6250 | - ',', // ‚ |
|
6251 | - ',,', // „ |
|
6252 | - '...', // … |
|
6253 | - "'", // ‘ |
|
6254 | - "'", // ’ |
|
6255 | - '"', // “ |
|
6256 | - '"', // ” |
|
6250 | + ',', // ‚ |
|
6251 | + ',,', // „ |
|
6252 | + '...', // … |
|
6253 | + "'", // ‘ |
|
6254 | + "'", // ’ |
|
6255 | + '"', // “ |
|
6256 | + '"', // ” |
|
6257 | 6257 | ); |
6258 | 6258 | |
6259 | 6259 | if ($context['utf8']) |
@@ -6614,7 +6614,7 @@ discard block |
||
6614 | 6614 | // We don't want abbreviations like '+03' or '-11'. |
6615 | 6615 | $abbrs = array_filter( |
6616 | 6616 | $tzvalue['abbrs'], |
6617 | - function ($abbr) |
|
6617 | + function($abbr) |
|
6618 | 6618 | { |
6619 | 6619 | return !strspn($abbr, '+-'); |
6620 | 6620 | } |
@@ -7603,7 +7603,7 @@ discard block |
||
7603 | 7603 | EXISTS ( |
7604 | 7604 | SELECT bpv.id_board |
7605 | 7605 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7606 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7606 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7607 | 7607 | AND bpv.deny = 0 |
7608 | 7608 | AND bpv.id_board = b.id_board |
7609 | 7609 | )'; |
@@ -7613,7 +7613,7 @@ discard block |
||
7613 | 7613 | AND NOT EXISTS ( |
7614 | 7614 | SELECT bpv.id_board |
7615 | 7615 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7616 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7616 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7617 | 7617 | AND bpv.deny = 1 |
7618 | 7618 | AND bpv.id_board = b.id_board |
7619 | 7619 | )'; |
@@ -7930,8 +7930,8 @@ discard block |
||
7930 | 7930 | $i = 0; |
7931 | 7931 | while (empty($done)) |
7932 | 7932 | { |
7933 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7934 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7933 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7934 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7935 | 7935 | else |
7936 | 7936 | $done = true; |
7937 | 7937 | } |
@@ -7941,8 +7941,8 @@ discard block |
||
7941 | 7941 | $i = 0; |
7942 | 7942 | while (empty($done)) |
7943 | 7943 | { |
7944 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7945 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7944 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7945 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7946 | 7946 | else |
7947 | 7947 | $done = true; |
7948 | 7948 | } |
@@ -8120,7 +8120,7 @@ discard block |
||
8120 | 8120 | if (empty($stringSubject)) |
8121 | 8121 | return ''; |
8122 | 8122 | |
8123 | - $translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches); |
|
8123 | + $translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches); |
|
8124 | 8124 | $toFind = array(); |
8125 | 8125 | $replaceWith = array(); |
8126 | 8126 |