Pagekit\Finder\Controller\FinderController::isValidFilename PHP Method

isValidFilename() protected method

protected isValidFilename ( $name )
    protected function isValidFilename($name)
    {
        if (empty($name)) {
            return false;
        }
        $extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
        $allowed = App::module('system/finder')->config['extensions'];
        if (!empty($extension) && !in_array($extension, explode(',', $allowed))) {
            return false;
        }
        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
            return !preg_match('#[\\/:"*?<>|]#', $name);
        }
        return -1 !== strpos($name, '/');
    }