From 700a120c225f056070f1c5601ca91f88b3bbe870 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Thu, 8 Mar 2012 15:47:49 +0100
Subject: [PATCH] fix write hook for gallery

---
 apps/gallery/lib/hooks_handlers.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php
index 3c101b1f8a..480e41a8bf 100644
--- a/apps/gallery/lib/hooks_handlers.php
+++ b/apps/gallery/lib/hooks_handlers.php
@@ -68,7 +68,7 @@ class OC_Gallery_Hooks_Handlers {
 
     if (!self::isPhoto($fullpath)) return;
 
-    $path = substr($fullpath, 0, strrpos($fullpath, '/'));
+    $path = dirname($fullpath);
     if (!self::pathInRoot($path)) return;
     OC_Gallery_Scanner::scanDir($path, $albums);
 
-- 
GitLab