Remove cached photo location directory on delete if empty

This commit is contained in:
Max Kostikov 2019-06-19 23:13:53 +02:00
parent db8e46184b
commit dd515da889

View File

@ -108,6 +108,7 @@ class Cron {
$file = dbunescbin($rr['content']); $file = dbunescbin($rr['content']);
if(is_file($file)) { if(is_file($file)) {
@unlink($file); @unlink($file);
@rmdir(dirname($file));
logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG); logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG);
} }
} }