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

This commit is contained in:
zotlabs 2017-02-20 15:06:17 -08:00
parent 74def75ca3
commit bc1812840a

View File

@ -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']) {