diff --git a/inc/StyleUtils.php b/inc/StyleUtils.php index 494ed8e0ca42e719759e60c499be7d765fe64a81..e584942c0f48a97e6556f81a2222f2d27337cc03 100644 --- a/inc/StyleUtils.php +++ b/inc/StyleUtils.php @@ -42,7 +42,18 @@ class StyleUtils // stylesheets 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