From 5df1dc135b6b1fad77a23cd604f008e0784bdd73 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Dec 2009 12:13:25 -0800 Subject: Fix some bugs in the cache database driver, and update the tests for K24. --- modules/gallery/libraries/drivers/Cache/Database.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/gallery/libraries/drivers/Cache/Database.php') diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php index 5c453f28..82a09ab9 100644 --- a/modules/gallery/libraries/drivers/Cache/Database.php +++ b/modules/gallery/libraries/drivers/Cache/Database.php @@ -90,7 +90,7 @@ class Cache_Database_Driver extends Cache_Driver { ->select() ->from("caches"); foreach ($tags as $tag) { - $db->where("tags", "LIKE", "<$tag>"); + $db->where("tags", "LIKE", "%<$tag>%"); } $db_result = $db->execute(); @@ -153,14 +153,13 @@ class Cache_Database_Driver extends Cache_Driver { * @param bool delete a tag * @return bool */ - public function delete($id, $tag = false) { + public function delete($id, $tag=false) { $db = db::build() ->delete("caches"); if ($id === true) { // Delete all caches - $db->where("1", "=", "1"); } else if ($tag === true) { - $db->where("tags", "LIKE", "<$id>"); + $db->where("tags", "LIKE", "%<$id>%"); } else { $db->where("key", "=", $id); } -- cgit v1.2.3