Announcement

  •  » Extensions
  •  » Automatic Size: "Original" download link points to the raw directory

#1 2015-06-12 05:50:19

fifreb
Member
2015-06-09
8

Automatic Size: "Original" download link points to the raw directory

Piwigo version: 1.7.4
PHP version: 5.6.9
MySQL version: 5.5.44
Automatic Size version: 2.7.a

Background:  I sync my pictures by Rsync, then run the Sync feature.  I keep the subfolder where the pictures are synced out of reach from the web server by using htaccess.
This works fine:  I can view the pictures and download them.

Now if I install Automatic Size, I can pick "Original" in the Size menu.
When "Original" is picked, a new window is opened and the original is loaded via its path in the sync folder.
My suggestion would be to use a link mediated by PHP (like the one used for downloading the image) instead of sending back a raw link which may point to the sync directory.

The following patch takes care of the problem:

Code:

--- automatic_size/main.inc.php~  2014-09-01 17:43:26.000000000 -0700
+++ automatic_size/main.inc.php  2015-06-11 14:56:40.000000000 -0700
@@ -144,7 +144,7 @@
 
   if ($show_original)
   {
-    $template->assign( 'U_ORIGINAL', $element_info['element_url'] );
+    $template->assign( 'U_ORIGINAL', str_replace('&download', '', $element_info['download_url']));
   }
 
   $template->append('current', array(

Offline

 
  •  » Extensions
  •  » Automatic Size: "Original" download link points to the raw directory

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact