Mercurial > hg > batmud > alchtool
changeset 23:6f96cdfbbbac
And another bugfix of the same sort.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 15 Jan 2011 06:26:35 +0200 |
parents | ef3920a6a688 |
children | 8032690680c7 |
files | index.php |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/index.php Sat Jan 15 06:25:36 2011 +0200 +++ b/index.php Sat Jan 15 06:26:35 2011 +0200 @@ -212,10 +212,10 @@ $str = is_array($val) ? $val[0]." / ".$val[1] : $val; // Create image files for the text entries, if they don't already exist - $filename = $imagePath."txt_".preg_replace("/[^a-z0-9]/", "_", strtolower($str)).".png"; - echo " <th><img src=\"".urlencode($filename)."\" alt=\"".htmlentities($str)."\" width=\"".$imgWidth."\" height=\"".$imgHeight."\"></th>\n"; + $filename = "txt_".preg_replace("/[^a-z0-9]/", "_", strtolower($str)).".png"; + echo " <th><img src=\"".$imagePath.urlencode($filename)."\" alt=\"".htmlentities($str)."\" width=\"".$imgWidth."\" height=\"".$imgHeight."\"></th>\n"; - if (!file_exists($filename)) { + if (!file_exists($imagePath.$filename)) { $image = imagecreate($imgWidth, $imgHeight); $c_black = imagecolorallocate($image, 0, 0, 0); $c_white = imagecolorallocate($image, 255, 255, 255); @@ -223,7 +223,7 @@ imagefill($image, 0, 0, $c_black); imagestringup($image, 2, -2, 78, $str, $c_white); - imagepng($image, $filename); + imagepng($image, $imagePath.$filename); imagedestroy($image); chmod($filename, 0644); }