@@ -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 | '', |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">'; |
1477 | 1477 | else |
1478 | 1478 | { |
1479 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1479 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1480 | 1480 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1481 | 1481 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1482 | 1482 | } |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1488 | 1488 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1489 | 1489 | |
1490 | - $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>' : ''); |
|
1490 | + $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>' : ''); |
|
1491 | 1491 | } |
1492 | 1492 | // Audio. |
1493 | 1493 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1495,7 +1495,7 @@ discard block |
||
1495 | 1495 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1496 | 1496 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1497 | 1497 | |
1498 | - $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>'; |
|
1498 | + $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>'; |
|
1499 | 1499 | } |
1500 | 1500 | // Anything else. |
1501 | 1501 | else |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | 'type' => 'unparsed_commas_content', |
1665 | 1665 | 'test' => '\d+,\d+\]', |
1666 | 1666 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1667 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1667 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1668 | 1668 | { |
1669 | 1669 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1670 | 1670 | if (empty($scheme)) |
@@ -1777,8 +1777,8 @@ discard block |
||
1777 | 1777 | else |
1778 | 1778 | $url = get_proxied_url($url); |
1779 | 1779 | |
1780 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
1781 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
1780 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
1781 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
1782 | 1782 | |
1783 | 1783 | $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">'; |
1784 | 1784 | }, |
@@ -2195,12 +2195,12 @@ discard block |
||
2195 | 2195 | $codes[] = array( |
2196 | 2196 | 'tag' => 'cowsay', |
2197 | 2197 | 'parameters' => array( |
2198 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2198 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2199 | 2199 | { |
2200 | 2200 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2201 | 2201 | }, |
2202 | 2202 | ), |
2203 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2203 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2204 | 2204 | { |
2205 | 2205 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2206 | 2206 | }, |
@@ -3925,7 +3925,7 @@ discard block |
||
3925 | 3925 | if ($fp != false) |
3926 | 3926 | { |
3927 | 3927 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3928 | - 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"); |
|
3928 | + 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"); |
|
3929 | 3929 | |
3930 | 3930 | // Read in the HTTP/1.1 or whatever. |
3931 | 3931 | $test = substr(fgets($fp, 11), -1); |
@@ -4521,7 +4521,7 @@ discard block |
||
4521 | 4521 | |
4522 | 4522 | uasort( |
4523 | 4523 | $context['css_files'], |
4524 | - function ($a, $b) |
|
4524 | + function($a, $b) |
|
4525 | 4525 | { |
4526 | 4526 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4527 | 4527 | } |
@@ -5820,7 +5820,7 @@ discard block |
||
5820 | 5820 | { |
5821 | 5821 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5822 | 5822 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5823 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5823 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5824 | 5824 | if ($keep_alive) |
5825 | 5825 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5826 | 5826 | else |
@@ -5830,7 +5830,7 @@ discard block |
||
5830 | 5830 | { |
5831 | 5831 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5832 | 5832 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5833 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5833 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5834 | 5834 | if ($keep_alive) |
5835 | 5835 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5836 | 5836 | else |
@@ -6079,24 +6079,24 @@ discard block |
||
6079 | 6079 | |
6080 | 6080 | // UTF-8 occurences of MS special characters |
6081 | 6081 | $findchars_utf8 = array( |
6082 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
6083 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
6084 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
6085 | - "\xe2\x80\x98", // left single curly quote |
|
6086 | - "\xe2\x80\x99", // right single curly quote |
|
6087 | - "\xe2\x80\x9c", // left double curly quote |
|
6088 | - "\xe2\x80\x9d", // right double curly quote |
|
6082 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
6083 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
6084 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
6085 | + "\xe2\x80\x98", // left single curly quote |
|
6086 | + "\xe2\x80\x99", // right single curly quote |
|
6087 | + "\xe2\x80\x9c", // left double curly quote |
|
6088 | + "\xe2\x80\x9d", // right double curly quote |
|
6089 | 6089 | ); |
6090 | 6090 | |
6091 | 6091 | // safe replacements |
6092 | 6092 | $replacechars = array( |
6093 | - ',', // ‚ |
|
6094 | - ',,', // „ |
|
6095 | - '...', // … |
|
6096 | - "'", // ‘ |
|
6097 | - "'", // ’ |
|
6098 | - '"', // “ |
|
6099 | - '"', // ” |
|
6093 | + ',', // ‚ |
|
6094 | + ',,', // „ |
|
6095 | + '...', // … |
|
6096 | + "'", // ‘ |
|
6097 | + "'", // ’ |
|
6098 | + '"', // “ |
|
6099 | + '"', // ” |
|
6100 | 6100 | ); |
6101 | 6101 | |
6102 | 6102 | $string = str_replace($findchars_utf8, $replacechars, $string); |
@@ -6439,7 +6439,7 @@ discard block |
||
6439 | 6439 | // We don't want abbreviations like '+03' or '-11'. |
6440 | 6440 | $abbrs = array_filter( |
6441 | 6441 | $tzvalue['abbrs'], |
6442 | - function ($abbr) |
|
6442 | + function($abbr) |
|
6443 | 6443 | { |
6444 | 6444 | return !strspn($abbr, '+-'); |
6445 | 6445 | } |
@@ -7428,7 +7428,7 @@ discard block |
||
7428 | 7428 | EXISTS ( |
7429 | 7429 | SELECT bpv.id_board |
7430 | 7430 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7431 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7431 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7432 | 7432 | AND bpv.deny = 0 |
7433 | 7433 | AND bpv.id_board = b.id_board |
7434 | 7434 | )'; |
@@ -7438,7 +7438,7 @@ discard block |
||
7438 | 7438 | AND NOT EXISTS ( |
7439 | 7439 | SELECT bpv.id_board |
7440 | 7440 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7441 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7441 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7442 | 7442 | AND bpv.deny = 1 |
7443 | 7443 | AND bpv.id_board = b.id_board |
7444 | 7444 | )'; |
@@ -7755,8 +7755,8 @@ discard block |
||
7755 | 7755 | $i = 0; |
7756 | 7756 | while (empty($done)) |
7757 | 7757 | { |
7758 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7759 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7758 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7759 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7760 | 7760 | else |
7761 | 7761 | $done = true; |
7762 | 7762 | } |
@@ -7766,8 +7766,8 @@ discard block |
||
7766 | 7766 | $i = 0; |
7767 | 7767 | while (empty($done)) |
7768 | 7768 | { |
7769 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7770 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7769 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7770 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7771 | 7771 | else |
7772 | 7772 | $done = true; |
7773 | 7773 | } |
@@ -7945,7 +7945,7 @@ discard block |
||
7945 | 7945 | if (empty($stringSubject)) |
7946 | 7946 | return ''; |
7947 | 7947 | |
7948 | - $translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches); |
|
7948 | + $translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches); |
|
7949 | 7949 | $toFind = array(); |
7950 | 7950 | $replaceWith = array(); |
7951 | 7951 |
@@ -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 | // Replace any kind of space with a normal space, and remove any kind of control character, then trim. |
321 | 321 | $value = $smcFunc['htmltrim'](preg_replace(array('~[\h\v]+~u', '~\p{Cc}+~'), array(' ', ''), $value)); |
@@ -616,7 +616,7 @@ |
||
616 | 616 | ); |
617 | 617 | |
618 | 618 | // Next, loop thru & fix each table |
619 | - foreach ($db_tables AS $cur_table) |
|
619 | + foreach ($db_tables as $cur_table) |
|
620 | 620 | { |
621 | 621 | $request = $smcFunc['db_query']('', ' |
622 | 622 | ALTER TABLE ' . $cur_table . ' CONVERT TO CHARACTER SET \'utf8mb4\' COLLATE \'utf8mb4_unicode_ci\'', |