php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5448 Backslashes in here files not happy
Submitted: 2000-07-08 01:14 UTC Modified: 2000-07-08 06:50 UTC
From: claw at kanga dot nu Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Debian Linux Woody
Private report: No CVE-ID: None
 [2000-07-08 01:14 UTC] claw at kanga dot nu
The following file:

  http://www.kanga.nu/~claw/backslash.php
  http://www.kanga.nu/~claw/backslash.phps

Which reads:

--<cut>--<?

$var = <<< END_VAR
                /(o__.       _____|  \                     |OcO|
 ---------/|-/|-(  ,__)-------|    |   |--------+++++++++/|_| - |_
-----------
       /\/ |/ |/ _ \++++++C+O+M+P+L|E+X+I+T+Y+++++O+F+++/f|  `-'  |
    |\/         / \/      "++++++D+|+S+T+R+I+B+U+T+E+D+( u|       |
 ___| . .____. /______________|
"|++++++S+Y+S+T+E+M+S+\n|_)___(_/-----------
  _| /| |_  || |_             |____|   |        "++++++++\| | | | \
 /__/LL__,) LL__,)                 |  /                    (__|__) \

END_VAR;
?>

<html>
  <body>
  Boo!
  </body>
</html>
--<cut>--

Generates the following syslog warnings:

  Jul  6 16:12:47 bush apache: PHP Warning:  Unexpected character in input:  '\' (ASCII=92) state=5 in /home/claw/public_html/backslash.php on line 11
  Jul  6 16:12:47 bush apache: PHP Warning:  Unexpected character in input:  '\' (ASCII=92) state=5 in /home/claw/public_html/backslash.php on line 12

This is not the problem with reading \n in here files which was reported as the last fix.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-08 01:16 UTC] claw at kanga dot nu
Noet, there is a "\n" on line 11.  There isn't one however on line 12, which also reports an error (the last line of the image).
 [2000-07-08 01:16 UTC] andi at cvs dot php dot net
You need to escape backslahes in here-docs (\\)
 [2000-07-08 06:50 UTC] stas at cvs dot php dot net
Should be fixed in latest CVS.
You still better to escape backslashes, but the warning should go.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 00:01:30 2024 UTC