Commit 76a5fa6c authored by Nigel McNie's avatar Nigel McNie
Browse files

Fixed path generation for view layout and block type images

parent 13056f44
......@@ -84,7 +84,8 @@ switch ($type) {
$basepath = 'artefact/' . $ap . '/' . $basepath;
}
header('Content-type: image/png');
if (is_readable(get_config('docroot') . $basepath . '/thumb.png')) {
$path = get_config('docroot') . $basepath . '/thumb.png';
if (is_readable($path)) {
readfile($path);
exit;
}
......@@ -94,8 +95,10 @@ switch ($type) {
header('Content-type: image/png');
$vl = param_integer('vl');
if ($widths = get_field('view_layout', 'widths', 'id', $vl)) {
$path = theme_get_path('images/vl-' . str_replace(',', '-', $widths) . '.png');
readfile($path);
if ($path = theme_get_path('images/vl-' . str_replace(',', '-', $widths) . '.png')) {
readfile($path);
exit;
}
}
readfile(theme_get_path('images/no_thumbnail.png'));
break;
......
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