Commit c61c4423 authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Check image file exists in db (bug #992930)



Change-Id: If385b84ed6f026922b68f7bf49d0853383a68354
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 93786ea3
......@@ -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