keep some default value be integer 3

This commit is contained in:
xiaomlove
2021-01-06 02:26:28 +08:00
parent 38dae7c068
commit 69857a62b7
+2 -2
View File
@@ -2934,8 +2934,8 @@ function return_torrent_bookmark_array($userid)
function get_torrent_bookmark_state($userid, $torrentid, $text = false) function get_torrent_bookmark_state($userid, $torrentid, $text = false)
{ {
global $lang_functions; global $lang_functions;
$userid = $userid ?? 0; $userid = intval($userid ?? 0);
$torrentid = $torrentid ?? 0; $torrentid = intval($torrentid ?? 0);
$ret = array(); $ret = array();
$ret = return_torrent_bookmark_array($userid); $ret = return_torrent_bookmark_array($userid);
if (!count($ret) || !in_array($torrentid, $ret, false)) // already bookmarked if (!count($ret) || !in_array($torrentid, $ret, false)) // already bookmarked