aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-05-03 12:49:26 +0000
committerplegall <plg@piwigo.org>2010-05-03 12:49:26 +0000
commit0c8cebe04422aa47021f66acfcd2e3629ccaf7ae (patch)
tree0b7d50520a0a81900b1c33169a9410ace97f04de /admin
parent89384aa6b1b8808ec8ceda6b9673236383c94cfe (diff)
bug 1639 fixed: the upload form now correctly uses the $conf['upload_dir']
parameter (web API already use it). By default, the $conf['upload_dir'] is no longer dependent to PHPWG_ROOT_PATH because it becomes a real mess when admin/include/uploadify.php (called directly, not from an include) tries to perform an upload. Improvement: make clearer how $conf['upload_dir'] can be set (relative to the Piwigo installation directory + HTTP reachable) git-svn-id: http://piwigo.org/svn/trunk@6052 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions_upload.inc.php4
-rw-r--r--admin/photos_add_direct.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/admin/include/functions_upload.inc.php b/admin/include/functions_upload.inc.php
index fa8944d70..2d8be3ceb 100644
--- a/admin/include/functions_upload.inc.php
+++ b/admin/include/functions_upload.inc.php
@@ -31,7 +31,7 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie
// upload directory hierarchy
$upload_dir = sprintf(
- PHPWG_ROOT_PATH.'upload/%s/%s/%s',
+ PHPWG_ROOT_PATH.$conf['upload_dir'].'/%s/%s/%s',
$year,
$month,
$day
@@ -96,7 +96,7 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie
'file' => isset($original_filename) ? $original_filename : basename($file_path),
'date_available' => $dbnow,
'tn_ext' => 'jpg',
- 'path' => preg_replace('/^.*?upload/', './upload', $file_path),
+ 'path' => preg_replace('#^'.preg_quote(PHPWG_ROOT_PATH).'#', '', $file_path),
'filesize' => $file_infos['filesize'],
'width' => $file_infos['width'],
'height' => $file_infos['height'],
diff --git a/admin/photos_add_direct.php b/admin/photos_add_direct.php
index 6f3991732..710eaf739 100644
--- a/admin/photos_add_direct.php
+++ b/admin/photos_add_direct.php
@@ -119,7 +119,7 @@ if (isset($_POST['submit_upload']))
$extension = pathinfo($_FILES['image_upload']['name'][$idx], PATHINFO_EXTENSION);
if ('zip' == strtolower($extension))
{
- $upload_dir = PHPWG_ROOT_PATH.'upload/buffer';
+ $upload_dir = $conf['upload_dir'].'/buffer';
prepare_directory($upload_dir);
$temporary_archive_name = date('YmdHis').'-'.generate_key(10);