aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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']) {