public function matchPath($path, $allowed_dirs)
    {
        if (!empty($allowed_dirs)) {
            foreach ($allowed_dirs as $one_dir) {
                if (preg_match('#^' . preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', $this->realPathSafe($one_dir))) . '#', $path)) {