|
@@ -379,7 +379,7 @@ discard block |
|
|
block discarded – undo |
|
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,12 +850,12 @@ discard block |
|
|
block discarded – undo |
|
850
|
850
|
// Anything that isn't a specification, punctuation mark, or whitespace. |
|
851
|
851
|
'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
|
852
|
852
|
// Repeated punctuation marks (except %), possibly separated by whitespace. |
|
853
|
|
- '~(?'.'>([^%\P{P}])\s*(?=\1))*~u', |
|
854
|
|
- '~([^%\P{P}])(?'.'>\1(?!$))*~u', |
|
|
853
|
+ '~(?' . '>([^%\P{P}])\s*(?=\1))*~u', |
|
|
854
|
+ '~([^%\P{P}])(?' . '>\1(?!$))*~u', |
|
855
|
855
|
// Unwanted trailing punctuation and whitespace. |
|
856
|
|
- '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
|
856
|
+ '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
857
|
857
|
// Unwanted opening punctuation and whitespace. |
|
858
|
|
- '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
|
858
|
+ '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
859
|
859
|
// Runs of horizontal whitespace. |
|
860
|
860
|
'~\s+~', |
|
861
|
861
|
), |
|
@@ -1162,7 +1162,7 @@ discard block |
|
|
block discarded – undo |
|
1162
|
1162
|
{ |
|
1163
|
1163
|
$dates[$tzid . '_' . $timestamp]['results'][$format] = preg_replace_callback( |
|
1164
|
1164
|
'/\xEE\x84\xA0([\d_]+)(\xEE\x84(?:[\xA1-\xAF]))/', |
|
1165
|
|
- function ($matches) |
|
|
1165
|
+ function($matches) |
|
1166
|
1166
|
{ |
|
1167
|
1167
|
switch ($matches[2]) |
|
1168
|
1168
|
{ |
|
@@ -1296,7 +1296,7 @@ discard block |
|
|
block discarded – undo |
|
1296
|
1296
|
elseif (!empty($context['character_set']) && is_callable('mb_decode_numericentity')) |
|
1297
|
1297
|
{ |
|
1298
|
1298
|
// Get whatever the default replacement character is for this encoding. |
|
1299
|
|
- $substitute = mb_decode_numericentity('�', array(0xFFFD,0xFFFD,0,0xFFFF), $context['character_set']); |
|
|
1299
|
+ $substitute = mb_decode_numericentity('�', array(0xFFFD, 0xFFFD, 0, 0xFFFF), $context['character_set']); |
|
1300
|
1300
|
} |
|
1301
|
1301
|
else |
|
1302
|
1302
|
$substitute = '?'; |
|
@@ -1745,7 +1745,7 @@ discard block |
|
|
block discarded – undo |
|
1745
|
1745
|
|
|
1746
|
1746
|
// parseAttachBBC will return a string ($txt key) rather than dying with a fatal_error. Up to you to decide what to do. |
|
1747
|
1747
|
if (is_string($currentAttachment)) |
|
1748
|
|
- return $data = '<span style="display:inline-block" class="errorbox">' . (!empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment) . '</span>'; |
|
|
1748
|
+ return $data = '<span style="display:inline-block" class="errorbox">' . (!empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment) . '</span>'; |
|
1749
|
1749
|
|
|
1750
|
1750
|
// We need a display mode. |
|
1751
|
1751
|
if (empty($params['{display}'])) |
|
@@ -1771,7 +1771,7 @@ discard block |
|
|
block discarded – undo |
|
1771
|
1771
|
$returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">'; |
|
1772
|
1772
|
else |
|
1773
|
1773
|
{ |
|
1774
|
|
- $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
|
1774
|
+ $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1775
|
1775
|
$height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
|
1776
|
1776
|
$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
|
1777
|
1777
|
} |
|
@@ -1782,7 +1782,7 @@ discard block |
|
|
block discarded – undo |
|
1782
|
1782
|
$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1783
|
1783
|
$height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
|
1784
|
1784
|
|
|
1785
|
|
- $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>' : ''); |
|
|
1785
|
+ $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>' : ''); |
|
1786
|
1786
|
} |
|
1787
|
1787
|
// Audio. |
|
1788
|
1788
|
elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
|
@@ -1790,7 +1790,7 @@ discard block |
|
|
block discarded – undo |
|
1790
|
1790
|
$width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
|
1791
|
1791
|
$height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
|
1792
|
1792
|
|
|
1793
|
|
- $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>'; |
|
|
1793
|
+ $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>'; |
|
1794
|
1794
|
} |
|
1795
|
1795
|
// Anything else. |
|
1796
|
1796
|
else |
|
@@ -1959,7 +1959,7 @@ discard block |
|
|
block discarded – undo |
|
1959
|
1959
|
'type' => 'unparsed_commas_content', |
|
1960
|
1960
|
'test' => '\d+,\d+\]', |
|
1961
|
1961
|
'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
|
1962
|
|
- 'validate' => function (&$tag, &$data, $disabled) |
|
|
1962
|
+ 'validate' => function(&$tag, &$data, $disabled) |
|
1963
|
1963
|
{ |
|
1964
|
1964
|
$data[0] = normalize_iri($data[0]); |
|
1965
|
1965
|
|
|
@@ -2085,8 +2085,8 @@ discard block |
|
|
block discarded – undo |
|
2085
|
2085
|
else |
|
2086
|
2086
|
$url = get_proxied_url($url); |
|
2087
|
2087
|
|
|
2088
|
|
- $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
2089
|
|
- $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
|
2088
|
+ $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
|
2089
|
+ $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
2090
|
2090
|
|
|
2091
|
2091
|
$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">'; |
|
2092
|
2092
|
}, |
|
@@ -2517,12 +2517,12 @@ discard block |
|
|
block discarded – undo |
|
2517
|
2517
|
$codes[] = array( |
|
2518
|
2518
|
'tag' => 'cowsay', |
|
2519
|
2519
|
'parameters' => array( |
|
2520
|
|
- 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
|
2520
|
+ 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2521
|
2521
|
{ |
|
2522
|
2522
|
return $smcFunc['substr']($eyes . 'oo', 0, 2); |
|
2523
|
2523
|
}, |
|
2524
|
2524
|
), |
|
2525
|
|
- 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
|
2525
|
+ 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2526
|
2526
|
{ |
|
2527
|
2527
|
return $smcFunc['substr']($tongue . ' ', 0, 2); |
|
2528
|
2528
|
}, |
|
@@ -4227,7 +4227,7 @@ discard block |
|
|
block discarded – undo |
|
4227
|
4227
|
if ($fp != false) |
|
4228
|
4228
|
{ |
|
4229
|
4229
|
// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
|
4230
|
|
- 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"); |
|
|
4230
|
+ 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"); |
|
4231
|
4231
|
|
|
4232
|
4232
|
// Read in the HTTP/1.1 or whatever. |
|
4233
|
4233
|
$test = substr(fgets($fp, 11), -1); |
|
@@ -4823,7 +4823,7 @@ discard block |
|
|
block discarded – undo |
|
4823
|
4823
|
|
|
4824
|
4824
|
uasort( |
|
4825
|
4825
|
$context['css_files'], |
|
4826
|
|
- function ($a, $b) |
|
|
4826
|
+ function($a, $b) |
|
4827
|
4827
|
{ |
|
4828
|
4828
|
return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
|
4829
|
4829
|
} |
|
@@ -6143,7 +6143,7 @@ discard block |
|
|
block discarded – undo |
|
6143
|
6143
|
{ |
|
6144
|
6144
|
fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
|
6145
|
6145
|
fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
|
6146
|
|
- fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
|
6146
|
+ fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
6147
|
6147
|
if ($keep_alive) |
|
6148
|
6148
|
fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
|
6149
|
6149
|
else |
|
@@ -6153,7 +6153,7 @@ discard block |
|
|
block discarded – undo |
|
6153
|
6153
|
{ |
|
6154
|
6154
|
fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
|
6155
|
6155
|
fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
|
6156
|
|
- fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
|
6156
|
+ fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
6157
|
6157
|
if ($keep_alive) |
|
6158
|
6158
|
fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
|
6159
|
6159
|
else |
|
@@ -6402,13 +6402,13 @@ discard block |
|
|
block discarded – undo |
|
6402
|
6402
|
|
|
6403
|
6403
|
// UTF-8 occurences of MS special characters |
|
6404
|
6404
|
$findchars_utf8 = array( |
|
6405
|
|
- "\xe2\x80\x9a", // single low-9 quotation mark |
|
6406
|
|
- "\xe2\x80\x9e", // double low-9 quotation mark |
|
6407
|
|
- "\xe2\x80\xa6", // horizontal ellipsis |
|
6408
|
|
- "\xe2\x80\x98", // left single curly quote |
|
6409
|
|
- "\xe2\x80\x99", // right single curly quote |
|
6410
|
|
- "\xe2\x80\x9c", // left double curly quote |
|
6411
|
|
- "\xe2\x80\x9d", // right double curly quote |
|
|
6405
|
+ "\xe2\x80\x9a", // single low-9 quotation mark |
|
|
6406
|
+ "\xe2\x80\x9e", // double low-9 quotation mark |
|
|
6407
|
+ "\xe2\x80\xa6", // horizontal ellipsis |
|
|
6408
|
+ "\xe2\x80\x98", // left single curly quote |
|
|
6409
|
+ "\xe2\x80\x99", // right single curly quote |
|
|
6410
|
+ "\xe2\x80\x9c", // left double curly quote |
|
|
6411
|
+ "\xe2\x80\x9d", // right double curly quote |
|
6412
|
6412
|
); |
|
6413
|
6413
|
|
|
6414
|
6414
|
// windows 1252 / iso equivalents |
|
@@ -6424,13 +6424,13 @@ discard block |
|
|
block discarded – undo |
|
6424
|
6424
|
|
|
6425
|
6425
|
// safe replacements |
|
6426
|
6426
|
$replacechars = array( |
|
6427
|
|
- ',', // ‚ |
|
6428
|
|
- ',,', // „ |
|
6429
|
|
- '...', // … |
|
6430
|
|
- "'", // ‘ |
|
6431
|
|
- "'", // ’ |
|
6432
|
|
- '"', // “ |
|
6433
|
|
- '"', // ” |
|
|
6427
|
+ ',', // ‚ |
|
|
6428
|
+ ',,', // „ |
|
|
6429
|
+ '...', // … |
|
|
6430
|
+ "'", // ‘ |
|
|
6431
|
+ "'", // ’ |
|
|
6432
|
+ '"', // “ |
|
|
6433
|
+ '"', // ” |
|
6434
|
6434
|
); |
|
6435
|
6435
|
|
|
6436
|
6436
|
if ($context['utf8']) |
|
@@ -6793,7 +6793,7 @@ discard block |
|
|
block discarded – undo |
|
6793
|
6793
|
// We don't want abbreviations like '+03' or '-11'. |
|
6794
|
6794
|
$abbrs = array_filter( |
|
6795
|
6795
|
$tzvalue['abbrs'], |
|
6796
|
|
- function ($abbr) |
|
|
6796
|
+ function($abbr) |
|
6797
|
6797
|
{ |
|
6798
|
6798
|
return !strspn($abbr, '+-'); |
|
6799
|
6799
|
} |
|
@@ -7782,7 +7782,7 @@ discard block |
|
|
block discarded – undo |
|
7782
|
7782
|
EXISTS ( |
|
7783
|
7783
|
SELECT bpv.id_board |
|
7784
|
7784
|
FROM ' . $db_prefix . 'board_permissions_view AS bpv |
|
7785
|
|
- WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
|
7785
|
+ WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7786
|
7786
|
AND bpv.deny = 0 |
|
7787
|
7787
|
AND bpv.id_board = b.id_board |
|
7788
|
7788
|
)'; |
|
@@ -7792,7 +7792,7 @@ discard block |
|
|
block discarded – undo |
|
7792
|
7792
|
AND NOT EXISTS ( |
|
7793
|
7793
|
SELECT bpv.id_board |
|
7794
|
7794
|
FROM ' . $db_prefix . 'board_permissions_view AS bpv |
|
7795
|
|
- WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
|
7795
|
+ WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7796
|
7796
|
AND bpv.deny = 1 |
|
7797
|
7797
|
AND bpv.id_board = b.id_board |
|
7798
|
7798
|
)'; |
|
@@ -8201,8 +8201,8 @@ discard block |
|
|
block discarded – undo |
|
8201
|
8201
|
$i = 0; |
|
8202
|
8202
|
while (empty($done)) |
|
8203
|
8203
|
{ |
|
8204
|
|
- if (strpos($format, '{'. --$i . '}') !== false) |
|
8205
|
|
- $replacements['{'. $i . '}'] = array_pop($list); |
|
|
8204
|
+ if (strpos($format, '{' . --$i . '}') !== false) |
|
|
8205
|
+ $replacements['{' . $i . '}'] = array_pop($list); |
|
8206
|
8206
|
else |
|
8207
|
8207
|
$done = true; |
|
8208
|
8208
|
} |
|
@@ -8212,8 +8212,8 @@ discard block |
|
|
block discarded – undo |
|
8212
|
8212
|
$i = 0; |
|
8213
|
8213
|
while (empty($done)) |
|
8214
|
8214
|
{ |
|
8215
|
|
- if (strpos($format, '{'. ++$i . '}') !== false) |
|
8216
|
|
- $replacements['{'. $i . '}'] = array_shift($list); |
|
|
8215
|
+ if (strpos($format, '{' . ++$i . '}') !== false) |
|
|
8216
|
+ $replacements['{' . $i . '}'] = array_shift($list); |
|
8217
|
8217
|
else |
|
8218
|
8218
|
$done = true; |
|
8219
|
8219
|
} |
|
@@ -8394,7 +8394,7 @@ discard block |
|
|
block discarded – undo |
|
8394
|
8394
|
if (empty($stringSubject)) |
|
8395
|
8395
|
return ''; |
|
8396
|
8396
|
|
|
8397
|
|
- $translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches); |
|
|
8397
|
+ $translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches); |
|
8398
|
8398
|
$toFind = array(); |
|
8399
|
8399
|
$replaceWith = array(); |
|
8400
|
8400
|
|