Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18745 Modified Files: config.php Log Message: Correct UPLOAD_FILE_PATH/UPLOAD_DATA_PATH mix-up; force creation of the returned directory if it does not exist Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.147 retrieving revision 1.148 diff -u -2 -b -p -d -r1.147 -r1.148 --- config.php 6 May 2008 19:27:30 -0000 1.147 +++ config.php 7 May 2008 19:10:08 -0000 1.148 @@ -582,11 +582,17 @@ function safe_wordwrap($str, $width=80, function getUploadFilePath() { + if (defined('UPLOAD_FILE_PATH')) { + // Force creation of the returned directory if it does not exist. + if (!file_exists(UPLOAD_FILE_PATH)) { + mkdir(UPLOAD_FILE_PATH, 0775); + } if (string_ends_with(UPLOAD_FILE_PATH, "/") - or string_ends_with(UPLOAD_FILE_PATH, "\\")) + or string_ends_with(UPLOAD_FILE_PATH, "\\")) { return UPLOAD_FILE_PATH; - else + } else { return UPLOAD_FILE_PATH."/"; } + } return defined('PHPWIKI_DIR') ? PHPWIKI_DIR . "/uploads/" @@ -594,5 +600,5 @@ function getUploadFilePath() { } function getUploadDataPath() { - if (defined('UPLOAD_FILE_PATH')) { + if (defined('UPLOAD_DATA_PATH')) { return string_ends_with(UPLOAD_DATA_PATH, "/") ? UPLOAD_DATA_PATH : UPLOAD_DATA_PATH."/"; @@ -657,4 +663,7 @@ function htmlspecialchars_workaround($st // $Log$ +// Revision 1.148 2008年05月07日 19:10:08 vargenau +// Correct UPLOAD_FILE_PATH/UPLOAD_DATA_PATH mix-up; force creation of the returned directory if it does not exist +// // Revision 1.147 2008年05月06日 19:27:30 rurban // comments only