php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31405 auto_append_file unable to see global variables
Submitted: 2005-01-04 12:22 UTC Modified: 2005-01-13 01:00 UTC
From: php20050104 at webfreezer dot com Assigned:
Status: No Feedback Package: PHP options/info functions
PHP Version: 4.3.8 OS: SuSE Linux 8.1
Private report: No CVE-ID: None
 [2005-01-04 12:22 UTC] php20050104 at webfreezer dot com
Description:
------------
Setting the following option in a .htaccess file appends the given file to any php file except it is terminated by exit:

php_value   auto_append_file   append.php

However although the manual states that this is just like a simple include() this is not true.
An included file can see the global variables from the script it is included from. Using the auto_append_file option does not allow the appended script to see the global variables.

Using a normal include() works of course so there is not a problem with the visibility of variables in included files in general.

Reproduce code:
---------------
apage.php:
<?php
  $a="This should work!";
  $GLOBALS["b"]="This should also work!";
  echo "Script apage.php will finish now.<br>";
?>

append.php:
<?php
  echo "And I say: ".$a."<br>";
  echo "And also: ".$GLOBALS["b"]."<br>";
?>

Expected result:
----------------
Script apage.php will finish now.<br>
And I say: This should work!<br>
And also: This should also work!<br>

Actual result:
--------------
Script apage.php will finish now.<br>
And I say: <br>
And also: <br>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC