summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/Gallery_I18n.php4
-rw-r--r--modules/gallery/libraries/drivers/Cache/Database.php9
2 files changed, 7 insertions, 6 deletions
diff --git a/modules/gallery/libraries/Gallery_I18n.php b/modules/gallery/libraries/Gallery_I18n.php
index 42fae266..9a5e7dc1 100644
--- a/modules/gallery/libraries/Gallery_I18n.php
+++ b/modules/gallery/libraries/Gallery_I18n.php
@@ -131,7 +131,7 @@ class Gallery_I18n_Core {
foreach (db::build()
->select("key", "translation")
->from("incoming_translations")
- ->where(array("locale" => $locale))
+ ->where("locale", "=", $locale)
->execute()
->as_array() as $row) {
$this->_cache[$locale][$row->key] = unserialize($row->translation);
@@ -141,7 +141,7 @@ class Gallery_I18n_Core {
foreach (db::build()
->select("key", "translation")
->from("outgoing_translations")
- ->where(array("locale" => $locale))
+ ->where("locale", "=", $locale)
->execute()
->as_array() as $row) {
$this->_cache[$locale][$row->key] = unserialize($row->translation);
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php
index eda445b6..a317798e 100644
--- a/modules/gallery/libraries/drivers/Cache/Database.php
+++ b/modules/gallery/libraries/drivers/Cache/Database.php
@@ -86,7 +86,7 @@ class Cache_Database_Driver extends Cache_Driver {
public function get_tag($tags) {
$db = db::build()->from("caches");
foreach ($tags as $tag) {
- $db->where("tags", "like", "<$tag>");
+ $db->where("tags", "LIKE", "<$tag>");
}
$db_result = $db->execute()->as_array();
@@ -152,12 +152,12 @@ class Cache_Database_Driver extends Cache_Driver {
public function delete($id, $tag = false) {
$this->db->from("caches");
if ($id === true) {
- $this->db->where(1);
// Delete all caches
+ $this->db->where("1", "=", "1");
} else if ($tag === true) {
$this->db->like("tags", "<$id>");
} else {
- $this->db->where("key", $id);
+ $this->db->where("key", "=", $id);
}
$status = $this->db->delete();
@@ -178,7 +178,8 @@ class Cache_Database_Driver extends Cache_Driver {
public function delete_expired() {
// Delete all expired caches
$status = $this->db->from("caches")
- ->where(array("expiration !=" => 0, "expiration <=" => time()))
+ ->where("expiration", "<>", 0)
+ ->where("expiration", "<=", time())
->delete();
return count($status) > 0;