From 52ecf12fd9c281c7eb68ea9d6d37bb239100cc23 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 16 Sep 2018 02:45:27 +0200 Subject: [PATCH] Added character check to colour_from_hex. --- src/colour.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/colour.php b/src/colour.php index 536d1d12..e83b7d08 100644 --- a/src/colour.php +++ b/src/colour.php @@ -126,6 +126,10 @@ function colour_from_hex(int &$colour, string $hex): bool return false; } + if (!ctype_xdigit($hex)) { + return false; + } + colour_from_rgb( $colour, hexdec(mb_substr($hex, 0, 2)),