From 168b95e3e89201db64dc206f41e175ccfe360957 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 30 Apr 2006 16:52:25 +0000 Subject: [PATCH] r793: - Forgot to implement verify_componentid() - Add verify_nozero() checks to productid and versionid --- includes/api_bug.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/includes/api_bug.php b/includes/api_bug.php index fe32d95..be0e6a1 100644 --- a/includes/api_bug.php +++ b/includes/api_bug.php @@ -93,6 +93,8 @@ class BugAPI extends API */ function verify_productid() { + $this->verify_nozero('productid'); + if (!$this->registry->datastore['product'][ $this->values['productid'] ]) { return false; @@ -108,7 +110,20 @@ class BugAPI extends API */ function verify_componentid() { - + if ($this->values['componentid'] != 0) + { + $product = $this->registry->datastore['product'][ $this->values['product'] ]; + $version = $this->registry->datastore['version'][ $this->values['version'] ]; + if ($component['componentmother'] != $product['productid']) + { + return false; + } + if (($version['productid'] != $component['productid'] AND $version['productid'] != $product['productid']) AND $version['productid'] != 0) + { + return false; + } + } + return true; } // ################################################################### @@ -119,6 +134,8 @@ class BugAPI extends API */ function verify_versionid() { + $this->verify_nozero('versionid'); + if (!$this->registry->datastore['version'][ $this->values['versionid'] ]) { return false; -- 2.22.5