Server add - exclude hidden dirs

appelflap

Joined: 2009-06-16
Posts: 23
Posted: Tue, 2009-06-16 11:03

All my pictures are in a directory on my server as a subdirectory in the form of "(YYYY-mm-dd) Description". I have a cron that makes thumbs for those pictures and stores them in a "(YYYY-mm-dd) Description/.tn" directory for another part of my website.

While running the server add module, the listing doesn't show the hidden dir or the thumbs in the hidden dir. That's ok. But! after checking the box in front of the main dir and submitting.. the thumbs get added as well.
I don't get it, because in the script the files/dirs get filtered by this part: 'if ($filename[0] != ".")'.
Does anybody know a solution to the problem?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2009-06-16 20:50

No fix yet, but I filed a ticket: http://sourceforge.net/apps/trac/gallery/ticket/426
---
Problems: Check gallery3/var/logs first!
file a bug or feature request | upgrade to the latest code | use git

 
appelflap

Joined: 2009-06-16
Posts: 23
Posted: Wed, 2009-06-17 18:25

Ok, nice.
The files get added because the dirlisting is being made by the following function:

    $children = new RecursiveIteratorIterator(
      new RecursiveDirectoryIterator($path),
      RecursiveIteratorIterator::SELF_FIRST);

So this way the script looks at the .jpg file in the .tn subdir and doesn't take the parent dir into account.

I temporarily fixed it by changing this:

223c223
<         } else {
---
>         } elseif (!ereg("\/\.[^\/]*$",dirname($file->getPathname()))) {