Fixing Issue 92 - Downloading files with same name

This commit is contained in:
Nathan Adams 2015-01-03 16:42:52 -06:00
parent 3ccdcf666b
commit 8555a1b7f7

View File

@ -198,7 +198,7 @@ class IDF_Views_Download
public function download($request, $match) public function download($request, $match)
{ {
$prj = $request->project; $prj = $request->project;
$sql = new Pluf_SQL('file=%s', array($match[2])); $sql = new Pluf_SQL('file=%s and project=%s', array($match[2], $prj->id));
$upload = Pluf::factory('IDF_Upload')->getOne(array('filter' => $sql->gen())); $upload = Pluf::factory('IDF_Upload')->getOne(array('filter' => $sql->gen()));
if (!$upload) throw new Pluf_HTTP_Error404(); if (!$upload) throw new Pluf_HTTP_Error404();
$prj->inOr404($upload); $prj->inOr404($upload);