ignore symlinks in bulk add, stops recursion

git-svn-id: file:///home/shish/svn/shimmie2/trunk@640 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-12-08 04:30:11 +00:00
parent 11c906b3fc
commit 0634cdd73d
2 changed files with 8 additions and 4 deletions

View file

@ -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");
}

View file

@ -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());
?>