Originally Posted by
siilike1232
I have currently solved it by replacing part on the code around line 1055:
/**
* @param $bg
*
* @return array|false
*/
protected function get_background_rgb($bg)
{
$color = false;
$bg = trim(str_replace('transparent', '', $bg));
list($red, $green, $blue)= preg_split('/[, :]/', $bg);
if (preg_match('/\d+/', $red.$green.$blue)) {
$red = min((int)$red, 255);
$green = min((int)$green, 255);
$blue = min((int)$blue, 255);
$color = ['r' => $red, 'g' => $green, 'b' => $blue];
}
return $color;
}
Replaced with:
protected function get_background_rgb($bg)
{
$color = false;
$bg = trim(str_replace('transparent', '', $bg));
$components = preg_split('/[, :]/', $bg);
if (count($components) === 3 && preg_match('/^\d+$/', $components[0]) && preg_match('/^\d+$/', $components[1]) && preg_match('/^\d+$/', $components[2])) {
$red = min((int)$components[0], 255);
$green = min((int)$components[1], 255);
$blue = min((int)$components[2], 255);
$color = ['r' => $red, 'g' => $green, 'b' => $blue];
}
return $color;
}
Bookmarks