php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7831 first session creation generate unwanted carachters INTO javascript source code
Submitted: 2000-11-15 11:09 UTC Modified: 2000-12-02 08:59 UTC
From: giancarlo dot favaretti at inforeti dot it Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: WINDOWS NT 4.0
Private report: No CVE-ID: None
 [2000-11-15 11:09 UTC] giancarlo dot favaretti at inforeti dot it
I have a script using sessions and returning to the browser some javascript code. The first time I run the script (throug the browser or even in a command shell) I get some additional '"' characters into <script> tag and javascript goes in error. After the first run (i.e. the session already exists) everithing is OK.

i.e. using the script:
---------------------------------------
<? session_start(); ?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
............
-----------------------------------------
I get the following response:
-----------------------------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" x.src="x.oSrc;
"
}
......
-----------------------------------------
The problem affects PHP4pl1 in Windows NT 4.0 with both IIS4 and Apache.
Moving the script into Linux enviroment everithing goes OK!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-02 08:59 UTC] sas@php.net
This has been addressed in the forth-coming PHP 4.0.4.

Thanks for using PHP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC