From 61fdc49bea6a1a2a8b4b063aeb3d2f40cea507f9 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 23 Sep 2009 13:13:40 -0400 Subject: [PATCH] Better check for valid resource --- kronolith/lib/Driver/Resource.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kronolith/lib/Driver/Resource.php b/kronolith/lib/Driver/Resource.php index 2bdf22abe..216891191 100644 --- a/kronolith/lib/Driver/Resource.php +++ b/kronolith/lib/Driver/Resource.php @@ -389,10 +389,13 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql * calendar. * * @param Kronolith_Resource $resource The kronolith resource to remove + * + * @return boolean + * @throws Horde_Exception */ public function delete($resource) { - if (!$resource->get('calendar') || !$resource->getId()) { + if (!($resource instanceof Kronolith_Resource_Base) || !$resource->getId()) { throw new Horde_Exception(_("Resource not valid.")); } -- 2.11.0