php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13375 Line break causes parse problem
Submitted: 2001-09-21 08:33 UTC Modified: 2002-01-03 18:00 UTC
From: kumar at chicagomodular dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.5 OS: LINUX
Private report: No CVE-ID: None
 [2001-09-21 08:33 UTC] kumar at chicagomodular dot com
hmmm.. didn't catch this in the include() notes or docs: 
PHP 4.0.5 doesn't seem to process an include() file 
correctly if the file has comments on the first line after 
the "<?" 

took me a while to try it without the comments but my 
function only worked when I did. the include file looked 
like this: 

<? 
//some comments on first line 

function null_zero_val($zero_val) { 
if ($zero_val == '0') { 
$zero_val = ''; 
return $zero_val; 
} 
else { 
return $zero_val; 
} 
} 

?> 

before I took the comments out all the code was returned in 
the web browser as text without line breaks and an error 
was generated saying call to undefined function

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-12 07:15 UTC] yohgaki@php.net
Cannot reproduce with 4.1.0.
Do you still have problem with 4.1.0?
 [2001-12-12 20:56 UTC] kumar at chicagomodular dot com
Hi.  I tried to ammend this comment once already but I 
couldn't log in (?) even with the correct password.  So I 
am trying again since someone else has posted a comment...  
-----------------------------
I found out what the error was and it wasn't anything to do 
with include().  In turns out that when I made a new 
document to write my include function, BBEdit wasn't set to 
make UNIX line breaks (for some reason).  I haven't tried 
it on PHP 4.1.0.  All I know is that the PHP 4.0.5 
processor on Apache/1.3.20 Server/ Linux mckenna 2.4.3-20 
will spit out any code that doesn't have proper line breaks 
in the <*.php> file.  The code goes right out to the html 
file, as you typed it, complete with sensitive passwords, 
etc, for all the world to see.  A fix should be to make an 
error respond to the wrong line breaks instead of spitting 
out the code.
 [2001-12-13 00:56 UTC] yohgaki@php.net
Please update bug report when you tried with 4.1.0.
I changed Summary for you.
 [2002-01-03 18:00 UTC] lobbin@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 03 04:01:28 2024 UTC