Skip to content

Commit a684afb

Browse files
committed
fixes #415, even if non-picture file, force download with action.php
1 parent f0d29d9 commit a684afb

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

action.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ function do_error( $code, $str )
100100
do_error(404, 'Requested id not found');
101101
}
102102

103+
$src_image = new SrcImage($element_info);
104+
103105
// $filter['visible_categories'] and $filter['visible_images']
104106
// are not used because it's not necessary (filter <> restriction)
105107
$query='
@@ -126,9 +128,9 @@ function do_error( $code, $str )
126128
switch ($_GET['part'])
127129
{
128130
case 'e':
129-
if ( !$user['enabled_high'] )
130-
{
131-
$deriv = new DerivativeImage(IMG_XXLARGE, new SrcImage($element_info));
131+
if ( $src_image->is_original() and !$user['enabled_high'] )
132+
{// we have a photo and the user has no access to HD
133+
$deriv = new DerivativeImage(IMG_XXLARGE, $src_image);
132134
if ( !$deriv->same_as_source() )
133135
{
134136
do_error(401, 'Access denied e');

picture.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ function default_picture_content($content, $element_info)
532532
}
533533
else
534534
{ // not a pic - need download link
535-
$row['download_url'] = $row['element_url'] = get_element_url($row);;
535+
$row['element_url'] = get_element_url($row);
536+
$row['download_url'] = get_action_url($row['id'], 'e', true);
536537
}
537538
}
538539

0 commit comments

Comments
 (0)