#35082 [NEW]: virtual() does not preserve variables from included shtml files
| From: | Christoph dot Freundl at informatik dot uni-erlangen dot de | Date: | Thu, 03 Nov 2005 09:39:43 +0000 |
| Subject: | #35082 [NEW]: virtual() does not preserve variables from included shtml files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-87455@lists.php.net to get a copy of this message | ||
From: Christoph dot Freundl at informatik dot uni-erlangen dot de
Operating system: Linux
PHP version: 5.0.5
PHP Bug Type: Apache2 related
Bug description: virtual() does not preserve variables from included shtml files
Description:
------------
If you use virtual() to include an shtml file which sets an environment
variable via <!--#set...-->, the set variable is not visible after the
virtual() call.
Reproduce code:
---------------
setvar.shtml
-------------------------------------------------
<!--#set var="myvar" value="myval" -->
-------------------------------------------------
showvar.php
-------------------------------------------------
<?php echo apache_getenv( "myvar" ); ?>
-------------------------------------------------
info.shtml
-------------------------------------------------
<!--#include virtual="setvar.shtml" -->
<!--#include virtual="showvar.php" -->
-------------------------------------------------
info.php
-------------------------------------------------
<?php
virtual( "setvar.shtml" );
echo apache_getenv( "myvar" );
?>
-------------------------------------------------
Expected result:
----------------
I expect that info.shtml and info.php should both give the same result,
i.e. show "myval". However, info.shtml does but info.php does not.
If this is a wanted behaviour (which I hope it is not), then at least the
documentation of virtual() --- "virtual() is an Apache-specific function
which is equivalent to <!--#include virtual...--> in mod_include." --- is
wrong.
--
Edit bug report at http://bugs.php.net/?id=35082&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35082&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35082&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35082&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35082&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35082&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35082&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35082&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35082&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35082&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35082&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35082&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35082&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35082&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35082&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35082&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35082&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35082&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35082&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35082&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35082&r=mysqlcfg