fix can not remove all tags

This commit is contained in:
xiaomlove
2022-03-18 21:50:42 +08:00
parent 3ad8fabe7b
commit 805dc002f1
2 changed files with 4 additions and 3 deletions
+3
View File
@@ -5311,6 +5311,9 @@ function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
if ($sync) {
sql_query("delete from torrent_tags where torrent_id = $torrentId");
}
if (empty($tagIdArr)) {
return;
}
$insertTagsSql = 'insert into torrent_tags (`torrent_id`, `tag_id`, `created_at`, `updated_at`) values ';
$values = [];
foreach ($tagIdArr as $tagId) {
+1 -3
View File
@@ -224,9 +224,7 @@ if (!empty($_POST['custom_fields'])) {
* @since v1.6
*/
$tagIdArr = array_filter($_POST['tags'] ?? []);
if (!empty($tagIdArr)) {
insert_torrent_tags($id, $tagIdArr, true);
}
insert_torrent_tags($id, $tagIdArr, true);
if($CURUSER["id"] == $row["owner"])
{