mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 15:19:55 +03:00
fix(sqlitecache): store blob as blob (#3555)
serialize() can return output with null bytes and other non-text data. The prior behavior truncated data which later results in unserialize() errors. This happens when e.g. caching an object with a private field or when caching e.g. a JPEG file (starts with 0xFFD8FFE1) Fixes errors such as e.g.: unserialize(): Error at offset 20 of 24 bytes at caches/SQLiteCache.php line 51
This commit is contained in:
parent
663729cf19
commit
0a118310cb
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ class SQLiteCache implements CacheInterface
|
|||
|
||||
$stmt = $this->db->prepare('INSERT OR REPLACE INTO storage (key, value, updated) VALUES (:key, :value, :updated)');
|
||||
$stmt->bindValue(':key', $this->getCacheKey());
|
||||
$stmt->bindValue(':value', $blob);
|
||||
$stmt->bindValue(':value', $blob, \SQLITE3_BLOB);
|
||||
$stmt->bindValue(':updated', time());
|
||||
$stmt->execute();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue