From bc1812840a443407db38a86831bb48dde5523e47 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 20 Feb 2017 15:06:17 -0800 Subject: don't search on empty filename - we shouldn't find it. The reason why this change is being made is because we actually did find it due to a development glitch --- include/attach.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/attach.php b/include/attach.php index 937d33ea3..5f0fa4ff8 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1479,10 +1479,12 @@ function find_folder_hash_by_path($channel_id, $path) { $filename = end(explode('/', $path)); - $r = q("SELECT hash FROM attach WHERE uid = %d AND filename = '%s' LIMIT 1", - intval($channel_id), - dbesc($filename) - ); + if($filename) { + $r = q("SELECT hash FROM attach WHERE uid = %d AND filename = '%s' LIMIT 1", + intval($channel_id), + dbesc($filename) + ); + } $hash = ''; if($r && $r[0]['hash']) { -- cgit v1.2.3