Correctly deal with CSS strings that begin with '-'.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 13 Oct 2009 15:46:58 +0000 (09:46 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 14 Oct 2009 09:37:18 +0000 (03:37 -0600)
framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy/class.csstidy_optimise.php

index 9a4ceb6..7dc355e 100644 (file)
@@ -398,7 +398,10 @@ class csstidy_optimise
 
             if (floatval($temp[$l]) == 0)
             {
-                $temp[$l] = '0';
+                /* Deal with values that begin with '-'. */
+                if (is_numeric($temp[$l])) {
+                    $temp[$l] = '0';
+                }
             }
             else
             {
@@ -806,4 +809,4 @@ class csstidy_optimise
         return $input_css;
     }
 }
-?>
\ No newline at end of file
+?>