Opened 14 years ago
Closed 14 years ago
#3418 closed defect (fixed)
[PATCH] imgObj->saveImage(null); sends unnecessary headers
Reported by: | adrive | Owned by: | aboudreault |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapScript-PHP | Version: | 5.6 |
Severity: | normal | Keywords: | header saveimage |
Cc: |
Description
As mentioned in this discussion http://n2.nabble.com/PHP-imgObj-saveImage-null-sends-headers-td4854424.html
imgObj->saveImage(null) sends unnecessary headers.
<?php error_reporting(E_ALL); ini_set('display_errors', 'on'); $map = ms_newMapObj('./test.map'); $img = $map->draw(); ob_start(); $img->saveImage(null); $data = ob_get_clean(); header('Content-type: image/jpeg'); echo $data;
is producing error Warning: Cannot modify header information - headers already sent in /www/test/buffer/mapserver/ob-reproduce.php on line 11
Tested on PHP 5.2.6 and PHP 5.3.2
Attachments (2)
Change History (5)
by , 14 years ago
Attachment: | php_mapscript.patch added |
---|
by , 14 years ago
Attachment: | testcase.tar added |
---|
comment:1 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Since the function php_header() behavior depends on many factors, I decided to not call this function ONLY when there is an output buffer active. That way, it'll not change the old behavior of the saveImage() function for those special cases.
Fixed and committed in r10066.
comment:2 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Can you merge that changeset also into branch-5.6, please?
patch removing php_header call