SerializedType:: toPHP fails with Postgres when data is stored as BLOB
The open source CMS powered by CakePHP v2 Framework
Brought to you by:
quickapps
Originally created by: aydot
Since Postgres stores uncorrupted serialized data as BLOB (bytea column type)
[https://github.com/quickapps/cms/blob/2.0/src/Database/Type/SerializedType.php#L34] could be improved by having
public function toPHP($value, Driver $driver)
{
if (is_resource($value)) {
return @unserialize(stream_get_contents($value));
}
if ($this->_isSerialized($value)) {
//@codingStandardsIgnoreStart
$value = @unserialize($value);
//@codingStandardsIgnoreEnd
}
return $value;
}
I'd happy to create a pull request and have a test for it.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: quickapps
I see,
could you please create the pull request and test case you mentioned? I would really appreciate it.
Thanks for reporting this one :)