From: avaurus at schipplock dot de
Operating system: Windows 2000
PHP version: 4.3.2
PHP Bug Type: Zlib Related
Bug description: gzencode encodes invalid data only if you use variables
<?php
# look at this :
# -----------------
# try to use just strings instead of variables -> will work :>
# try to use variables instead of just strings -> will NOT work :/
# -----------------
# it is really a mess with some functions of php under windows
$fontfile = str_rot13($id);
$gzfilename = str_replace(".ttf","",$fontfile);
header("Content-Disposition: attachment;
filename=\"$gzfilename.gz\"");
header("Content-type: application/x-gzip");
$data = implode("", file("fonts/".$fontfile));
$gzdata = gzencode($data, 9);
$fp = fopen("fonts/".$gzfilename.".gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
readfile("fonts/".$gzfilename.".gz");
?>
--
Edit bug report at http://bugs.php.net/?id=23878&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23878&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23878&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23878&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23878&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23878&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23878&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23878&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23878&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23878&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23878&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23878&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23878&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23878&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23878&r=gnused