mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-20 05:45:11 -04:00
The problem occurs because the square brackets are treated as special characters in the glob to find the children. This patch escapes the square brackets. Fixes ticket #855
This commit is contained in:
@@ -42,13 +42,15 @@ class Server_Add_Controller extends Admin_Controller {
|
||||
|
||||
// Make a tree with the parents back up to the authorized path, and all the children under the
|
||||
// current path.
|
||||
Kohana_Log::add("error", $path);
|
||||
if (server_add::is_valid_path($path)) {
|
||||
$tree->parents[] = $path;
|
||||
while (server_add::is_valid_path(dirname($tree->parents[0]))) {
|
||||
array_unshift($tree->parents, dirname($tree->parents[0]));
|
||||
}
|
||||
|
||||
foreach (glob("$path/*") as $file) {
|
||||
$glob_path = str_replace(array("{", "}", "[", "]"), array("\{", "\}", "\[", "\]"), $path);
|
||||
foreach (glob("$glob_path/*") as $file) {
|
||||
if (!is_readable($file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user