|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-11-21 10:48 UTC] philippem at online2006 dot majerus dot net
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]


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


<h3>JScript block 1</h3>
<script language="JScript">
i = 5

<h3>JScript block 2</h3>
<script language="JScript">



<h3>PHPScript block 1</h3>
<script language="PHPScript">
$i = 5;

<h3>PHPScript block 2</h3>
<script language="PHPScript">


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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 21:26 UTC]
-Status: Open +Status: Wont fix
 [2017-04-01 21:26 UTC]
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-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 03 22:05:53 2022 UTC