php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57387 engine loses state between multiple ParseScriptText calls
Submitted: 2006-11-21 10:48 UTC Modified: 2017-04-01 21:26 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:0 of 1 (0.0%)
From: philippem at online2006 dot majerus dot net Assigned:
Status: Wont fix Package: PHPScript (PECL)
PHP Version: 5_2 CVS-2006-11-21 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: philippem at online2006 dot majerus dot net
New email:
PHP Version: OS:

 

 [2006-11-21 10:48 UTC] philippem at online2006 dot majerus dot net
Description:
------------
I tested with both pecl-5.2.0-Win32 and 6.0-dev for Win32.

I found the following issue with the PHPScript engine provided by php*activescript.dll.

When the host adds several script blocks, it seems the engine doesn't keep its state between blocks.
I believe this goes down to multiple successive calls to IActiveScriptParse::ParseScriptText. It seems each block is executed as a separate script instead of continuation of the existing script.

It can be tested in Windows Internet Explorer using several script blocks, as shown in the reproduce code.
The code can easily be tested in a .hta file, and the corresponding JScript code is included to show the expected behavior.


Reproduce code:
---------------
[save this as .hta file]

<html>
<body>

<h1>Script state bug</h1>
<p>
This page shows problems with script engine state persistance between separate IActiveScriptParse::ParseScriptText calls.<br/>
</p>

<h2>JScript</h2>

<h3>JScript block 1</h3>
<script language="JScript">
i = 5
document.write(i)
</script>

<h3>JScript block 2</h3>
<script language="JScript">
document.write(i)
</script>

<hr>

<h2>PHPScript</h2>

<h3>PHPScript block 1</h3>
<script language="PHPScript">
$i = 5;
$document->write($i);
</script>

<h3>PHPScript block 2</h3>
<script language="PHPScript">
$document->write($i);
</script>

</body>
</html>

Expected result:
----------------
When the 2nd PHPScript block is executed, the $i variable is lost. Active Script engines should be able to keep their state between script blocks, and so the second $document->write($i); call should have the same effect as the first one.


Actual result:
--------------
When $document->write($i); is executed in the 2nd PHPScript block, $i is null instead of 5.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 21:26 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 21:26 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2009, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC