From:             csaba at alum dot mit dot edu
Operating system: Win XP Pro
PHP version:      5.0.3
PHP Bug Type:     COM related
Bug description:  navigating to javascript:anything kills IE

Description:
------------
If I do
$ie = new COM("InternetExplorer.Application"); 
$nav = "javascript:alert('hi mom');";
$ie->Navigate($nav); 

IE vanishes, but fast

Note, this is run using PHP.exe (CLI) from a CMD box
on a Win XP Pro SP2 machine with IE 6

Thanks,
Csaba Gabor from Vienna

Reproduce code:
---------------
<?php 
$ie = new COM("InternetExplorer.Application"); 
$ie->Visible = true; 
$nav = "javascript:document.open();document.write('<body
onload=\"alert(\\'Ready\\')\">Hi mom</body>');document.close();";
print "$nav\n";
sleep(3);
$ie->Navigate($nav); 
sleep(5);
print "finished!\n"; 
?>


Expected result:
----------------
I expect to see a browser which displays a 'Ready' alert box and 'Hi Mom'
in the browser window.

Actual result:
--------------
As soon as the $ie->Navigate is called, the bell clinks and IE is gone. 
The PHP program continues to run without error.

It doesn't seem to matter what is after the javascript:
It could be as simple as
$nav = "javascript:alert('hi mom');";
or you could get rid of the onload part from $nav in the example I
supplied.
By the way, you can see that IE accepts $nav directly just fine (but get
rid of the backslashes except one each before the inner single quotes, and
of course remove the first " and the trailing ";  -  In other words, use
what is printed to the CMD screen) by manually copying it in to the
location bar and pressing enter yourself.

-- 
Edit bug report at http://bugs.php.net/?id=31493&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31493&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31493&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31493&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31493&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31493&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31493&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31493&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31493&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31493&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31493&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31493&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31493&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31493&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31493&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31493&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31493&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31493&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31493&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31493&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31493&r=mysqlcfg

Reply via email to