mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes an issue where using invalid CSS in brand settings completely breaks the backend
This commit is contained in:
parent
58ace7ee6c
commit
445c95ad46
@ -5,6 +5,7 @@ use Lang;
|
||||
use Model;
|
||||
use Cache;
|
||||
use Less_Parser;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Backend settings that affect all users
|
||||
@ -81,8 +82,14 @@ class BrandSettings extends Model
|
||||
return Cache::get(self::CACHE_KEY);
|
||||
}
|
||||
|
||||
$customCss = self::compileCss();
|
||||
Cache::forever(self::CACHE_KEY, $customCss);
|
||||
try {
|
||||
$customCss = self::compileCss();
|
||||
Cache::forever(self::CACHE_KEY, $customCss);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
$customCss = '/* ' . $ex->getMessage() . ' */';
|
||||
}
|
||||
|
||||
return $customCss;
|
||||
}
|
||||
|
||||
@ -108,8 +115,8 @@ class BrandSettings extends Model
|
||||
$parser->ModifyVars($vars);
|
||||
|
||||
$parser->parse(
|
||||
File::get(base_path().'/modules/backend/models/brandsettings/custom.less')
|
||||
. self::get('custom_css')
|
||||
File::get(base_path().'/modules/backend/models/brandsettings/custom.less') .
|
||||
self::get('custom_css')
|
||||
);
|
||||
|
||||
$css = $parser->getCss();
|
||||
|
Loading…
x
Reference in New Issue
Block a user