I'm not sure if this is a bug or a feature request. I would like to only display some specific file types (e.g. pdf only), but also list subdirectories. Setting the whitelist to:
*.pdf
automatically hides subdirectories, which is not the desired behavior. Whitelisting all subdirectories is not an option, because there are too many of them. Could we set the policy so that listing subdirectories takes precedence over the whitelist, and only hide those which are explicitly blacklisted? I also tried to whitelist:
[^\.]+
*.pdf
but [^\.]+ fails to catch subdirectories.
Comments
Comment #2
clivesj commentedI can't imagine this is intended behaviour.
We can solve it by *not* sending the directories to the Whitelist validator.
We can do that in ServerFileList::createServerFileList which is easier than in the the validator itsself because we need the path_to_file to check if it is a directory.
I will come back on this shortly, or if you have time: go-ahead.
Comment #3
lpsolit commentedI have a patch ready. I will upload it in a minute or two.
Comment #4
lpsolit commentedWhile fixing this bug, I found another more severe issue: filetype() returns 'dir' for directories, not 'directory'. So the check to hide subdirectories was always wrong, meaning that subdirectories were always displayed independently of the exploreSubdirs value. I fixed this issue as part of this patch.
Comment #5
clivesj commentedThanks for the patch. Committed to dev. Realease will follow soon
Comment #7
clivesj commented