mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-01 12:40:45 -04:00
Fix delete() function of DB based Cache driver. It expected a scalar key / tag value, but it was always an array of keys / tags.
(compare to system/libraries/Cache.php and the File.php driver)
This commit is contained in:
@@ -153,15 +153,17 @@ class Cache_Database_Driver extends Cache_Driver {
|
||||
* @param bool delete a tag
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($id, $tag=false) {
|
||||
public function delete($keys, $is_tag=false) {
|
||||
$db = db::build()
|
||||
->delete("caches");
|
||||
if ($id === true) {
|
||||
if ($keys === true) {
|
||||
// Delete all caches
|
||||
} else if ($tag === true) {
|
||||
$db->where("tags", "LIKE", "%<$id>%");
|
||||
} else if ($is_tag === true) {
|
||||
foreach ($keys as $tag) {
|
||||
$db->where("tags", "LIKE", "%<$tag>%");
|
||||
}
|
||||
} else {
|
||||
$db->where("key", "=", $id);
|
||||
$db->where("key", "IN", $keys);
|
||||
}
|
||||
|
||||
$status = $db->execute();
|
||||
|
||||
Reference in New Issue
Block a user