Added character check to colour_from_hex.

This commit is contained in:
flash 2018-09-16 02:45:27 +02:00
parent f12ac03629
commit 52ecf12fd9

View file

@ -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)),