More explicitly exclude a series of double dots

This commit is contained in:
Kijin Sung 2016-03-15 18:05:48 +09:00
parent ff0df0a14b
commit b088348be2

View file

@ -77,7 +77,7 @@ class FilenameFilter
$path = preg_replace('@/(\./)+@', '/', $path);
// Remove double dots and the preceding directory.
while (preg_match('@/[^/]+/\.\.(?:/|$)@', $path, $matches))
while (preg_match('@/(?!\.\.)[^/]+/\.\.(?:/|$)@', $path, $matches))
{
$path = str_replace($matches[0], '/', $path);
}