@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | log_error(sprintf($txt['smiley_set_dir_not_found'], $set_names[array_search($set, $context['smiley_sets'])])); |
| 501 | 501 | |
| 502 | 502 | $context['smiley_sets'] = array_filter($context['smiley_sets'], function($v) use ($set) |
| 503 | - { |
|
| 503 | + { |
|
| 504 | 504 | return $v != $set; |
| 505 | 505 | }); |
| 506 | 506 | } |
@@ -3467,7 +3467,6 @@ discard block |
||
| 3467 | 3467 | } |
| 3468 | 3468 | } |
| 3469 | 3469 | } |
| 3470 | - |
|
| 3471 | 3470 | elseif (($value == 'upload' && allowedTo('profile_upload_avatar')) || $downloadedExternalAvatar) |
| 3472 | 3471 | { |
| 3473 | 3472 | if ((isset($_FILES['attachment']['name']) && $_FILES['attachment']['name'] != '') || $downloadedExternalAvatar) |
@@ -869,7 +869,6 @@ |
||
| 869 | 869 | $can_approve_boards = boardsAllowedTo('approve_posts'); |
| 870 | 870 | $onlyApproved = $can_approve_boards !== array(0) && !in_array($_REQUEST['targetboard'], $can_approve_boards); |
| 871 | 871 | } |
| 872 | - |
|
| 873 | 872 | else |
| 874 | 873 | $onlyApproved = false; |
| 875 | 874 | |
@@ -1197,7 +1197,8 @@ discard block |
||
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | // It's important to do the numbered ones before the named ones, or messes happen. |
| 1200 | - uksort($substitutions, function($a, $b) { |
|
| 1200 | + uksort($substitutions, function($a, $b) |
|
| 1201 | + { |
|
| 1201 | 1202 | if (is_int($a) && is_int($b)) |
| 1202 | 1203 | return $a > $b; |
| 1203 | 1204 | elseif (is_int($a)) |
@@ -1716,8 +1717,12 @@ discard block |
||
| 1716 | 1717 | unset($mtime, $settingsFile, $settingsText); |
| 1717 | 1718 | $defined_vars = get_defined_vars(); |
| 1718 | 1719 | } |
| 1719 | - catch (Throwable $e) {} |
|
| 1720 | - catch (ErrorException $e) {} |
|
| 1720 | + catch (Throwable $e) |
|
| 1721 | + { |
|
| 1722 | +} |
|
| 1723 | + catch (ErrorException $e) |
|
| 1724 | + { |
|
| 1725 | +} |
|
| 1721 | 1726 | if (isset($e)) |
| 1722 | 1727 | return false; |
| 1723 | 1728 | |
@@ -1877,7 +1882,8 @@ discard block |
||
| 1877 | 1882 | // For the same reason, replace literal returns and newlines with "\r" and "\n" |
| 1878 | 1883 | elseif (is_string($var) && (strpos($var, "\n") !== false || strpos($var, "\r") !== false)) |
| 1879 | 1884 | { |
| 1880 | - return strtr(preg_replace_callback('/[\r\n]+/', function($m) { |
|
| 1885 | + return strtr(preg_replace_callback('/[\r\n]+/', function($m) |
|
| 1886 | + { |
|
| 1881 | 1887 | return '\' . "' . strtr($m[0], array("\r" => '\r', "\n" => '\n')) . '" . \''; |
| 1882 | 1888 | }, $var), array("'' . " => '', " . ''" => '')); |
| 1883 | 1889 | } |
@@ -93,7 +93,6 @@ |
||
| 93 | 93 | if ($ts <= 0 || $ts % 15 != 0 || time() - $ts < 0 || time() - $ts > 20) |
| 94 | 94 | obExit_cron(); |
| 95 | 95 | } |
| 96 | - |
|
| 97 | 96 | else |
| 98 | 97 | $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; |
| 99 | 98 | |
@@ -266,7 +266,6 @@ |
||
| 266 | 266 | $user_info = $real_user_info; |
| 267 | 267 | unset($real_user_info); |
| 268 | 268 | } |
| 269 | - |
|
| 270 | 269 | else |
| 271 | 270 | $user_info = null; |
| 272 | 271 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | // Set a list of common functions. |
| 105 | 105 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 106 | 106 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 107 | - { |
|
| 107 | + { |
|
| 108 | 108 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 109 | 109 | return $string; |
| 110 | 110 | } : function($string) |
@@ -925,7 +925,6 @@ discard block |
||
| 925 | 925 | $user_settings_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) - |
| 926 | 926 | $tz_system->getOffset($time_system)) / 3600; |
| 927 | 927 | } |
| 928 | - |
|
| 929 | 928 | else |
| 930 | 929 | $user_settings_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset']; |
| 931 | 930 | } |
@@ -1655,7 +1654,6 @@ discard block |
||
| 1655 | 1654 | $time_user = new DateTime('now', $tz_user); |
| 1656 | 1655 | $profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600; |
| 1657 | 1656 | } |
| 1658 | - |
|
| 1659 | 1657 | else |
| 1660 | 1658 | { |
| 1661 | 1659 | // !!! Compatibility. |
@@ -2318,7 +2316,6 @@ discard block |
||
| 2318 | 2316 | loadLanguage('index+Modifications'); |
| 2319 | 2317 | $context['template_layers'] = array(); |
| 2320 | 2318 | } |
| 2321 | - |
|
| 2322 | 2319 | else |
| 2323 | 2320 | { |
| 2324 | 2321 | // Custom templates to load, or just default? |
@@ -2699,14 +2696,12 @@ discard block |
||
| 2699 | 2696 | $fileUrl = $settings['default_theme_url'] . '/css/' . $fileName; |
| 2700 | 2697 | $filePath = $settings['default_theme_dir'] . '/css/' . $fileName; |
| 2701 | 2698 | } |
| 2702 | - |
|
| 2703 | 2699 | else |
| 2704 | 2700 | { |
| 2705 | 2701 | $fileUrl = false; |
| 2706 | 2702 | $filePath = false; |
| 2707 | 2703 | } |
| 2708 | 2704 | } |
| 2709 | - |
|
| 2710 | 2705 | else |
| 2711 | 2706 | { |
| 2712 | 2707 | $fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName; |
@@ -2814,14 +2809,12 @@ discard block |
||
| 2814 | 2809 | $fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName; |
| 2815 | 2810 | $filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName; |
| 2816 | 2811 | } |
| 2817 | - |
|
| 2818 | 2812 | else |
| 2819 | 2813 | { |
| 2820 | 2814 | $fileUrl = false; |
| 2821 | 2815 | $filePath = false; |
| 2822 | 2816 | } |
| 2823 | 2817 | } |
| 2824 | - |
|
| 2825 | 2818 | else |
| 2826 | 2819 | { |
| 2827 | 2820 | $fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName; |
@@ -119,7 +119,9 @@ |
||
| 119 | 119 | |
| 120 | 120 | $feed_meta = array( |
| 121 | 121 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 122 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 122 | + 'desc' => sentence_list(array_map(function ($datatype) use ($txt) |
|
| 123 | + { |
|
| 124 | +return $txt[$datatype]; }, array_keys($included))), |
|
| 123 | 125 | 'author' => $mbname, |
| 124 | 126 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
| 125 | 127 | 'self' => $scripturl . '?action=profile;area=download;u=' . $uid . ';t=' . hash_hmac('sha1', $idhash, get_auth_secret()), |
@@ -1396,7 +1396,9 @@ |
||
| 1396 | 1396 | |
| 1397 | 1397 | // Figure out the filename we'll tell the browser. |
| 1398 | 1398 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
| 1399 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 1399 | + $included_desc = array_map(function ($datatype) use ($txt) |
|
| 1400 | + { |
|
| 1401 | +return $txt[$datatype]; }, $datatypes); |
|
| 1400 | 1402 | |
| 1401 | 1403 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
| 1402 | 1404 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -20,13 +20,15 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | final class InstallTest extends TestCase |
| 22 | 22 | { |
| 23 | - public function testWrite() { |
|
| 23 | + public function testWrite() |
|
| 24 | + { |
|
| 24 | 25 | load_lang_file(); |
| 25 | 26 | $var = CheckFilesWritable(); |
| 26 | 27 | $this->assertEquals(true,$var); |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | - public function testDBSettings() { |
|
| 30 | + public function testDBSettings() |
|
| 31 | + { |
|
| 30 | 32 | $_POST['db_type'] = 'postgresql'; |
| 31 | 33 | $_POST['db_prefix'] = 'smf_'; |
| 32 | 34 | $_POST['db_name'] = 'postgres'; |
@@ -43,7 +45,8 @@ discard block |
||
| 43 | 45 | $this->assertEquals(true,$var); |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | - public function testForumSettings() { |
|
| 48 | + public function testForumSettings() |
|
| 49 | + { |
|
| 47 | 50 | $_SERVER['SERVER_NAME'] = 'localhost'; |
| 48 | 51 | $_POST['boardurl'] = 'http://localhost'; |
| 49 | 52 | $_POST['mbname'] = 'My PHPUnit Community'; |
@@ -52,13 +55,15 @@ discard block |
||
| 52 | 55 | $this->assertEquals(true,$var); |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | - public function testDatabasePopulation() { |
|
| 58 | + public function testDatabasePopulation() |
|
| 59 | + { |
|
| 56 | 60 | load_lang_file(); |
| 57 | 61 | $var = DatabasePopulation(); |
| 58 | 62 | $this->assertEquals(true,$var); |
| 59 | 63 | } |
| 60 | 64 | |
| 61 | - public function testAdminAccount() { |
|
| 65 | + public function testAdminAccount() |
|
| 66 | + { |
|
| 62 | 67 | $_POST['username'] = 'Admin'; |
| 63 | 68 | $_POST['email'] = '[email protected]'; |
| 64 | 69 | $_POST['password1'] = 'admin'; |