From: franz at fholzinger dot com Operating system: LINUX Red Hat PHP version: 4.4.2 PHP Bug Type: Scripting Engine problem Bug description: weird javascript mangling
Description: ------------ same as bug #7293 weird javascript mangling Same bug here with PHP 4.3.11. See files http://fholzinger.com/development/error_for_negative.zip which are part of TYPO3 4.0 and the tt_products 2.5.0 shop system extension. This error happens only when I e.g. add the following lines in PHP to JavaScript. for (var l=8; l>1; l--) { b = l; } This make the generated JavaScript broken. for (var k=0; k<len; k="" sboptionsk1="new" optioncccategory2k0="" ccategory2k="" for="" var="" l="">1; l--) { b = l; } The for some lines above get bad now. Without the lines above this has worked fine however. The line before them are in the PHP string which will generate the JavaScript: for (var k=0; k<len; k++) { sb.options[k+1] = new Option(c[c[category][2][k]][0], c[category][2][k]); } I works however when I change the loop above to for (var l=8; l<15; l++) { b = l; } Regards, Franz Holzinger Reproduce code: --------------- $code .= ' for (var k=0; k<len; k++) { sb.options[k+1] = new Option(c[c[category][2][k]][0], c[category][2][k]); } for (var l=8; l>1; l--) { b = l; }' ... Expected result: ---------------- The JavaScript output of the webbrowser shall be the text string from above. Actual result: -------------- The loop above get broken. for (var k=0; k<len; k="" sboptionsk1="new" optioncccategory2k0="" ccategory2k="" for="" var="" l="">1; l--) { b = l; } -- Edit bug report at http://bugs.php.net/?id=38202&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38202&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38202&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38202&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38202&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38202&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38202&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38202&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38202&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38202&r=support Expected behavior: http://bugs.php.net/fix.php?id=38202&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38202&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38202&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38202&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38202&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38202&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38202&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38202&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38202&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38202&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38202&r=mysqlcfg