def _normalize_path(self, path):
        base_path = self.get_base_path()

        if path is None:
            directory = base_path
            path = ''
        else:
            path = op.normpath(path)
            directory = op.normpath(op.join(base_path, path))

            if not self.is_in_folder(base_path, directory):
                abort(404)

        if not op.exists(directory):
            abort(404)

        return base_path, directory, path
Verify and normalize path.
dataset/ETHPy150Open syrusakbary/Flask-SuperAdmin/flask_superadmin/contrib/fileadmin.py/FileAdmin._normalize_path