Package: Validate

class Omeka_Validate_File_Extension

extends Zend_Validate_File_Extension

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 the responsibility of plugin writers to suppress or replace these messages if necessary for security reasons, e.g. if displaying it to the end user might expose the site to vulnerability probes.

property Omeka_Validate_File_Extension::$_messageTemplates

protected array

Overrides default error message templates.

property Omeka_Validate_File_Extension::$_targetExtension

protected string

The extension of the file being validated

Omeka_Validate_File_Extension::__construct($options = null)

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

  • $options (mixed) –
Omeka_Validate_File_Extension::isValid($value, $file = null)

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

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