Bug #13729 Updated: PHP Outputs #! line

From: Date: Wed, 10 Apr 2002 22:46:10 +0000
Subject: Bug #13729 Updated: PHP Outputs #! line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4577@lists.php.net to get a copy of this message
ID: 13729 Updated by: sniper@php.net Reported By: mc@mcslp.com -Status: Duplicate +Status: Closed Bug Type: *General Issues Operating System: Any PHP Version: 4.0.6 New Comment: the patch was applied to CVS a while ago. Previous Comments: ------------------------------------------------------------------------ [2001-10-18 21:04:39] sniper@php.net Duplicate of #9041 ------------------------------------------------------------------------ [2001-10-18 05:00:29] mc@mcslp.com When running PHP either as a CGI or through mod_php, including the #! line causes it to be included in the output. When running as CGI this trips up the browser, when running through mod_php it just appears as an additional part of the display HTML document. The check is in the source code, but it's ignored. The patch to fix is: *** sapi/cgi/cgi_main.c Thu Oct 18 07:01:34 2001 --- sapi/cgi/cgi_main.c.orig Thu Oct 18 06:19:44 2001 *************** *** 699,706 **** return FAILURE; } file_handle.filename = argv0; ! } ! if (file_handle.handle.fp && file_handle.handle.fp!=stdin) { /* #!php support */ c = fgetc(file_handle.handle.fp); if (c == '#') { --- 699,705 ---- return FAILURE; } file_handle.filename = argv0; ! } else if (file_handle.handle.fp && file_handle.handle.fp!=stdin) { /* #!php support */ c = fgetc(file_handle.handle.fp); if (c == '#') { ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=13729&edit=1

« previous php.bugs (#4577) next »