Commit 3075e9c7 authored by drumm's avatar drumm
Browse files

#92430 by Jo Wouters. Encode blobs as blobs.

parent b245ff5b
......@@ -92,9 +92,9 @@ function cache_get($key, $table = 'cache') {
*/
function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
db_lock_table($table);
db_query("UPDATE {%s} SET data = '%s', created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid);
db_query("UPDATE {%s} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid);
if (!db_affected_rows()) {
@db_query("INSERT INTO {%s} (cid, data, created, expire, headers) VALUES ('%s', '%s', %d, %d, '%s')", $table, $cid, $data, time(), $expire, $headers);
@db_query("INSERT INTO {%s} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $table, $cid, $data, time(), $expire, $headers);
}
db_unlock_tables();
}
......
Markdown is supported
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