From a978ae260a73b42fbb0bf2c7264a6d98d30b40c7 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Mon, 30 Jan 2017 22:41:02 +0300 Subject: [PATCH] Incorrect case close operands --- ajax.php | 2 +- library/ajax/change_torrent.php | 14 +++++++------- library/ajax/posts.php | 4 ++-- library/attach_mod/includes/functions_thumbs.php | 2 +- library/attach_mod/posting_attachments.php | 1 - library/includes/classes/emailer.php | 8 ++++++-- library/includes/classes/utf8.php | 10 +++++----- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ajax.php b/ajax.php index 0da426248..5680cd3dc 100644 --- a/ajax.php +++ b/ajax.php @@ -84,7 +84,7 @@ switch ($ajax->action) { require(INC_DIR . 'functions_group.php'); break; - case 'sitemap'; + case 'sitemap': require(CLASS_DIR . 'sitemap.php'); break; } diff --git a/library/ajax/change_torrent.php b/library/ajax/change_torrent.php index 1b1354b19..1e995ce96 100644 --- a/library/ajax/change_torrent.php +++ b/library/ajax/change_torrent.php @@ -75,9 +75,9 @@ if ($torrent['poster_id'] == $userdata['user_id'] && !IS_AM) { $title = $url = ''; switch ($type) { - case 'set_gold'; - case 'set_silver'; - case 'unset_silver_gold'; + case 'set_gold': + case 'set_silver': + case 'unset_silver_gold': if ($type == 'set_silver') { $tor_type = TOR_TYPE_SILVER; } elseif ($type == 'set_gold') { @@ -90,17 +90,17 @@ switch ($type) { $url = make_url(TOPIC_URL . $torrent['topic_id']); break; - case 'reg'; + case 'reg': tracker_register($attach_id); $url = (TOPIC_URL . $torrent['topic_id']); break; - case 'unreg'; + case 'unreg': tracker_unregister($attach_id); $url = (TOPIC_URL . $torrent['topic_id']); break; - case 'del_torrent'; + case 'del_torrent': if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['DEL_TORRENT']); } @@ -108,7 +108,7 @@ switch ($type) { $url = make_url(TOPIC_URL . $torrent['topic_id']); break; - case 'del_torrent_move_topic'; + case 'del_torrent_move_topic': if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['DEL_MOVE_TORRENT']); } diff --git a/library/ajax/posts.php b/library/ajax/posts.php index 1029bb0c2..2bf306fa8 100644 --- a/library/ajax/posts.php +++ b/library/ajax/posts.php @@ -71,7 +71,7 @@ if (!defined('WORD_LIST_OBTAINED')) { } switch ($this->request['type']) { - case 'delete'; + case 'delete': if ($post['post_id'] != $post['topic_first_post_id'] && $is_auth['auth_delete'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600 * 3 > TIMENOW))) { if (empty($this->request['confirmed'])) { $this->prompt_for_confirm($lang['CONFIRM_DELETE']); @@ -88,7 +88,7 @@ switch ($this->request['type']) { } break; - case 'reply'; + case 'reply': if (bf($userdata['user_opt'], 'user_opt', 'dis_post')) { $this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT'])); } elseif (!$is_auth['auth_reply']) { diff --git a/library/attach_mod/includes/functions_thumbs.php b/library/attach_mod/includes/functions_thumbs.php index d09031618..fea9f9963 100644 --- a/library/attach_mod/includes/functions_thumbs.php +++ b/library/attach_mod/includes/functions_thumbs.php @@ -119,7 +119,7 @@ function create_thumbnail($source, $new_file, $mimetype) return false; } - list($width, $height, $type,) = getimagesize($source); + list($width, $height, $type, ) = getimagesize($source); if (!$width || !$height) { return false; diff --git a/library/attach_mod/posting_attachments.php b/library/attach_mod/posting_attachments.php index 3de72f8bf..03f1a6847 100644 --- a/library/attach_mod/posting_attachments.php +++ b/library/attach_mod/posting_attachments.php @@ -335,7 +335,6 @@ class attach_parent // restore values :) if (isset($_POST['attachment_list'])) { - for ($i = 0, $iMax = count($actual_list); $i < $iMax; $i++) { $restore = false; $del_thumb = false; diff --git a/library/includes/classes/emailer.php b/library/includes/classes/emailer.php index 45c8a4dfd..2330c6049 100644 --- a/library/includes/classes/emailer.php +++ b/library/includes/classes/emailer.php @@ -29,8 +29,12 @@ if (!defined('BB_ROOT')) { class emailer { - public $msg, $subject, $extra_headers; - public $addresses, $reply_to, $from; + public $msg; + public $subject; + public $extra_headers; + public $addresses; + public $reply_to; + public $from; public $use_smtp; public $tpl_msg = array(); diff --git a/library/includes/classes/utf8.php b/library/includes/classes/utf8.php index 30acc68d3..261fffd3d 100644 --- a/library/includes/classes/utf8.php +++ b/library/includes/classes/utf8.php @@ -3072,21 +3072,21 @@ class utf8 } #speed improve switch (strlen($char)) { - case 1 : + case 1: return $cache[$char] = ord($char); - case 2 : + case 2: return $cache[$char] = (ord($char{1}) & 63) | ((ord($char{0}) & 31) << 6); - case 3 : + case 3: return $cache[$char] = (ord($char{2}) & 63) | ((ord($char{1}) & 63) << 6) | ((ord($char{0}) & 15) << 12); - case 4 : + case 4: return $cache[$char] = (ord($char{3}) & 63) | ((ord($char{2}) & 63) << 6) | ((ord($char{1}) & 63) << 12) | ((ord($char{0}) & 7) << 18); - default : + default: trigger_error('Character 0x' . bin2hex($char) . ' is not UTF-8!', E_USER_WARNING); return false; }