Commit 05abaad2 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1694158 - Fix site logo not loading allowed extensions within the selected custom theme"

parents 4acfe8f7 ee6a4086
......@@ -1344,10 +1344,25 @@ class Theme {
$extensions = array('svg', 'png', 'gif', 'jpg');
// Check for all images extension in the correct order.
$temps = array();
foreach ($extensions as $ext) {
$temploc = $this->_get_path("images/$filename.$ext", false, $plugindirectory, '', false);
if (is_readable(get_config('docroot') . $temploc)) {
$loc = $temploc;
$temps["images/$filename.$ext"] = $temploc;
}
// Now check for which image exists by theme order
$inheritance = $this->inheritance;
array_unshift($inheritance, 'local'); // Add local dir to be checked first
foreach ($inheritance as $theme) {
foreach ($temps as $key => $temploc) {
$pluginpath = $plugindirectory ? 'plugintype/' . $plugindirectory . '/' : '';
$tplfile = 'theme/' . $theme . '/' . $pluginpath . $key;
if ($temploc == $tplfile && is_readable(get_config('docroot') . $temploc)) {
$loc = $temploc;
break;
}
}
if ($loc != '') {
// we've found a valid file in the theme
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