cvs: smarty / NEWS /libs Smarty.class.php
| From: | Messju Mohr | Date: | Thu, 08 May 2003 13:18:18 +0000 |
| Subject: | cvs: smarty / NEWS /libs Smarty.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-593@lists.php.net to get a copy of this message | ||
messju Thu May 8 09:18:18 2003 EDT
Modified files:
/smarty NEWS
/smarty/libs Smarty.class.php
Log:
fixed bug in _create_dir_structure() when used with
open_basedir-restriction and relative paths
Index: smarty/NEWS
diff -u smarty/NEWS:1.361 smarty/NEWS:1.362
--- smarty/NEWS:1.361 Mon May 5 10:41:22 2003
+++ smarty/NEWS Thu May 8 09:18:17 2003
@@ -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)
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.394 smarty/libs/Smarty.class.php:1.395
--- smarty/libs/Smarty.class.php:1.394 Wed May 7 14:54:41 2003
+++ smarty/libs/Smarty.class.php Thu May 8 09:18:17 2003
@@ -42,7 +42,7 @@
* @version 2.5.0
*/
-/* $Id: Smarty.class.php,v 1.394 2003/05/07 18:54:41 mohrt Exp $ */
+/* $Id: Smarty.class.php,v 1.395 2003/05/08 13:18:17 messju Exp $ */
/**
* DIR_SEP isn't used anymore, but third party apps might
@@ -2130,10 +2130,12 @@
*/
function _create_dir_structure($dir)
{
- if (!file_exists($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');
if(!empty($_open_basedir_ini)) {
@@ -2146,7 +2148,6 @@
foreach ($_dir_parts as $_dir_part) {
$_new_dir .= $_dir_part;
-
if ($_use_open_basedir) {
$_make_new_dir = false;
foreach ($_open_basedirs as $_open_basedir) {