|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-12-19 09:09 UTC] jbourguignon at ecritel dot net
[2000-12-22 17:41 UTC] sas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jul 09 21:00:02 2026 UTC |
Hi, When compiling php with --enable-trans-sid I get a rather strange behaviour : double quotes are inserted in javascript (between <script> and </script>) Here's my page : <html> <head> <script language="Javascript"> function MM_preloadImages() { var d=document; if(d.images) { if(!d.MM_p) d.MM_p=new Array(); var a = MM_preloadImages.arguments; var i; var j = d.MM_p.length; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; } toto=a[i]; } } to=a[i]; to<a[i]; to=a[j]; to=b[i]; to=a; to=a[2]; to=a[]; to=a[2] to = a[ 2 ] ; to=a[ ]; to=b[] to=b to=ab to ab; to=b ; </script> oto=a[i]; </head> <body onload="javascript:toto=a[2];"> titi a[i]; </body> </html> All the to=... are here cos I tried to find out which "rule" the bug followed. It looks it has sthg to do with the "=" sign but I'm not positive :) Here's the result once parsed by PHP (this one was a command line one but we got the same with an Apache buil-in version) [root@smokyracle php-4.0.3pl1]# ./php index.php X-Powered-By: PHP/4.0.3pl1 Set-Cookie: PHPSESSID=18f7e65b019e224a86c02c036ff0bc8a; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html <html> <head> <script language="Javascript"> function MM_preloadImages() { var d=document; if(d.images) { if(!d.MM_p) d.MM_p=new Array(); var a = MM_preloadImages.arguments; var i; var j = d.MM_p.length; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src="a[i];" } toto="a[i];" } } to="a[i];" to<a[i]; to="a[j];" to="b[i];" to="a;" to="a[2];" to="a[];" to="a[2]" to = "a[" 2 ] ; to="a[" ]; to="b[]" to="b" to="ab" to ab; to="b" ; </script> oto=a[i]; </head> <body onload="javascript:toto=a[2];"> titi a[i]; </body> </html> I really don't think it's a feature :) Thank you Jerome