mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 06:57:22 +08:00
fix can not remove all tags
This commit is contained in:
@@ -5311,6 +5311,9 @@ function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
|
|||||||
if ($sync) {
|
if ($sync) {
|
||||||
sql_query("delete from torrent_tags where torrent_id = $torrentId");
|
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 ';
|
$insertTagsSql = 'insert into torrent_tags (`torrent_id`, `tag_id`, `created_at`, `updated_at`) values ';
|
||||||
$values = [];
|
$values = [];
|
||||||
foreach ($tagIdArr as $tagId) {
|
foreach ($tagIdArr as $tagId) {
|
||||||
|
|||||||
+1
-3
@@ -224,9 +224,7 @@ if (!empty($_POST['custom_fields'])) {
|
|||||||
* @since v1.6
|
* @since v1.6
|
||||||
*/
|
*/
|
||||||
$tagIdArr = array_filter($_POST['tags'] ?? []);
|
$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"])
|
if($CURUSER["id"] == $row["owner"])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user