Skip to content
Snippets Groups Projects
Unverified Commit fcbc6130 authored by Andreas Gohr's avatar Andreas Gohr Committed by GitHub
Browse files

Merge pull request #2300 from splitbrain/cssLessFallback

switch extensions if stylesheet in style.ini doesn't exist (backwards compatibility)
parents 5a165017 432cf0d1
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,18 @@ class StyleUtils ...@@ -42,7 +42,18 @@ class StyleUtils
// stylesheets // stylesheets
if(is_array($data['stylesheets'])) foreach($data['stylesheets'] as $file => $mode){ if(is_array($data['stylesheets'])) foreach($data['stylesheets'] as $file => $mode){
$stylesheets[$mode][$incbase.$file] = $webbase; if (!file_exists($incbase . $file)) {
list($extension, $basename) = array_map('strrev', explode('.', strrev($file), 2));
$newExtension = $extension === 'css' ? 'less' : 'css';
if (file_exists($incbase . $basename . '.' . $newExtension)) {
$stylesheets[$mode][$incbase . $basename . '.' . $newExtension] = $webbase;
if ($conf['allowdebug']) {
msg("Stylesheet $file not found, using $basename.$newExtension instead. Please contact developer of \"{$conf['template']}\" template.", 2);
}
continue;
}
}
$stylesheets[$mode][$incbase . $file] = $webbase;
} }
// replacements // replacements
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment