@@ -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'; |
@@ -850,11 +850,11 @@ discard block |
||
850 | 850 | // Anything that isn't a specification, punctuation mark, or whitespace. |
851 | 851 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
852 | 852 | // A series of punctuation marks (except %), possibly separated by whitespace. |
853 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
853 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
854 | 854 | // Unwanted trailing punctuation and whitespace. |
855 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
855 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
856 | 856 | // Unwanted opening punctuation and whitespace. |
857 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
857 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
858 | 858 | ), |
859 | 859 | array( |
860 | 860 | '', |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | { |
1158 | 1158 | $dates[$tzid . '_' . $timestamp]['results'][$format] = preg_replace_callback( |
1159 | 1159 | '/\xEE\x84\xA0([\d_]+)(\xEE\x84(?:[\xA1-\xAF]))/', |
1160 | - function ($matches) |
|
1160 | + function($matches) |
|
1161 | 1161 | { |
1162 | 1162 | switch ($matches[2]) |
1163 | 1163 | { |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | elseif (!empty($context['character_set']) && is_callable('mb_decode_numericentity')) |
1292 | 1292 | { |
1293 | 1293 | // Get whatever the default replacement character is for this encoding. |
1294 | - $substitute = mb_decode_numericentity('�', array(0xFFFD,0xFFFD,0,0xFFFF), $context['character_set']); |
|
1294 | + $substitute = mb_decode_numericentity('�', array(0xFFFD, 0xFFFD, 0, 0xFFFF), $context['character_set']); |
|
1295 | 1295 | } |
1296 | 1296 | else |
1297 | 1297 | $substitute = '?'; |
@@ -1740,7 +1740,7 @@ discard block |
||
1740 | 1740 | |
1741 | 1741 | // parseAttachBBC will return a string ($txt key) rather than dying with a fatal_error. Up to you to decide what to do. |
1742 | 1742 | if (is_string($currentAttachment)) |
1743 | - return $data = '<span style="display:inline-block" class="errorbox">' . (!empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment) . '</span>'; |
|
1743 | + return $data = '<span style="display:inline-block" class="errorbox">' . (!empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment) . '</span>'; |
|
1744 | 1744 | |
1745 | 1745 | // We need a display mode. |
1746 | 1746 | if (empty($params['{display}'])) |
@@ -1766,7 +1766,7 @@ discard block |
||
1766 | 1766 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">'; |
1767 | 1767 | else |
1768 | 1768 | { |
1769 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1769 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1770 | 1770 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1771 | 1771 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1772 | 1772 | } |
@@ -1777,7 +1777,7 @@ discard block |
||
1777 | 1777 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1778 | 1778 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1779 | 1779 | |
1780 | - $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>' : ''); |
|
1780 | + $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>' : ''); |
|
1781 | 1781 | } |
1782 | 1782 | // Audio. |
1783 | 1783 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1786 | 1786 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1787 | 1787 | |
1788 | - $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>'; |
|
1788 | + $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>'; |
|
1789 | 1789 | } |
1790 | 1790 | // Anything else. |
1791 | 1791 | else |
@@ -1954,7 +1954,7 @@ discard block |
||
1954 | 1954 | 'type' => 'unparsed_commas_content', |
1955 | 1955 | 'test' => '\d+,\d+\]', |
1956 | 1956 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1957 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1957 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1958 | 1958 | { |
1959 | 1959 | $data[0] = normalize_iri($data[0]); |
1960 | 1960 | |
@@ -2080,8 +2080,8 @@ discard block |
||
2080 | 2080 | else |
2081 | 2081 | $url = get_proxied_url($url); |
2082 | 2082 | |
2083 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
2084 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
2083 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
2084 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
2085 | 2085 | |
2086 | 2086 | $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">'; |
2087 | 2087 | }, |
@@ -2512,12 +2512,12 @@ discard block |
||
2512 | 2512 | $codes[] = array( |
2513 | 2513 | 'tag' => 'cowsay', |
2514 | 2514 | 'parameters' => array( |
2515 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2515 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2516 | 2516 | { |
2517 | 2517 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2518 | 2518 | }, |
2519 | 2519 | ), |
2520 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2520 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2521 | 2521 | { |
2522 | 2522 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2523 | 2523 | }, |
@@ -4222,7 +4222,7 @@ discard block |
||
4222 | 4222 | if ($fp != false) |
4223 | 4223 | { |
4224 | 4224 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
4225 | - 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"); |
|
4225 | + 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"); |
|
4226 | 4226 | |
4227 | 4227 | // Read in the HTTP/1.1 or whatever. |
4228 | 4228 | $test = substr(fgets($fp, 11), -1); |
@@ -4818,7 +4818,7 @@ discard block |
||
4818 | 4818 | |
4819 | 4819 | uasort( |
4820 | 4820 | $context['css_files'], |
4821 | - function ($a, $b) |
|
4821 | + function($a, $b) |
|
4822 | 4822 | { |
4823 | 4823 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4824 | 4824 | } |
@@ -6138,7 +6138,7 @@ discard block |
||
6138 | 6138 | { |
6139 | 6139 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
6140 | 6140 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
6141 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
6141 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
6142 | 6142 | if ($keep_alive) |
6143 | 6143 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
6144 | 6144 | else |
@@ -6148,7 +6148,7 @@ discard block |
||
6148 | 6148 | { |
6149 | 6149 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
6150 | 6150 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
6151 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
6151 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
6152 | 6152 | if ($keep_alive) |
6153 | 6153 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
6154 | 6154 | else |
@@ -6397,13 +6397,13 @@ discard block |
||
6397 | 6397 | |
6398 | 6398 | // UTF-8 occurences of MS special characters |
6399 | 6399 | $findchars_utf8 = array( |
6400 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
6401 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
6402 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
6403 | - "\xe2\x80\x98", // left single curly quote |
|
6404 | - "\xe2\x80\x99", // right single curly quote |
|
6405 | - "\xe2\x80\x9c", // left double curly quote |
|
6406 | - "\xe2\x80\x9d", // right double curly quote |
|
6400 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
6401 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
6402 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
6403 | + "\xe2\x80\x98", // left single curly quote |
|
6404 | + "\xe2\x80\x99", // right single curly quote |
|
6405 | + "\xe2\x80\x9c", // left double curly quote |
|
6406 | + "\xe2\x80\x9d", // right double curly quote |
|
6407 | 6407 | ); |
6408 | 6408 | |
6409 | 6409 | // windows 1252 / iso equivalents |
@@ -6419,13 +6419,13 @@ discard block |
||
6419 | 6419 | |
6420 | 6420 | // safe replacements |
6421 | 6421 | $replacechars = array( |
6422 | - ',', // ‚ |
|
6423 | - ',,', // „ |
|
6424 | - '...', // … |
|
6425 | - "'", // ‘ |
|
6426 | - "'", // ’ |
|
6427 | - '"', // “ |
|
6428 | - '"', // ” |
|
6422 | + ',', // ‚ |
|
6423 | + ',,', // „ |
|
6424 | + '...', // … |
|
6425 | + "'", // ‘ |
|
6426 | + "'", // ’ |
|
6427 | + '"', // “ |
|
6428 | + '"', // ” |
|
6429 | 6429 | ); |
6430 | 6430 | |
6431 | 6431 | if ($context['utf8']) |
@@ -6788,7 +6788,7 @@ discard block |
||
6788 | 6788 | // We don't want abbreviations like '+03' or '-11'. |
6789 | 6789 | $abbrs = array_filter( |
6790 | 6790 | $tzvalue['abbrs'], |
6791 | - function ($abbr) |
|
6791 | + function($abbr) |
|
6792 | 6792 | { |
6793 | 6793 | return !strspn($abbr, '+-'); |
6794 | 6794 | } |
@@ -7777,7 +7777,7 @@ discard block |
||
7777 | 7777 | EXISTS ( |
7778 | 7778 | SELECT bpv.id_board |
7779 | 7779 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7780 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7780 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7781 | 7781 | AND bpv.deny = 0 |
7782 | 7782 | AND bpv.id_board = b.id_board |
7783 | 7783 | )'; |
@@ -7787,7 +7787,7 @@ discard block |
||
7787 | 7787 | AND NOT EXISTS ( |
7788 | 7788 | SELECT bpv.id_board |
7789 | 7789 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7790 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7790 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7791 | 7791 | AND bpv.deny = 1 |
7792 | 7792 | AND bpv.id_board = b.id_board |
7793 | 7793 | )'; |
@@ -8196,8 +8196,8 @@ discard block |
||
8196 | 8196 | $i = 0; |
8197 | 8197 | while (empty($done)) |
8198 | 8198 | { |
8199 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
8200 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
8199 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
8200 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
8201 | 8201 | else |
8202 | 8202 | $done = true; |
8203 | 8203 | } |
@@ -8207,8 +8207,8 @@ discard block |
||
8207 | 8207 | $i = 0; |
8208 | 8208 | while (empty($done)) |
8209 | 8209 | { |
8210 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
8211 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
8210 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
8211 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
8212 | 8212 | else |
8213 | 8213 | $done = true; |
8214 | 8214 | } |
@@ -8389,7 +8389,7 @@ discard block |
||
8389 | 8389 | if (empty($stringSubject)) |
8390 | 8390 | return ''; |
8391 | 8391 | |
8392 | - $translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches); |
|
8392 | + $translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches); |
|
8393 | 8393 | $toFind = array(); |
8394 | 8394 | $replaceWith = array(); |
8395 | 8395 |
@@ -155,8 +155,7 @@ |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // No access if you don't have permission to see this attachment. |
158 | - if |
|
159 | - ( |
|
158 | + if ( |
|
160 | 159 | // This was from SMF or a hook didn't claim it. |
161 | 160 | ( |
162 | 161 | empty($file['source']) |
@@ -181,8 +181,7 @@ |
||
181 | 181 | ) |
182 | 182 | // We are not previewing an attachment. |
183 | 183 | && !isset($_SESSION['attachments_can_preview'][$attachId]) |
184 | - ) |
|
185 | - { |
|
184 | + ) { |
|
186 | 185 | send_http_status(404, 'File Not Found'); |
187 | 186 | die('404 File Not Found'); |
188 | 187 | } |