From: Tim Düsterhus Date: Thu, 17 Apr 2014 14:13:57 +0000 (+0200) Subject: Fix pending report check X-Git-Tag: 2.1.0_Alpha_1~886^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d62c8ddc07ac9b0c46ad8b395ea3332a6606f98;p=GitHub%2FWoltLab%2FWCF.git Fix pending report check see 71b3fabad7123da741f3ce4152017dc2232b539a --- diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php index e213adb0d0..2779e507b9 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php @@ -58,18 +58,19 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager { public function hasPendingReport($objectType, $objectID) { $objectTypeID = $this->getObjectTypeID($objectType); - $sql = "SELECT status + $sql = "SELECT COUNT(*) FROM wcf".WCF_N."_moderation_queue WHERE objectTypeID = ? - AND objectID = ?"; + AND objectID = ? + AND status <> ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array( $objectTypeID, - $objectID + $objectID, + ModerationQueue::STATUS_DONE )); - $status = $statement->fetchColumn(); - return $status !== false && $status != ModerationQueue::STATUS_DONE; + return $statement->fetchColumn() > 0; } /**