diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-06-02 14:33:11 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-06-02 14:46:36 +0200 |
commit | 72c8504b99fbd423651bab0180a044c489ca05cc (patch) | |
tree | d7903d6e17aacbee1637642a0530bb8ea9e7a6ee /program/lib/Roundcube/rcube_imap_cache.php | |
parent | 6213c6a6e18848d861f2add83bdb69a1de3f5956 (diff) |
Fix bug where serialized strings were truncated in PDO::quote() (#1489142)
Conflicts:
CHANGELOG
program/lib/Roundcube/rcube_cache_shared.php
Diffstat (limited to 'program/lib/Roundcube/rcube_imap_cache.php')
-rw-r--r-- | program/lib/Roundcube/rcube_imap_cache.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php index 89e3ceb6f..a3bdf2196 100644 --- a/program/lib/Roundcube/rcube_imap_cache.php +++ b/program/lib/Roundcube/rcube_imap_cache.php @@ -419,7 +419,7 @@ class rcube_imap_cache } unset($msg->flags); - $msg = serialize($this->db->encode($msg)); + $msg = $this->db->encode($msg, true); // update cache record (even if it exists, the update // here will work as select, assume row exist if affected_rows=0) @@ -641,7 +641,7 @@ class rcube_imap_cache if ($sql_arr = $this->db->fetch_assoc($sql_result)) { $data = explode('@', $sql_arr['data']); - $index = @unserialize($data[0]); + $index = $this->db->decode($data[0], true); unset($data[0]); if (empty($index)) { @@ -678,7 +678,7 @@ class rcube_imap_cache if ($sql_arr = $this->db->fetch_assoc($sql_result)) { $data = explode('@', $sql_arr['data']); - $thread = @unserialize($data[0]); + $thread = $this->db->decode($data[0], true); unset($data[0]); if (empty($thread)) { @@ -704,7 +704,7 @@ class rcube_imap_cache $data, $mbox_data = array(), $exists = false, $modseq = null) { $data = array( - serialize($data), + $this->db->encode($data, true), $sort_field, (int) $this->skip_deleted, (int) $mbox_data['UIDVALIDITY'], @@ -737,7 +737,7 @@ class rcube_imap_cache private function add_thread_row($mailbox, $data, $mbox_data = array(), $exists = false) { $data = array( - serialize($data), + $this->db->encode($data, true), (int) $this->skip_deleted, (int) $mbox_data['UIDVALIDITY'], (int) $mbox_data['UIDNEXT'], @@ -1069,7 +1069,7 @@ class rcube_imap_cache */ private function build_message($sql_arr) { - $message = $this->db->decode(unserialize($sql_arr['data'])); + $message = $this->db->decode($sql_arr['data'], true); if ($message) { $message->flags = array(); |