From a957ab19cdf3e86fe78a4bf82f287d8c622cf67e Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Tue, 11 Jun 2013 12:16:12 -0400 Subject: Abstract serialization within Query --- lib/class/query.class.php | 12 ++++++++++-- 1 file 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` = ?'; -- cgit