Fix storing "empty" values in rcube_cache/rcube_cache_shared (#5519)

pull/5754/head
Aleksander Machniak 8 years ago
parent c633e605dd
commit 7f04df9ec0

@ -13,6 +13,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where it wasn't possible to store more that 2MB objects in memcache/apc,
Added memcache_max_allowed_packet and apc_max_allowed_packet settings (#5452)
- Fix "Illegal string offset" warning in rcube::log_bug() on PHP 7.1 (#5508)
- Fix storing "empty" values in rcube_cache/rcube_cache_shared (#5519)
RELEASE 1.2.2
-------------

@ -280,7 +280,7 @@ class rcube_cache
}
}
if ($data) {
if ($data !== false) {
$md5sum = md5($data);
$data = $this->unserialize($data);
@ -306,10 +306,9 @@ class rcube_cache
0, 1, $this->userid, $this->prefix.'.'.$key);
if ($sql_arr = $this->db->fetch_assoc($sql_result)) {
$key = substr($sql_arr['cache_key'], strlen($this->prefix)+1);
$md5sum = $sql_arr['data'] ? md5($sql_arr['data']) : null;
if ($sql_arr['data']) {
$data = $this->unserialize($sql_arr['data']);
if (strlen($sql_arr['data']) > 0) {
$md5sum = md5($sql_arr['data']);
$data = $this->unserialize($sql_arr['data']);
}
if ($nostore) {

@ -275,7 +275,7 @@ class rcube_cache_shared
}
}
if ($data) {
if ($data !== false) {
$md5sum = md5($data);
$data = $this->unserialize($data);
@ -301,9 +301,9 @@ class rcube_cache_shared
0, 1, $this->prefix . '.' . $key);
if ($sql_arr = $this->db->fetch_assoc($sql_result)) {
$md5sum = $sql_arr['data'] ? md5($sql_arr['data']) : null;
if ($sql_arr['data']) {
$data = $this->unserialize($sql_arr['data']);
if (strlen($sql_arr['data']) > 0) {
$md5sum = md5($sql_arr['data']);
$data = $this->unserialize($sql_arr['data']);
}
if ($nostore) {

Loading…
Cancel
Save