Permalink
Browse files

merge r6384 from branch 2.1 to trunk

bug 1704 fixed: windows needs a specific directory separator when creating
recursive directory.


git-svn-id: http://piwigo.org/svn/trunk@6385 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information...
plegall committed May 27, 2010
1 parent 5f597c2 commit d63d95e0242fad3ae835941df0caf28f8187ec70
Showing with 8 additions and 0 deletions.
  1. +4 −0 admin/include/functions_upload.inc.php
  2. +4 −0 include/functions.inc.php
@@ -141,6 +141,10 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie
function prepare_directory($directory)
{
if (!is_dir($directory)) {
if (substr(PHP_OS, 0, 3) == 'WIN')
{
$directory = str_replace('/', DIRECTORY_SEPARATOR, $directory);
}
umask(0000);
$recursive = true;
if (!@mkdir($directory, 0777, $recursive))
@@ -168,6 +168,10 @@ function mkgetdir($dir, $flags=MKGETDIR_DEFAULT)
{
if ( !is_dir($dir) )
{
if (substr(PHP_OS, 0, 3) == 'WIN')
{
$dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);
}
$umask = umask(0);
$mkd = @mkdir($dir, 0755, ($flags&MKGETDIR_RECURSIVE) ? true:false );
umask($umask);

0 comments on commit d63d95e

Please sign in to comment.