@@ -372,7 +372,7 @@ |
||
| 372 | 372 | // And a bit more for database changes. |
| 373 | 373 | if ($context['uninstalling'] && !empty($context['database_changes'])) |
| 374 | 374 | echo ' |
| 375 | - makeToggle(document.getElementById(\'db_changes_div\'), ', JavaScriptEscape($txt['package_db_uninstall_details']) , ');'; |
|
| 375 | + makeToggle(document.getElementById(\'db_changes_div\'), ', JavaScriptEscape($txt['package_db_uninstall_details']), ');'; |
|
| 376 | 376 | |
| 377 | 377 | echo ' |
| 378 | 378 | </script>'; |
@@ -1155,7 +1155,7 @@ |
||
| 1155 | 1155 | // We're really just checking for entries which are create table AND add columns (etc). |
| 1156 | 1156 | $tables = array(); |
| 1157 | 1157 | |
| 1158 | - usort($db_package_log, function ($a, $b) |
|
| 1158 | + usort($db_package_log, function($a, $b) |
|
| 1159 | 1159 | { |
| 1160 | 1160 | if ($a[0] == $b[0]) |
| 1161 | 1161 | return 0; |
@@ -964,7 +964,7 @@ |
||
| 964 | 964 | $incontext['continue'] = 1; |
| 965 | 965 | |
| 966 | 966 | // Check Postgres setting |
| 967 | - if ( $db_type === 'postgresql') |
|
| 967 | + if ($db_type === 'postgresql') |
|
| 968 | 968 | { |
| 969 | 969 | load_database(); |
| 970 | 970 | $result = $smcFunc['db_query']('', ' |
@@ -1259,7 +1259,7 @@ |
||
| 1259 | 1259 | // File Upload. |
| 1260 | 1260 | if ($context['can_post_attachment']) |
| 1261 | 1261 | { |
| 1262 | - $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function ($val) use ($smcFunc) |
|
| 1262 | + $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function($val) use ($smcFunc) |
|
| 1263 | 1263 | { |
| 1264 | 1264 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
| 1265 | 1265 | }, explode(',', $context['allowed_extensions']))); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | $val = 'CASE '; |
| 379 | 379 | foreach ($members as $k => $v) |
| 380 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
| 380 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
| 381 | 381 | |
| 382 | 382 | $val = $val . ' END'; |
| 383 | 383 | $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 | '', |
@@ -1452,7 +1452,7 @@ discard block |
||
| 1452 | 1452 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
| 1453 | 1453 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
| 1454 | 1454 | |
| 1455 | - $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1455 | + $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1456 | 1456 | } |
| 1457 | 1457 | // Audio. |
| 1458 | 1458 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
| 1461 | 1461 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
| 1462 | 1462 | |
| 1463 | - $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>'; |
|
| 1463 | + $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>'; |
|
| 1464 | 1464 | } |
| 1465 | 1465 | // Anything else. |
| 1466 | 1466 | else |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | 'type' => 'unparsed_commas_content', |
| 1624 | 1624 | 'test' => '\d+,\d+\]', |
| 1625 | 1625 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
| 1626 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1626 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1627 | 1627 | { |
| 1628 | 1628 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
| 1629 | 1629 | if (empty($scheme)) |
@@ -2161,7 +2161,7 @@ discard block |
||
| 2161 | 2161 | $codes[] = array( |
| 2162 | 2162 | 'tag' => 'cowsay', |
| 2163 | 2163 | 'parameters' => array( |
| 2164 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2164 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2165 | 2165 | { |
| 2166 | 2166 | static $css_added; |
| 2167 | 2167 | |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2179 | 2179 | }, |
| 2180 | 2180 | ), |
| 2181 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2181 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2182 | 2182 | { |
| 2183 | 2183 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2184 | 2184 | }, |
@@ -3550,7 +3550,7 @@ discard block |
||
| 3550 | 3550 | if ($fp != false) |
| 3551 | 3551 | { |
| 3552 | 3552 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 3553 | - 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"); |
|
| 3553 | + 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"); |
|
| 3554 | 3554 | |
| 3555 | 3555 | // Read in the HTTP/1.1 or whatever. |
| 3556 | 3556 | $test = substr(fgets($fp, 11), -1); |
@@ -4151,7 +4151,7 @@ discard block |
||
| 4151 | 4151 | $toMinify = array(); |
| 4152 | 4152 | $normal = array(); |
| 4153 | 4153 | |
| 4154 | - usort($context['css_files'], function ($a, $b) |
|
| 4154 | + usort($context['css_files'], function($a, $b) |
|
| 4155 | 4155 | { |
| 4156 | 4156 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4157 | 4157 | }); |
@@ -5443,7 +5443,7 @@ discard block |
||
| 5443 | 5443 | { |
| 5444 | 5444 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 5445 | 5445 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5446 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5446 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5447 | 5447 | if ($keep_alive) |
| 5448 | 5448 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 5449 | 5449 | else |
@@ -5453,7 +5453,7 @@ discard block |
||
| 5453 | 5453 | { |
| 5454 | 5454 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 5455 | 5455 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5456 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5456 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5457 | 5457 | if ($keep_alive) |
| 5458 | 5458 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 5459 | 5459 | else |
@@ -5609,13 +5609,13 @@ discard block |
||
| 5609 | 5609 | |
| 5610 | 5610 | // UTF-8 occurences of MS special characters |
| 5611 | 5611 | $findchars_utf8 = array( |
| 5612 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5613 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5614 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5615 | - "\xe2\x80\x98", // left single curly quote |
|
| 5616 | - "\xe2\x80\x99", // right single curly quote |
|
| 5617 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5618 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5612 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5613 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5614 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5615 | + "\xe2\x80\x98", // left single curly quote |
|
| 5616 | + "\xe2\x80\x99", // right single curly quote |
|
| 5617 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5618 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5619 | 5619 | ); |
| 5620 | 5620 | |
| 5621 | 5621 | // windows 1252 / iso equivalents |
@@ -5631,13 +5631,13 @@ discard block |
||
| 5631 | 5631 | |
| 5632 | 5632 | // safe replacements |
| 5633 | 5633 | $replacechars = array( |
| 5634 | - ',', // ‚ |
|
| 5635 | - ',,', // „ |
|
| 5636 | - '...', // … |
|
| 5637 | - "'", // ‘ |
|
| 5638 | - "'", // ’ |
|
| 5639 | - '"', // “ |
|
| 5640 | - '"', // ” |
|
| 5634 | + ',', // ‚ |
|
| 5635 | + ',,', // „ |
|
| 5636 | + '...', // … |
|
| 5637 | + "'", // ‘ |
|
| 5638 | + "'", // ’ |
|
| 5639 | + '"', // “ |
|
| 5640 | + '"', // ” |
|
| 5641 | 5641 | ); |
| 5642 | 5642 | |
| 5643 | 5643 | if ($context['utf8']) |
@@ -6818,7 +6818,7 @@ discard block |
||
| 6818 | 6818 | EXISTS ( |
| 6819 | 6819 | SELECT bpv.id_board |
| 6820 | 6820 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6821 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 6821 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 6822 | 6822 | AND bpv.deny = 0 |
| 6823 | 6823 | AND bpv.id_board = b.id_board |
| 6824 | 6824 | )'; |
@@ -6828,7 +6828,7 @@ discard block |
||
| 6828 | 6828 | AND NOT EXISTS ( |
| 6829 | 6829 | SELECT bpv.id_board |
| 6830 | 6830 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6831 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 6831 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 6832 | 6832 | AND bpv.deny = 1 |
| 6833 | 6833 | AND bpv.id_board = b.id_board |
| 6834 | 6834 | )'; |
@@ -7099,8 +7099,8 @@ discard block |
||
| 7099 | 7099 | $i = 0; |
| 7100 | 7100 | while (empty($done)) |
| 7101 | 7101 | { |
| 7102 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 7103 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 7102 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 7103 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 7104 | 7104 | else |
| 7105 | 7105 | $done = true; |
| 7106 | 7106 | } |
@@ -7110,8 +7110,8 @@ discard block |
||
| 7110 | 7110 | $i = 0; |
| 7111 | 7111 | while (empty($done)) |
| 7112 | 7112 | { |
| 7113 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 7114 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 7113 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 7114 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 7115 | 7115 | else |
| 7116 | 7116 | $done = true; |
| 7117 | 7117 | } |
@@ -1736,7 +1736,7 @@ discard block |
||
| 1736 | 1736 | // Prevents warnings about constants that are already defined. |
| 1737 | 1737 | $settingsText = preg_replace_callback( |
| 1738 | 1738 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
| 1739 | - function ($matches) |
|
| 1739 | + function($matches) |
|
| 1740 | 1740 | { |
| 1741 | 1741 | return 'define(\'' . md5(mt_rand()) . '\''; |
| 1742 | 1742 | }, |
@@ -1746,7 +1746,7 @@ discard block |
||
| 1746 | 1746 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
| 1747 | 1747 | try |
| 1748 | 1748 | { |
| 1749 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
| 1749 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
| 1750 | 1750 | throw new ErrorException('eval error'); |
| 1751 | 1751 | |
| 1752 | 1752 | unset($mtime, $settingsFile, $settingsText); |
@@ -1953,7 +1953,7 @@ discard block |
||
| 1953 | 1953 | } |
| 1954 | 1954 | |
| 1955 | 1955 | // Everything is simpler if we convert heredocs to normal strings first. |
| 1956 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1956 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1957 | 1957 | { |
| 1958 | 1958 | foreach ($matches[0] as $mkey => $heredoc) |
| 1959 | 1959 | { |
@@ -1967,7 +1967,7 @@ discard block |
||
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | // Split before everything that could possibly delimit a comment or a string. |
| 1970 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1970 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1971 | 1971 | |
| 1972 | 1972 | $in_string = 0; |
| 1973 | 1973 | $in_comment = 0; |