fixed bug in _create_dir_structure() when used with

open_basedir-restriction and relative paths
This commit is contained in:
messju
2003-05-08 13:18:17 +00:00
parent 0e78fa20d6
commit 60a1b8cdc5
2 changed files with 7 additions and 4 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- fixed bug in _create_dir_structure() when used with open_basedir-
restriction and relative paths (messju)
- use DIRECTORY_SEPARATOR exclusively, keep DIR_SEP for BC (Monte)
- changed "link" to "href" in html_image. "link" is still working
but deprecated (messju)

View File

@@ -2131,8 +2131,10 @@ class Smarty
function _create_dir_structure($dir)
{
if (!file_exists($dir)) {
$_new_dir = (preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $dir))
? DIRECTORY_SEPARATOR : getcwd().DIRECTORY_SEPARATOR;
$_dir_parts = preg_split('!\\' . DIRECTORY_SEPARATOR . '+!', $dir, -1, PREG_SPLIT_NO_EMPTY);
$_new_dir = ($dir{0} == DIRECTORY_SEPARATOR) ? DIRECTORY_SEPARATOR : '';
// do not attempt to test or make directories outside of open_basedir
$_open_basedir_ini = ini_get('open_basedir');
@@ -2146,7 +2148,6 @@ class Smarty
foreach ($_dir_parts as $_dir_part) {
$_new_dir .= $_dir_part;
if ($_use_open_basedir) {
$_make_new_dir = false;
foreach ($_open_basedirs as $_open_basedir) {