From: <nk...@us...> - 2011-08-25 00:22:30
|
Revision: 36464 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=36464&view=rev Author: nkoth Date: 2011-08-25 00:22:23 +0000 (Thu, 25 Aug 2011) Log Message: ----------- [ENH] Allow easy showing of avatar from file gallery Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2011-08-24 22:08:26 UTC (rev 36463) +++ trunk/tiki-download_file.php 2011-08-25 00:22:23 UTC (rev 36464) @@ -56,6 +56,13 @@ $access->check_feature('feature_file_galleries'); } +if ($prefs["user_store_file_gallery_picture"] == 'y' && isset($_REQUEST["avatar"])) { + require_once ('lib/userprefs/userprefslib.php'); + if ($user_picture_id = $userprefslib->get_user_picture_id($_REQUEST["avatar"])) { + $_REQUEST['fileId'] = $user_picture_id; + } +} + if ( ! ini_get('safe_mode') ) { @set_time_limit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ch...@us...> - 2011-11-15 17:48:37
|
Revision: 38826 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38826&view=rev Author: chealer Date: 2011-11-15 17:48:27 +0000 (Tue, 15 Nov 2011) Log Message: ----------- [REF] File download: use readfile() instead of readfile_chunked(), and remove now unused borrowed readfile_chunked() Ref: http://www.php.net/manual/en/function.readfile.php#81032 and r6598 Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=6598&view=rev Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2011-11-15 15:13:51 UTC (rev 38825) +++ trunk/tiki-download_file.php 2011-11-15 17:48:27 UTC (rev 38826) @@ -69,33 +69,6 @@ @set_time_limit(0); } -/* - Borrowed from http://php.net/manual/en/function.readfile.php#54295 to come - over the 2MB readfile() limitation - */ -function readfile_chunked($filename,$retbytes=true) { - $chunksize = 1*(1024*1024); // how many bytes per chunk - $buffer = ''; - $cnt =0; - $handle = fopen($filename, 'rb'); - if ($handle === false) { - return false; - } - while (!feof($handle)) { - $buffer = fread($handle, $chunksize); - echo $buffer; - @ob_flush(); - flush(); - if ($retbytes) { - $cnt += strlen($buffer); - } - } - $status = fclose($handle); - if ($retbytes && $status) { - return $cnt; // return num. bytes delivered like readfile() does. - } - return $status; -} $zip = false; $error = ''; @@ -398,7 +371,7 @@ if ( !empty($filepath) and !$content_changed ) { header('Content-Length: '.filesize($filepath)); - readfile_chunked($filepath); + readfile($filepath); } else { if ( function_exists('mb_strlen') ) { header('Content-Length: '.mb_strlen($content, '8bit')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ch...@us...> - 2011-11-16 01:10:43
|
Revision: 38833 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38833&view=rev Author: chealer Date: 2011-11-16 01:10:36 +0000 (Wed, 16 Nov 2011) Log Message: ----------- [FIX] Download file: for thumbnails, use setup_base instead of custom setup which used possibly invalid $_SESSION['s_prefs'] from r15629 Ref: r15623. Impact on permance appears to be relatively small. Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15629&view=rev http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15623&view=rev Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2011-11-15 23:00:09 UTC (rev 38832) +++ trunk/tiki-download_file.php 2011-11-16 01:10:36 UTC (rev 38833) @@ -18,29 +18,12 @@ session_start(); if ( isset($_SESSION['allowed'][$_GET['fileId']]) ) { - require_once 'tiki-filter-base.php'; - include('db/tiki-db.php'); - $db = TikiDb::get(); + require_once 'tiki-setup_base.php'; $query = "select * from `tiki_files` where `fileId`=?"; - $result = $db->query($query, array((int)$_GET['fileId'])); + $result = $tikilib->query($query, array((int)$_GET['fileId'])); if ( $result ) { $info = $result->fetchRow(); - - if ( isset($_SESSION['s_prefs']) ) { - $prefs = $_SESSION['s_prefs']; - } else { - $query = "select `value` from `tiki_preferences` where `name` = 'fgal_use_dir';"; - $result = $db->query($query); - if ( $result ) { - $tmp = $result->fetchRow(); - $prefs['fgal_use_dir'] = $tmp['value']; - } - } - if ( !isset($prefs['fgal_use_dir']) ) { - $prefs['fgal_use_dir'] = ''; - } - $skip = true; } else { $info = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ch...@us...> - 2011-11-16 01:20:15
|
Revision: 38834 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38834&view=rev Author: chealer Date: 2011-11-16 01:20:07 +0000 (Wed, 16 Nov 2011) Log Message: ----------- [FIX] Download file: truely pass no $page to display_error(). fixes "page not found [empty]" error when file does not exist Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2011-11-16 01:10:36 UTC (rev 38833) +++ trunk/tiki-download_file.php 2011-11-16 01:20:07 UTC (rev 38834) @@ -73,7 +73,7 @@ $access->display_error('', tra('Incorrect param'), 400); } if ( ! is_array($info) ) { - $access->display_error('', tra('File has been deleted'), 404); + $access->display_error(NULL, tra('File has been deleted'), 404); } if ( $prefs['auth_tokens'] == 'n' || !$is_token_access ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2012-01-30 23:29:47
|
Revision: 39711 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39711&view=rev Author: sylvieg Date: 2012-01-30 23:29:41 +0000 (Mon, 30 Jan 2012) Log Message: ----------- [merge/r39710][ENH]download: when clicking on a download link with no perm - remember the link so that after login you dowload the file Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39710&view=rev Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-01-30 23:25:46 UTC (rev 39710) +++ trunk/tiki-download_file.php 2012-01-30 23:29:41 UTC (rev 39711) @@ -80,11 +80,13 @@ // Check permissions except if the user comes with a valid Token if ( !$zip && $tiki_p_admin_file_galleries != 'y' && !$userlib->user_has_perm_on_object($user, $info['galleryId'], 'file gallery', 'tiki_p_download_files') && !($info['backlinkPerms'] == 'y' && !$filegallib->hasOnlyPrivateBacklinks($info['fileId']))) { + if (!$user) $_SESSION['loginfrom'] = $_SERVER['REQUEST_URI']; $access->display_error('', tra('Permission denied'), 401); } if ( isset($_GET['thumbnail']) && is_numeric($_GET['thumbnail'])) { //check also perms on thumb $info_thumb = $filegallib->get_file($_GET['thumbnail']); if ( !$zip && $tiki_p_admin_file_galleries != 'y' && !$userlib->user_has_perm_on_object($user, $info_thumb['galleryId'], 'file gallery', 'tiki_p_download_files') && !($info['backlinkPerms'] == 'y' && !$filegallib->hasOnlyPrivateBacklinks($info_thumb['fileId']))) { + if (!$user) $_SESSION['loginfrom'] = $_SERVER['REQUEST_URI']; $access->display_error('', tra('Permission denied'), 401); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jon...@us...> - 2012-03-25 13:21:35
|
Revision: 40369 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40369&view=rev Author: jonnybradley Date: 2012-03-25 13:21:28 +0000 (Sun, 25 Mar 2012) Log Message: ----------- [FIX] thumbnails: Use png format for thumb if the file is png. Preserves transparency in thumbnails at last - hurrah! Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-03-25 11:49:00 UTC (rev 40368) +++ trunk/tiki-download_file.php 2012-03-25 13:21:28 UTC (rev 40369) @@ -270,7 +270,7 @@ $resize = false; // We resize if needed - if ( isset($_GET['x']) || isset($_GET['y']) ) { + if ( isset($_GET['x']) && isset($_GET['y']) ) { $image->resize($_GET['x']+0, $_GET['y']+0); $resize = true; } elseif ( isset($_GET['scale']) ) { @@ -306,7 +306,10 @@ if ( isset($_GET['format']) && Image::is_supported($_GET['format']) ) { $image->convert($_GET['format']); } elseif ( isset($_GET['thumbnail']) ) { - // Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format + // Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format + if ($image->format == 'png') { + $thumbnail_format = 'png'; // preserves transparency + } $image->convert($thumbnail_format); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: lindon <li...@ti...> - 2012-03-25 13:32:08
|
Way to go - this is a big one! On Sun, Mar 25, 2012 at 9:21 AM, <jon...@us...> wrote: > Revision: 40369 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40369&view=rev > Author: jonnybradley > Date: 2012-03-25 13:21:28 +0000 (Sun, 25 Mar 2012) > Log Message: > ----------- > [FIX] thumbnails: Use png format for thumb if the file is png. Preserves > transparency in thumbnails at last - hurrah! > > Modified Paths: > -------------- > trunk/tiki-download_file.php > > Modified: trunk/tiki-download_file.php > =================================================================== > --- trunk/tiki-download_file.php 2012-03-25 11:49:00 UTC (rev 40368) > +++ trunk/tiki-download_file.php 2012-03-25 13:21:28 UTC (rev 40369) > @@ -270,7 +270,7 @@ > > $resize = false; > // We resize if needed > - if ( isset($_GET['x']) || > isset($_GET['y']) ) { > + if ( isset($_GET['x']) && > isset($_GET['y']) ) { > > $image->resize($_GET['x']+0, $_GET['y']+0); > $resize = true; > } elseif ( isset($_GET['scale']) ) { > @@ -306,7 +306,10 @@ > if ( isset($_GET['format']) && > Image::is_supported($_GET['format']) ) { > > $image->convert($_GET['format']); > } elseif ( > isset($_GET['thumbnail']) ) { > - // Or, if no format is explicitely > specified and a thumbnail has to be created, we convert the image to the > $thumbnail_format > + // Or, if no format is > explicitely specified and a thumbnail has to be created, we convert the > image to the $thumbnail_format > + if ($image->format == > 'png') { > + $thumbnail_format > = 'png'; // preserves transparency > + } > > $image->convert($thumbnail_format); > } > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > |
From: Stephane C. <se...@lo...> - 2012-03-26 07:42:34
|
Le Sun, Mar 25, 2012 at 01:21:29PM +0000, jon...@us... écrivait : > Revision: 40369 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40369&view=rev > Author: jonnybradley > Date: 2012-03-25 13:21:28 +0000 (Sun, 25 Mar 2012) > Log Message: > ----------- > [FIX] thumbnails: Use png format for thumb if the file is png. Preserves transparency in thumbnails at last - hurrah! > > Modified Paths: > -------------- > trunk/tiki-download_file.php > > Modified: trunk/tiki-download_file.php > =================================================================== > --- trunk/tiki-download_file.php 2012-03-25 11:49:00 UTC (rev 40368) > +++ trunk/tiki-download_file.php 2012-03-25 13:21:28 UTC (rev 40369) > @@ -270,7 +270,7 @@ > > $resize = false; > // We resize if needed > - if ( isset($_GET['x']) || isset($_GET['y']) ) { > + if ( isset($_GET['x']) && isset($_GET['y']) ) { No, no, no We resize if width OR height is passed to the script not both size need to be set ! The rest of the patch looks good though ! > $image->resize($_GET['x']+0, $_GET['y']+0); > $resize = true; > } elseif ( isset($_GET['scale']) ) { > @@ -306,7 +306,10 @@ > if ( isset($_GET['format']) && Image::is_supported($_GET['format']) ) { > $image->convert($_GET['format']); > } elseif ( isset($_GET['thumbnail']) ) { > - // Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format > + // Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format > + if ($image->format == 'png') { > + $thumbnail_format = 'png'; // preserves transparency > + } > $image->convert($thumbnail_format); > } > > A+ -- Stéphane Casset LOGIDÉE sàrl Se faire plaisir d'apprendre 1a, rue Pasteur Tel : +33 388 23 69 77 ca...@lo... F-67540 OSTWALD Fax : +33 388 23 69 77 http://logidee.com |
From: <jon...@us...> - 2012-03-26 09:31:39
|
Revision: 40407 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40407&view=rev Author: jonnybradley Date: 2012-03-26 09:31:29 +0000 (Mon, 26 Mar 2012) Log Message: ----------- [FIX] files: Restore scale by x OR y (but test first) - thanks Sept_7 Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-03-26 05:52:00 UTC (rev 40406) +++ trunk/tiki-download_file.php 2012-03-26 09:31:29 UTC (rev 40407) @@ -270,8 +270,8 @@ $resize = false; // We resize if needed - if ( isset($_GET['x']) && isset($_GET['y']) ) { - $image->resize($_GET['x']+0, $_GET['y']+0); + if ( isset($_GET['x']) || isset($_GET['y']) ) { + $image->resize(isset($_GET['x']) ? (int) $_GET['x'] : 0, isset($_GET['y']) ? (int) $_GET['y'] : 0); $resize = true; } elseif ( isset($_GET['scale']) ) { // We scale if needed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Stephane C. <se...@lo...> - 2012-03-26 09:59:38
|
Le Mon, Mar 26, 2012 at 09:31:29AM +0000, jon...@us... écrivait : > Revision: 40407 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40407&view=rev > Author: jonnybradley > Date: 2012-03-26 09:31:29 +0000 (Mon, 26 Mar 2012) > Log Message: > ----------- > [FIX] files: Restore scale by x OR y (but test first) - thanks Sept_7 Thanx ! ;p > Modified Paths: > -------------- > trunk/tiki-download_file.php > > Modified: trunk/tiki-download_file.php > =================================================================== > --- trunk/tiki-download_file.php 2012-03-26 05:52:00 UTC (rev 40406) > +++ trunk/tiki-download_file.php 2012-03-26 09:31:29 UTC (rev 40407) > @@ -270,8 +270,8 @@ > > $resize = false; > // We resize if needed > - if ( isset($_GET['x']) && isset($_GET['y']) ) { > - $image->resize($_GET['x']+0, $_GET['y']+0); > + if ( isset($_GET['x']) || isset($_GET['y']) ) { > + $image->resize(isset($_GET['x']) ? (int) $_GET['x'] : 0, isset($_GET['y']) ? (int) $_GET['y'] : 0); > $resize = true; > } elseif ( isset($_GET['scale']) ) { > // We scale if needed > A+ -- Stéphane Casset LOGIDÉE sàrl Se faire plaisir d'apprendre 1a, rue Pasteur Tel : +33 388 23 69 77 ca...@lo... F-67540 OSTWALD Fax : +33 388 23 69 77 http://logidee.com |
From: <ar...@us...> - 2012-04-24 17:06:12
|
Revision: 41077 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=41077&view=rev Author: arildb Date: 2012-04-24 17:06:02 +0000 (Tue, 24 Apr 2012) Log Message: ----------- [FIX] Better determination of the image type. If the filename doesn't have (the right image) extension, try to interpret the MIME type Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-04-24 16:24:50 UTC (rev 41076) +++ trunk/tiki-download_file.php 2012-04-24 17:06:02 UTC (rev 41077) @@ -234,8 +234,13 @@ // Fallback to an icon if the format is not supported if ( ! Image::is_supported($format) ) { - $_GET['icon'] = 'y'; - $_GET['max'] = 32; + // Is the filename correct? Maybe it doesn't have an extenstion? + // Try to determine the format from the filetype too + $format = substr($info['filetype'], strrpos($info['filetype'], '/') + 1); + if ( ! Image::is_supported($format) ) { + $_GET['icon'] = 'y'; + $_GET['max'] = 32; + } } do { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2012-09-14 15:29:09
|
Revision: 42965 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=42965&view=rev Author: robertplummer Date: 2012-09-14 15:29:00 +0000 (Fri, 14 Sep 2012) Log Message: ----------- [FIX] Have tiki handle the file like a proxy Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-09-14 15:27:19 UTC (rev 42964) +++ trunk/tiki-download_file.php 2012-09-14 15:29:00 UTC (rev 42965) @@ -99,6 +99,18 @@ } } +//if the file is remote, display, and don't cache +$attributelib = TikiLib::lib('attribute'); +$attributes = $attributelib->get_attributes('file', $info['fileId']); + +if (isset($attributes['tiki.content.url'])) { + $smarty->loadPlugin('smarty_modifier_sefurl'); + $src = smarty_modifier_sefurl($info['fileId'], 'file'); + session_write_close(); + echo file_get_contents($src); + exit(); +} + // Add hits ( if download or display only ) + lock if set if ( ! isset($_GET['thumbnail']) && ! isset($_GET['icon']) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2012-09-19 19:23:13
|
Revision: 43050 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=43050&view=rev Author: robertplummer Date: 2012-09-19 19:23:06 +0000 (Wed, 19 Sep 2012) Log Message: ----------- [FIX] Migrate over to http request, to expose header/content type Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2012-09-19 19:22:24 UTC (rev 43049) +++ trunk/tiki-download_file.php 2012-09-19 19:23:06 UTC (rev 43050) @@ -107,7 +107,11 @@ $smarty->loadPlugin('smarty_modifier_sefurl'); $src = smarty_modifier_sefurl($info['fileId'], 'file'); session_write_close(); - echo file_get_contents($src); + + $client = $tikilib->get_http_client($src); + $response = $client->request(); + header('Content-Type: ' . $response->getHeader('Content-Type')); + echo $response->getBody(); exit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jon...@us...> - 2013-01-23 12:43:05
|
Revision: 44597 http://sourceforge.net/p/tikiwiki/code/44597 Author: jonnybradley Date: 2013-01-23 12:43:02 +0000 (Wed, 23 Jan 2013) Log Message: ----------- [FIX] files: Strict: Only vars can be passed by reference. Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2013-01-23 12:42:32 UTC (rev 44596) +++ trunk/tiki-download_file.php 2013-01-23 12:43:02 UTC (rev 44597) @@ -338,7 +338,7 @@ $image->convert($thumbnail_format); } - $content =& $image->display(); + $content = $image->display(); // If the new image creating has failed, fallback to an icon if ( ! isset($_GET['icon']) && ( $content === null || $content === false ) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jon...@us...> - 2013-01-24 11:41:23
|
Revision: 44608 http://sourceforge.net/p/tikiwiki/code/44608 Author: jonnybradley Date: 2013-01-24 11:41:20 +0000 (Thu, 24 Jan 2013) Log Message: ----------- [FIX] images: Strict: Non-static methods in Image classes should not be called statically (not easy to fix inside the Image classes as it seems to have been designed to work that way) Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2013-01-24 02:07:42 UTC (rev 44607) +++ trunk/tiki-download_file.php 2013-01-24 11:41:20 UTC (rev 44608) @@ -253,11 +253,12 @@ $format = substr($info['filename'], strrpos($info['filename'], '.') + 1); // Fallback to an icon if the format is not supported - if ( ! Image::is_supported($format) ) { + $tmp = new Image('img/icons/pixel_trans.gif', true, 'gif'); // needed to call non-static Image functions non-statically + if ( ! $tmp->is_supported($format) ) { // Is the filename correct? Maybe it doesn't have an extenstion? // Try to determine the format from the filetype too $format = substr($info['filetype'], strrpos($info['filetype'], '/') + 1); - if ( ! Image::is_supported($format) ) { + if ( ! $tmp->is_supported($format) ) { $_GET['icon'] = 'y'; $_GET['max'] = 32; } @@ -278,8 +279,8 @@ $icon_y = isset($_GET['y']) ? $_GET['y'] : 0; } - $content = Image::icon($format, $icon_x, $icon_y); - $format = Image::get_icon_default_format(); + $content = $tmp->icon($format, $icon_x, $icon_y); + $format = $tmp->get_icon_default_format(); $info['filetype'] = 'image/'.$format; $info['lastModif'] = 0; } @@ -328,7 +329,7 @@ } // We change the image format if needed - if ( isset($_GET['format']) && Image::is_supported($_GET['format']) ) { + if ( isset($_GET['format']) && $image->is_supported($_GET['format']) ) { $image->convert($_GET['format']); } elseif ( isset($_GET['thumbnail']) ) { // Or, if no format is explicitely specified and a thumbnail has to be created, we convert the image to the $thumbnail_format This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jy...@us...> - 2015-09-16 09:46:54
|
Revision: 56192 http://sourceforge.net/p/tikiwiki/code/56192 Author: jyhem Date: 2015-09-16 09:46:52 +0000 (Wed, 16 Sep 2015) Log Message: ----------- [FIX] Provide real name for downloads instead of 'tiki-download_file.php' Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2015-09-16 09:15:36 UTC (rev 56191) +++ trunk/tiki-download_file.php 2015-09-16 09:46:52 UTC (rev 56192) @@ -388,6 +388,8 @@ // If the content has not changed, ask the browser to download it (instead of displaying it) if ( ! $content_changed and !isset($_GET['display']) ) { header("Content-Disposition: attachment; filename=\"$file\""); +} else { + header("Content-Disposition: filename=\"$file\""); } if ( !empty($filepath) and !$content_changed ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <amn...@us...> - 2016-07-02 05:29:30
|
Revision: 59040 http://sourceforge.net/p/tikiwiki/code/59040 Author: amnabilal Date: 2016-07-02 05:29:27 +0000 (Sat, 02 Jul 2016) Log Message: ----------- [Fix]Fixed session variable to be checked for validation before pdf is allowed to access image. Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2016-07-02 03:22:52 UTC (rev 59039) +++ trunk/tiki-download_file.php 2016-07-02 05:29:27 UTC (rev 59040) @@ -81,7 +81,7 @@ if(isset($_REQUEST['genPDF'])) { - if(!file_exists( session_save_path().'/'.$_REQUEST['sid']) || !isset($_REQUEST['sid'])) + if(!file_exists( session_save_path().'/sess_'.$_REQUEST['sid']) || !isset($_REQUEST['sid'])) { $access->display_error('', tra('Permission denied'), 401); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <drs...@us...> - 2016-11-19 00:33:07
|
Revision: 60318 http://sourceforge.net/p/tikiwiki/code/60318 Author: drsassafras Date: 2016-11-19 00:33:04 +0000 (Sat, 19 Nov 2016) Log Message: ----------- [FIX] Prevent file resize error in rare instances. Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2016-11-19 00:30:26 UTC (rev 60317) +++ trunk/tiki-download_file.php 2016-11-19 00:33:04 UTC (rev 60318) @@ -185,12 +185,16 @@ die; } +$scale = 0; +if (isset($_GET['scale'])) $scale =(float)$_GET['scale']; +if ($scale >= 1) $scale =0; + // ETag: Entity Tag used for strong cache validation. -if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || isset($_GET['scale']) || isset($_GET['max']) || isset($_GET['format']) ) { +if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || $scale || isset($_GET['max']) || isset($_GET['format']) ) { // if image will be modified, emit a different ETag for modifications. $str = isset($_GET['x']) ? $_GET['x'] . 'x' : ''; $str .= isset($_GET['y']) ? $_GET['y'] . 'y' : ''; - $str .= isset($_GET['scale']) ? $_GET['scale'] . 's' : ''; + $str .= $scale ? $scale . 's' : ''; $str .= isset($_GET['max']) ? $_GET['max'] . 'm' : ''; $str .= isset($_GET['format']) ? $_GET['format'] . 'f' : ''; $etag = '"' . $md5 . '-' . crc32($md5) . '-' . crc32($str) . '"'; @@ -231,7 +235,7 @@ // Cache only thumbnails to avoid DOS attacks $cacheName = ''; $cacheType = ''; - if ( ( isset($_GET['thumbnail']) || isset($_GET['preview']) ) && ! isset($_GET['display']) && ! isset($_GET['icon']) && ! isset($_GET['scale']) && ! isset($_GET['x']) && ! isset($_GET['y']) && ! isset($_GET['format']) && ! isset($_GET['max']) ) { + if ( ( isset($_GET['thumbnail']) || isset($_GET['preview']) ) && ! isset($_GET['display']) && ! isset($_GET['icon']) && ! $scale && ! isset($_GET['x']) && ! isset($_GET['y']) && ! isset($_GET['format']) && ! isset($_GET['max']) ) { $cachelib = TikiLib::lib('cache'); $cacheName = $md5; $cacheType = ( isset($_GET['thumbnail']) ? 'thumbnail_' : 'preview_' ) . ((int)$_REQUEST['fileId']).'_'; @@ -252,7 +256,7 @@ if ($build_content) { // Modify the original image if needed - if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || isset($_GET['scale']) || isset($_GET['max']) || isset($_GET['format']) || isset($_GET['thumbnail']) ) { + if ( ! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || $scale || isset($_GET['max']) || isset($_GET['format']) || isset($_GET['thumbnail']) ) { require_once('lib/images/images.php'); if (!class_exists('Image')) die(); @@ -309,9 +313,9 @@ if ( isset($_GET['x']) || isset($_GET['y']) ) { $image->resize(isset($_GET['x']) ? (int) $_GET['x'] : 0, isset($_GET['y']) ? (int) $_GET['y'] : 0); $resize = true; - } elseif ( isset($_GET['scale']) ) { + } elseif ($scale ) { // We scale if needed - $image->scale($_GET['scale']+0); + $image->scale($scale); $resize = true; } elseif ( isset($_GET['max']) ) { // We reduce size if length or width is greater that $_GET['max'] if needed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xo...@us...> - 2019-03-01 17:00:56
|
Revision: 69333 http://sourceforge.net/p/tikiwiki/code/69333 Author: xorti Date: 2019-03-01 17:00:54 +0000 (Fri, 01 Mar 2019) Log Message: ----------- [FIX] Fix issue in displaying converted pdf in browser display Modified Paths: -------------- trunk/tiki-download_file.php Modified: trunk/tiki-download_file.php =================================================================== --- trunk/tiki-download_file.php 2019-03-01 15:57:55 UTC (rev 69332) +++ trunk/tiki-download_file.php 2019-03-01 17:00:54 UTC (rev 69333) @@ -259,6 +259,7 @@ if ($build_content) { if ($convertToPdf) { $content = PDFHelper::convertToPDF($_REQUEST['fileId']); + $content_changed = true; } elseif (! isset($_GET['display']) || isset($_GET['x']) || isset($_GET['y']) || $scale || isset($_GET['max']) || isset($_GET['format']) || isset($_GET['thumbnail'])) { // Modify the original image if needed if (! Image::isAvailable()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |