Skip to content
Snippets Groups Projects
Commit c0dee3b7 authored by Demian Katz's avatar Demian Katz
Browse files

Validate unserialized data to avoid "member call on non-object."

parent 80fa1b2c
No related merge requests found
...@@ -58,7 +58,11 @@ class Search extends RowGateway ...@@ -58,7 +58,11 @@ class Search extends RowGateway
// Resource check for PostgreSQL compatibility: // Resource check for PostgreSQL compatibility:
$raw = is_resource($this->search_object) $raw = is_resource($this->search_object)
? stream_get_contents($this->search_object) : $this->search_object; ? stream_get_contents($this->search_object) : $this->search_object;
return unserialize($raw); $result = unserialize($raw);
if (!($result instanceof \VuFind\Search\Minified)) {
throw new \Exception('Problem decoding saved search');
}
return $result;
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment