|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-02 18:56 UTC] tony2001@php.net
[2006-07-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ Sorry I cannot reliably reproduce this but... php-win.exe often errors, giving me one of those "would you like to report this to Microsoft dialogs" on account of the $ox=new COM("Shell.Application"); line. This happens in version 5.1.1 (from about Dec. 2005) and today's 5.2 Note that it only happens: 1. with php-win.exe 2. in the php-win -a form and not the -r form 3. when the Shell.Application line is present 4. when the execScript line is present The last two lines and the opener="me" line are not required for the bug to be shown. They are there so that when you go to the new IE, you can make it go away by pressing any key. Also, despite the bug, the new IE appears and the execScript functionality is present. // to see the bug, have DOSKEY active, and // call the file below (named inc.php) a few // times from a (wrapped) command line with: // echo ^^^<?php include('inc.php');ieStuff("<strong>Whoever</strong>"); ?^^^> | php-win -a // or // echo ^^^<?php ieStuff("<strong>Whoever</strong>"); ?^^^> | php-win -d auto_prepend_file=inc.php -a Reproduce code: --------------- <?php function ieStuff($html) { // Without this line, the bug does not happen $ox = new COM("Shell.Application"); // new instance of IE $ie = new COM("InternetExplorer.Application"); // next line creates a DOM $ie->Navigate2("about:blank"); // allow for settling while ($ie->ReadyState!=4) usleep(10000); $ie->Visible = true; // next line allows self.close() $ie->Document->ParentWindow->opener="me"; // escape handler definition $ie->document->parentWindow->execScript( "document.onkeypress=function(){window.close();}"); // proof of access to IE $ie->document->body->innerHTML = $html; // so escape handler listens $ie->document->body->focus(); } ?> Expected result: ---------------- I don't expect to see any CLI error message Actual result: -------------- Every so often, sometimes consistently every time, I get a CLI error dialog box on account of the Shell.Application line, which is not even used (in the example). The more windows you have open (IE and otherwise), the more likely the bug is to show itself. Under 25 windows open, and it doesn't fail much. Also, the problem tends to surface more readily if you go do your thing and then come back to the Cmd window 10 or 20 minutes later and then try it again. Sorry, I can't be more specific. I'm probably as unhappy reporting on an intermittent bug as you are reading about it. Csaba Gabor from Vienna