Commit c6a7c77b authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review

Merge "Check image file exists in db (bug #992930)"

parents cda6ff9a c61c4423
......@@ -71,8 +71,8 @@ switch ($type) {
}
}
if ($id) {
if ($path = get_dataroot_image_path('artefact/file/profileicons', get_field('artefact_file_files', 'fileid', 'artefact', $id), $size)) {
if ($id && $fileid = get_field('artefact_file_files', 'fileid', 'artefact', $id)) {
if ($path = get_dataroot_image_path('artefact/file/profileicons', $fileid, $size)) {
if ($mimetype) {
header('Content-type: ' . $mimetype);
......@@ -192,4 +192,4 @@ function readfile_exit($path) {
readfile($path);
perf_to_log();
exit;
}
\ No newline at end of file
}
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