[PHP-DEV] PHP 4.0 Bug #7831: first session creation generate unwanted carachters INTO javascript source code From: giancarlo.favaretti <email protected>
Date: 11/15/00

From: giancarlo.favaretti <email protected>
Operating system: WINDOWS NT 4.0
PHP version: 4.0.3pl1
PHP Bug Type: *Session related
Bug description: first session creation generate unwanted carachters INTO javascript source code

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!

-- 
Edit Bug report at: http://bugs.php.net/?id=7831&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>