Added character check to colour_from_hex.
This commit is contained in:
parent
f12ac03629
commit
52ecf12fd9
1 changed files with 4 additions and 0 deletions
|
@ -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)),
|
||||
|
|
Loading…
Reference in a new issue