@@ -1364,7 +1364,6 @@ |
||
1364 | 1364 | // return all the info. |
1365 | 1365 | return $context['to_install']; |
1366 | 1366 | } |
1367 | - |
|
1368 | 1367 | else |
1369 | 1368 | fatal_lang_error('theme_install_error_title', false); |
1370 | 1369 | } |
@@ -849,7 +849,6 @@ |
||
849 | 849 | die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); |
850 | 850 | } |
851 | 851 | } |
852 | - |
|
853 | 852 | elseif ($_REQUEST['format'] === '.wav') |
854 | 853 | { |
855 | 854 | require_once($sourcedir . '/Subs-Sound.php'); |
@@ -315,7 +315,7 @@ |
||
315 | 315 | |
316 | 316 | array_walk_recursive( |
317 | 317 | $_POST, |
318 | - function (&$value, $key) use ($context, $smcFunc) |
|
318 | + function(&$value, $key) use ($context, $smcFunc) |
|
319 | 319 | { |
320 | 320 | // Normalize Unicode characters. (Does nothing if not in UTF-8 mode.) |
321 | 321 | $value = $smcFunc['normalize']($value); |
@@ -756,7 +756,6 @@ |
||
756 | 756 | $groups[$row['id_group']]['num_members'] += $row['num_members']; |
757 | 757 | $smcFunc['db_free_result']($query); |
758 | 758 | } |
759 | - |
|
760 | 759 | else |
761 | 760 | { |
762 | 761 | $query = $smcFunc['db_query']('', ' |
@@ -199,7 +199,6 @@ |
||
199 | 199 | list ($context['attachments']['quantity'], $context['attachments']['total_size']) = $smcFunc['db_fetch_row']($request); |
200 | 200 | $smcFunc['db_free_result']($request); |
201 | 201 | } |
202 | - |
|
203 | 202 | else |
204 | 203 | $context['attachments'] = array( |
205 | 204 | 'quantity' => 0, |
@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | if (class_exists('Imagick')) |
43 | 43 | { |
44 | - $temp = New Imagick; |
|
44 | + $temp = new Imagick; |
|
45 | 45 | $temp2 = $temp->getVersion(); |
46 | 46 | $im_version = $temp2['versionString']; |
47 | 47 | $extension_version = 'Imagick ' . phpversion('Imagick'); |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | 'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))', |
860 | 860 | ' $cachedir = $boarddir . \'/cache\';', |
861 | 861 | )), |
862 | - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
862 | + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
863 | 863 | ), |
864 | 864 | 'db_character_set' => array( |
865 | 865 | 'text' => implode("\n", array( |
@@ -958,8 +958,8 @@ discard block |
||
958 | 958 | 'boolean' => '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)', |
959 | 959 | 'NULL' => '(?i:NULL)', |
960 | 960 | // These use a PCRE subroutine to match nested arrays. |
961 | - 'array' => 'array\s*(\((?'.'>[^()]|(?1))*\))', |
|
962 | - 'object' => '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)', |
|
961 | + 'array' => 'array\s*(\((?' . '>[^()]|(?1))*\))', |
|
962 | + 'object' => '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)', |
|
963 | 963 | ); |
964 | 964 | |
965 | 965 | /* |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | ), |
993 | 993 | // Remove the code that redirects to the installer. |
994 | 994 | $neg_index-- => array( |
995 | - 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
995 | + 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
996 | 996 | 'placeholder' => '', |
997 | 997 | ), |
998 | 998 | ); |
@@ -1758,7 +1758,7 @@ discard block |
||
1758 | 1758 | // Prevents warnings about constants that are already defined. |
1759 | 1759 | $settingsText = preg_replace_callback( |
1760 | 1760 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
1761 | - function ($matches) |
|
1761 | + function($matches) |
|
1762 | 1762 | { |
1763 | 1763 | return 'define(\'' . md5(mt_rand()) . '\''; |
1764 | 1764 | }, |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
1769 | 1769 | try |
1770 | 1770 | { |
1771 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
1771 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
1772 | 1772 | throw new ErrorException('eval error'); |
1773 | 1773 | |
1774 | 1774 | unset($mtime, $settingsFile, $settingsText); |
@@ -1234,7 +1234,8 @@ discard block |
||
1234 | 1234 | // It's important to do the numbered ones before the named ones, or messes happen. |
1235 | 1235 | uksort( |
1236 | 1236 | $substitutions, |
1237 | - function($a, $b) { |
|
1237 | + function($a, $b) |
|
1238 | + { |
|
1238 | 1239 | if (is_int($a) && is_int($b)) |
1239 | 1240 | return $a > $b ? 1 : ($a < $b ? -1 : 0); |
1240 | 1241 | elseif (is_int($a)) |
@@ -1774,8 +1775,12 @@ discard block |
||
1774 | 1775 | unset($mtime, $settingsFile, $settingsText); |
1775 | 1776 | $defined_vars = get_defined_vars(); |
1776 | 1777 | } |
1777 | - catch (Throwable $e) {} |
|
1778 | - catch (ErrorException $e) {} |
|
1778 | + catch (Throwable $e) |
|
1779 | + { |
|
1780 | +} |
|
1781 | + catch (ErrorException $e) |
|
1782 | + { |
|
1783 | +} |
|
1779 | 1784 | if (isset($e)) |
1780 | 1785 | return false; |
1781 | 1786 | |
@@ -1973,7 +1978,8 @@ discard block |
||
1973 | 1978 | { |
1974 | 1979 | list($id, $text) = $token; |
1975 | 1980 | |
1976 | - switch ($id) { |
|
1981 | + switch ($id) |
|
1982 | + { |
|
1977 | 1983 | case T_COMMENT: |
1978 | 1984 | case T_DOC_COMMENT: |
1979 | 1985 | end($parts); |
@@ -2310,7 +2316,8 @@ discard block |
||
2310 | 2316 | // Search for a working temp directory. |
2311 | 2317 | foreach ($temp_dir_options as $id_temp => $temp_option) |
2312 | 2318 | { |
2313 | - switch ($temp_option) { |
|
2319 | + switch ($temp_option) |
|
2320 | + { |
|
2314 | 2321 | case 'cachedir': |
2315 | 2322 | $possible_temp = rtrim($cachedir, '/'); |
2316 | 2323 | break; |
@@ -222,7 +222,6 @@ |
||
222 | 222 | |
223 | 223 | $this->_validLikes['can_like'] = ($this->_user['id'] == $topicOwner ? 'cannot_like_content' : (allowedTo('likes_like') ? true : 'cannot_like_content')); |
224 | 224 | } |
225 | - |
|
226 | 225 | else |
227 | 226 | { |
228 | 227 | // Modders: This will give you whatever the user offers up in terms of liking, e.g. $this->_type=msg, $this->_content=1 |
@@ -3219,7 +3219,7 @@ discard block |
||
3219 | 3219 | // Deleting an existing label? |
3220 | 3220 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
3221 | 3221 | { |
3222 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
3222 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
3223 | 3223 | { |
3224 | 3224 | unset($the_labels[$label]); |
3225 | 3225 | $labels_to_remove[] = $label; |
@@ -3260,7 +3260,7 @@ discard block |
||
3260 | 3260 | if (!empty($labels_to_add)) |
3261 | 3261 | { |
3262 | 3262 | $inserts = array(); |
3263 | - foreach ($labels_to_add AS $label) |
|
3263 | + foreach ($labels_to_add as $label) |
|
3264 | 3264 | $inserts[] = array($user_info['id'], $label); |
3265 | 3265 | |
3266 | 3266 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3269,7 +3269,7 @@ discard block |
||
3269 | 3269 | // Update existing labels as needed |
3270 | 3270 | if (!empty($label_upates)) |
3271 | 3271 | { |
3272 | - foreach ($label_updates AS $id => $name) |
|
3272 | + foreach ($label_updates as $id => $name) |
|
3273 | 3273 | { |
3274 | 3274 | $smcFunc['db_query']('', ' |
3275 | 3275 | UPDATE {db_prefix}labels |
@@ -419,7 +419,7 @@ |
||
419 | 419 | |
420 | 420 | if (checkImagick()) |
421 | 421 | { |
422 | - $imagick = New Imagick($destName); |
|
422 | + $imagick = new Imagick($destName); |
|
423 | 423 | $src_width = empty($src_width) ? $imagick->getImageWidth() : $src_width; |
424 | 424 | $src_height = empty($src_height) ? $imagick->getImageHeight() : $src_height; |
425 | 425 | $dest_width = empty($max_width) ? $src_width : $max_width; |
@@ -93,7 +93,6 @@ |
||
93 | 93 | |
94 | 94 | continue; |
95 | 95 | } |
96 | - |
|
97 | 96 | elseif (empty($row['show_online']) && empty($membersOnlineOptions['show_hidden'])) |
98 | 97 | { |
99 | 98 | // Just increase the stats and don't add this hidden user to any list. |