mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 09:03:36 +08:00
Prevent invalid LESS from crashing application
Failure is silent for now... The default LESS will compile without the invalid customisations. Not sure if we should log an error somewhere and display it on the admin page? closes #400
This commit is contained in:
parent
aa9e867f77
commit
35dfe10513
|
@ -11,6 +11,7 @@
|
|||
namespace Flarum\Assets;
|
||||
|
||||
use Less_Parser;
|
||||
use Less_Exception_Parser;
|
||||
|
||||
class LessCompiler extends RevisionCompiler
|
||||
{
|
||||
|
@ -28,7 +29,11 @@ class LessCompiler extends RevisionCompiler
|
|||
}
|
||||
|
||||
foreach ($this->strings as $callback) {
|
||||
$parser->parse($callback());
|
||||
try {
|
||||
$parser->parse($callback());
|
||||
} catch (Less_Exception_Parser $e) {
|
||||
// TODO: log an error somewhere?
|
||||
}
|
||||
}
|
||||
|
||||
return $parser->getCss();
|
||||
|
|
Loading…
Reference in New Issue
Block a user