]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Throw an WebColorException if wrong # of hex chars
authorZach Copley <zach@controlyourself.ca>
Tue, 16 Jun 2009 04:21:33 +0000 (21:21 -0700)
committerZach Copley <zach@controlyourself.ca>
Tue, 16 Jun 2009 04:21:33 +0000 (21:21 -0700)
lib/webcolor.php

index 65713d26ef7e695821a2faa94c47e9b4ffd54761..aaf31d990363921d3036a3878cd683fcd200557a 100644 (file)
@@ -120,7 +120,8 @@ class WebColor {
                                      $hexcolor[1].$hexcolor[1],
                                      $hexcolor[2].$hexcolor[2]);
         } else {
-            return false;
+            $errmsg = _('%s is not a valid color! Use 3 or 6 hex chars.');
+            throw new WebColorException(sprintf($errmsg, $hexcolor));
         }
 
         $this->red   = hexdec($r);