summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-06-11 12:16:12 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2013-06-12 13:26:03 -0400
commita957ab19cdf3e86fe78a4bf82f287d8c622cf67e (patch)
tree3110c276effc664c25e5e71da5fa45abfde1d77a /lib
parent778f5b203db6db57d875070f4cff5a96738f326b (diff)
downloadampache-a957ab19cdf3e86fe78a4bf82f287d8c622cf67e.tar.gz
ampache-a957ab19cdf3e86fe78a4bf82f287d8c622cf67e.tar.bz2
ampache-a957ab19cdf3e86fe78a4bf82f287d8c622cf67e.zip
Abstract serialization within Query
Diffstat (limited to 'lib')
-rw-r--r--lib/class/query.class.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/class/query.class.php b/lib/class/query.class.php
index 139421f7..d586d726 100644
--- a/lib/class/query.class.php
+++ b/lib/class/query.class.php
@@ -225,6 +225,14 @@ class Query {
$db_results = Dba::write($sql);
}
+ private static function _serialize($data) {
+ return serialize($data);
+ }
+
+ private static function _unserialize($data) {
+ return unserialize($data);
+ }
+
/**
* set_filter
* This saves the filter data we pass it.
@@ -651,7 +659,7 @@ class Query {
$row = Dba::fetch_assoc($db_results);
- $this->_cache = unserialize($row['object_data']);
+ $this->_cache = self::_unserialize($row['object_data']);
return $this->_cache;
}
else {
@@ -1433,7 +1441,7 @@ class Query {
$this->set_total(count($object_ids));
$id = $this->id;
if ($id != 'nocache') {
- $data = serialize($this->_cache);
+ $data = self::_serialize($this->_cache);
$sql = 'UPDATE `tmp_browse` SET `object_data` = ? ' .
'WHERE `sid` = ? AND `id` = ?';