[ticket/11362] Correctly sanitise the directory path

We need to correctly remove ../ form the path if possible by removing the
previous folder aswell. Otherwise the finder is unable to locate /adm/style
directories in extensions as he is looking for /adm/../adm/style instead.

PHPBB3-11362
This commit is contained in:
Joas Schilling 2013-03-12 22:35:31 +01:00
parent d6930df7a2
commit 567eefb2bd

View file

@ -227,7 +227,7 @@ class phpbb_extension_finder
*/
protected function sanitise_directory($directory)
{
$directory = preg_replace('#(?:^|/)\./#', '/', $directory);
$directory = phpbb_clean_path($directory);
$dir_len = strlen($directory);
if ($dir_len > 1 && $directory[$dir_len - 1] === '/')