From: Zach Copley Date: Tue, 16 Jun 2009 04:21:33 +0000 (-0700) Subject: Throw an WebColorException if wrong # of hex chars X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e7e3709ae0294b8400b85d87f2ebeade5b31858d;p=quix0rs-gnu-social.git Throw an WebColorException if wrong # of hex chars --- diff --git a/lib/webcolor.php b/lib/webcolor.php index 65713d26ef..aaf31d9903 100644 --- a/lib/webcolor.php +++ b/lib/webcolor.php @@ -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);