Commit 768ed4d1 by Scott

Fix blob missing from disk (but still in database)

parent 18aacb0f
...@@ -133,7 +133,11 @@ ...@@ -133,7 +133,11 @@
{ {
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); } if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
return file_get_contents(qa_get_blob_filename($blobid, $format)); $filename = qa_get_blob_filename($blobid, $format);
if (is_readable($filename))
return file_get_contents($filename);
else
return null;
} }
......
...@@ -47,7 +47,7 @@ qa_db_connect('qa_blob_db_fail_handler'); ...@@ -47,7 +47,7 @@ qa_db_connect('qa_blob_db_fail_handler');
$blob = qa_read_blob(qa_get('qa_blobid')); $blob = qa_read_blob(qa_get('qa_blobid'));
if (isset($blob)) { if (isset($blob) && isset($blob['content'])) {
// allows browsers and proxies to cache the blob (30 days) // allows browsers and proxies to cache the blob (30 days)
header('Cache-Control: max-age=2592000, public'); header('Cache-Control: max-age=2592000, public');
......
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