maxmuen Downloading a folder with square brackets in there name will result in 'No files to zip!' error.
OK. I have been looking into this. Two things:
1. Next Files gallery release will download and create zip in browser.
This is much more flexible than the server-zip method, and I can confirm that it does not care about [brackets] in folder names. Server ZIP will still be an option, but browser-download will be the new default.
glob() and [brackets] is a big mess.
$glob_dir = preg_replace('[\[\]*?\\\\]', '\\\\\\0', $dir);
This does not work on Mac. I'm assuming the fix above will only work on Windows.
This works on Mac, but guessing it fails on Windows because of
$glob_dir = str_replace(['[', ']'], ['\[', '\]'], $dir);
The only cross-platform solution that seems to work, is a long fix noted in these posts:
Brackets and PHP
glob() is really a bad combination, and is the reason it's actually listed as a"bug" (see above link), and as noted in this post this is a common problem:
Considering the awkwardness of the solution, and that in next release we are moving towards browser-based zip download (which supports [brackets] nicely), this circumstantial bug will not be fixed.