run wrong values in error message through htmlspecialchars()

This commit is contained in:
Ralf Becker 2009-09-21 06:51:05 +00:00
parent 6648c7c404
commit ff0f2dcbbe
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,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

@ -27,7 +27,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]));
}