aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-05-10 11:37:35 +0200
committerplegall <plg@piwigo.org>2016-05-10 11:37:35 +0200
commita684afbdc33fc904734ee63152e3040dbdbaa1bd (patch)
tree9a907994815f59a53b72beb92ca3b749b3feca80
parentf0d29d9134193be7fe708b6a2f54f80eeb9e77bf (diff)
fixes #415, even if non-picture file, force download with action.php
-rw-r--r--action.php8
-rw-r--r--picture.php3
2 files changed, 7 insertions, 4 deletions
diff --git a/action.php b/action.php
index 33ae408ed..5a7ca423e 100644
--- a/action.php
+++ b/action.php
@@ -100,6 +100,8 @@ if ( empty($element_info) )
do_error(404, 'Requested id not found');
}
+$src_image = new SrcImage($element_info);
+
// $filter['visible_categories'] and $filter['visible_images']
// are not used because it's not necessary (filter <> restriction)
$query='
@@ -126,9 +128,9 @@ $file='';
switch ($_GET['part'])
{
case 'e':
- if ( !$user['enabled_high'] )
- {
- $deriv = new DerivativeImage(IMG_XXLARGE, new SrcImage($element_info));
+ if ( $src_image->is_original() and !$user['enabled_high'] )
+ {// we have a photo and the user has no access to HD
+ $deriv = new DerivativeImage(IMG_XXLARGE, $src_image);
if ( !$deriv->same_as_source() )
{
do_error(401, 'Access denied e');
diff --git a/picture.php b/picture.php
index db58c12e7..37d65a1f9 100644
--- a/picture.php
+++ b/picture.php
@@ -532,7 +532,8 @@ while ($row = pwg_db_fetch_assoc($result))
}
else
{ // not a pic - need download link
- $row['download_url'] = $row['element_url'] = get_element_url($row);;
+ $row['element_url'] = get_element_url($row);
+ $row['download_url'] = get_action_url($row['id'], 'e', true);
}
}