diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-12-07 13:20:40 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-12-07 13:20:40 +0100 |
commit | 8370857f0408b9610ba80e9bc06cde19c8e58983 (patch) | |
tree | 64c32f324da238257c16e135a45412b037cfa55c /phpBB/includes/functions.php | |
parent | 68db335468c0395d8500d1e4e54ed28aca875a30 (diff) | |
download | forums-8370857f0408b9610ba80e9bc06cde19c8e58983.tar forums-8370857f0408b9610ba80e9bc06cde19c8e58983.tar.gz forums-8370857f0408b9610ba80e9bc06cde19c8e58983.tar.bz2 forums-8370857f0408b9610ba80e9bc06cde19c8e58983.tar.xz forums-8370857f0408b9610ba80e9bc06cde19c8e58983.zip |
[ticket/11997] Undo changes to phpbb_own_realpath()
PHPBB3-11997
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0663d0cf85..588a060630 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -994,6 +994,14 @@ function phpbb_own_realpath($path) $resolved .= $bit . (($i == $max) ? '' : '/'); } + // @todo If the file exists fine and open_basedir only has one path we should be able to prepend it + // because we must be inside that basedir, the question is where... + // @internal The slash in is_dir() gets around an open_basedir restriction + if (!@file_exists($resolved) || (!@is_dir($resolved . '/') && !is_file($resolved))) + { + return false; + } + // Put the slashes back to the native operating systems slashes $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved); |