From:             omich at artofaktur dot de
Operating system: DebianLinux www 2.4.23-1-686-smp
PHP version:      4.3.4
PHP Bug Type:     Scripting Engine problem
Bug description:  include inconsistency of identical scripts

Description:
------------
A script 'A', which 'include's a php script file 'X' 
from a subfolder of the php.ini-include path, does work 
fine, but the exact same copy of the script of 'A' (call 
it 'B') in a different folder does not include the file 
'X' at all.
Example here: www.dannemann.com/info.php shows the 
environment. The script 'A' is
www.dannemann.com/de/kompetenz/lexikon/search.php
the script 'B' is
www.dannemann.com/at/kompetenz/lexikon/search.php
Both load file 'X' which is located in 
www.dannemann.com/global/dict.php 
from the global folder, but only in 'de' the include 
works, not in 'at'.

In the given code I have replaced the flawed include 
command with a hack:
eval (substr (implode ('', file ($DOCUMENT_ROOT.'/
global/dict.php')), 2, -2));
and this works!

We use output buffering before this code and fetched the 
output and transparent php sessions without cookies (see 
phpinfo-output). Although we use APC-Cache we disabled 
it for testing - to no avail even without APC the 
include fails...

Thank you for your patience...

Reproduce code:
---------------
// this is the calling code
...
// dict-lookup
$hits_per_page = 10;
include ('gobal/dict.php');
$arr = split ($dictsep, $search);
foreach ($arr as $token) {
...

Expected result:
----------------
dict.php cotains two arrays of key-value pairs and looks 
like this:
<?
$dictsep = "[ \t\n\r<>,.:\(\)]";
$dict = array (
"ich",
"du",
"er",
"sie",
...
?>
These variables should be visible to the calling script, 
which is for 'at' not the case.

Actual result:
--------------
The two 'imported' variables $dictsep and $dict are not 
even set (isset on both resulted in false) for 'at'.

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

Reply via email to