aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-02-20 15:06:17 -0800
committerzotlabs <mike@macgirvin.com>2017-02-20 15:06:17 -0800
commitbc1812840a443407db38a86831bb48dde5523e47 (patch)
tree722605ad19e7d2d4c4cc7f2f327f18eddaa116be /include
parent74def75ca39d8bf79da1f3e4e3356954d4f9da02 (diff)
downloadvolse-hubzilla-bc1812840a443407db38a86831bb48dde5523e47.tar.gz
volse-hubzilla-bc1812840a443407db38a86831bb48dde5523e47.tar.bz2
volse-hubzilla-bc1812840a443407db38a86831bb48dde5523e47.zip
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
Diffstat (limited to 'include')
-rw-r--r--include/attach.php10
1 files changed, 6 insertions, 4 deletions
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']) {