Omeka_Validate_File_Extension

class Omeka_Validate_File_Extension

Package: Validate

Define custom behavior for the default whitelist file extension validator.

Baseline behavior of this class is to tweak the default error messages.Messages are intentionally as detailed as possible. Note that it is theresponsibility of plugin writers to suppress or replace these messages ifnecessary for security reasons, e.g. if displaying it to the end user mightexpose the site to vulnerability probes.

property _messageTemplates

Overrides default error message templates.

property _targetExtension

The extension of the file being validated

__construct(mixed $options)

Constructor retrieves the whitelist from the database if no arguments are given.

Parameters:
  • $options (mixed) –
Returns:

void

isValid(string $value, array $file)

Returns true if and only if the fileextension of $value is included in the set extension list.

Parameters:
  • $value (string) – Real file to check for extension.
  • $file (array) – File data from Zend_File_Transfer.
Returns:

boolean

Project Versions

Previous topic

Libraries/Omeka/Validate/File

Next topic

Omeka_Validate_File_MimeType

This Page