diff --git a/admin/admin_extensions.php b/admin/admin_extensions.php index 83838a103..63ed1420a 100644 --- a/admin/admin_extensions.php +++ b/admin/admin_extensions.php @@ -507,7 +507,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) { // Generate array for Auth_Pack, do not add doubled forums for ($i = 0; $i < count($add_forums_list); $i++) { - if (!in_array($add_forums_list[$i], $auth_p)) { + if (!in_array($add_forums_list[$i], $auth_p, true)) { $auth_p[] = $add_forums_list[$i]; } } @@ -544,7 +544,7 @@ if (@$delete_forum && $e_mode == 'perm' && $group) { // Generate array for Auth_Pack, delete the chosen ones for ($i = 0; $i < count($auth_p2); $i++) { - if (!in_array($auth_p2[$i], $delete_forums_list)) { + if (!in_array($auth_p2[$i], $delete_forums_list, true)) { $auth_p[] = $auth_p2[$i]; } } @@ -657,7 +657,7 @@ if ($e_mode == 'perm' && $group) { for ($i = 0; $i < $num_rows; $i++) { $allowed_forums = auth_unpack(trim($rows[$i]['forum_permissions'])); - if (in_array($forum_id, $allowed_forums) || trim($rows[$i]['forum_permissions']) == '') { + if (in_array($forum_id, $allowed_forums, true) || trim($rows[$i]['forum_permissions']) == '') { $found_forum = true; break; } diff --git a/admin/admin_forum_prune.php b/admin/admin_forum_prune.php index 08bd0bcbc..51c3a172f 100644 --- a/admin/admin_forum_prune.php +++ b/admin/admin_forum_prune.php @@ -42,7 +42,7 @@ if (isset($_REQUEST['submit'])) { } $prunetime = TIMENOW - 86400 * $prunedays; - $forum_csv = in_array($all_forums, $f_selected) ? $all_forums : implode(',', $f_selected); + $forum_csv = in_array($all_forums, $f_selected, true) ? $all_forums : implode(',', $f_selected); $where_sql = ($forum_csv != $all_forums) ? "WHERE forum_id IN($forum_csv)" : ''; diff --git a/admin/admin_log.php b/admin/admin_log.php index 77e749f73..36f09a744 100644 --- a/admin/admin_log.php +++ b/admin/admin_log.php @@ -103,7 +103,7 @@ $type_csv = ''; if ($var =& $_REQUEST[$type_key]) { $type_selected = get_id_ary($var); - if (in_array($all_types, $type_selected)) { + if (in_array($all_types, $type_selected, true)) { $type_selected = array($all_types); } $type_csv = implode(',', $type_selected); @@ -117,7 +117,7 @@ $user_csv = ''; if ($var =& $_REQUEST[$user_key]) { $user_selected = get_id_ary($var); - if (in_array($all_users, $user_selected)) { + if (in_array($all_users, $user_selected, true)) { $user_selected = array($all_users); } $user_csv = implode(',', $user_selected); @@ -131,7 +131,7 @@ $forum_csv = ''; if ($var =& $_REQUEST[$forum_key]) { $forum_selected = get_id_ary($var); - if (in_array($all_forums, $forum_selected)) { + if (in_array($all_forums, $forum_selected, true)) { $forum_selected = array($all_forums); } $forum_csv = implode(',', $forum_selected); diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index cb96ac37f..3c38f1771 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -212,7 +212,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'CAT_HREF' => "$base_url&c=$c_id", )); - if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { + if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id), true) or empty($c_data['forums'])) { continue; } @@ -334,7 +334,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'CAT_HREF' => "$base_url&c=$c_id", )); - if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { + if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id), true) or empty($c_data['forums'])) { continue; } diff --git a/admin/index.php b/admin/index.php index 1e1420849..375c91e97 100644 --- a/admin/index.php +++ b/admin/index.php @@ -193,7 +193,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { $registered_users = $hidden_users = 0; for ($i = 0, $cnt = count($onlinerow_reg); $i < $cnt; $i++) { - if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary)) { + if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary, true)) { $reg_userid_ary[] = $onlinerow_reg[$i]['user_id']; $username = $onlinerow_reg[$i]['username']; diff --git a/common.php b/common.php index 615929064..4258d95eb 100644 --- a/common.php +++ b/common.php @@ -64,7 +64,7 @@ require_once __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/library/config.php'; $server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; -$server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port']; +$server_port = (in_array($bb_cfg['server_port'], array(80, 443), true)) ? '' : ':' . $bb_cfg['server_port']; define('FORUM_PATH', $bb_cfg['script_path']); define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']); unset($server_protocol, $server_port); diff --git a/dl.php b/dl.php index 94ced0caa..40d891f80 100644 --- a/dl.php +++ b/dl.php @@ -174,7 +174,7 @@ for ($i = 0; $i < $num_rows; $i++) { } // Disallowed -if (!in_array($attachment['extension'], $allowed_extensions) && !IS_ADMIN) { +if (!in_array($attachment['extension'], $allowed_extensions, true) && !IS_ADMIN) { bb_die(sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); } diff --git a/index.php b/index.php index 689d604d7..2936d4d38 100644 --- a/index.php +++ b/index.php @@ -207,7 +207,7 @@ foreach ($cat_forums as $cid => $c) { $template->assign_block_vars('h_c', array( 'H_C_ID' => $cid, 'H_C_TITLE' => $cat_title_html[$cid], - 'H_C_CHEKED' => in_array($cid, preg_split("/[-]+/", $hide_cat_opt)) ? 'checked' : '', + 'H_C_CHEKED' => in_array($cid, preg_split("/[-]+/", $hide_cat_opt), true) ? 'checked' : '', )); $template->assign_vars(array( diff --git a/library/ajax/change_tor_status.php b/library/ajax/change_tor_status.php index 2959884c6..33ae42f0c 100644 --- a/library/ajax/change_tor_status.php +++ b/library/ajax/change_tor_status.php @@ -103,7 +103,7 @@ switch ($mode) { $this->response['status'] = $bb_cfg['tor_icons'][$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status] . ' · ' . profile_url($userdata) . ' · ' . delta_time(TIMENOW) . $lang['TOR_BACK'] . ''; - if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply']))) { + if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply'], true))) { if ($tor['poster_id'] > 0) { $subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']); $message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status]); diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index 4b5b9e768..06c67e826 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -35,7 +35,7 @@ switch ($mode) { case 'clear_cache': foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) { - if (!in_array('db_sqlite', $cache_val)) { + if (!in_array('db_sqlite', $cache_val, true)) { CACHE($cache_name)->rm(); } } diff --git a/library/attach_mod/displaying.php b/library/attach_mod/displaying.php index dfcc38242..c14c56220 100644 --- a/library/attach_mod/displaying.php +++ b/library/attach_mod/displaying.php @@ -220,7 +220,7 @@ function display_attachments($post_id) $denied = false; // Admin is allowed to view forbidden Attachments, but the error-message is displayed too to inform the Admin - if (!in_array($attachments['_' . $post_id][$i]['extension'], $allowed_extensions)) { + if (!in_array($attachments['_' . $post_id][$i]['extension'], $allowed_extensions, true)) { $denied = true; $template->assign_block_vars('postrow.attach.denyrow', array( diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index f67816919..418d4306c 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -219,7 +219,7 @@ if ($tor_reged && $tor_info) { 'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor_info['tor_status']], 'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && $is_auth['auth_mod']) ? (' · ' . profile_url($tor_info) . ' · ' . delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] . '') : '', 'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED), - 'TOR_STATUS_REPLY' => $bb_cfg['tor_comment'] && !IS_GUEST && in_array($tor_info['tor_status'], $bb_cfg['tor_reply']) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED, + 'TOR_STATUS_REPLY' => $bb_cfg['tor_comment'] && !IS_GUEST && in_array($tor_info['tor_status'], $bb_cfg['tor_reply'], true) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED, //end torrent status mod 'S_UPLOAD_IMAGE' => $upload_image, diff --git a/library/config.php b/library/config.php index 6a4d69089..169ca5872 100644 --- a/library/config.php +++ b/library/config.php @@ -360,7 +360,7 @@ $page_cfg['show_sidebar2'] = array( ); // Cookie -$bb_cfg['cookie_domain'] = in_array($domain_name, array(getenv('SERVER_ADDR'), 'localhost')) ? '' : ".$domain_name"; +$bb_cfg['cookie_domain'] = in_array($domain_name, array(getenv('SERVER_ADDR'), 'localhost'), true) ? '' : ".$domain_name"; $bb_cfg['cookie_secure'] = (!empty($_SERVER['HTTPS']) ? 1 : 0); $bb_cfg['cookie_prefix'] = 'bb_'; // 'bb_' diff --git a/library/includes/bbcode.php b/library/includes/bbcode.php index b3db418ef..11cda280c 100644 --- a/library/includes/bbcode.php +++ b/library/includes/bbcode.php @@ -673,7 +673,7 @@ class bbcode $url = 'http://' . $url; } - if (in_array(parse_url($url, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url']) || $bb_cfg['nofollow']['disabled']) { + if (in_array(parse_url($url, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url'], true) || $bb_cfg['nofollow']['disabled']) { $link = "$url_name"; } else { $link = "$url_name"; @@ -741,7 +741,7 @@ class bbcode $href = $m[1]; $name = (mb_strlen($href, 'UTF-8') > $max_len) ? mb_substr($href, 0, $max_len - 19) . '...' . mb_substr($href, -16) : $href; - if (in_array(parse_url($href, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url']) || $bb_cfg['nofollow']['disabled']) { + if (in_array(parse_url($href, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url'], true) || $bb_cfg['nofollow']['disabled']) { $link = "$name"; } else { $link = "$name"; diff --git a/library/includes/datastore/common.php b/library/includes/datastore/common.php index 41179c2c4..24af5fb9e 100644 --- a/library/includes/datastore/common.php +++ b/library/includes/datastore/common.php @@ -77,7 +77,7 @@ class datastore_common { foreach ((array)$items as $item) { // игнор уже поставленного в очередь либо уже извлеченного - if (!in_array($item, $this->queued_items) && !isset($this->data[$item])) { + if (!in_array($item, $this->queued_items, true) && !isset($this->data[$item])) { $this->queued_items[] = $item; } } diff --git a/library/includes/functions.php b/library/includes/functions.php index dfee72d84..fdbecd012 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -368,7 +368,7 @@ function auth($type, $forum_id, $ug_data, $f_access = array(), $group_perm = UG_ // if ($type == AUTH_ALL) { $auth_fields = array_keys($bf['forum_perm']); - } elseif ($auth_type = array_search($type, $bf['forum_perm'])) { + } elseif ($auth_type = array_search($type, $bf['forum_perm'], true)) { $auth_fields = array($auth_type); } @@ -2452,7 +2452,7 @@ function profile_url($data) $profile = '' . $username . ''; - if (!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username) { + if (!in_array($user_id, array('', GUEST_UID, BOT_UID), true) && $username) { $profile = '' . $profile . ''; } diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 040b6f807..0abf5185a 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -297,7 +297,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED $ann = (@$tor['announce']) ? $tor['announce'] : ''; $announce_urls['main_url'] = $bb_cfg['bt_announce_url']; - if (!$ann || !in_array($ann, $announce_urls)) { + if (!$ann || !in_array($ann, $announce_urls, true)) { $msg = sprintf($lang['INVALID_ANN_URL'], htmlspecialchars($ann), $announce_urls['main_url']); return torrent_error_exit($msg); } diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index a4dbe5b30..052b7d90c 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -81,7 +81,7 @@ switch ($mode) { } // Ограничение по времени elseif ($bb_cfg['new_user_reg_restricted']) { if (in_array(date('G'), array(0, /*1,2,3,4,5,6,7,8,11,12,13,14,15,16,*/ - 17, 18, 19, 20, 21, 22, 23))) { + 17, 18, 19, 20, 21, 22, 23), true)) { bb_die($lang['REGISTERED_IN_TIME']); } } diff --git a/library/includes/ucp/sendpasswd.php b/library/includes/ucp/sendpasswd.php index 3b5a63d4f..9f95a762d 100644 --- a/library/includes/ucp/sendpasswd.php +++ b/library/includes/ucp/sendpasswd.php @@ -46,7 +46,7 @@ if (isset($_POST['submit'])) { if (!$row['user_active']) { bb_die($lang['NO_SEND_ACCOUNT_INACTIVE']); } - if (in_array($row['user_level'], array(MOD, ADMIN))) { + if (in_array($row['user_level'], array(MOD, ADMIN), true)) { bb_die($lang['NO_SEND_ACCOUNT']); } diff --git a/posting.php b/posting.php index 1d009d889..76a67f3b6 100644 --- a/posting.php +++ b/posting.php @@ -50,7 +50,7 @@ $orig_word = $replacement_word = array(); // Set topic type $topic_type = (@$_POST['topictype']) ? (int)$_POST['topictype'] : POST_NORMAL; -$topic_type = in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE)) ? $topic_type : POST_NORMAL; +$topic_type = in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE), true) ? $topic_type : POST_NORMAL; $selected_rg = 0; $switch_rg_sig = 0; @@ -373,7 +373,7 @@ if (($delete || $mode == 'delete') && !$confirm) { } if (!$error_msg) { - if (!in_array($mode, array('editpost', 'delete'))) { + if (!in_array($mode, array('editpost', 'delete'), true)) { $user_id = ($mode == 'reply' || $mode == 'newtopic') ? $userdata['user_id'] : $post_data['poster_id']; update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id); } diff --git a/search.php b/search.php index fa1c9ab66..915ecb70c 100644 --- a/search.php +++ b/search.php @@ -389,7 +389,7 @@ if (!$items_found) { if ($var =& $_REQUEST[$forum_key]) { $forum_selected = get_id_ary($var); - if (!in_array($search_all, $forum_selected)) { + if (!in_array($search_all, $forum_selected, true)) { $forum_val = implode(',', $forum_selected); } } @@ -468,7 +468,7 @@ if ($post_mode) { // Run initial search for post_ids if (!$items_found) { - $join_t = ($title_match || $my_topics || $new_topics || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl))); + $join_t = ($title_match || $my_topics || $new_topics || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl), true)); $join_s = ($text_match_sql && !$title_match); $join_p = ($my_posts || $join_s); @@ -650,7 +650,7 @@ else { // Run initial search for topic_ids if (!$items_found) { - $join_t = ($title_match || $my_topics || $new_topics || $dl_search || $new_posts || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl))); + $join_t = ($title_match || $my_topics || $new_topics || $dl_search || $new_posts || in_array($order_val, array($ord_last_p, $ord_created, $ord_name, $ord_repl), true)); $join_s = ($text_match_sql && !$title_match); $join_p = ($my_posts || $join_s); $join_dl = ($dl_search); diff --git a/tracker.php b/tracker.php index bb13ef19c..1c4b4c8e1 100644 --- a/tracker.php +++ b/tracker.php @@ -548,7 +548,7 @@ if ($allowed_forums) { $order_by_peers = ($order_val == $ord_seeders || $order_val == $ord_leechers); $order_by_speed = ($order_val == $ord_sp_up || $order_val == $ord_sp_down); - $join_t = in_array($order_val, array($ord_name, $ord_repl, $ord_views, $ord_last_p, $title_match)); + $join_t = in_array($order_val, array($ord_name, $ord_repl, $ord_views, $ord_last_p, $title_match), true); $join_sn = ($only_active || $order_by_peers || $order_by_speed); $join_dl = $dl_search; diff --git a/viewforum.php b/viewforum.php index ec7cda9aa..53733803a 100644 --- a/viewforum.php +++ b/viewforum.php @@ -233,7 +233,7 @@ $topics_per_page = $bb_cfg['topics_per_page']; $select_tpp = ''; if ($is_auth['auth_mod']) { - if ($req_tpp = abs((int)(@$_REQUEST['tpp'])) and in_array($req_tpp, $bb_cfg['allowed_topics_per_page'])) { + if ($req_tpp = abs((int)(@$_REQUEST['tpp'])) and in_array($req_tpp, $bb_cfg['allowed_topics_per_page'], true)) { $topics_per_page = $req_tpp; } diff --git a/viewtopic.php b/viewtopic.php index 9bcd8c1fd..81dce6c34 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -54,7 +54,7 @@ $posts_per_page = $bb_cfg['posts_per_page']; $select_ppp = ''; if ($userdata['session_admin']) { - if ($req_ppp = abs((int)(@$_REQUEST['ppp'])) and in_array($req_ppp, $bb_cfg['allowed_posts_per_page'])) { + if ($req_ppp = abs((int)(@$_REQUEST['ppp'])) and in_array($req_ppp, $bb_cfg['allowed_posts_per_page'], true)) { $posts_per_page = $req_ppp; }