aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-08-30 19:20:00 +0000
committerrvelices <rv-github@modusoptimus.com>2012-08-30 19:20:00 +0000
commitc918bb9209202bf9c7172890db626f07381346ac (patch)
tree5a5e6141716c401c5e0f9330989763f6587ee5b3 /include
parentd9854148a5100e2a1056441057deac40cbd67379 (diff)
bug 2725: Piwigo isn't compatible with suPHP + better handling of watermark upload errors
git-svn-id: http://piwigo.org/svn/trunk@17675 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/template.class.php26
-rw-r--r--include/ws_functions.inc.php20
2 files changed, 5 insertions, 41 deletions
diff --git a/include/template.class.php b/include/template.class.php
index 3bc386c80..6d81b7169 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -78,28 +78,6 @@ class Template {
}
}
- if (!isset($conf['combined_dir_checked']))
- {
- $dir = PHPWG_ROOT_PATH.PWG_COMBINED_DIR;
- mkgetdir($dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
- if (!is_writable($dir))
- {
- load_language('admin.lang');
- fatal_error(
- sprintf(
- l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
- PWG_COMBINED_DIR
- ),
- l10n('an error happened'),
- false // show trace
- );
- }
- if (function_exists('pwg_query')) {
- conf_update_param('combined_dir_checked', 1);
- }
- }
-
-
$compile_dir = PHPWG_ROOT_PATH.$conf['data_location'].'templates_c';
mkgetdir( $compile_dir );
@@ -1343,7 +1321,9 @@ final class FileCombiner
$output .= "\n";
}
- file_put_contents( PHPWG_ROOT_PATH . $file, $output );
+ mkgetdir( dirname(PHPWG_ROOT_PATH.$file) );
+ file_put_contents( PHPWG_ROOT_PATH.$file, $output );
+ @chmod(PHPWG_ROOT_PATH.$file, 0644);
$out_file = $file;
$out_version = false;
$this->clear();
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'],