Fixed handling of empty lines and hashes
authorAlexander Ebert <ebert@woltlab.com>
Tue, 30 Oct 2012 20:13:28 +0000 (21:13 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 30 Oct 2012 20:13:28 +0000 (21:13 +0100)
files/lib/acp/form/StyleAddForm.class.php

index 9b62c21d540f0e29e4e1b39c3fffbd1c01d23a14..159bf7702fba07b9c7e92d000cedd53cb8bea020 100644 (file)
@@ -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();