@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * @version 2.1 RC2 |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -define('SMFPHPUNIT',TRUE); |
|
| 17 | +define('SMFPHPUNIT', TRUE); |
|
| 18 | 18 | use PHPUnit\Framework\TestCase; |
| 19 | 19 | require_once('./install.php'); |
| 20 | 20 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function testWrite() { |
| 24 | 24 | load_lang_file(); |
| 25 | 25 | $var = CheckFilesWritable(); |
| 26 | - $this->assertEquals(true,$var); |
|
| 26 | + $this->assertEquals(true, $var); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function testDBSettings() { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | load_lang_file(); |
| 42 | 42 | $var = DatabaseSettings(); |
| 43 | - $this->assertEquals(true,$var); |
|
| 43 | + $this->assertEquals(true, $var); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function testForumSettings() { |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | $_POST['mbname'] = 'My PHPUnit Community'; |
| 50 | 50 | load_lang_file(); |
| 51 | 51 | $var = ForumSettings(); |
| 52 | - $this->assertEquals(true,$var); |
|
| 52 | + $this->assertEquals(true, $var); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function testDatabasePopulation() { |
| 56 | 56 | load_lang_file(); |
| 57 | 57 | $var = DatabasePopulation(); |
| 58 | - $this->assertEquals(true,$var); |
|
| 58 | + $this->assertEquals(true, $var); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function testAdminAccount() { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $_POST['server_email'] = $_POST['email']; |
| 69 | 69 | load_lang_file(); |
| 70 | 70 | $var = AdminAccount(); |
| 71 | - $this->assertEquals(true,$var); |
|
| 71 | + $this->assertEquals(true, $var); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -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 | '', |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
| 1461 | 1461 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
| 1462 | 1462 | |
| 1463 | - $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>' : ''); |
|
| 1463 | + $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>' : ''); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | // Audio. |
| 1466 | 1466 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
| 1469 | 1469 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
| 1470 | 1470 | |
| 1471 | - $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>'; |
|
| 1471 | + $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>'; |
|
| 1472 | 1472 | } |
| 1473 | 1473 | // Anything else. |
| 1474 | 1474 | 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)) |
@@ -2169,12 +2169,12 @@ discard block |
||
| 2169 | 2169 | $codes[] = array( |
| 2170 | 2170 | 'tag' => 'cowsay', |
| 2171 | 2171 | 'parameters' => array( |
| 2172 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2172 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2173 | 2173 | { |
| 2174 | 2174 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2175 | 2175 | }, |
| 2176 | 2176 | ), |
| 2177 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2177 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2178 | 2178 | { |
| 2179 | 2179 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2180 | 2180 | }, |
@@ -3546,7 +3546,7 @@ discard block |
||
| 3546 | 3546 | if ($fp != false) |
| 3547 | 3547 | { |
| 3548 | 3548 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 3549 | - 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"); |
|
| 3549 | + 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"); |
|
| 3550 | 3550 | |
| 3551 | 3551 | // Read in the HTTP/1.1 or whatever. |
| 3552 | 3552 | $test = substr(fgets($fp, 11), -1); |
@@ -4150,7 +4150,7 @@ discard block |
||
| 4150 | 4150 | $toMinify = array(); |
| 4151 | 4151 | $normal = array(); |
| 4152 | 4152 | |
| 4153 | - usort($context['css_files'], function ($a, $b) |
|
| 4153 | + usort($context['css_files'], function($a, $b) |
|
| 4154 | 4154 | { |
| 4155 | 4155 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4156 | 4156 | }); |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | { |
| 5447 | 5447 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 5448 | 5448 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5449 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5449 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5450 | 5450 | if ($keep_alive) |
| 5451 | 5451 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 5452 | 5452 | else |
@@ -5456,7 +5456,7 @@ discard block |
||
| 5456 | 5456 | { |
| 5457 | 5457 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 5458 | 5458 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5459 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5459 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5460 | 5460 | if ($keep_alive) |
| 5461 | 5461 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 5462 | 5462 | else |
@@ -5704,13 +5704,13 @@ discard block |
||
| 5704 | 5704 | |
| 5705 | 5705 | // UTF-8 occurences of MS special characters |
| 5706 | 5706 | $findchars_utf8 = array( |
| 5707 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | - "\xe2\x80\x98", // left single curly quote |
|
| 5711 | - "\xe2\x80\x99", // right single curly quote |
|
| 5712 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5707 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | + "\xe2\x80\x98", // left single curly quote |
|
| 5711 | + "\xe2\x80\x99", // right single curly quote |
|
| 5712 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5714 | 5714 | ); |
| 5715 | 5715 | |
| 5716 | 5716 | // windows 1252 / iso equivalents |
@@ -5726,13 +5726,13 @@ discard block |
||
| 5726 | 5726 | |
| 5727 | 5727 | // safe replacements |
| 5728 | 5728 | $replacechars = array( |
| 5729 | - ',', // ‚ |
|
| 5730 | - ',,', // „ |
|
| 5731 | - '...', // … |
|
| 5732 | - "'", // ‘ |
|
| 5733 | - "'", // ’ |
|
| 5734 | - '"', // “ |
|
| 5735 | - '"', // ” |
|
| 5729 | + ',', // ‚ |
|
| 5730 | + ',,', // „ |
|
| 5731 | + '...', // … |
|
| 5732 | + "'", // ‘ |
|
| 5733 | + "'", // ’ |
|
| 5734 | + '"', // “ |
|
| 5735 | + '"', // ” |
|
| 5736 | 5736 | ); |
| 5737 | 5737 | |
| 5738 | 5738 | if ($context['utf8']) |
@@ -6917,7 +6917,7 @@ discard block |
||
| 6917 | 6917 | EXISTS ( |
| 6918 | 6918 | SELECT bpv.id_board |
| 6919 | 6919 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6920 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 6920 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 6921 | 6921 | AND bpv.deny = 0 |
| 6922 | 6922 | AND bpv.id_board = b.id_board |
| 6923 | 6923 | )'; |
@@ -6927,7 +6927,7 @@ discard block |
||
| 6927 | 6927 | AND NOT EXISTS ( |
| 6928 | 6928 | SELECT bpv.id_board |
| 6929 | 6929 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6930 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 6930 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 6931 | 6931 | AND bpv.deny = 1 |
| 6932 | 6932 | AND bpv.id_board = b.id_board |
| 6933 | 6933 | )'; |
@@ -7198,8 +7198,8 @@ discard block |
||
| 7198 | 7198 | $i = 0; |
| 7199 | 7199 | while (empty($done)) |
| 7200 | 7200 | { |
| 7201 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 7202 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 7201 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 7202 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 7203 | 7203 | else |
| 7204 | 7204 | $done = true; |
| 7205 | 7205 | } |
@@ -7209,8 +7209,8 @@ discard block |
||
| 7209 | 7209 | $i = 0; |
| 7210 | 7210 | while (empty($done)) |
| 7211 | 7211 | { |
| 7212 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 7213 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 7212 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 7213 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 7214 | 7214 | else |
| 7215 | 7215 | $done = true; |
| 7216 | 7216 | } |