public function validate(ValidationResult $result, $filename = null)
    {
        if (empty($filename)) {
            $filename = $this->getFilename();
        }
        if (empty($filename) || $this->isValidFilename($filename)) {
            return true;
        }

        $message = _t(
            'SilverStripe\\Assets\\File.INVALIDEXTENSION_SHORT_EXT',
            'Extension \'{extension}\' is not allowed',
            [ 'extension' => strtolower(File::get_file_extension($filename)) ]
        );
        $result->addError($message);
        return false;
    }