run wrong values in error message through htmlspecialchars()

This commit is contained in:
Ralf Becker 2009-09-21 06:51:43 +00:00
parent 9752dbb70a
commit 5c07584db0
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ foreach(array('width'=>1,'height'=>1,'color1'=>'000080','color2'=>'ffffff') as $
foreach(array('color1','color2') as $name)
{
preg_match('/^#?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/',$$name,$rgb) or
die("Wrong value '".$$name."' for $name, should be something like #80FFFF' !!!");
die("Wrong value '".htmlspecialchars($$name)."' for $name, should be something like #80FFFF' !!!");
$$name = array('r'=>hexdec($rgb[1]),'g'=>hexdec($rgb[2]),'b'=>hexdec($rgb[3]));
}

View File

@ -41,7 +41,7 @@ imagecolortransparent($image, $white);
foreach(array('color','bgcolor') as $name)
{
preg_match('/^#?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/',$$name,$rgb) or
die("Wrong value '".$$name."' for $name, should be something like #80FFFF' !!!");
die("Wrong value '".htmlspecialchars($$name)."' for $name, should be something like #80FFFF' !!!");
$$name = imagecolorallocate($image,hexdec($rgb[1]),hexdec($rgb[2]),hexdec($rgb[3]));
}