Commit 0fd34352 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4549 (Greater tolerance for corrupt PHP serialized data)

parent d1c3d32f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -823,7 +823,13 @@ function _get_cache_entries($dets, $special_cache_flags = null)

                $cache_row['the_value'] = $ob;
            } else {
                $cache_row['the_value'] = unserialize($cache_row['the_value']);
                $cache_row['the_value'] = @unserialize($cache_row['the_value']);

                if ($cache_row['the_value'] === false) { // Corrupt data
                    $cache[$sz] = null;
                    $rets[] = null;
                    continue;
                }
            }
        }

+4 −1
Original line number Diff line number Diff line
@@ -96,7 +96,10 @@ class Hook_cron_block_caching
        $requests = $GLOBALS['SITE_DB']->query_select('cron_caching_requests', array('*'), $where);
        foreach ($requests as $request) {
            $codename = $request['c_codename'];
            $map = unserialize($request['c_map']);
            $map = @unserialize($request['c_map']);
            if (!is_array($map)) {
                $map = array();
            }

            list($object, $new_security_scope) = do_block_hunt_file($codename, $map);

+5 −1
Original line number Diff line number Diff line
@@ -59,7 +59,11 @@ class Persistent_caching_eacceleratorcache
        if ((!is_null($min_cache_date)) && ($data[0] < $min_cache_date)) {
            return null;
        }
        return unserialize($data[1]);
        $ret = @unserialize($data[1]);
        if ($ret === false) {
            return null;
        }
        return $ret;
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -94,6 +94,9 @@ class Persistent_caching_filecache
        }

        $ret = @unserialize($contents);
        if ($ret === false) {
            $ret = null;
        }

        flock($myfile, LOCK_UN);
        fclose($myfile);
+4 −1
Original line number Diff line number Diff line
@@ -67,7 +67,10 @@ class Persistent_caching_memcache
        if ($_data === false) {
            return null;
        }
        $data = unserialize($_data);
        $data = @unserialize($_data);
        if ($data === false) {
            return null;
        }
        if ((!is_null($min_cache_date)) && ($data[0] < $min_cache_date)) {
            return null;
        }
Loading