aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-08-30 19:20:50 +0000
committerrvelices <rv-github@modusoptimus.com>2012-08-30 19:20:50 +0000
commita2f73718d9588a2b6185e73aa683cecd9f990363 (patch)
treee73c443a871d1ddadfa767b60d3d8221e5f93fa8 /include/ws_functions.inc.php
parent2c24b0b38ae678a0269b308ddf03ab1bc85630d2 (diff)
bug 2725: Piwigo isn't compatible with suPHP + better handling of watermark upload errors merge from trunk to branch 2.4
git-svn-id: http://piwigo.org/svn/branches/2.4@17676 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/ws_functions.inc.php20
1 files changed, 2 insertions, 18 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 4e439af88..c25ed02ee 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1507,27 +1507,11 @@ function ws_images_add_chunk($params, &$service)
$upload_dir = $conf['upload_dir'].'/buffer';
// create the upload directory tree if not exists
- if (!is_dir($upload_dir)) {
- umask(0000);
- if (!@mkdir($upload_dir, 0777, true))
- {
- return new PwgError(500, 'error during buffer directory creation');
- }
- }
-
- if (!is_writable($upload_dir))
+ if (!mkgetdir($upload_dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR))
{
- // last chance to make the directory writable
- @chmod($upload_dir, 0777);
-
- if (!is_writable($upload_dir))
- {
- return new PwgError(500, 'buffer directory has no write access');
- }
+ return new PwgError(500, 'error during buffer directory creation');
}
- secure_directory($upload_dir);
-
$filename = sprintf(
'%s-%s-%05u.block',
$params['original_sum'],