From 4c20bffab38da3dd0ebfb001d20f8350e29e75a4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 30 Oct 2012 21:13:28 +0100 Subject: [PATCH] Fixed handling of empty lines and hashes --- files/lib/acp/form/StyleAddForm.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/lib/acp/form/StyleAddForm.class.php b/files/lib/acp/form/StyleAddForm.class.php index 9b62c21d54..159bf7702f 100644 --- a/files/lib/acp/form/StyleAddForm.class.php +++ b/files/lib/acp/form/StyleAddForm.class.php @@ -319,11 +319,17 @@ class StyleAddForm extends ACPForm { } $lines = explode("\n", StringUtil::unifyNewlines($this->variables['overrideLess'])); - $regEx = new Regex('^@([a-zA-Z]+): ?([@a-zA-Z0-9 ,\.\(\)\%]+);$'); + $regEx = new Regex('^@([a-zA-Z]+): ?([@a-zA-Z0-9 ,\.\(\)\%\#]+);$'); $errors = array(); foreach ($lines as $index => &$line) { $line = StringUtil::trim($line); + // ignore empty lines + if (empty($line)) { + unset($lines[$index]); + continue; + } + if ($regEx->match($line)) { $matches = $regEx->getMatches(); -- 2.20.1