#35082 [Opn->Fbk]: virtual() does not preserve variables from included shtml files

From: Date: Thu, 03 Nov 2005 09:45:33 +0000
Subject: #35082 [Opn->Fbk]: virtual() does not preserve variables from included shtml files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87456@lists.php.net to get a copy of this message
ID: 35082 Updated by: derick@php.net Reported By: Christoph dot Freundl at informatik dot uni-erlange -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: Linux PHP Version: 5.0.5 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-11-03 10:39:42] Christoph dot Freundl at informatik dot uni-erlange 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 this bug report at http://bugs.php.net/?id=35082&edit=1

« previous php.bugs (#87456) next »