php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22577 url rewrite messes up Javascript area tag
Submitted: 2003-03-06 16:37 UTC Modified: 2003-03-06 22:11 UTC
From: mreuter at gmx dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
 [2003-03-06 16:37 UTC] mreuter at gmx dot de
Hi,
after creating a new session with use_trans_sid enabled, php messes up my javascript area tag.
Here is a shortend test file:

<?php session_start();?>
<html>
<head>
<title>Testseite</title>
<script type="text/javascript">
<!--
  document.writeln("<map name=\"Mmap\"><area shape=\"rect\"></map>");
//-->
</script>
</head>
<body>
<a href="next.php"> next </a>
</body>
</html>

The document.writeln is changed to:

document.writeln("<map name=\"Mmap\"><area shape="\""rect\"></map>");

with the "\"" instead of \" it produces errors.

Since I cannot update to a newer Php, a workaround would be very helpful.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-06 16:43 UTC] andrew@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Sorry, but this issue should be sent to the php.general newslist (if in fact there is a PHP error, which i sincerely doubt).. Otherwise, this is an HTML issue, and bears no dependencies with PHP.

~ Andrew Heebner
 [2003-03-06 16:59 UTC] mreuter at gmx dot de
Hi again,
it is a bug with php!!
php tries to put " around the first word after the first = inside an area tag, no matter if it is inside a Javascript command or not. This leads as in my example to broken code. It only happens when using session.
I just found a workaround. One can split the String passed to document.writeln after the first = in area like this:
... area shape="+"\"rect\">...
and php will not put new " characters.

Still it is a bug.
 [2003-03-06 17:19 UTC] andrew@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


I don't see how this is remotely caused by PHP, when your javascript lines aren't even being parsed by PHP itself.  The only PHP i see in the file is the session_start(), and that's it.

Please send more info as to how this is being run, and also, an active online example could help.

Marking this as (feedback) until more info is passed along.

~ Andrew Heebner
 [2003-03-06 17:31 UTC] mreuter at gmx dot de
It is a similar bug to
Bug #5963

my short example is online now:
http://www.e-church.de/start.php

php parses the code, because it tries to place the trans-sid, which it does correctly with the <a href ..>.
 [2003-03-06 22:11 UTC] sniper@php.net
This was a bug which have been fixed.
(not sure if it was fixed already in 4.3.0 but it sure
works fine with 4.3.2-dev)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 11:01:32 2024 UTC