@@ -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'; |
@@ -1041,11 +1041,11 @@ discard block |
||
1041 | 1041 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1042 | 1042 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1043 | 1043 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1044 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1044 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1045 | 1045 | // Unwanted trailing punctuation and whitespace. |
1046 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1046 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1047 | 1047 | // Unwanted opening punctuation and whitespace. |
1048 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1048 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1049 | 1049 | ), |
1050 | 1050 | array( |
1051 | 1051 | '', |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>'; |
1444 | 1444 | else |
1445 | 1445 | { |
1446 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1446 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1447 | 1447 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1448 | 1448 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1449 | 1449 | } |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1455 | 1455 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1456 | 1456 | |
1457 | - $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>' : ''); |
|
1457 | + $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>' : ''); |
|
1458 | 1458 | } |
1459 | 1459 | // Audio. |
1460 | 1460 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1463 | 1463 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1464 | 1464 | |
1465 | - $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>'; |
|
1465 | + $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>'; |
|
1466 | 1466 | } |
1467 | 1467 | // Anything else. |
1468 | 1468 | else |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | 'type' => 'unparsed_commas_content', |
1632 | 1632 | 'test' => '\d+,\d+\]', |
1633 | 1633 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1634 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1634 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1635 | 1635 | { |
1636 | 1636 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1637 | 1637 | if (empty($scheme)) |
@@ -1744,8 +1744,8 @@ discard block |
||
1744 | 1744 | else |
1745 | 1745 | $url = get_proxied_url($url); |
1746 | 1746 | |
1747 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
1748 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
1747 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
1748 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
1749 | 1749 | |
1750 | 1750 | $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">'; |
1751 | 1751 | }, |
@@ -2162,12 +2162,12 @@ discard block |
||
2162 | 2162 | $codes[] = array( |
2163 | 2163 | 'tag' => 'cowsay', |
2164 | 2164 | 'parameters' => array( |
2165 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2165 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2166 | 2166 | { |
2167 | 2167 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2168 | 2168 | }, |
2169 | 2169 | ), |
2170 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2170 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2171 | 2171 | { |
2172 | 2172 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2173 | 2173 | }, |
@@ -3827,7 +3827,7 @@ discard block |
||
3827 | 3827 | if ($fp != false) |
3828 | 3828 | { |
3829 | 3829 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3830 | - 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"); |
|
3830 | + 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"); |
|
3831 | 3831 | |
3832 | 3832 | // Read in the HTTP/1.1 or whatever. |
3833 | 3833 | $test = substr(fgets($fp, 11), -1); |
@@ -4446,7 +4446,7 @@ discard block |
||
4446 | 4446 | |
4447 | 4447 | uasort( |
4448 | 4448 | $context['css_files'], |
4449 | - function ($a, $b) |
|
4449 | + function($a, $b) |
|
4450 | 4450 | { |
4451 | 4451 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4452 | 4452 | } |
@@ -5748,7 +5748,7 @@ discard block |
||
5748 | 5748 | { |
5749 | 5749 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5750 | 5750 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5751 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5751 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5752 | 5752 | if ($keep_alive) |
5753 | 5753 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5754 | 5754 | else |
@@ -5758,7 +5758,7 @@ discard block |
||
5758 | 5758 | { |
5759 | 5759 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5760 | 5760 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5761 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5761 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5762 | 5762 | if ($keep_alive) |
5763 | 5763 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5764 | 5764 | else |
@@ -6007,13 +6007,13 @@ discard block |
||
6007 | 6007 | |
6008 | 6008 | // UTF-8 occurences of MS special characters |
6009 | 6009 | $findchars_utf8 = array( |
6010 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
6011 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
6012 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
6013 | - "\xe2\x80\x98", // left single curly quote |
|
6014 | - "\xe2\x80\x99", // right single curly quote |
|
6015 | - "\xe2\x80\x9c", // left double curly quote |
|
6016 | - "\xe2\x80\x9d", // right double curly quote |
|
6010 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
6011 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
6012 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
6013 | + "\xe2\x80\x98", // left single curly quote |
|
6014 | + "\xe2\x80\x99", // right single curly quote |
|
6015 | + "\xe2\x80\x9c", // left double curly quote |
|
6016 | + "\xe2\x80\x9d", // right double curly quote |
|
6017 | 6017 | ); |
6018 | 6018 | |
6019 | 6019 | // windows 1252 / iso equivalents |
@@ -6029,13 +6029,13 @@ discard block |
||
6029 | 6029 | |
6030 | 6030 | // safe replacements |
6031 | 6031 | $replacechars = array( |
6032 | - ',', // ‚ |
|
6033 | - ',,', // „ |
|
6034 | - '...', // … |
|
6035 | - "'", // ‘ |
|
6036 | - "'", // ’ |
|
6037 | - '"', // “ |
|
6038 | - '"', // ” |
|
6032 | + ',', // ‚ |
|
6033 | + ',,', // „ |
|
6034 | + '...', // … |
|
6035 | + "'", // ‘ |
|
6036 | + "'", // ’ |
|
6037 | + '"', // “ |
|
6038 | + '"', // ” |
|
6039 | 6039 | ); |
6040 | 6040 | |
6041 | 6041 | if ($context['utf8']) |
@@ -6382,7 +6382,7 @@ discard block |
||
6382 | 6382 | // We don't want abbreviations like '+03' or '-11'. |
6383 | 6383 | $abbrs = array_filter( |
6384 | 6384 | $tzvalue['abbrs'], |
6385 | - function ($abbr) |
|
6385 | + function($abbr) |
|
6386 | 6386 | { |
6387 | 6387 | return !strspn($abbr, '+-'); |
6388 | 6388 | } |
@@ -7357,7 +7357,7 @@ discard block |
||
7357 | 7357 | EXISTS ( |
7358 | 7358 | SELECT bpv.id_board |
7359 | 7359 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7360 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7360 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7361 | 7361 | AND bpv.deny = 0 |
7362 | 7362 | AND bpv.id_board = b.id_board |
7363 | 7363 | )'; |
@@ -7367,7 +7367,7 @@ discard block |
||
7367 | 7367 | AND NOT EXISTS ( |
7368 | 7368 | SELECT bpv.id_board |
7369 | 7369 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7370 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7370 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7371 | 7371 | AND bpv.deny = 1 |
7372 | 7372 | AND bpv.id_board = b.id_board |
7373 | 7373 | )'; |
@@ -7676,8 +7676,8 @@ discard block |
||
7676 | 7676 | $i = 0; |
7677 | 7677 | while (empty($done)) |
7678 | 7678 | { |
7679 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7680 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7679 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7680 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7681 | 7681 | else |
7682 | 7682 | $done = true; |
7683 | 7683 | } |
@@ -7687,8 +7687,8 @@ discard block |
||
7687 | 7687 | $i = 0; |
7688 | 7688 | while (empty($done)) |
7689 | 7689 | { |
7690 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7691 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7690 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7691 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7692 | 7692 | else |
7693 | 7693 | $done = true; |
7694 | 7694 | } |
@@ -280,7 +280,6 @@ discard block |
||
280 | 280 | $condition = 'id_member IN ({array_int:members})'; |
281 | 281 | $parameters['members'] = $members; |
282 | 282 | } |
283 | - |
|
284 | 283 | elseif ($members === null) |
285 | 284 | $condition = '1=1'; |
286 | 285 | |
@@ -383,11 +382,9 @@ discard block |
||
383 | 382 | $val = $val . ' END'; |
384 | 383 | $type = 'raw'; |
385 | 384 | } |
386 | - |
|
387 | 385 | else |
388 | 386 | $val = alert_count($members, true); |
389 | 387 | } |
390 | - |
|
391 | 388 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
392 | 389 | { |
393 | 390 | $val = $var . ' ' . $val . ' 1'; |
@@ -2163,12 +2160,12 @@ discard block |
||
2163 | 2160 | 'tag' => 'cowsay', |
2164 | 2161 | 'parameters' => array( |
2165 | 2162 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
2166 | - { |
|
2163 | + { |
|
2167 | 2164 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2168 | 2165 | }, |
2169 | 2166 | ), |
2170 | 2167 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
2171 | - { |
|
2168 | + { |
|
2172 | 2169 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2173 | 2170 | }, |
2174 | 2171 | ), |
@@ -2497,7 +2494,8 @@ discard block |
||
2497 | 2494 | |
2498 | 2495 | foreach (array('path', 'query', 'fragment') as $part) |
2499 | 2496 | { |
2500 | - switch ($part) { |
|
2497 | + switch ($part) |
|
2498 | + { |
|
2501 | 2499 | case 'path': |
2502 | 2500 | $part_disallowed_chars = '<>' . $bracket_quote_chars . $space_chars . $excluded_trailing_chars . '/#&'; |
2503 | 2501 | $part_excluded_trailing_chars = str_replace('?', '', $excluded_trailing_chars); |
@@ -2814,7 +2812,9 @@ discard block |
||
2814 | 2812 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2815 | 2813 | |
2816 | 2814 | // A closing tag that doesn't match any open tags? Skip it. |
2817 | - if (!in_array($look_for, array_map(function($code) { return $code['tag']; }, $open_tags))) |
|
2815 | + if (!in_array($look_for, array_map(function($code) |
|
2816 | + { |
|
2817 | +return $code['tag']; }, $open_tags))) |
|
2818 | 2818 | continue; |
2819 | 2819 | |
2820 | 2820 | $to_close = array(); |
@@ -4365,7 +4365,6 @@ discard block |
||
4365 | 4365 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
4366 | 4366 | $minSeed = $js_file['options']['seed']; |
4367 | 4367 | } |
4368 | - |
|
4369 | 4368 | else |
4370 | 4369 | { |
4371 | 4370 | echo ' |
@@ -6295,7 +6294,8 @@ discard block |
||
6295 | 6294 | $zones[$tzkey]['tzid'] = $tzid; |
6296 | 6295 | $zones[$tzkey]['dst_type'] = count($tzinfo) > 1 ? 1 : ($tzinfo[0]['isdst'] ? 2 : 0); |
6297 | 6296 | |
6298 | - foreach ($tzinfo as $transition) { |
|
6297 | + foreach ($tzinfo as $transition) |
|
6298 | + { |
|
6299 | 6299 | $zones[$tzkey]['abbrs'][] = $transition['abbr']; |
6300 | 6300 | } |
6301 | 6301 | |
@@ -6785,7 +6785,6 @@ discard block |
||
6785 | 6785 | $isWritable = true; |
6786 | 6786 | break; |
6787 | 6787 | } |
6788 | - |
|
6789 | 6788 | else |
6790 | 6789 | @chmod($file, $val); |
6791 | 6790 | } |
@@ -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 |