From 0634cdd73d0c7345b9bc9f5cc921d5ce92077c23 Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 8 Dec 2007 04:30:11 +0000 Subject: [PATCH] ignore symlinks in bulk add, stops recursion git-svn-id: file:///home/shish/svn/shimmie2/trunk@640 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/handle_archive/main.php | 5 ++++- ext/bulk_add/main.php | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/contrib/handle_archive/main.php b/contrib/handle_archive/main.php index b2419671..47a4881e 100644 --- a/contrib/handle_archive/main.php +++ b/contrib/handle_archive/main.php @@ -51,7 +51,10 @@ class ArchiveFileHandler extends Extension { while($filename = readdir($dir)) { $fullpath = "$base/$subdir/$filename"; - if(is_dir($fullpath)) { + if(is_link($fullpath)) { + // ignore + } + else if(is_dir($fullpath)) { if($filename[0] != ".") { $this->add_dir($base, "$subdir/$filename"); } diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php index e83db71b..89bd891c 100644 --- a/ext/bulk_add/main.php +++ b/ext/bulk_add/main.php @@ -21,7 +21,6 @@ class BulkAdd extends Extension { } } -// do the adding {{{ private function add_image($tmpname, $filename, $tags) { if(file_exists($tmpname)) { global $user; @@ -52,7 +51,10 @@ class BulkAdd extends Extension { while($filename = readdir($dir)) { $fullpath = "$base/$subdir/$filename"; - if(is_dir($fullpath)) { + if(is_link($fullpath)) { + // ignore + } + else if(is_dir($fullpath)) { if($filename[0] != ".") { $this->add_dir($base, "$subdir/$filename"); } @@ -76,7 +78,6 @@ class BulkAdd extends Extension { $this->theme->add_status("Adding $subdir", $list); } -// }}} } add_event_listener(new BulkAdd()); ?>