php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21297 CGI/CLI '#!php' handler doesn't skip LF if CR present
Submitted: 2002-12-30 14:36 UTC Modified: 2003-01-07 18:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: benjamin at rqdq dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4CVS-2002-12-30 (dev) OS: Any
Private report: No CVE-ID: None
 [2002-12-30 14:36 UTC] benjamin at rqdq dot com
  a real simple one...

  in the cli sapi (checked latest in cvs) will check the first byte for '#' to see if it should skip past a script parser line... it will skip until it reaches CR or LF, but if it hits CR, the LF is left as the first byte to be executed by the engine, so the script produces output. 

  example...

  #!c:\php4\php-cli.exe -c c:\php4\ [CR] [LF]
  <?
  ?>[EOF]

  will produce output - the LF.

  mostly a windows issue, but since i send code back and forth from unix & windows machines, sometimes i may have cr/lf in them - and it this would break there as well.

  -benjamin

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-07 18:45 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 18:01:29 2024 UTC