@@ -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\'', |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | { |
| 380 | 380 | $val = 'CASE '; |
| 381 | 381 | foreach ($members as $k => $v) |
| 382 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
| 382 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
| 383 | 383 | |
| 384 | 384 | $val = $val . ' END'; |
| 385 | 385 | $type = 'raw'; |
@@ -871,11 +871,11 @@ discard block |
||
| 871 | 871 | // Anything that isn't a specification, punctuation mark, or whitespace. |
| 872 | 872 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
| 873 | 873 | // A series of punctuation marks (except %), possibly separated by whitespace. |
| 874 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 874 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 875 | 875 | // Unwanted trailing punctuation and whitespace. |
| 876 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 876 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 877 | 877 | // Unwanted opening punctuation and whitespace. |
| 878 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 878 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 879 | 879 | ), |
| 880 | 880 | array( |
| 881 | 881 | '', |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | { |
| 1179 | 1179 | $dates[$tzid . '_' . $timestamp]['results'][$format] = preg_replace_callback( |
| 1180 | 1180 | '/\xEE\x84\xA0([\d_]+)(\xEE\x84(?:[\xA1-\xAF]))/', |
| 1181 | - function ($matches) |
|
| 1181 | + function($matches) |
|
| 1182 | 1182 | { |
| 1183 | 1183 | switch ($matches[2]) |
| 1184 | 1184 | { |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | elseif (!empty($context['character_set']) && is_callable('mb_decode_numericentity')) |
| 1307 | 1307 | { |
| 1308 | 1308 | // Get whatever the default replacement character is for this encoding. |
| 1309 | - $substitute = mb_decode_numericentity('�', array(0xFFFD,0xFFFD,0,0xFFFF), $context['character_set']); |
|
| 1309 | + $substitute = mb_decode_numericentity('�', array(0xFFFD, 0xFFFD, 0, 0xFFFF), $context['character_set']); |
|
| 1310 | 1310 | } |
| 1311 | 1311 | else |
| 1312 | 1312 | $substitute = '?'; |
@@ -1777,7 +1777,7 @@ discard block |
||
| 1777 | 1777 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">'; |
| 1778 | 1778 | else |
| 1779 | 1779 | { |
| 1780 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
| 1780 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
| 1781 | 1781 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
| 1782 | 1782 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
| 1783 | 1783 | } |
@@ -1788,7 +1788,7 @@ discard block |
||
| 1788 | 1788 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
| 1789 | 1789 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
| 1790 | 1790 | |
| 1791 | - $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>' : ''); |
|
| 1791 | + $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>' : ''); |
|
| 1792 | 1792 | } |
| 1793 | 1793 | // Audio. |
| 1794 | 1794 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1796,7 +1796,7 @@ discard block |
||
| 1796 | 1796 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
| 1797 | 1797 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
| 1798 | 1798 | |
| 1799 | - $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>'; |
|
| 1799 | + $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>'; |
|
| 1800 | 1800 | } |
| 1801 | 1801 | // Anything else. |
| 1802 | 1802 | else |
@@ -1965,7 +1965,7 @@ discard block |
||
| 1965 | 1965 | 'type' => 'unparsed_commas_content', |
| 1966 | 1966 | 'test' => '\d+,\d+\]', |
| 1967 | 1967 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
| 1968 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1968 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1969 | 1969 | { |
| 1970 | 1970 | $data[0] = normalize_iri($data[0]); |
| 1971 | 1971 | |
@@ -2091,8 +2091,8 @@ discard block |
||
| 2091 | 2091 | else |
| 2092 | 2092 | $url = get_proxied_url($url); |
| 2093 | 2093 | |
| 2094 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
| 2095 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
| 2094 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
| 2095 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
| 2096 | 2096 | |
| 2097 | 2097 | $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">'; |
| 2098 | 2098 | }, |
@@ -2523,12 +2523,12 @@ discard block |
||
| 2523 | 2523 | $codes[] = array( |
| 2524 | 2524 | 'tag' => 'cowsay', |
| 2525 | 2525 | 'parameters' => array( |
| 2526 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2526 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2527 | 2527 | { |
| 2528 | 2528 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2529 | 2529 | }, |
| 2530 | 2530 | ), |
| 2531 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2531 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2532 | 2532 | { |
| 2533 | 2533 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2534 | 2534 | }, |
@@ -4233,7 +4233,7 @@ discard block |
||
| 4233 | 4233 | if ($fp != false) |
| 4234 | 4234 | { |
| 4235 | 4235 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 4236 | - 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"); |
|
| 4236 | + 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"); |
|
| 4237 | 4237 | |
| 4238 | 4238 | // Read in the HTTP/1.1 or whatever. |
| 4239 | 4239 | $test = substr(fgets($fp, 11), -1); |
@@ -4829,7 +4829,7 @@ discard block |
||
| 4829 | 4829 | |
| 4830 | 4830 | uasort( |
| 4831 | 4831 | $context['css_files'], |
| 4832 | - function ($a, $b) |
|
| 4832 | + function($a, $b) |
|
| 4833 | 4833 | { |
| 4834 | 4834 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4835 | 4835 | } |
@@ -6130,7 +6130,7 @@ discard block |
||
| 6130 | 6130 | { |
| 6131 | 6131 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 6132 | 6132 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 6133 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 6133 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 6134 | 6134 | if ($keep_alive) |
| 6135 | 6135 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 6136 | 6136 | else |
@@ -6140,7 +6140,7 @@ discard block |
||
| 6140 | 6140 | { |
| 6141 | 6141 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 6142 | 6142 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 6143 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 6143 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 6144 | 6144 | if ($keep_alive) |
| 6145 | 6145 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 6146 | 6146 | else |
@@ -6389,24 +6389,24 @@ discard block |
||
| 6389 | 6389 | |
| 6390 | 6390 | // UTF-8 occurences of MS special characters |
| 6391 | 6391 | $findchars_utf8 = array( |
| 6392 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 6393 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 6394 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 6395 | - "\xe2\x80\x98", // left single curly quote |
|
| 6396 | - "\xe2\x80\x99", // right single curly quote |
|
| 6397 | - "\xe2\x80\x9c", // left double curly quote |
|
| 6398 | - "\xe2\x80\x9d", // right double curly quote |
|
| 6392 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 6393 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 6394 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 6395 | + "\xe2\x80\x98", // left single curly quote |
|
| 6396 | + "\xe2\x80\x99", // right single curly quote |
|
| 6397 | + "\xe2\x80\x9c", // left double curly quote |
|
| 6398 | + "\xe2\x80\x9d", // right double curly quote |
|
| 6399 | 6399 | ); |
| 6400 | 6400 | |
| 6401 | 6401 | // safe replacements |
| 6402 | 6402 | $replacechars = array( |
| 6403 | - ',', // ‚ |
|
| 6404 | - ',,', // „ |
|
| 6405 | - '...', // … |
|
| 6406 | - "'", // ‘ |
|
| 6407 | - "'", // ’ |
|
| 6408 | - '"', // “ |
|
| 6409 | - '"', // ” |
|
| 6403 | + ',', // ‚ |
|
| 6404 | + ',,', // „ |
|
| 6405 | + '...', // … |
|
| 6406 | + "'", // ‘ |
|
| 6407 | + "'", // ’ |
|
| 6408 | + '"', // “ |
|
| 6409 | + '"', // ” |
|
| 6410 | 6410 | ); |
| 6411 | 6411 | |
| 6412 | 6412 | $string = str_replace($findchars_utf8, $replacechars, $string); |
@@ -6751,7 +6751,7 @@ discard block |
||
| 6751 | 6751 | // We don't want abbreviations like '+03' or '-11'. |
| 6752 | 6752 | $abbrs = array_filter( |
| 6753 | 6753 | $tzvalue['abbrs'], |
| 6754 | - function ($abbr) |
|
| 6754 | + function($abbr) |
|
| 6755 | 6755 | { |
| 6756 | 6756 | return !strspn($abbr, '+-'); |
| 6757 | 6757 | } |
@@ -7740,7 +7740,7 @@ discard block |
||
| 7740 | 7740 | EXISTS ( |
| 7741 | 7741 | SELECT bpv.id_board |
| 7742 | 7742 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 7743 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 7743 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 7744 | 7744 | AND bpv.deny = 0 |
| 7745 | 7745 | AND bpv.id_board = b.id_board |
| 7746 | 7746 | )'; |
@@ -7750,7 +7750,7 @@ discard block |
||
| 7750 | 7750 | AND NOT EXISTS ( |
| 7751 | 7751 | SELECT bpv.id_board |
| 7752 | 7752 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 7753 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 7753 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 7754 | 7754 | AND bpv.deny = 1 |
| 7755 | 7755 | AND bpv.id_board = b.id_board |
| 7756 | 7756 | )'; |
@@ -8157,8 +8157,8 @@ discard block |
||
| 8157 | 8157 | $i = 0; |
| 8158 | 8158 | while (empty($done)) |
| 8159 | 8159 | { |
| 8160 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 8161 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 8160 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 8161 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 8162 | 8162 | else |
| 8163 | 8163 | $done = true; |
| 8164 | 8164 | } |
@@ -8168,8 +8168,8 @@ discard block |
||
| 8168 | 8168 | $i = 0; |
| 8169 | 8169 | while (empty($done)) |
| 8170 | 8170 | { |
| 8171 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 8172 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 8171 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 8172 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 8173 | 8173 | else |
| 8174 | 8174 | $done = true; |
| 8175 | 8175 | } |
@@ -8347,7 +8347,7 @@ discard block |
||
| 8347 | 8347 | if (empty($stringSubject)) |
| 8348 | 8348 | return ''; |
| 8349 | 8349 | |
| 8350 | - $translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches); |
|
| 8350 | + $translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches); |
|
| 8351 | 8351 | $toFind = array(); |
| 8352 | 8352 | $replaceWith = array(); |
| 8353 | 8353 | |