From dae0d964262ea8d53b1629af898bc46c30bc9501 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 May 2005 07:10:56 +0000 Subject: [PATCH] r146: Only mark and log obsoletes if we have them.. duh --- attachment.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/attachment.php b/attachment.php index 666f543..21db4de 100755 --- a/attachment.php +++ b/attachment.php @@ -124,10 +124,12 @@ if ($_POST['do'] == 'insert') // mark obsoletes $obsoletes = $_POST['obsoletes']; - array_walk($obsoletes, 'intval'); - $db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]"); - - log_action($bug['bugid'], 'log_mark_obsoletes', array($attachmentid, $FILE['name'], implode(', ', $obsoletes))); + if (count($obsoletes) > 0) + { + array_walk($obsoletes, 'intval'); + $db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]"); + log_action($bug['bugid'], 'log_mark_obsoletes', array($attachmentid, $FILE['name'], implode(', ', $obsoletes))); + } // handle comment stuff if (can_perform('canpostcomments') AND trim($bugsys->in['comment'])) -- 2.43.5