X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fwebcolor.php;h=6fa603fa2ac89286b47e2b00924808be40577f4f;hb=acaf07f6e8c873e0069e84dac74bac3c7da98a97;hp=65713d26ef7e695821a2faa94c47e9b4ffd54761;hpb=20d93508776398627f5aff64b83bd20a362cb45d;p=quix0rs-gnu-social.git diff --git a/lib/webcolor.php b/lib/webcolor.php index 65713d26ef..6fa603fa2a 100644 --- a/lib/webcolor.php +++ b/lib/webcolor.php @@ -1,6 +1,6 @@ . * * @category Personal - * @package Laconica - * @author Zach Copley - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -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); @@ -163,7 +164,7 @@ class WebColor { $hexcolor .= (strlen(dechex($this->blue)) < 2 ? '0' : '') . dechex($this->blue); - return $hexcolor; + return strtoupper($hexcolor); }