public function is_allowed_name($name, $is_dir = false)
    {
        $name = basename($name);

        // check if folder name is allowed regarding the security Policy settings
        if ($is_dir && (
            in_array($name, $this->config['security']['excluded_dirs']) ||
            preg_match($this->config['security']['excluded_dirs_REGEXP'], $name))
        ) {
            return false;
        }

        // check if file name is allowed regarding the security Policy settings
        if (!$is_dir && (
            in_array($name, $this->config['security']['excluded_files']) ||
            preg_match($this->config['security']['excluded_files_REGEXP'], $name))
        ) {
            return false;
        }

        return true;
    }
public function is_allowed_name($name, $is_dir = false)
    {
        $name = basename($name);

        // check if folder name is allowed regarding the security Policy settings
        if ($is_dir && (
            in_array($name, $this->config['security']['excluded_dirs']) ||
            preg_match($this->config['security']['excluded_dirs_REGEXP'], $name))
        ) {
            return false;
        }

        // check if file name is allowed regarding the security Policy settings
        if (!$is_dir && (
            in_array($name, $this->config['security']['excluded_files']) ||
            preg_match($this->config['security']['excluded_files_REGEXP'], $name))
        ) {
            return false;
        }

        return true;
    }
public function is_allowed_name ( $ name , $ is_dir = false ) { $ name = basename ( $ name ) ; // check if folder name is allowed regarding the security Policy settings if ( $ is_dir && ( in_array ( $ name , $ this -> config [ 'security' ] [ 'excluded_dirs' ] ) || preg_match ( $ this -> config [ 'security' ] [ 'excluded_dirs_REGEXP' ] , $ name ) ) ) { return false ; } // check if file name is allowed regarding the security Policy settings if ( ! $ is_dir && ( in_array ( $ name , $ this -> config [ 'security' ] [ 'excluded_files' ] ) || preg_match ( $ this -> config [ 'security' ] [ 'excluded_files_REGEXP' ] , $ name ) ) ) { return false ; } return true ; }
Check if file or folder name is not in "excluded" list
@param string $name
@param bool $is_dir
@return bool
Check if file or folder name is not in excluded list