1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Check filename before reading file from cache

Test Plan: Downloaded empty file, got proper filename.

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3534
This commit is contained in:
vrana 2012-09-20 17:02:59 -07:00
parent 65bbd24974
commit 8d0918885d

View file

@ -127,7 +127,8 @@ final class PhabricatorFile extends PhabricatorFileDAO {
array $params = array()) { array $params = array()) {
$file = id(new PhabricatorFile())->loadOneWhere( $file = id(new PhabricatorFile())->loadOneWhere(
'contentHash = %s LIMIT 1', 'name = %s AND contentHash = %s LIMIT 1',
self::normalizeFileName(idx($params, 'name')),
PhabricatorHash::digest($data)); PhabricatorHash::digest($data));
if (!$file) { if (!$file) {