#38202 [Bgs]: weird javascript mangling
| From: | franz at fholzinger dot com | Date: | Tue, 15 Aug 2006 12:17:23 +0000 |
| Subject: | #38202 [Bgs]: weird javascript mangling | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100824@lists.php.net to get a copy of this message | ||
ID: 38202
User updated by: franz at fholzinger dot com
Reported By: franz at fholzinger dot com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: LINUX Red Hat
PHP Version: 4.4.2
New Comment:
I agree.
http://bugs.typo3.org/view.php?id=1477
Previous Comments:
------------------------------------------------------------------------
[2006-07-25 07:36:20] tony2001@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. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2006-07-25 07:33:33] franz at fholzinger dot com
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 this bug report at http://bugs.php.net/?id=38202&edit=1