CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.
This commit is contained in:
parent
514777e8d2
commit
b11cbd8159
4546 changed files with 138 additions and 51 deletions
436
airtime_mvc/library/Zend/Validate/Abstract.php
Normal file
436
airtime_mvc/library/Zend/Validate/Abstract.php
Normal file
|
@ -0,0 +1,436 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Interface
|
||||
*/
|
||||
require_once 'Zend/Validate/Interface.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Validate_Abstract implements Zend_Validate_Interface
|
||||
{
|
||||
/**
|
||||
* The value to be validated
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_value;
|
||||
|
||||
/**
|
||||
* Additional variables available for validation failure messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array();
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array();
|
||||
|
||||
/**
|
||||
* Array of validation failure messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messages = array();
|
||||
|
||||
/**
|
||||
* Flag indidcating whether or not value should be obfuscated in error
|
||||
* messages
|
||||
* @var bool
|
||||
*/
|
||||
protected $_obscureValue = false;
|
||||
|
||||
/**
|
||||
* Array of validation failure message codes
|
||||
*
|
||||
* @var array
|
||||
* @deprecated Since 1.5.0
|
||||
*/
|
||||
protected $_errors = array();
|
||||
|
||||
/**
|
||||
* Translation object
|
||||
* @var Zend_Translate
|
||||
*/
|
||||
protected $_translator;
|
||||
|
||||
/**
|
||||
* Default translation object for all validate objects
|
||||
* @var Zend_Translate
|
||||
*/
|
||||
protected static $_defaultTranslator;
|
||||
|
||||
/**
|
||||
* Is translation disabled?
|
||||
* @var Boolean
|
||||
*/
|
||||
protected $_translatorDisabled = false;
|
||||
|
||||
/**
|
||||
* Limits the maximum returned length of a error message
|
||||
*
|
||||
* @var Integer
|
||||
*/
|
||||
protected static $_messageLength = -1;
|
||||
|
||||
/**
|
||||
* Returns array of validation failure messages
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->_messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the names of variables that are used in constructing validation failure messages
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessageVariables()
|
||||
{
|
||||
return array_keys($this->_messageVariables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the message templates from the validator
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessageTemplates()
|
||||
{
|
||||
return $this->_messageTemplates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the validation failure message template for a particular key
|
||||
*
|
||||
* @param string $messageString
|
||||
* @param string $messageKey OPTIONAL
|
||||
* @return Zend_Validate_Abstract Provides a fluent interface
|
||||
* @throws Zend_Validate_Exception
|
||||
*/
|
||||
public function setMessage($messageString, $messageKey = null)
|
||||
{
|
||||
if ($messageKey === null) {
|
||||
$keys = array_keys($this->_messageTemplates);
|
||||
foreach($keys as $key) {
|
||||
$this->setMessage($messageString, $key);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (!isset($this->_messageTemplates[$messageKey])) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("No message template exists for key '$messageKey'");
|
||||
}
|
||||
|
||||
$this->_messageTemplates[$messageKey] = $messageString;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets validation failure message templates given as an array, where the array keys are the message keys,
|
||||
* and the array values are the message template strings.
|
||||
*
|
||||
* @param array $messages
|
||||
* @return Zend_Validate_Abstract
|
||||
*/
|
||||
public function setMessages(array $messages)
|
||||
{
|
||||
foreach ($messages as $key => $message) {
|
||||
$this->setMessage($message, $key);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic function returns the value of the requested property, if and only if it is the value or a
|
||||
* message variable.
|
||||
*
|
||||
* @param string $property
|
||||
* @return mixed
|
||||
* @throws Zend_Validate_Exception
|
||||
*/
|
||||
public function __get($property)
|
||||
{
|
||||
if ($property == 'value') {
|
||||
return $this->_value;
|
||||
}
|
||||
if (array_key_exists($property, $this->_messageVariables)) {
|
||||
return $this->{$this->_messageVariables[$property]};
|
||||
}
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("No property exists by the name '$property'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs and returns a validation failure message with the given message key and value.
|
||||
*
|
||||
* Returns null if and only if $messageKey does not correspond to an existing template.
|
||||
*
|
||||
* If a translator is available and a translation exists for $messageKey,
|
||||
* the translation will be used.
|
||||
*
|
||||
* @param string $messageKey
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
protected function _createMessage($messageKey, $value)
|
||||
{
|
||||
if (!isset($this->_messageTemplates[$messageKey])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$message = $this->_messageTemplates[$messageKey];
|
||||
|
||||
if (null !== ($translator = $this->getTranslator())) {
|
||||
if ($translator->isTranslated($message)) {
|
||||
$message = $translator->translate($message);
|
||||
} elseif ($translator->isTranslated($messageKey)) {
|
||||
$message = $translator->translate($messageKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_object($value)) {
|
||||
if (!in_array('__toString', get_class_methods($value))) {
|
||||
$value = get_class($value) . ' object';
|
||||
} else {
|
||||
$value = $value->__toString();
|
||||
}
|
||||
} else {
|
||||
$value = (string)$value;
|
||||
}
|
||||
|
||||
if ($this->getObscureValue()) {
|
||||
$value = str_repeat('*', strlen($value));
|
||||
}
|
||||
|
||||
$message = str_replace('%value%', (string) $value, $message);
|
||||
foreach ($this->_messageVariables as $ident => $property) {
|
||||
$message = str_replace("%$ident%", (string) $this->$property, $message);
|
||||
}
|
||||
|
||||
$length = self::getMessageLength();
|
||||
if (($length > -1) && (strlen($message) > $length)) {
|
||||
$message = substr($message, 0, (self::getMessageLength() - 3)) . '...';
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $messageKey
|
||||
* @param string $value OPTIONAL
|
||||
* @return void
|
||||
*/
|
||||
protected function _error($messageKey, $value = null)
|
||||
{
|
||||
if ($messageKey === null) {
|
||||
$keys = array_keys($this->_messageTemplates);
|
||||
$messageKey = current($keys);
|
||||
}
|
||||
if ($value === null) {
|
||||
$value = $this->_value;
|
||||
}
|
||||
$this->_errors[] = $messageKey;
|
||||
$this->_messages[$messageKey] = $this->_createMessage($messageKey, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value to be validated and clears the messages and errors arrays
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
protected function _setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
$this->_messages = array();
|
||||
$this->_errors = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of validation failure message codes
|
||||
*
|
||||
* @return array
|
||||
* @deprecated Since 1.5.0
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->_errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set flag indicating whether or not value should be obfuscated in messages
|
||||
*
|
||||
* @param bool $flag
|
||||
* @return Zend_Validate_Abstract
|
||||
*/
|
||||
public function setObscureValue($flag)
|
||||
{
|
||||
$this->_obscureValue = (bool) $flag;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve flag indicating whether or not value should be obfuscated in
|
||||
* messages
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getObscureValue()
|
||||
{
|
||||
return $this->_obscureValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set translation object
|
||||
*
|
||||
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
|
||||
* @return Zend_Validate_Abstract
|
||||
*/
|
||||
public function setTranslator($translator = null)
|
||||
{
|
||||
if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
|
||||
$this->_translator = $translator;
|
||||
} elseif ($translator instanceof Zend_Translate) {
|
||||
$this->_translator = $translator->getAdapter();
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid translator specified');
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return translation object
|
||||
*
|
||||
* @return Zend_Translate_Adapter|null
|
||||
*/
|
||||
public function getTranslator()
|
||||
{
|
||||
if ($this->translatorIsDisabled()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (null === $this->_translator) {
|
||||
return self::getDefaultTranslator();
|
||||
}
|
||||
|
||||
return $this->_translator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default translation object for all validate objects
|
||||
*
|
||||
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
|
||||
* @return void
|
||||
*/
|
||||
public static function setDefaultTranslator($translator = null)
|
||||
{
|
||||
if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
|
||||
self::$_defaultTranslator = $translator;
|
||||
} elseif ($translator instanceof Zend_Translate) {
|
||||
self::$_defaultTranslator = $translator->getAdapter();
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid translator specified');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default translation object for all validate objects
|
||||
*
|
||||
* @return Zend_Translate_Adapter|null
|
||||
*/
|
||||
public static function getDefaultTranslator()
|
||||
{
|
||||
if (null === self::$_defaultTranslator) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Translate')) {
|
||||
$translator = Zend_Registry::get('Zend_Translate');
|
||||
if ($translator instanceof Zend_Translate_Adapter) {
|
||||
return $translator;
|
||||
} elseif ($translator instanceof Zend_Translate) {
|
||||
return $translator->getAdapter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return self::$_defaultTranslator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate whether or not translation should be disabled
|
||||
*
|
||||
* @param bool $flag
|
||||
* @return Zend_Validate_Abstract
|
||||
*/
|
||||
public function setDisableTranslator($flag)
|
||||
{
|
||||
$this->_translatorDisabled = (bool) $flag;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is translation disabled?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function translatorIsDisabled()
|
||||
{
|
||||
return $this->_translatorDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum allowed message length
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function getMessageLength()
|
||||
{
|
||||
return self::$_messageLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum allowed message length
|
||||
*
|
||||
* @param integer $length
|
||||
*/
|
||||
public static function setMessageLength($length = -1)
|
||||
{
|
||||
self::$_messageLength = $length;
|
||||
}
|
||||
}
|
150
airtime_mvc/library/Zend/Validate/Alnum.php
Normal file
150
airtime_mvc/library/Zend/Validate/Alnum.php
Normal file
|
@ -0,0 +1,150 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Alnum.php 20442 2010-01-20 15:15:40Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Alnum extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'alnumInvalid';
|
||||
const NOT_ALNUM = 'notAlnum';
|
||||
const STRING_EMPTY = 'alnumStringEmpty';
|
||||
|
||||
/**
|
||||
* Whether to allow white space characters; off by default
|
||||
*
|
||||
* @var boolean
|
||||
* @deprecated
|
||||
*/
|
||||
public $allowWhiteSpace;
|
||||
|
||||
/**
|
||||
* Alphanumeric filter used for validation
|
||||
*
|
||||
* @var Zend_Filter_Alnum
|
||||
*/
|
||||
protected static $_filter = null;
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be float, string, or integer",
|
||||
self::NOT_ALNUM => "'%value%' contains characters which are non alphabetic and no digits",
|
||||
self::STRING_EMPTY => "'%value%' is an empty string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets default option values for this instance
|
||||
*
|
||||
* @param boolean|Zend_Config $allowWhiteSpace
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($allowWhiteSpace = false)
|
||||
{
|
||||
if ($allowWhiteSpace instanceof Zend_Config) {
|
||||
$allowWhiteSpace = $allowWhiteSpace->toArray();
|
||||
}
|
||||
|
||||
if (is_array($allowWhiteSpace)) {
|
||||
if (array_key_exists('allowWhiteSpace', $allowWhiteSpace)) {
|
||||
$allowWhiteSpace = $allowWhiteSpace['allowWhiteSpace'];
|
||||
} else {
|
||||
$allowWhiteSpace = false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->allowWhiteSpace = (boolean) $allowWhiteSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowWhiteSpace option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getAllowWhiteSpace()
|
||||
{
|
||||
return $this->allowWhiteSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the allowWhiteSpace option
|
||||
*
|
||||
* @param boolean $allowWhiteSpace
|
||||
* @return Zend_Filter_Alnum Provides a fluent interface
|
||||
*/
|
||||
public function setAllowWhiteSpace($allowWhiteSpace)
|
||||
{
|
||||
$this->allowWhiteSpace = (boolean) $allowWhiteSpace;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value contains only alphabetic and digit characters
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
|
||||
if ('' === $value) {
|
||||
$this->_error(self::STRING_EMPTY);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null === self::$_filter) {
|
||||
/**
|
||||
* @see Zend_Filter_Alnum
|
||||
*/
|
||||
require_once 'Zend/Filter/Alnum.php';
|
||||
self::$_filter = new Zend_Filter_Alnum();
|
||||
}
|
||||
|
||||
self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;
|
||||
|
||||
if ($value != self::$_filter->filter($value)) {
|
||||
$this->_error(self::NOT_ALNUM);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
150
airtime_mvc/library/Zend/Validate/Alpha.php
Normal file
150
airtime_mvc/library/Zend/Validate/Alpha.php
Normal file
|
@ -0,0 +1,150 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Alpha.php 20442 2010-01-20 15:15:40Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Alpha extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'alphaInvalid';
|
||||
const NOT_ALPHA = 'notAlpha';
|
||||
const STRING_EMPTY = 'alphaStringEmpty';
|
||||
|
||||
/**
|
||||
* Whether to allow white space characters; off by default
|
||||
*
|
||||
* @var boolean
|
||||
* @deprecated
|
||||
*/
|
||||
public $allowWhiteSpace;
|
||||
|
||||
/**
|
||||
* Alphabetic filter used for validation
|
||||
*
|
||||
* @var Zend_Filter_Alpha
|
||||
*/
|
||||
protected static $_filter = null;
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::NOT_ALPHA => "'%value%' contains non alphabetic characters",
|
||||
self::STRING_EMPTY => "'%value%' is an empty string"
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets default option values for this instance
|
||||
*
|
||||
* @param boolean|Zend_Config $allowWhiteSpace
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($allowWhiteSpace = false)
|
||||
{
|
||||
if ($allowWhiteSpace instanceof Zend_Config) {
|
||||
$allowWhiteSpace = $allowWhiteSpace->toArray();
|
||||
}
|
||||
|
||||
if (is_array($allowWhiteSpace)) {
|
||||
if (array_key_exists('allowWhiteSpace', $allowWhiteSpace)) {
|
||||
$allowWhiteSpace = $allowWhiteSpace['allowWhiteSpace'];
|
||||
} else {
|
||||
$allowWhiteSpace = false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->allowWhiteSpace = (boolean) $allowWhiteSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowWhiteSpace option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getAllowWhiteSpace()
|
||||
{
|
||||
return $this->allowWhiteSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the allowWhiteSpace option
|
||||
*
|
||||
* @param boolean $allowWhiteSpace
|
||||
* @return Zend_Filter_Alpha Provides a fluent interface
|
||||
*/
|
||||
public function setAllowWhiteSpace($allowWhiteSpace)
|
||||
{
|
||||
$this->allowWhiteSpace = (boolean) $allowWhiteSpace;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value contains only alphabetic characters
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
|
||||
if ('' === $value) {
|
||||
$this->_error(self::STRING_EMPTY);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null === self::$_filter) {
|
||||
/**
|
||||
* @see Zend_Filter_Alpha
|
||||
*/
|
||||
require_once 'Zend/Filter/Alpha.php';
|
||||
self::$_filter = new Zend_Filter_Alpha();
|
||||
}
|
||||
|
||||
self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;
|
||||
|
||||
if ($value !== self::$_filter->filter($value)) {
|
||||
$this->_error(self::NOT_ALPHA);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
217
airtime_mvc/library/Zend/Validate/Barcode.php
Normal file
217
airtime_mvc/library/Zend/Validate/Barcode.php
Normal file
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Barcode.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Loader
|
||||
*/
|
||||
require_once 'Zend/Loader.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'barcodeInvalid';
|
||||
const FAILED = 'barcodeFailed';
|
||||
const INVALID_CHARS = 'barcodeInvalidChars';
|
||||
const INVALID_LENGTH = 'barcodeInvalidLength';
|
||||
|
||||
protected $_messageTemplates = array(
|
||||
self::FAILED => "'%value%' failed checksum validation",
|
||||
self::INVALID_CHARS => "'%value%' contains invalid characters",
|
||||
self::INVALID_LENGTH => "'%value%' should have a length of %length% characters",
|
||||
self::INVALID => "Invalid type given, value should be string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Additional variables available for validation failure messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'length' => '_length'
|
||||
);
|
||||
|
||||
/**
|
||||
* Length for the set subtype
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length;
|
||||
|
||||
/**
|
||||
* Barcode adapter
|
||||
*
|
||||
* @var Zend_Validate_Barcode_BarcodeAdapter
|
||||
*/
|
||||
protected $_adapter;
|
||||
|
||||
/**
|
||||
* Generates the standard validator object
|
||||
*
|
||||
* @param string|Zend_Config|
|
||||
* Zend_Validate_Barcode_BarcodeAdapter $adapter Barcode adapter to use
|
||||
* @return void
|
||||
* @throws Zend_Validate_Exception
|
||||
*/
|
||||
public function __construct($adapter)
|
||||
{
|
||||
if ($adapter instanceof Zend_Config) {
|
||||
$adapter = $adapter->toArray();
|
||||
}
|
||||
|
||||
$options = null;
|
||||
$checksum = null;
|
||||
if (is_array($adapter)) {
|
||||
if (array_key_exists('options', $adapter)) {
|
||||
$options = $adapter['options'];
|
||||
}
|
||||
|
||||
if (array_key_exists('checksum', $adapter)) {
|
||||
$checksum = $adapter['checksum'];
|
||||
}
|
||||
|
||||
if (array_key_exists('adapter', $adapter)) {
|
||||
$adapter = $adapter['adapter'];
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Missing option 'adapter'");
|
||||
}
|
||||
}
|
||||
|
||||
$this->setAdapter($adapter, $options);
|
||||
if ($checksum !== null) {
|
||||
$this->setChecksum($checksum);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set adapter
|
||||
*
|
||||
* @return Zend_Validate_Barcode_BarcodeAdapter
|
||||
*/
|
||||
public function getAdapter()
|
||||
{
|
||||
return $this->_adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new barcode adapter
|
||||
*
|
||||
* @param string|Zend_Validate_Barcode $adapter Barcode adapter to use
|
||||
* @param array $options Options for this adapter
|
||||
* @return void
|
||||
* @throws Zend_Validate_Exception
|
||||
*/
|
||||
public function setAdapter($adapter, $options = null)
|
||||
{
|
||||
$adapter = ucfirst(strtolower($adapter));
|
||||
require_once 'Zend/Loader.php';
|
||||
if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
|
||||
$adapter = 'Zend_Validate_Barcode_' . $adapter;
|
||||
}
|
||||
|
||||
if (!class_exists($adapter)) {
|
||||
Zend_Loader::loadClass($adapter);
|
||||
}
|
||||
|
||||
$this->_adapter = new $adapter($options);
|
||||
if (!$this->_adapter instanceof Zend_Validate_Barcode_AdapterInterface) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception(
|
||||
"Adapter " . $adapter . " does not implement Zend_Validate_Barcode_AdapterInterface"
|
||||
);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the checksum option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getChecksum()
|
||||
{
|
||||
return $this->getAdapter()->getCheck();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the checksum option
|
||||
*
|
||||
* @param boolean $checksum
|
||||
* @return Zend_Validate_Barcode
|
||||
*/
|
||||
public function setChecksum($checksum)
|
||||
{
|
||||
$this->getAdapter()->setCheck($checksum);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value contains a valid barcode
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_value = (string) $value;
|
||||
$adapter = $this->getAdapter();
|
||||
$this->_length = $adapter->getLength();
|
||||
$result = $adapter->checkLength($value);
|
||||
if (!$result) {
|
||||
$this->_error(self::INVALID_LENGTH);
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = $adapter->checkChars($value);
|
||||
if (!$result) {
|
||||
$this->_error(self::INVALID_CHARS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getChecksum()) {
|
||||
$result = $adapter->checksum($value);
|
||||
if (!$result) {
|
||||
$this->_error(self::FAILED);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
315
airtime_mvc/library/Zend/Validate/Barcode/AdapterAbstract.php
Normal file
315
airtime_mvc/library/Zend/Validate/Barcode/AdapterAbstract.php
Normal file
|
@ -0,0 +1,315 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterInterface
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterInterface.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Validate_Barcode_AdapterAbstract
|
||||
implements Zend_Validate_Barcode_AdapterInterface
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer|array|string
|
||||
*/
|
||||
protected $_length;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters;
|
||||
|
||||
/**
|
||||
* Callback to checksum function
|
||||
* @var string|array
|
||||
*/
|
||||
protected $_checksum;
|
||||
|
||||
/**
|
||||
* Is a checksum value included?
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_hasChecksum = true;
|
||||
|
||||
/**
|
||||
* Checks the length of a barcode
|
||||
*
|
||||
* @param string $value The barcode to check for proper length
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkLength($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$fixum = strlen($value);
|
||||
$found = false;
|
||||
$length = $this->getLength();
|
||||
if (is_array($length)) {
|
||||
foreach ($length as $value) {
|
||||
if ($fixum == $value) {
|
||||
$found = true;
|
||||
}
|
||||
|
||||
if ($value == -1) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
} elseif ($fixum == $length) {
|
||||
$found = true;
|
||||
} elseif ($length == -1) {
|
||||
$found = true;
|
||||
} elseif ($length == 'even') {
|
||||
$count = $fixum % 2;
|
||||
$found = ($count == 0) ? true : false;
|
||||
} elseif ($length == 'odd') {
|
||||
$count = $fixum % 2;
|
||||
$found = ($count == 1) ? true : false;
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for allowed characters within the barcode
|
||||
*
|
||||
* @param string $value The barcode to check for allowed characters
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkChars($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$characters = $this->getCharacters();
|
||||
if ($characters == 128) {
|
||||
for ($x = 0; $x < 128; ++$x) {
|
||||
$value = str_replace(chr($x), '', $value);
|
||||
}
|
||||
} else {
|
||||
$chars = str_split($characters);
|
||||
foreach ($chars as $char) {
|
||||
$value = str_replace($char, '', $value);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($value) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum
|
||||
*
|
||||
* @param string $value The barcode to check the checksum for
|
||||
* @return boolean
|
||||
*/
|
||||
public function checksum($value)
|
||||
{
|
||||
$checksum = $this->getChecksum();
|
||||
if (!empty($checksum)) {
|
||||
if (method_exists($this, $checksum)) {
|
||||
return call_user_func(array($this, $checksum), $value);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowed barcode length
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLength()
|
||||
{
|
||||
return $this->_length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowed characters
|
||||
*
|
||||
* @return integer|string
|
||||
*/
|
||||
public function getCharacters()
|
||||
{
|
||||
return $this->_characters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the checksum function name
|
||||
*
|
||||
*/
|
||||
public function getChecksum()
|
||||
{
|
||||
return $this->_checksum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if barcode uses checksum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCheck()
|
||||
{
|
||||
return $this->_hasChecksum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the checksum validation
|
||||
*
|
||||
* @param boolean $check
|
||||
* @return Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
public function setCheck($check)
|
||||
{
|
||||
$this->_hasChecksum = (boolean) $check;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum (Modulo 10)
|
||||
* GTIN implementation factor 3
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _gtin($value)
|
||||
{
|
||||
$barcode = substr($value, 0, -1);
|
||||
$sum = 0;
|
||||
$length = strlen($barcode) - 1;
|
||||
|
||||
for ($i = 0; $i <= $length; $i++) {
|
||||
if (($i % 2) === 0) {
|
||||
$sum += $barcode[$length - $i] * 3;
|
||||
} else {
|
||||
$sum += $barcode[$length - $i];
|
||||
}
|
||||
}
|
||||
|
||||
$calc = $sum % 10;
|
||||
$checksum = ($calc === 0) ? 0 : (10 - $calc);
|
||||
if ($value[$length + 1] != $checksum) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum (Modulo 10)
|
||||
* IDENTCODE implementation factors 9 and 4
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _identcode($value)
|
||||
{
|
||||
$barcode = substr($value, 0, -1);
|
||||
$sum = 0;
|
||||
$length = strlen($value) - 2;
|
||||
|
||||
for ($i = 0; $i <= $length; $i++) {
|
||||
if (($i % 2) === 0) {
|
||||
$sum += $barcode[$length - $i] * 4;
|
||||
} else {
|
||||
$sum += $barcode[$length - $i] * 9;
|
||||
}
|
||||
}
|
||||
|
||||
$calc = $sum % 10;
|
||||
$checksum = ($calc === 0) ? 0 : (10 - $calc);
|
||||
if ($value[$length + 1] != $checksum) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum (Modulo 10)
|
||||
* CODE25 implementation factor 3
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _code25($value)
|
||||
{
|
||||
$barcode = substr($value, 0, -1);
|
||||
$sum = 0;
|
||||
$length = strlen($barcode) - 1;
|
||||
|
||||
for ($i = 0; $i <= $length; $i++) {
|
||||
if (($i % 2) === 0) {
|
||||
$sum += $barcode[$i] * 3;
|
||||
} else {
|
||||
$sum += $barcode[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$calc = $sum % 10;
|
||||
$checksum = ($calc === 0) ? 0 : (10 - $calc);
|
||||
if ($value[$length + 1] != $checksum) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum ()
|
||||
* POSTNET implementation
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _postnet($value)
|
||||
{
|
||||
$checksum = substr($value, -1, 1);
|
||||
$values = str_split(substr($value, 0, -1));
|
||||
|
||||
$check = 0;
|
||||
foreach($values as $row) {
|
||||
$check += $row;
|
||||
}
|
||||
|
||||
$check %= 10;
|
||||
$check = 10 - $check;
|
||||
if ($check == $checksum) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Validate_Barcode_AdapterInterface
|
||||
{
|
||||
/**
|
||||
* Checks the length of a barcode
|
||||
*
|
||||
* @param string $value The barcode to check for proper length
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkLength($value);
|
||||
|
||||
/**
|
||||
* Checks for allowed characters within the barcode
|
||||
*
|
||||
* @param string $value The barcode to check for allowed characters
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkChars($value);
|
||||
|
||||
/**
|
||||
* Validates the checksum
|
||||
*
|
||||
* @param string $value The barcode to check the checksum for
|
||||
* @return boolean
|
||||
*/
|
||||
public function checksum($value);
|
||||
|
||||
/**
|
||||
* Returns if barcode uses a checksum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCheck();
|
||||
|
||||
/**
|
||||
* Sets the checksum validation
|
||||
*
|
||||
* @param boolean $check
|
||||
* @return Zend_Validate_Barcode_Adapter Provides fluid interface
|
||||
*/
|
||||
public function setCheck($check);
|
||||
}
|
64
airtime_mvc/library/Zend/Validate/Barcode/Code25.php
Normal file
64
airtime_mvc/library/Zend/Validate/Barcode/Code25.php
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code25 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_code25';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code25interleaved extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 'even';
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_code25';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
100
airtime_mvc/library/Zend/Validate/Barcode/Code39.php
Normal file
100
airtime_mvc/library/Zend/Validate/Barcode/Code39.php
Normal file
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code39 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_code39';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_check = array(
|
||||
'0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,
|
||||
'7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,
|
||||
'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,
|
||||
'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,
|
||||
'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,
|
||||
'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,
|
||||
'%' => 42,
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum (Modulo 43)
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _code39($value)
|
||||
{
|
||||
$checksum = substr($value, -1, 1);
|
||||
$value = str_split(substr($value, 0, -1));
|
||||
$count = 0;
|
||||
foreach($value as $char) {
|
||||
$count += $this->_check[$char];
|
||||
}
|
||||
|
||||
$mod = $count % 43;
|
||||
if ($mod == $this->_check[$checksum]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
58
airtime_mvc/library/Zend/Validate/Barcode/Code39ext.php
Normal file
58
airtime_mvc/library/Zend/Validate/Barcode/Code39ext.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code39ext extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = 128;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
120
airtime_mvc/library/Zend/Validate/Barcode/Code93.php
Normal file
120
airtime_mvc/library/Zend/Validate/Barcode/Code93.php
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code93 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_code93';
|
||||
|
||||
/**
|
||||
* Note that the characters !"§& are only synonyms
|
||||
* @var array
|
||||
*/
|
||||
protected $_check = array(
|
||||
'0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,
|
||||
'7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,
|
||||
'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,
|
||||
'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,
|
||||
'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,
|
||||
'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,
|
||||
'%' => 42, '!' => 43, '"' => 44, '§' => 45, '&' => 46,
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum (Modulo CK)
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _code93($value)
|
||||
{
|
||||
$checksum = substr($value, -2, 2);
|
||||
$value = str_split(substr($value, 0, -2));
|
||||
$count = 0;
|
||||
$length = count($value) % 20;
|
||||
foreach($value as $char) {
|
||||
if ($length == 0) {
|
||||
$length = 20;
|
||||
}
|
||||
|
||||
$count += $this->_check[$char] * $length;
|
||||
--$length;
|
||||
}
|
||||
|
||||
$check = array_search(($count % 47), $this->_check);
|
||||
$value[] = $check;
|
||||
$count = 0;
|
||||
$length = count($value) % 15;
|
||||
foreach($value as $char) {
|
||||
if ($length == 0) {
|
||||
$length = 15;
|
||||
}
|
||||
|
||||
$count += $this->_check[$char] * $length;
|
||||
--$length;
|
||||
}
|
||||
$check .= array_search(($count % 47), $this->_check);
|
||||
|
||||
if ($check == $checksum) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
58
airtime_mvc/library/Zend/Validate/Barcode/Code93ext.php
Normal file
58
airtime_mvc/library/Zend/Validate/Barcode/Code93ext.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Code93ext extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = 128;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Ean12.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Ean12.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean12 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 12;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Ean13.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Ean13.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean13 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 13;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Ean14.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Ean14.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean14 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 14;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Ean18.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Ean18.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean18 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 18;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
58
airtime_mvc/library/Zend/Validate/Barcode/Ean2.php
Normal file
58
airtime_mvc/library/Zend/Validate/Barcode/Ean2.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean2 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 2;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
58
airtime_mvc/library/Zend/Validate/Barcode/Ean5.php
Normal file
58
airtime_mvc/library/Zend/Validate/Barcode/Ean5.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean5 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 5;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
69
airtime_mvc/library/Zend/Validate/Barcode/Ean8.php
Normal file
69
airtime_mvc/library/Zend/Validate/Barcode/Ean8.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Ean8 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(7, 8);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
|
||||
/**
|
||||
* Overrides parent checkLength
|
||||
*
|
||||
* @param string $value Value
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkLength($value)
|
||||
{
|
||||
if (strlen($value) == 7) {
|
||||
$this->setCheck(false);
|
||||
} else {
|
||||
$this->setCheck(true);
|
||||
}
|
||||
|
||||
return parent::checkLength($value);
|
||||
}
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin12.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin12.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Gtin12 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 12;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin13.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin13.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Gtin13 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 13;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin14.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Gtin14.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Gtin14 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 14;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Identcode.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Identcode.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Identcode extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 12;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_identcode';
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_IntelligentMail extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(20, 25, 29, 31);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets check flag to false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->setCheck(false);
|
||||
}
|
||||
}
|
119
airtime_mvc/library/Zend/Validate/Barcode/Issn.php
Normal file
119
airtime_mvc/library/Zend/Validate/Barcode/Issn.php
Normal file
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Issn extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(8, 13);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789X';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
|
||||
/**
|
||||
* Allows X on length of 8 chars
|
||||
*
|
||||
* @param string $value The barcode to check for allowed characters
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkChars($value)
|
||||
{
|
||||
if (strlen($value) != 8) {
|
||||
if (strpos($value, 'X') !== false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::checkChars($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum
|
||||
*
|
||||
* @param string $value The barcode to check the checksum for
|
||||
* @return boolean
|
||||
*/
|
||||
public function checksum($value)
|
||||
{
|
||||
if (strlen($value) == 8) {
|
||||
$this->_checksum = '_issn';
|
||||
} else {
|
||||
$this->_checksum = '_gtin';
|
||||
}
|
||||
|
||||
return parent::checksum($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the checksum ()
|
||||
* ISSN implementation (reversed mod11)
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _issn($value)
|
||||
{
|
||||
$checksum = substr($value, -1, 1);
|
||||
$values = str_split(substr($value, 0, -1));
|
||||
$check = 0;
|
||||
$multi = 8;
|
||||
foreach($values as $token) {
|
||||
if ($token == 'X') {
|
||||
$token = 10;
|
||||
}
|
||||
|
||||
$check += ($token * $multi);
|
||||
--$multi;
|
||||
}
|
||||
|
||||
$check %= 11;
|
||||
$check = 11 - $check;
|
||||
if ($check == $checksum) {
|
||||
return true;
|
||||
} else if (($check == 10) && ($checksum == 'X')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Itf14.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Itf14.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Itf14 extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 14;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Leitcode.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Leitcode.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Leitcode extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 14;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_identcode';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Planet.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Planet.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Planet extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(12, 14);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_postnet';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Postnet.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Postnet.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Postnet extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(6, 7, 10, 12);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_postnet';
|
||||
}
|
121
airtime_mvc/library/Zend/Validate/Barcode/Royalmail.php
Normal file
121
airtime_mvc/library/Zend/Validate/Barcode/Royalmail.php
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id:$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Royalmail extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = -1;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
protected $_rows = array(
|
||||
'0' => 1, '1' => 1, '2' => 1, '3' => 1, '4' => 1, '5' => 1,
|
||||
'6' => 2, '7' => 2, '8' => 2, '9' => 2, 'A' => 2, 'B' => 2,
|
||||
'C' => 3, 'D' => 3, 'E' => 3, 'F' => 3, 'G' => 3, 'H' => 3,
|
||||
'I' => 4, 'J' => 4, 'K' => 4, 'L' => 4, 'M' => 4, 'N' => 4,
|
||||
'O' => 5, 'P' => 5, 'Q' => 5, 'R' => 5, 'S' => 5, 'T' => 5,
|
||||
'U' => 0, 'V' => 0, 'W' => 0, 'X' => 0, 'Y' => 0, 'Z' => 0,
|
||||
);
|
||||
|
||||
protected $_columns = array(
|
||||
'0' => 1, '1' => 2, '2' => 3, '3' => 4, '4' => 5, '5' => 0,
|
||||
'6' => 1, '7' => 2, '8' => 3, '9' => 4, 'A' => 5, 'B' => 0,
|
||||
'C' => 1, 'D' => 2, 'E' => 3, 'F' => 4, 'G' => 5, 'H' => 0,
|
||||
'I' => 1, 'J' => 2, 'K' => 3, 'L' => 4, 'M' => 5, 'N' => 0,
|
||||
'O' => 1, 'P' => 2, 'Q' => 3, 'R' => 4, 'S' => 5, 'T' => 0,
|
||||
'U' => 1, 'V' => 2, 'W' => 3, 'X' => 4, 'Y' => 5, 'Z' => 0,
|
||||
);
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_royalmail';
|
||||
|
||||
/**
|
||||
* Validates the checksum ()
|
||||
*
|
||||
* @param string $value The barcode to validate
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _royalmail($value)
|
||||
{
|
||||
$checksum = substr($value, -1, 1);
|
||||
$values = str_split(substr($value, 0, -1));
|
||||
$rowvalue = 0;
|
||||
$colvalue = 0;
|
||||
foreach($values as $row) {
|
||||
$rowvalue += $this->_rows[$row];
|
||||
$colvalue += $this->_columns[$row];
|
||||
}
|
||||
|
||||
$rowvalue %= 6;
|
||||
$colvalue %= 6;
|
||||
|
||||
$rowchkvalue = array_keys($this->_rows, $rowvalue);
|
||||
$colchkvalue = array_keys($this->_columns, $colvalue);
|
||||
$chkvalue = current(array_intersect($rowchkvalue, $colchkvalue));
|
||||
if ($chkvalue == $checksum) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows start and stop tag within checked chars
|
||||
*
|
||||
* @param string $value The barcode to check for allowed characters
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkChars($value)
|
||||
{
|
||||
if ($value[0] == '(') {
|
||||
$value = substr($value, 1);
|
||||
|
||||
if ($value[strlen($value) - 1] == ')') {
|
||||
$value = substr($value, 0, -1);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::checkChars($value);
|
||||
}
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Sscc.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Sscc.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ean13.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Sscc extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 18;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
52
airtime_mvc/library/Zend/Validate/Barcode/Upca.php
Normal file
52
airtime_mvc/library/Zend/Validate/Barcode/Upca.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Upca.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Upca extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = 12;
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
}
|
69
airtime_mvc/library/Zend/Validate/Barcode/Upce.php
Normal file
69
airtime_mvc/library/Zend/Validate/Barcode/Upce.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: UpcA.php 18028 2009-09-08 20:52:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Barcode_AdapterAbstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Barcode/AdapterAbstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Barcode_Upce extends Zend_Validate_Barcode_AdapterAbstract
|
||||
{
|
||||
/**
|
||||
* Allowed barcode lengths
|
||||
* @var integer
|
||||
*/
|
||||
protected $_length = array(6, 7, 8);
|
||||
|
||||
/**
|
||||
* Allowed barcode characters
|
||||
* @var string
|
||||
*/
|
||||
protected $_characters = '0123456789';
|
||||
|
||||
/**
|
||||
* Checksum function
|
||||
* @var string
|
||||
*/
|
||||
protected $_checksum = '_gtin';
|
||||
|
||||
/**
|
||||
* Overrides parent checkLength
|
||||
*
|
||||
* @param string $value Value
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkLength($value)
|
||||
{
|
||||
if (strlen($value) != 8) {
|
||||
$this->setCheck(false);
|
||||
} else {
|
||||
$this->setCheck(true);
|
||||
}
|
||||
|
||||
return parent::checkLength($value);
|
||||
}
|
||||
}
|
224
airtime_mvc/library/Zend/Validate/Between.php
Normal file
224
airtime_mvc/library/Zend/Validate/Between.php
Normal file
|
@ -0,0 +1,224 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Between.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Between extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Validation failure message key for when the value is not between the min and max, inclusively
|
||||
*/
|
||||
const NOT_BETWEEN = 'notBetween';
|
||||
|
||||
/**
|
||||
* Validation failure message key for when the value is not strictly between the min and max
|
||||
*/
|
||||
const NOT_BETWEEN_STRICT = 'notBetweenStrict';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_BETWEEN => "'%value%' is not between '%min%' and '%max%', inclusively",
|
||||
self::NOT_BETWEEN_STRICT => "'%value%' is not strictly between '%min%' and '%max%'"
|
||||
);
|
||||
|
||||
/**
|
||||
* Additional variables available for validation failure messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'min' => '_min',
|
||||
'max' => '_max'
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum value
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_min;
|
||||
|
||||
/**
|
||||
* Maximum value
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_max;
|
||||
|
||||
/**
|
||||
* Whether to do inclusive comparisons, allowing equivalence to min and/or max
|
||||
*
|
||||
* If false, then strict comparisons are done, and the value may equal neither
|
||||
* the min nor max options
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_inclusive;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
* Accepts the following option keys:
|
||||
* 'min' => scalar, minimum border
|
||||
* 'max' => scalar, maximum border
|
||||
* 'inclusive' => boolean, inclusive border values
|
||||
*
|
||||
* @param array|Zend_Config $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['min'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['max'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['inclusive'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (!array_key_exists('min', $options) || !array_key_exists('max', $options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Missing option. 'min' and 'max' has to be given");
|
||||
}
|
||||
|
||||
if (!array_key_exists('inclusive', $options)) {
|
||||
$options['inclusive'] = true;
|
||||
}
|
||||
|
||||
$this->setMin($options['min'])
|
||||
->setMax($options['max'])
|
||||
->setInclusive($options['inclusive']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min option
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMin()
|
||||
{
|
||||
return $this->_min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min option
|
||||
*
|
||||
* @param mixed $min
|
||||
* @return Zend_Validate_Between Provides a fluent interface
|
||||
*/
|
||||
public function setMin($min)
|
||||
{
|
||||
$this->_min = $min;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the max option
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMax()
|
||||
{
|
||||
return $this->_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max option
|
||||
*
|
||||
* @param mixed $max
|
||||
* @return Zend_Validate_Between Provides a fluent interface
|
||||
*/
|
||||
public function setMax($max)
|
||||
{
|
||||
$this->_max = $max;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the inclusive option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getInclusive()
|
||||
{
|
||||
return $this->_inclusive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the inclusive option
|
||||
*
|
||||
* @param boolean $inclusive
|
||||
* @return Zend_Validate_Between Provides a fluent interface
|
||||
*/
|
||||
public function setInclusive($inclusive)
|
||||
{
|
||||
$this->_inclusive = $inclusive;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is between min and max options, inclusively
|
||||
* if inclusive option is true.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
if ($this->_inclusive) {
|
||||
if ($this->_min > $value || $value > $this->_max) {
|
||||
$this->_error(self::NOT_BETWEEN);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if ($this->_min >= $value || $value >= $this->_max) {
|
||||
$this->_error(self::NOT_BETWEEN_STRICT);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
174
airtime_mvc/library/Zend/Validate/Callback.php
Normal file
174
airtime_mvc/library/Zend/Validate/Callback.php
Normal file
|
@ -0,0 +1,174 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Callback.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Callback extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Invalid callback
|
||||
*/
|
||||
const INVALID_CALLBACK = 'callbackInvalid';
|
||||
|
||||
/**
|
||||
* Invalid value
|
||||
*/
|
||||
const INVALID_VALUE = 'callbackValue';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID_VALUE => "'%value%' is not valid",
|
||||
self::INVALID_CALLBACK => "Failure within the callback, exception returned",
|
||||
);
|
||||
|
||||
/**
|
||||
* Callback in a call_user_func format
|
||||
*
|
||||
* @var string|array
|
||||
*/
|
||||
protected $_callback = null;
|
||||
|
||||
/**
|
||||
* Default options to set for the filter
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_options = array();
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array $callback
|
||||
* @param mixed $max
|
||||
* @param boolean $inclusive
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($callback = null)
|
||||
{
|
||||
if (is_callable($callback)) {
|
||||
$this->setCallback($callback);
|
||||
} elseif (is_array($callback)) {
|
||||
if (isset($callback['callback'])) {
|
||||
$this->setCallback($callback['callback']);
|
||||
}
|
||||
if (isset($callback['options'])) {
|
||||
$this->setOptions($callback['options']);
|
||||
}
|
||||
}
|
||||
|
||||
if (null === ($initializedCallack = $this->getCallback())) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('No callback registered');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set callback
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCallback()
|
||||
{
|
||||
return $this->_callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callback
|
||||
*
|
||||
* @param string|array $callback
|
||||
* @return Zend_Validate_Callback Provides a fluent interface
|
||||
*/
|
||||
public function setCallback($callback)
|
||||
{
|
||||
if (!is_callable($callback)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid callback given');
|
||||
}
|
||||
$this->_callback = $callback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set options for the callback
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets options for the callback
|
||||
*
|
||||
* @param mixed $max
|
||||
* @return Zend_Validate_Callback Provides a fluent interface
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
$this->_options = (array) $options;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the set callback returns
|
||||
* for the provided $value
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
$options = $this->getOptions();
|
||||
$callback = $this->getCallback();
|
||||
$args = func_get_args();
|
||||
$options = array_merge($args, $options);
|
||||
|
||||
try {
|
||||
if (!call_user_func_array($callback, $options)) {
|
||||
$this->_error(self::INVALID_VALUE);
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->_error(self::INVALID_CALLBACK);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
112
airtime_mvc/library/Zend/Validate/Ccnum.php
Normal file
112
airtime_mvc/library/Zend/Validate/Ccnum.php
Normal file
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ccnum.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Ccnum extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Validation failure message key for when the value is not of valid length
|
||||
*/
|
||||
const LENGTH = 'ccnumLength';
|
||||
|
||||
/**
|
||||
* Validation failure message key for when the value fails the mod-10 checksum
|
||||
*/
|
||||
const CHECKSUM = 'ccnumChecksum';
|
||||
|
||||
/**
|
||||
* Digits filter for input
|
||||
*
|
||||
* @var Zend_Filter_Digits
|
||||
*/
|
||||
protected static $_filter = null;
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::LENGTH => "'%value%' must contain between 13 and 19 digits",
|
||||
self::CHECKSUM => "Luhn algorithm (mod-10 checksum) failed on '%value%'"
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
trigger_error('Using the Ccnum validator is deprecated in favor of the CreditCard validator');
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
if (null === self::$_filter) {
|
||||
/**
|
||||
* @see Zend_Filter_Digits
|
||||
*/
|
||||
require_once 'Zend/Filter/Digits.php';
|
||||
self::$_filter = new Zend_Filter_Digits();
|
||||
}
|
||||
|
||||
$valueFiltered = self::$_filter->filter($value);
|
||||
|
||||
$length = strlen($valueFiltered);
|
||||
|
||||
if ($length < 13 || $length > 19) {
|
||||
$this->_error(self::LENGTH);
|
||||
return false;
|
||||
}
|
||||
|
||||
$sum = 0;
|
||||
$weight = 2;
|
||||
|
||||
for ($i = $length - 2; $i >= 0; $i--) {
|
||||
$digit = $weight * $valueFiltered[$i];
|
||||
$sum += floor($digit / 10) + $digit % 10;
|
||||
$weight = $weight % 2 + 1;
|
||||
}
|
||||
|
||||
if ((10 - $sum % 10) % 10 != $valueFiltered[$length - 1]) {
|
||||
$this->_error(self::CHECKSUM, $valueFiltered);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
317
airtime_mvc/library/Zend/Validate/CreditCard.php
Normal file
317
airtime_mvc/library/Zend/Validate/CreditCard.php
Normal file
|
@ -0,0 +1,317 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: CreditCard.php 21570 2010-03-19 19:00:50Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_CreditCard extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Detected CCI list
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const ALL = 'All';
|
||||
const AMERICAN_EXPRESS = 'American_Express';
|
||||
const UNIONPAY = 'Unionpay';
|
||||
const DINERS_CLUB = 'Diners_Club';
|
||||
const DINERS_CLUB_US = 'Diners_Club_US';
|
||||
const DISCOVER = 'Discover';
|
||||
const JCB = 'JCB';
|
||||
const LASER = 'Laser';
|
||||
const MAESTRO = 'Maestro';
|
||||
const MASTERCARD = 'Mastercard';
|
||||
const SOLO = 'Solo';
|
||||
const VISA = 'Visa';
|
||||
|
||||
const CHECKSUM = 'creditcardChecksum';
|
||||
const CONTENT = 'creditcardContent';
|
||||
const INVALID = 'creditcardInvalid';
|
||||
const LENGTH = 'creditcardLength';
|
||||
const PREFIX = 'creditcardPrefix';
|
||||
const SERVICE = 'creditcardService';
|
||||
const SERVICEFAILURE = 'creditcardServiceFailure';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::CHECKSUM => "Luhn algorithm (mod-10 checksum) failed on '%value%'",
|
||||
self::CONTENT => "'%value%' must contain only digits",
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::LENGTH => "'%value%' contains an invalid amount of digits",
|
||||
self::PREFIX => "'%value%' is not from an allowed institute",
|
||||
self::SERVICE => "Validation of '%value%' has been failed by the service",
|
||||
self::SERVICEFAILURE => "The service returned a failure while validating '%value%'",
|
||||
);
|
||||
|
||||
/**
|
||||
* List of allowed CCV lengths
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_cardLength = array(
|
||||
self::AMERICAN_EXPRESS => array(15),
|
||||
self::DINERS_CLUB => array(14),
|
||||
self::DINERS_CLUB_US => array(16),
|
||||
self::DISCOVER => array(16),
|
||||
self::JCB => array(16),
|
||||
self::LASER => array(16, 17, 18, 19),
|
||||
self::MAESTRO => array(12, 13, 14, 15, 16, 17, 18, 19),
|
||||
self::MASTERCARD => array(16),
|
||||
self::SOLO => array(16, 18, 19),
|
||||
self::UNIONPAY => array(16, 17, 18, 19),
|
||||
self::VISA => array(16),
|
||||
);
|
||||
|
||||
/**
|
||||
* List of accepted CCV provider tags
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_cardType = array(
|
||||
self::AMERICAN_EXPRESS => array('34', '37'),
|
||||
self::DINERS_CLUB => array('300', '301', '302', '303', '304', '305', '36'),
|
||||
self::DINERS_CLUB_US => array('54', '55'),
|
||||
self::DISCOVER => array('6011', '622126', '622127', '622128', '622129', '62213',
|
||||
'62214', '62215', '62216', '62217', '62218', '62219',
|
||||
'6222', '6223', '6224', '6225', '6226', '6227', '6228',
|
||||
'62290', '62291', '622920', '622921', '622922', '622923',
|
||||
'622924', '622925', '644', '645', '646', '647', '648',
|
||||
'649', '65'),
|
||||
self::JCB => array('3528', '3529', '353', '354', '355', '356', '357', '358'),
|
||||
self::LASER => array('6304', '6706', '6771', '6709'),
|
||||
self::MAESTRO => array('5018', '5020', '5038', '6304', '6759', '6761', '6763'),
|
||||
self::MASTERCARD => array('51', '52', '53', '54', '55'),
|
||||
self::SOLO => array('6334', '6767'),
|
||||
self::UNIONPAY => array('622126', '622127', '622128', '622129', '62213', '62214',
|
||||
'62215', '62216', '62217', '62218', '62219', '6222', '6223',
|
||||
'6224', '6225', '6226', '6227', '6228', '62290', '62291',
|
||||
'622920', '622921', '622922', '622923', '622924', '622925'),
|
||||
self::VISA => array('4'),
|
||||
);
|
||||
|
||||
/**
|
||||
* CCIs which are accepted by validation
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_type = array();
|
||||
|
||||
/**
|
||||
* Service callback for additional validation
|
||||
*
|
||||
* @var callback
|
||||
*/
|
||||
protected $_service;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string|array $type OPTIONAL Type of CCI to allow
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['type'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['service'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (!array_key_exists('type', $options)) {
|
||||
$options['type'] = self::ALL;
|
||||
}
|
||||
|
||||
$this->setType($options['type']);
|
||||
if (array_key_exists('service', $options)) {
|
||||
$this->setService($options['service']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of accepted CCIs
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets CCIs which are accepted by validation
|
||||
*
|
||||
* @param string|array $type Type to allow for validation
|
||||
* @return Zend_Validate_CreditCard Provides a fluid interface
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->_type = array();
|
||||
return $this->addType($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a CCI to be accepted by validation
|
||||
*
|
||||
* @param string|array $type Type to allow for validation
|
||||
* @return Zend_Validate_CreditCard Provides a fluid interface
|
||||
*/
|
||||
public function addType($type)
|
||||
{
|
||||
if (is_string($type)) {
|
||||
$type = array($type);
|
||||
}
|
||||
|
||||
foreach($type as $typ) {
|
||||
if (defined('self::' . strtoupper($typ)) && !in_array($typ, $this->_type)) {
|
||||
$this->_type[] = $typ;
|
||||
}
|
||||
|
||||
if (($typ == self::ALL)) {
|
||||
$this->_type = array_keys($this->_cardLength);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the actual set service
|
||||
*
|
||||
* @return callback
|
||||
*/
|
||||
public function getService()
|
||||
{
|
||||
return $this->_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new callback for service validation
|
||||
*
|
||||
* @param unknown_type $service
|
||||
*/
|
||||
public function setService($service)
|
||||
{
|
||||
if (!is_callable($service)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid callback given');
|
||||
}
|
||||
|
||||
$this->_service = $service;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID, $value);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ctype_digit($value)) {
|
||||
$this->_error(self::CONTENT, $value);
|
||||
return false;
|
||||
}
|
||||
|
||||
$length = strlen($value);
|
||||
$types = $this->getType();
|
||||
$foundp = false;
|
||||
$foundl = false;
|
||||
foreach ($types as $type) {
|
||||
foreach ($this->_cardType[$type] as $prefix) {
|
||||
if (substr($value, 0, strlen($prefix)) == $prefix) {
|
||||
$foundp = true;
|
||||
if (in_array($length, $this->_cardLength[$type])) {
|
||||
$foundl = true;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($foundp == false){
|
||||
$this->_error(self::PREFIX, $value);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($foundl == false) {
|
||||
$this->_error(self::LENGTH, $value);
|
||||
return false;
|
||||
}
|
||||
|
||||
$sum = 0;
|
||||
$weight = 2;
|
||||
|
||||
for ($i = $length - 2; $i >= 0; $i--) {
|
||||
$digit = $weight * $value[$i];
|
||||
$sum += floor($digit / 10) + $digit % 10;
|
||||
$weight = $weight % 2 + 1;
|
||||
}
|
||||
|
||||
if ((10 - $sum % 10) % 10 != $value[$length - 1]) {
|
||||
$this->_error(self::CHECKSUM, $value);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($this->_service)) {
|
||||
try {
|
||||
require_once 'Zend/Validate/Callback.php';
|
||||
$callback = new Zend_Validate_Callback($this->_service);
|
||||
$callback->setOptions($this->_type);
|
||||
if (!$callback->isValid($value)) {
|
||||
$this->_error(self::SERVICE, $value);
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Exception $e) {
|
||||
$this->_error(self::SERVICEFAILURE, $value);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
259
airtime_mvc/library/Zend/Validate/Date.php
Normal file
259
airtime_mvc/library/Zend/Validate/Date.php
Normal file
|
@ -0,0 +1,259 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Date.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Date extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'dateInvalid';
|
||||
const INVALID_DATE = 'dateInvalidDate';
|
||||
const FALSEFORMAT = 'dateFalseFormat';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be string, integer, array or Zend_Date",
|
||||
self::INVALID_DATE => "'%value%' does not appear to be a valid date",
|
||||
self::FALSEFORMAT => "'%value%' does not fit the date format '%format%'",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'format' => '_format'
|
||||
);
|
||||
|
||||
/**
|
||||
* Optional format
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_format;
|
||||
|
||||
/**
|
||||
* Optional locale
|
||||
*
|
||||
* @var string|Zend_Locale|null
|
||||
*/
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|Zend_Config $options OPTIONAL
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['format'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['locale'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (array_key_exists('format', $options)) {
|
||||
$this->setFormat($options['format']);
|
||||
}
|
||||
|
||||
if (!array_key_exists('locale', $options)) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale')) {
|
||||
$options['locale'] = Zend_Registry::get('Zend_Locale');
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('locale', $options)) {
|
||||
$this->setLocale($options['locale']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the locale option
|
||||
*
|
||||
* @return string|Zend_Locale|null
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->_locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the locale option
|
||||
*
|
||||
* @param string|Zend_Locale $locale
|
||||
* @return Zend_Validate_Date provides a fluent interface
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
require_once 'Zend/Locale.php';
|
||||
$this->_locale = Zend_Locale::findLocale($locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the locale option
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the format option
|
||||
*
|
||||
* @param string $format
|
||||
* @return Zend_Validate_Date provides a fluent interface
|
||||
*/
|
||||
public function setFormat($format = null)
|
||||
{
|
||||
$this->_format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if $value is a valid date of the format YYYY-MM-DD
|
||||
* If optional $format or $locale is set the date format is checked
|
||||
* according to Zend_Date, see Zend_Date::isDate()
|
||||
*
|
||||
* @param string|array|Zend_Date $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value) &&
|
||||
!is_array($value) && !($value instanceof Zend_Date)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
|
||||
if (($this->_format !== null) || ($this->_locale !== null) || is_array($value) ||
|
||||
$value instanceof Zend_Date) {
|
||||
require_once 'Zend/Date.php';
|
||||
if (!Zend_Date::isDate($value, $this->_format, $this->_locale)) {
|
||||
if ($this->_checkFormat($value) === false) {
|
||||
$this->_error(self::FALSEFORMAT);
|
||||
} else {
|
||||
$this->_error(self::INVALID_DATE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) {
|
||||
$this->_format = 'yyyy-MM-dd';
|
||||
$this->_error(self::FALSEFORMAT);
|
||||
$this->_format = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
list($year, $month, $day) = sscanf($value, '%d-%d-%d');
|
||||
|
||||
if (!checkdate($month, $day, $year)) {
|
||||
$this->_error(self::INVALID_DATE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given date fits the given format
|
||||
*
|
||||
* @param string $value Date to check
|
||||
* @return boolean False when date does not fit the format
|
||||
*/
|
||||
private function _checkFormat($value)
|
||||
{
|
||||
try {
|
||||
require_once 'Zend/Locale/Format.php';
|
||||
$parsed = Zend_Locale_Format::getDate($value, array(
|
||||
'date_format' => $this->_format, 'format_type' => 'iso',
|
||||
'fix_date' => false));
|
||||
if (isset($parsed['year']) and ((strpos(strtoupper($this->_format), 'YY') !== false) and
|
||||
(strpos(strtoupper($this->_format), 'YYYY') === false))) {
|
||||
$parsed['year'] = Zend_Date::getFullYear($parsed['year']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// Date can not be parsed
|
||||
return false;
|
||||
}
|
||||
|
||||
if (((strpos($this->_format, 'Y') !== false) or (strpos($this->_format, 'y') !== false)) and
|
||||
(!isset($parsed['year']))) {
|
||||
// Year expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strpos($this->_format, 'M') !== false) and (!isset($parsed['month']))) {
|
||||
// Month expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strpos($this->_format, 'd') !== false) and (!isset($parsed['day']))) {
|
||||
// Day expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
if (((strpos($this->_format, 'H') !== false) or (strpos($this->_format, 'h') !== false)) and
|
||||
(!isset($parsed['hour']))) {
|
||||
// Hour expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strpos($this->_format, 'm') !== false) and (!isset($parsed['minute']))) {
|
||||
// Minute expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strpos($this->_format, 's') !== false) and (!isset($parsed['second']))) {
|
||||
// Second expected but not found
|
||||
return false;
|
||||
}
|
||||
|
||||
// Date fits the format
|
||||
return true;
|
||||
}
|
||||
}
|
298
airtime_mvc/library/Zend/Validate/Db/Abstract.php
Normal file
298
airtime_mvc/library/Zend/Validate/Db/Abstract.php
Normal file
|
@ -0,0 +1,298 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 20412 2010-01-19 07:02:01Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Class for Database record validation
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @uses Zend_Validate_Abstract
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Error constants
|
||||
*/
|
||||
const ERROR_NO_RECORD_FOUND = 'noRecordFound';
|
||||
const ERROR_RECORD_FOUND = 'recordFound';
|
||||
|
||||
/**
|
||||
* @var array Message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::ERROR_NO_RECORD_FOUND => 'No record matching %value% was found',
|
||||
self::ERROR_RECORD_FOUND => 'A record matching %value% was found',
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_schema = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_table = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_field = '';
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_exclude = null;
|
||||
|
||||
/**
|
||||
* Database adapter to use. If null isValid() will use Zend_Db::getInstance instead
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $_adapter = null;
|
||||
|
||||
/**
|
||||
* Provides basic configuration for use with Zend_Validate_Db Validators
|
||||
* Setting $exclude allows a single record to be excluded from matching.
|
||||
* Exclude can either be a String containing a where clause, or an array with `field` and `value` keys
|
||||
* to define the where clause added to the sql.
|
||||
* A database adapter may optionally be supplied to avoid using the registered default adapter.
|
||||
*
|
||||
* The following option keys are supported:
|
||||
* 'table' => The database table to validate against
|
||||
* 'schema' => The schema keys
|
||||
* 'field' => The field to check for a match
|
||||
* 'exclude' => An optional where clause or field/value pair to exclude from the query
|
||||
* 'adapter' => An optional database adapter to use
|
||||
*
|
||||
* @param array|Zend_Config $options Options to use for this validator
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (func_num_args() > 1) {
|
||||
$options = func_get_args();
|
||||
$temp['table'] = array_shift($options);
|
||||
$temp['field'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['exclude'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['adapter'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (!array_key_exists('table', $options) && !array_key_exists('schema', $options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Table or Schema option missing!');
|
||||
}
|
||||
|
||||
if (!array_key_exists('field', $options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Field option missing!');
|
||||
}
|
||||
|
||||
if (array_key_exists('adapter', $options)) {
|
||||
$this->setAdapter($options['adapter']);
|
||||
}
|
||||
|
||||
if (array_key_exists('exclude', $options)) {
|
||||
$this->setExclude($options['exclude']);
|
||||
}
|
||||
|
||||
$this->setField($options['field']);
|
||||
if (array_key_exists('table', $options)) {
|
||||
$this->setTable($options['table']);
|
||||
}
|
||||
|
||||
if (array_key_exists('schema', $options)) {
|
||||
$this->setSchema($options['schema']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set adapter
|
||||
*
|
||||
* @return Zend_Db_Adapter
|
||||
*/
|
||||
public function getAdapter()
|
||||
{
|
||||
return $this->_adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new database adapter
|
||||
*
|
||||
* @param Zend_Db_Adapter_Abstract $adapter
|
||||
* @return Zend_Validate_Db_Abstract
|
||||
*/
|
||||
public function setAdapter($adapter)
|
||||
{
|
||||
if (!($adapter instanceof Zend_Db_Adapter_Abstract)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Adapter option must be a database adapter!');
|
||||
}
|
||||
|
||||
$this->_adapter = $adapter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set exclude clause
|
||||
*
|
||||
* @return string|array
|
||||
*/
|
||||
public function getExclude()
|
||||
{
|
||||
return $this->_exclude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new exclude clause
|
||||
*
|
||||
* @param string|array $exclude
|
||||
* @return Zend_Validate_Db_Abstract
|
||||
*/
|
||||
public function setExclude($exclude)
|
||||
{
|
||||
$this->_exclude = $exclude;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set field
|
||||
*
|
||||
* @return string|array
|
||||
*/
|
||||
public function getField()
|
||||
{
|
||||
return $this->_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new field
|
||||
*
|
||||
* @param string $field
|
||||
* @return Zend_Validate_Db_Abstract
|
||||
*/
|
||||
public function setField($field)
|
||||
{
|
||||
$this->_field = (string) $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTable()
|
||||
{
|
||||
return $this->_table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new table
|
||||
*
|
||||
* @param string $table
|
||||
* @return Zend_Validate_Db_Abstract
|
||||
*/
|
||||
public function setTable($table)
|
||||
{
|
||||
$this->_table = (string) $table;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set schema
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSchema()
|
||||
{
|
||||
return $this->_schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new schema
|
||||
*
|
||||
* @param string $schema
|
||||
* @return Zend_Validate_Db_Abstract
|
||||
*/
|
||||
public function setSchema($schema)
|
||||
{
|
||||
$this->_schema = $schema;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run query and returns matches, or null if no matches are found.
|
||||
*
|
||||
* @param String $value
|
||||
* @return Array when matches are found.
|
||||
*/
|
||||
protected function _query($value)
|
||||
{
|
||||
/**
|
||||
* Check for an adapter being defined. if not, fetch the default adapter.
|
||||
*/
|
||||
if ($this->_adapter === null) {
|
||||
$this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
if (null === $this->_adapter) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('No database adapter present');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build select object
|
||||
*/
|
||||
$select = new Zend_Db_Select($this->_adapter);
|
||||
$select->from($this->_table, array($this->_field), $this->_schema)
|
||||
->where($this->_adapter->quoteIdentifier($this->_field).' = ?', $value);
|
||||
if ($this->_exclude !== null) {
|
||||
if (is_array($this->_exclude)) {
|
||||
$select->where($this->_adapter->quoteIdentifier($this->_exclude['field']).' != ?', $this->_exclude['value']);
|
||||
} else {
|
||||
$select->where($this->_exclude);
|
||||
}
|
||||
}
|
||||
$select->limit(1);
|
||||
|
||||
/**
|
||||
* Run query
|
||||
*/
|
||||
$result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
51
airtime_mvc/library/Zend/Validate/Db/NoRecordExists.php
Normal file
51
airtime_mvc/library/Zend/Validate/Db/NoRecordExists.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: NoRecordExists.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Db_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Db/Abstract.php';
|
||||
|
||||
/**
|
||||
* Confirms a record does not exist in a table.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @uses Zend_Validate_Db_Abstract
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Db_NoRecordExists extends Zend_Validate_Db_Abstract
|
||||
{
|
||||
public function isValid($value)
|
||||
{
|
||||
$valid = true;
|
||||
$this->_setValue($value);
|
||||
|
||||
$result = $this->_query($value);
|
||||
if ($result) {
|
||||
$valid = false;
|
||||
$this->_error(self::ERROR_RECORD_FOUND);
|
||||
}
|
||||
|
||||
return $valid;
|
||||
}
|
||||
}
|
51
airtime_mvc/library/Zend/Validate/Db/RecordExists.php
Normal file
51
airtime_mvc/library/Zend/Validate/Db/RecordExists.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: RecordExists.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Db_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Db/Abstract.php';
|
||||
|
||||
/**
|
||||
* Confirms a record exists in a table.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @uses Zend_Validate_Db_Abstract
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Db_RecordExists extends Zend_Validate_Db_Abstract
|
||||
{
|
||||
public function isValid($value)
|
||||
{
|
||||
$valid = true;
|
||||
$this->_setValue($value);
|
||||
|
||||
$result = $this->_query($value);
|
||||
if (!$result) {
|
||||
$valid = false;
|
||||
$this->_error(self::ERROR_NO_RECORD_FOUND);
|
||||
}
|
||||
|
||||
return $valid;
|
||||
}
|
||||
}
|
91
airtime_mvc/library/Zend/Validate/Digits.php
Normal file
91
airtime_mvc/library/Zend/Validate/Digits.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Digits.php 21136 2010-02-22 22:30:50Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Digits extends Zend_Validate_Abstract
|
||||
{
|
||||
const NOT_DIGITS = 'notDigits';
|
||||
const STRING_EMPTY = 'digitsStringEmpty';
|
||||
const INVALID = 'digitsInvalid';
|
||||
|
||||
/**
|
||||
* Digits filter used for validation
|
||||
*
|
||||
* @var Zend_Filter_Digits
|
||||
*/
|
||||
protected static $_filter = null;
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_DIGITS => "'%value%' contains characters which are not digits; but only digits are allowed",
|
||||
self::STRING_EMPTY => "'%value%' is an empty string",
|
||||
self::INVALID => "Invalid type given, value should be string, integer or float",
|
||||
);
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value only contains digit characters
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue((string) $value);
|
||||
|
||||
if ('' === $this->_value) {
|
||||
$this->_error(self::STRING_EMPTY);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null === self::$_filter) {
|
||||
require_once 'Zend/Filter/Digits.php';
|
||||
self::$_filter = new Zend_Filter_Digits();
|
||||
}
|
||||
|
||||
if ($this->_value !== self::$_filter->filter($this->_value)) {
|
||||
$this->_error(self::NOT_DIGITS);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
560
airtime_mvc/library/Zend/Validate/EmailAddress.php
Normal file
560
airtime_mvc/library/Zend/Validate/EmailAddress.php
Normal file
|
@ -0,0 +1,560 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: EmailAddress.php 21461 2010-03-10 22:34:03Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Hostname
|
||||
*/
|
||||
require_once 'Zend/Validate/Hostname.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_EmailAddress extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'emailAddressInvalid';
|
||||
const INVALID_FORMAT = 'emailAddressInvalidFormat';
|
||||
const INVALID_HOSTNAME = 'emailAddressInvalidHostname';
|
||||
const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord';
|
||||
const INVALID_SEGMENT = 'emailAddressInvalidSegment';
|
||||
const DOT_ATOM = 'emailAddressDotAtom';
|
||||
const QUOTED_STRING = 'emailAddressQuotedString';
|
||||
const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart';
|
||||
const LENGTH_EXCEEDED = 'emailAddressLengthExceeded';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::INVALID_FORMAT => "'%value%' is no valid email address in the basic format local-part@hostname",
|
||||
self::INVALID_HOSTNAME => "'%hostname%' is no valid hostname for email address '%value%'",
|
||||
self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'",
|
||||
self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network.",
|
||||
self::DOT_ATOM => "'%localPart%' can not be matched against dot-atom format",
|
||||
self::QUOTED_STRING => "'%localPart%' can not be matched against quoted-string format",
|
||||
self::INVALID_LOCAL_PART => "'%localPart%' is no valid local part for email address '%value%'",
|
||||
self::LENGTH_EXCEEDED => "'%value%' exceeds the allowed length",
|
||||
);
|
||||
|
||||
/**
|
||||
* @see http://en.wikipedia.org/wiki/IPv4
|
||||
* @var array
|
||||
*/
|
||||
protected $_invalidIp = array(
|
||||
'0' => '0.0.0.0/8',
|
||||
'10' => '10.0.0.0/8',
|
||||
'127' => '127.0.0.0/8',
|
||||
'128' => '128.0.0.0/16',
|
||||
'169' => '169.254.0.0/16',
|
||||
'172' => '172.16.0.0/12',
|
||||
'191' => '191.255.0.0/16',
|
||||
'192' => array(
|
||||
'192.0.0.0/24',
|
||||
'192.0.2.0/24',
|
||||
'192.88.99.0/24',
|
||||
'192.168.0.0/16'
|
||||
),
|
||||
'198' => '198.18.0.0/15',
|
||||
'223' => '223.255.255.0/24',
|
||||
'224' => '224.0.0.0/4',
|
||||
'240' => '240.0.0.0/4'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'hostname' => '_hostname',
|
||||
'localPart' => '_localPart'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_hostname;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_localPart;
|
||||
|
||||
/**
|
||||
* Internal options array
|
||||
*/
|
||||
protected $_options = array(
|
||||
'mx' => false,
|
||||
'deep' => false,
|
||||
'domain' => true,
|
||||
'allow' => Zend_Validate_Hostname::ALLOW_DNS,
|
||||
'hostname' => null
|
||||
);
|
||||
|
||||
/**
|
||||
* Instantiates hostname validator for local use
|
||||
*
|
||||
* The following option keys are supported:
|
||||
* 'hostname' => A hostname validator, see Zend_Validate_Hostname
|
||||
* 'allow' => Options for the hostname validator, see Zend_Validate_Hostname::ALLOW_*
|
||||
* 'mx' => If MX check should be enabled, boolean
|
||||
* 'deep' => If a deep MX check should be done, boolean
|
||||
*
|
||||
* @param array|Zend_Config $options OPTIONAL
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['allow'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['mx'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['hostname'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
$options += $this->_options;
|
||||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set Options
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set options for the email validator
|
||||
*
|
||||
* @param array $options
|
||||
* @return Zend_Validate_EmailAddress fluid interface
|
||||
*/
|
||||
public function setOptions(array $options = array())
|
||||
{
|
||||
if (array_key_exists('messages', $options)) {
|
||||
$this->setMessages($options['messages']);
|
||||
}
|
||||
|
||||
if (array_key_exists('hostname', $options)) {
|
||||
if (array_key_exists('allow', $options)) {
|
||||
$this->setHostnameValidator($options['hostname'], $options['allow']);
|
||||
} else {
|
||||
$this->setHostnameValidator($options['hostname']);
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('mx', $options)) {
|
||||
$this->setValidateMx($options['mx']);
|
||||
}
|
||||
|
||||
if (array_key_exists('deep', $options)) {
|
||||
$this->setDeepMxCheck($options['deep']);
|
||||
}
|
||||
|
||||
if (array_key_exists('domain', $options)) {
|
||||
$this->setDomainCheck($options['domain']);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the validation failure message template for a particular key
|
||||
* Adds the ability to set messages to the attached hostname validator
|
||||
*
|
||||
* @param string $messageString
|
||||
* @param string $messageKey OPTIONAL
|
||||
* @return Zend_Validate_Abstract Provides a fluent interface
|
||||
* @throws Zend_Validate_Exception
|
||||
*/
|
||||
public function setMessage($messageString, $messageKey = null)
|
||||
{
|
||||
$messageKeys = $messageKey;
|
||||
if ($messageKey === null) {
|
||||
$keys = array_keys($this->_messageTemplates);
|
||||
$messageKeys = current($keys);
|
||||
}
|
||||
|
||||
if (!isset($this->_messageTemplates[$messageKeys])) {
|
||||
$this->_options['hostname']->setMessage($messageString, $messageKey);
|
||||
}
|
||||
|
||||
$this->_messageTemplates[$messageKeys] = $messageString;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set hostname validator
|
||||
*
|
||||
* @return Zend_Validate_Hostname
|
||||
*/
|
||||
public function getHostnameValidator()
|
||||
{
|
||||
return $this->_options['hostname'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Validate_Hostname $hostnameValidator OPTIONAL
|
||||
* @param int $allow OPTIONAL
|
||||
* @return void
|
||||
*/
|
||||
public function setHostnameValidator(Zend_Validate_Hostname $hostnameValidator = null, $allow = Zend_Validate_Hostname::ALLOW_DNS)
|
||||
{
|
||||
if (!$hostnameValidator) {
|
||||
$hostnameValidator = new Zend_Validate_Hostname($allow);
|
||||
}
|
||||
|
||||
$this->_options['hostname'] = $hostnameValidator;
|
||||
$this->_options['allow'] = $allow;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether MX checking via getmxrr is supported or not
|
||||
*
|
||||
* This currently only works on UNIX systems
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function validateMxSupported()
|
||||
{
|
||||
return function_exists('getmxrr');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set validateMx option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getValidateMx()
|
||||
{
|
||||
return $this->_options['mx'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether we check for a valid MX record via DNS
|
||||
*
|
||||
* This only applies when DNS hostnames are validated
|
||||
*
|
||||
* @param boolean $mx Set allowed to true to validate for MX records, and false to not validate them
|
||||
* @return Zend_Validate_EmailAddress Fluid Interface
|
||||
*/
|
||||
public function setValidateMx($mx)
|
||||
{
|
||||
if ((bool) $mx && !$this->validateMxSupported()) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('MX checking not available on this system');
|
||||
}
|
||||
|
||||
$this->_options['mx'] = (bool) $mx;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set deepMxCheck option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getDeepMxCheck()
|
||||
{
|
||||
return $this->_options['deep'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether we check MX record should be a deep validation
|
||||
*
|
||||
* @param boolean $deep Set deep to true to perform a deep validation process for MX records
|
||||
* @return Zend_Validate_EmailAddress Fluid Interface
|
||||
*/
|
||||
public function setDeepMxCheck($deep)
|
||||
{
|
||||
$this->_options['deep'] = (bool) $deep;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set domainCheck option
|
||||
*
|
||||
* @return unknown
|
||||
*/
|
||||
public function getDomainCheck()
|
||||
{
|
||||
return $this->_options['domain'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the domain should also be checked
|
||||
* or only the local part of the email address
|
||||
*
|
||||
* @param boolean $domain
|
||||
* @return Zend_Validate_EmailAddress Fluid Interface
|
||||
*/
|
||||
public function setDomainCheck($domain = true)
|
||||
{
|
||||
$this->_options['domain'] = (boolean) $domain;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the given host is reserved
|
||||
*
|
||||
* @param string $host
|
||||
* @return boolean
|
||||
*/
|
||||
private function _isReserved($host){
|
||||
if (!preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $host)) {
|
||||
$host = gethostbyname($host);
|
||||
}
|
||||
|
||||
$octet = explode('.',$host);
|
||||
if ((int)$octet[0] >= 224) {
|
||||
return true;
|
||||
} else if (array_key_exists($octet[0], $this->_invalidIp)) {
|
||||
foreach ((array)$this->_invalidIp[$octet[0]] as $subnetData) {
|
||||
// we skip the first loop as we already know that octet matches
|
||||
for ($i = 1; $i < 4; $i++) {
|
||||
if (strpos($subnetData, $octet[$i]) !== $i * 4) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$host = explode("/", $subnetData);
|
||||
$binaryHost = "";
|
||||
$tmp = explode(".", $host[0]);
|
||||
for ($i = 0; $i < 4 ; $i++) {
|
||||
$binaryHost .= str_pad(decbin($tmp[$i]), 8, "0", STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$segmentData = array(
|
||||
'network' => (int)$this->_toIp(str_pad(substr($binaryHost, 0, $host[1]), 32, 0)),
|
||||
'broadcast' => (int)$this->_toIp(str_pad(substr($binaryHost, 0, $host[1]), 32, 1))
|
||||
);
|
||||
|
||||
for ($j = $i; $j < 4; $j++) {
|
||||
if ((int)$octet[$j] < $segmentData['network'][$j] ||
|
||||
(int)$octet[$j] > $segmentData['broadcast'][$j]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a binary string to an IP address
|
||||
*
|
||||
* @param string $binary
|
||||
* @return mixed
|
||||
*/
|
||||
private function _toIp($binary)
|
||||
{
|
||||
$ip = array();
|
||||
$tmp = explode(".", chunk_split($binary, 8, "."));
|
||||
for ($i = 0; $i < 4 ; $i++) {
|
||||
$ip[$i] = bindec($tmp[$i]);
|
||||
}
|
||||
|
||||
return $ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to validate the local part of the email address
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function _validateLocalPart()
|
||||
{
|
||||
// First try to match the local part on the common dot-atom format
|
||||
$result = false;
|
||||
|
||||
// Dot-atom characters are: 1*atext *("." 1*atext)
|
||||
// atext: ALPHA / DIGIT / and "!", "#", "$", "%", "&", "'", "*",
|
||||
// "+", "-", "/", "=", "?", "^", "_", "`", "{", "|", "}", "~"
|
||||
$atext = 'a-zA-Z0-9\x21\x23\x24\x25\x26\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b\x7c\x7d\x7e';
|
||||
if (preg_match('/^[' . $atext . ']+(\x2e+[' . $atext . ']+)*$/', $this->_localPart)) {
|
||||
$result = true;
|
||||
} else {
|
||||
// Try quoted string format
|
||||
|
||||
// Quoted-string characters are: DQUOTE *([FWS] qtext/quoted-pair) [FWS] DQUOTE
|
||||
// qtext: Non white space controls, and the rest of the US-ASCII characters not
|
||||
// including "\" or the quote character
|
||||
$noWsCtl = '\x01-\x08\x0b\x0c\x0e-\x1f\x7f';
|
||||
$qtext = $noWsCtl . '\x21\x23-\x5b\x5d-\x7e';
|
||||
$ws = '\x20\x09';
|
||||
if (preg_match('/^\x22([' . $ws . $qtext . '])*[$ws]?\x22$/', $this->_localPart)) {
|
||||
$result = true;
|
||||
} else {
|
||||
$this->_error(self::DOT_ATOM);
|
||||
$this->_error(self::QUOTED_STRING);
|
||||
$this->_error(self::INVALID_LOCAL_PART);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to validate the servers MX records
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function _validateMXRecords()
|
||||
{
|
||||
$mxHosts = array();
|
||||
$result = getmxrr($this->_hostname, $mxHosts);
|
||||
if (!$result) {
|
||||
$this->_error(self::INVALID_MX_RECORD);
|
||||
} else if ($this->_options['deep'] && function_exists('checkdnsrr')) {
|
||||
$validAddress = false;
|
||||
$reserved = true;
|
||||
foreach ($mxHosts as $hostname) {
|
||||
$res = $this->_isReserved($hostname);
|
||||
if (!$res) {
|
||||
$reserved = false;
|
||||
}
|
||||
|
||||
if (!$res
|
||||
&& (checkdnsrr($hostname, "A")
|
||||
|| checkdnsrr($hostname, "AAAA")
|
||||
|| checkdnsrr($hostname, "A6"))) {
|
||||
$validAddress = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$validAddress) {
|
||||
$result = false;
|
||||
if ($reserved) {
|
||||
$this->_error(self::INVALID_SEGMENT);
|
||||
} else {
|
||||
$this->_error(self::INVALID_MX_RECORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to validate the hostname part of the email address
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function _validateHostnamePart()
|
||||
{
|
||||
$hostname = $this->_options['hostname']->setTranslator($this->getTranslator())
|
||||
->isValid($this->_hostname);
|
||||
if (!$hostname) {
|
||||
$this->_error(self::INVALID_HOSTNAME);
|
||||
|
||||
// Get messages and errors from hostnameValidator
|
||||
foreach ($this->_options['hostname']->getMessages() as $code => $message) {
|
||||
$this->_messages[$code] = $message;
|
||||
}
|
||||
|
||||
foreach ($this->_options['hostname']->getErrors() as $error) {
|
||||
$this->_errors[] = $error;
|
||||
}
|
||||
} else if ($this->_options['mx']) {
|
||||
// MX check on hostname
|
||||
$hostname = $this->_validateMXRecords();
|
||||
}
|
||||
|
||||
return $hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is a valid email address
|
||||
* according to RFC2822
|
||||
*
|
||||
* @link http://www.ietf.org/rfc/rfc2822.txt RFC2822
|
||||
* @link http://www.columbia.edu/kermit/ascii.html US-ASCII characters
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$matches = array();
|
||||
$length = true;
|
||||
$this->_setValue($value);
|
||||
|
||||
// Split email address up and disallow '..'
|
||||
if ((strpos($value, '..') !== false) or
|
||||
(!preg_match('/^(.+)@([^@]+)$/', $value, $matches))) {
|
||||
$this->_error(self::INVALID_FORMAT);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_localPart = $matches[1];
|
||||
$this->_hostname = $matches[2];
|
||||
|
||||
if ((strlen($this->_localPart) > 64) || (strlen($this->_hostname) > 255)) {
|
||||
$length = false;
|
||||
$this->_error(self::LENGTH_EXCEEDED);
|
||||
}
|
||||
|
||||
// Match hostname part
|
||||
if ($this->_options['domain']) {
|
||||
$hostname = $this->_validateHostnamePart();
|
||||
}
|
||||
|
||||
$local = $this->_validateLocalPart();
|
||||
|
||||
// If both parts valid, return true
|
||||
if ($local && $length) {
|
||||
if (($this->_options['domain'] && $hostname) || !$this->_options['domain']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
34
airtime_mvc/library/Zend/Validate/Exception.php
Normal file
34
airtime_mvc/library/Zend/Validate/Exception.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Exception
|
||||
*/
|
||||
require_once 'Zend/Exception.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Exception extends Zend_Exception
|
||||
{}
|
284
airtime_mvc/library/Zend/Validate/File/Count.php
Normal file
284
airtime_mvc/library/Zend/Validate/File/Count.php
Normal file
|
@ -0,0 +1,284 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Count.php 21326 2010-03-04 20:32:39Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for counting all given files
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Count extends Zend_Validate_Abstract
|
||||
{
|
||||
/**#@+
|
||||
* @const string Error constants
|
||||
*/
|
||||
const TOO_MANY = 'fileCountTooMany';
|
||||
const TOO_FEW = 'fileCountTooFew';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::TOO_MANY => "Too many files, maximum '%max%' are allowed but '%count%' are given",
|
||||
self::TOO_FEW => "Too few files, minimum '%min%' are expected but '%count%' are given",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Error message template variables
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'min' => '_min',
|
||||
'max' => '_max',
|
||||
'count' => '_count'
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum file count
|
||||
*
|
||||
* If null, there is no minimum file count
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_min;
|
||||
|
||||
/**
|
||||
* Maximum file count
|
||||
*
|
||||
* If null, there is no maximum file count
|
||||
*
|
||||
* @var integer|null
|
||||
*/
|
||||
protected $_max;
|
||||
|
||||
/**
|
||||
* Actual filecount
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_count;
|
||||
|
||||
/**
|
||||
* Internal file array
|
||||
* @var array
|
||||
*/
|
||||
protected $_files;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* Min limits the file count, when used with max=null it is the maximum file count
|
||||
* It also accepts an array with the keys 'min' and 'max'
|
||||
*
|
||||
* If $options is a integer, it will be used as maximum file count
|
||||
* As Array is accepts the following keys:
|
||||
* 'min': Minimum filecount
|
||||
* 'max': Maximum filecount
|
||||
*
|
||||
* @param integer|array|Zend_Config $options Options for the adapter
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_string($options) || is_numeric($options)) {
|
||||
$options = array('max' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
$options['min'] = func_get_arg(0);
|
||||
$options['max'] = func_get_arg(1);
|
||||
}
|
||||
|
||||
if (isset($options['min'])) {
|
||||
$this->setMin($options);
|
||||
}
|
||||
|
||||
if (isset($options['max'])) {
|
||||
$this->setMax($options);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum file count
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMin()
|
||||
{
|
||||
return $this->_min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum file count
|
||||
*
|
||||
* @param integer|array $min The minimum file count
|
||||
* @return Zend_Validate_File_Count Provides a fluent interface
|
||||
* @throws Zend_Validate_Exception When min is greater than max
|
||||
*/
|
||||
public function setMin($min)
|
||||
{
|
||||
if (is_array($min) and isset($min['min'])) {
|
||||
$min = $min['min'];
|
||||
}
|
||||
|
||||
if (!is_string($min) and !is_numeric($min)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$min = (integer) $min;
|
||||
if (($this->_max !== null) && ($min > $this->_max)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum file count, but $min >"
|
||||
. " {$this->_max}");
|
||||
}
|
||||
|
||||
$this->_min = $min;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum file count
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMax()
|
||||
{
|
||||
return $this->_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum file count
|
||||
*
|
||||
* @param integer|array $max The maximum file count
|
||||
* @return Zend_Validate_StringLength Provides a fluent interface
|
||||
* @throws Zend_Validate_Exception When max is smaller than min
|
||||
*/
|
||||
public function setMax($max)
|
||||
{
|
||||
if (is_array($max) and isset($max['max'])) {
|
||||
$max = $max['max'];
|
||||
}
|
||||
|
||||
if (!is_string($max) and !is_numeric($max)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$max = (integer) $max;
|
||||
if (($this->_min !== null) && ($max < $this->_min)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum file count, but "
|
||||
. "$max < {$this->_min}");
|
||||
}
|
||||
|
||||
$this->_max = $max;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a file for validation
|
||||
*
|
||||
* @param string|array $file
|
||||
*/
|
||||
public function addFile($file)
|
||||
{
|
||||
if (is_string($file)) {
|
||||
$file = array($file);
|
||||
}
|
||||
|
||||
if (is_array($file)) {
|
||||
foreach ($file as $name) {
|
||||
if (!isset($this->_files[$name]) && !empty($name)) {
|
||||
$this->_files[$name] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the file count of all checked files is at least min and
|
||||
* not bigger than max (when max is not null). Attention: When checking with set min you
|
||||
* must give all files with the first call, otherwise you will get an false.
|
||||
*
|
||||
* @param string|array $value Filenames to check for count
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
if (($file !== null) && !array_key_exists('destination', $file)) {
|
||||
$file['destination'] = dirname($value);
|
||||
}
|
||||
|
||||
if (($file !== null) && array_key_exists('tmp_name', $file)) {
|
||||
$value = $file['destination'] . DIRECTORY_SEPARATOR . $file['name'];
|
||||
}
|
||||
|
||||
if (($file === null) || !empty($file['tmp_name'])) {
|
||||
$this->addFile($value);
|
||||
}
|
||||
|
||||
$this->_count = count($this->_files);
|
||||
if (($this->_max !== null) && ($this->_count > $this->_max)) {
|
||||
return $this->_throw($file, self::TOO_MANY);
|
||||
}
|
||||
|
||||
if (($this->_min !== null) && ($this->_count < $this->_min)) {
|
||||
return $this->_throw($file, self::TOO_FEW);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
179
airtime_mvc/library/Zend/Validate/File/Crc32.php
Normal file
179
airtime_mvc/library/Zend/Validate/File/Crc32.php
Normal file
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Crc32.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Hash
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Hash.php';
|
||||
|
||||
/**
|
||||
* Validator for the crc32 hash of given files
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_NOT_MATCH = 'fileCrc32DoesNotMatch';
|
||||
const NOT_DETECTED = 'fileCrc32NotDetected';
|
||||
const NOT_FOUND = 'fileCrc32NotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_NOT_MATCH => "File '%value%' does not match the given crc32 hashes",
|
||||
self::NOT_DETECTED => "A crc32 hash could not be evaluated for the given file",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash of the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_hash;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array|Zend_Config $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_scalar($options)) {
|
||||
$options = array('hash1' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$this->setCrc32($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set crc32 hashes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCrc32()
|
||||
{
|
||||
return $this->getHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the crc32 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = array($options);
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'crc32';
|
||||
parent::setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the crc32 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setCrc32($options)
|
||||
{
|
||||
$this->setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the crc32 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = array($options);
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'crc32';
|
||||
parent::addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the crc32 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addCrc32($options)
|
||||
{
|
||||
$this->addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the given file confirms the set hash
|
||||
*
|
||||
* @param string $value Filename to check for hash
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
$hashes = array_unique(array_keys($this->_hash));
|
||||
$filehash = hash_file('crc32', $value);
|
||||
if ($filehash === false) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
foreach($hashes as $hash) {
|
||||
if ($filehash === $hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::DOES_NOT_MATCH);
|
||||
}
|
||||
}
|
94
airtime_mvc/library/Zend/Validate/File/ExcludeExtension.php
Normal file
94
airtime_mvc/library/Zend/Validate/File/ExcludeExtension.php
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ExcludeExtension.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Extension.php';
|
||||
|
||||
/**
|
||||
* Validator for the excluding file extensions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_ExcludeExtension extends Zend_Validate_File_Extension
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const FALSE_EXTENSION = 'fileExcludeExtensionFalse';
|
||||
const NOT_FOUND = 'fileExcludeExtensionNotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::FALSE_EXTENSION => "File '%value%' has a false extension",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the fileextension of $value is not included in the
|
||||
* set extension list
|
||||
*
|
||||
* @param string $value Real file to check for extension
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
if ($file !== null) {
|
||||
$info['extension'] = substr($file['name'], strrpos($file['name'], '.') + 1);
|
||||
} else {
|
||||
$info = pathinfo($value);
|
||||
}
|
||||
|
||||
$extensions = $this->getExtension();
|
||||
|
||||
if ($this->_case and (!in_array($info['extension'], $extensions))) {
|
||||
return true;
|
||||
} else if (!$this->_case) {
|
||||
$found = false;
|
||||
foreach ($extensions as $extension) {
|
||||
if (strtolower($extension) == strtolower($info['extension'])) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::FALSE_EXTENSION);
|
||||
}
|
||||
}
|
109
airtime_mvc/library/Zend/Validate/File/ExcludeMimeType.php
Normal file
109
airtime_mvc/library/Zend/Validate/File/ExcludeMimeType.php
Normal file
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ExcludeMimeType.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_MimeType
|
||||
*/
|
||||
require_once 'Zend/Validate/File/MimeType.php';
|
||||
|
||||
/**
|
||||
* Validator for the mime type of a file
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_ExcludeMimeType extends Zend_Validate_File_MimeType
|
||||
{
|
||||
const FALSE_TYPE = 'fileExcludeMimeTypeFalse';
|
||||
const NOT_DETECTED = 'fileExcludeMimeTypeNotDetected';
|
||||
const NOT_READABLE = 'fileExcludeMimeTypeNotReadable';
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if the mimetype of the file does not matche the given ones. Also parts
|
||||
* of mimetypes can be checked. If you give for example "image" all image
|
||||
* mime types will not be accepted like "image/gif", "image/jpeg" and so on.
|
||||
*
|
||||
* @param string $value Real file to check for mimetype
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
if ($file === null) {
|
||||
$file = array(
|
||||
'type' => null,
|
||||
'name' => $value
|
||||
);
|
||||
}
|
||||
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_READABLE);
|
||||
}
|
||||
|
||||
$mimefile = $this->getMagicFile();
|
||||
if (class_exists('finfo', false)) {
|
||||
$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
|
||||
if (!empty($mimefile)) {
|
||||
$mime = new finfo($const, $mimefile);
|
||||
} else {
|
||||
$mime = new finfo($const);
|
||||
}
|
||||
|
||||
if ($mime !== false) {
|
||||
$this->_type = $mime->file($value);
|
||||
}
|
||||
unset($mime);
|
||||
}
|
||||
|
||||
if (empty($this->_type)) {
|
||||
if (function_exists('mime_content_type') && ini_get('mime_magic.magicfile')) {
|
||||
$this->_type = mime_content_type($value);
|
||||
} elseif ($this->_headerCheck) {
|
||||
$this->_type = $file['type'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->_type)) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
$mimetype = $this->getMimeType(true);
|
||||
if (in_array($this->_type, $mimetype)) {
|
||||
return $this->_throw($file, self::FALSE_TYPE);
|
||||
}
|
||||
|
||||
$types = explode('/', $this->_type);
|
||||
$types = array_merge($types, explode('-', $this->_type));
|
||||
foreach($mimetype as $mime) {
|
||||
if (in_array($mime, $types)) {
|
||||
return $this->_throw($file, self::FALSE_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
203
airtime_mvc/library/Zend/Validate/File/Exists.php
Normal file
203
airtime_mvc/library/Zend/Validate/File/Exists.php
Normal file
|
@ -0,0 +1,203 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exists.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator which checks if the file already exists in the directory
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Exists extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_NOT_EXIST = 'fileExistsDoesNotExist';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_NOT_EXIST => "File '%value%' does not exist",
|
||||
);
|
||||
|
||||
/**
|
||||
* Internal list of directories
|
||||
* @var string
|
||||
*/
|
||||
protected $_directory = '';
|
||||
|
||||
/**
|
||||
* @var array Error message template variables
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'directory' => '_directory'
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array|Zend_Config $directory
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($directory = array())
|
||||
{
|
||||
if ($directory instanceof Zend_Config) {
|
||||
$directory = $directory->toArray();
|
||||
} else if (is_string($directory)) {
|
||||
$directory = explode(',', $directory);
|
||||
} else if (!is_array($directory)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$this->setDirectory($directory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set file directories which are checked
|
||||
*
|
||||
* @param boolean $asArray Returns the values as array, when false an concated string is returned
|
||||
* @return string
|
||||
*/
|
||||
public function getDirectory($asArray = false)
|
||||
{
|
||||
$asArray = (bool) $asArray;
|
||||
$directory = (string) $this->_directory;
|
||||
if ($asArray) {
|
||||
$directory = explode(',', $directory);
|
||||
}
|
||||
|
||||
return $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file directory which will be checked
|
||||
*
|
||||
* @param string|array $directory The directories to validate
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function setDirectory($directory)
|
||||
{
|
||||
$this->_directory = null;
|
||||
$this->addDirectory($directory);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the file directory which will be checked
|
||||
*
|
||||
* @param string|array $directory The directory to add for validation
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function addDirectory($directory)
|
||||
{
|
||||
$directories = $this->getDirectory(true);
|
||||
|
||||
if (is_string($directory)) {
|
||||
$directory = explode(',', $directory);
|
||||
} else if (!is_array($directory)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
foreach ($directory as $content) {
|
||||
if (empty($content) || !is_string($content)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$directories[] = trim($content);
|
||||
}
|
||||
$directories = array_unique($directories);
|
||||
|
||||
// Sanity check to ensure no empty values
|
||||
foreach ($directories as $key => $dir) {
|
||||
if (empty($dir)) {
|
||||
unset($directories[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_directory = implode(',', $directories);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the file already exists in the set directories
|
||||
*
|
||||
* @param string $value Real file to check for existance
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
$directories = $this->getDirectory(true);
|
||||
if (($file !== null) and (!empty($file['destination']))) {
|
||||
$directories[] = $file['destination'];
|
||||
} else if (!isset($file['name'])) {
|
||||
$file['name'] = $value;
|
||||
}
|
||||
|
||||
$check = false;
|
||||
foreach ($directories as $directory) {
|
||||
if (empty($directory)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$check = true;
|
||||
if (!file_exists($directory . DIRECTORY_SEPARATOR . $file['name'])) {
|
||||
return $this->_throw($file, self::DOES_NOT_EXIST);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$check) {
|
||||
return $this->_throw($file, self::DOES_NOT_EXIST);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
232
airtime_mvc/library/Zend/Validate/File/Extension.php
Normal file
232
airtime_mvc/library/Zend/Validate/File/Extension.php
Normal file
|
@ -0,0 +1,232 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Extension.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the file extension of a file
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Extension extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const FALSE_EXTENSION = 'fileExtensionFalse';
|
||||
const NOT_FOUND = 'fileExtensionNotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::FALSE_EXTENSION => "File '%value%' has a false extension",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Internal list of extensions
|
||||
* @var string
|
||||
*/
|
||||
protected $_extension = '';
|
||||
|
||||
/**
|
||||
* Validate case sensitive
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_case = false;
|
||||
|
||||
/**
|
||||
* @var array Error message template variables
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'extension' => '_extension'
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array|Zend_Config $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
$case = func_get_arg(1);
|
||||
$this->setCase($case);
|
||||
}
|
||||
|
||||
if (is_array($options) and isset($options['case'])) {
|
||||
$this->setCase($options['case']);
|
||||
unset($options['case']);
|
||||
}
|
||||
|
||||
$this->setExtension($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the case option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCase()
|
||||
{
|
||||
return $this->_case;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the case to use
|
||||
*
|
||||
* @param boolean $case
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function setCase($case)
|
||||
{
|
||||
$this->_case = (boolean) $case;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set file extension
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getExtension()
|
||||
{
|
||||
$extension = explode(',', $this->_extension);
|
||||
|
||||
return $extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file extensions
|
||||
*
|
||||
* @param string|array $extension The extensions to validate
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function setExtension($extension)
|
||||
{
|
||||
$this->_extension = null;
|
||||
$this->addExtension($extension);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the file extensions
|
||||
*
|
||||
* @param string|array $extension The extensions to add for validation
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function addExtension($extension)
|
||||
{
|
||||
$extensions = $this->getExtension();
|
||||
if (is_string($extension)) {
|
||||
$extension = explode(',', $extension);
|
||||
}
|
||||
|
||||
foreach ($extension as $content) {
|
||||
if (empty($content) || !is_string($content)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$extensions[] = trim($content);
|
||||
}
|
||||
$extensions = array_unique($extensions);
|
||||
|
||||
// Sanity check to ensure no empty values
|
||||
foreach ($extensions as $key => $ext) {
|
||||
if (empty($ext)) {
|
||||
unset($extensions[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_extension = implode(',', $extensions);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the fileextension of $value is included in the
|
||||
* set extension list
|
||||
*
|
||||
* @param string $value Real file to check for extension
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
if ($file !== null) {
|
||||
$info['extension'] = substr($file['name'], strrpos($file['name'], '.') + 1);
|
||||
} else {
|
||||
$info = pathinfo($value);
|
||||
}
|
||||
|
||||
$extensions = $this->getExtension();
|
||||
|
||||
if ($this->_case && (in_array($info['extension'], $extensions))) {
|
||||
return true;
|
||||
} else if (!$this->getCase()) {
|
||||
foreach ($extensions as $extension) {
|
||||
if (strtolower($extension) == strtolower($info['extension'])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::FALSE_EXTENSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if (null !== $file) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
164
airtime_mvc/library/Zend/Validate/File/FilesSize.php
Normal file
164
airtime_mvc/library/Zend/Validate/File/FilesSize.php
Normal file
|
@ -0,0 +1,164 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FilesSize.php 20455 2010-01-20 22:54:18Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Size
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Size.php';
|
||||
|
||||
/**
|
||||
* Validator for the size of all files which will be validated in sum
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const TOO_BIG = 'fileFilesSizeTooBig';
|
||||
const TOO_SMALL = 'fileFilesSizeTooSmall';
|
||||
const NOT_READABLE = 'fileFilesSizeNotReadable';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::TOO_BIG => "All files in sum should have a maximum size of '%max%' but '%size%' were detected",
|
||||
self::TOO_SMALL => "All files in sum should have a minimum size of '%min%' but '%size%' were detected",
|
||||
self::NOT_READABLE => "One or more files can not be read",
|
||||
);
|
||||
|
||||
/**
|
||||
* Internal file array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_files;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* Min limits the used diskspace for all files, when used with max=null it is the maximum filesize
|
||||
* It also accepts an array with the keys 'min' and 'max'
|
||||
*
|
||||
* @param integer|array|Zend_Config $options Options for this validator
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
$this->_files = array();
|
||||
$this->_setSize(0);
|
||||
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_scalar($options)) {
|
||||
$options = array('max' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
$argv = func_get_args();
|
||||
array_shift($argv);
|
||||
$options['max'] = array_shift($argv);
|
||||
if (!empty($argv)) {
|
||||
$options['bytestring'] = array_shift($argv);
|
||||
}
|
||||
}
|
||||
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the disk usage of all files is at least min and
|
||||
* not bigger than max (when max is not null).
|
||||
*
|
||||
* @param string|array $value Real file to check for size
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
require_once 'Zend/Loader.php';
|
||||
if (is_string($value)) {
|
||||
$value = array($value);
|
||||
}
|
||||
|
||||
$min = $this->getMin(true);
|
||||
$max = $this->getMax(true);
|
||||
$size = $this->_getSize();
|
||||
foreach ($value as $files) {
|
||||
// Is file readable ?
|
||||
if (!Zend_Loader::isReadable($files)) {
|
||||
$this->_throw($file, self::NOT_READABLE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($this->_files[$files])) {
|
||||
$this->_files[$files] = $files;
|
||||
} else {
|
||||
// file already counted... do not count twice
|
||||
continue;
|
||||
}
|
||||
|
||||
// limited to 2GB files
|
||||
$size += @filesize($files);
|
||||
$this->_size = $size;
|
||||
if (($max !== null) && ($max < $size)) {
|
||||
if ($this->useByteString()) {
|
||||
$this->_max = $this->_toByteString($max);
|
||||
$this->_size = $this->_toByteString($size);
|
||||
$this->_throw($file, self::TOO_BIG);
|
||||
$this->_max = $max;
|
||||
$this->_size = $size;
|
||||
} else {
|
||||
$this->_throw($file, self::TOO_BIG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check that aggregate files are >= minimum size
|
||||
if (($min !== null) && ($size < $min)) {
|
||||
if ($this->useByteString()) {
|
||||
$this->_min = $this->_toByteString($min);
|
||||
$this->_size = $this->_toByteString($size);
|
||||
$this->_throw($file, self::TOO_SMALL);
|
||||
$this->_min = $min;
|
||||
$this->_size = $size;
|
||||
} else {
|
||||
$this->_throw($file, self::TOO_SMALL);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->_messages) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
194
airtime_mvc/library/Zend/Validate/File/Hash.php
Normal file
194
airtime_mvc/library/Zend/Validate/File/Hash.php
Normal file
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Hash.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the hash of given files
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Hash extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_NOT_MATCH = 'fileHashDoesNotMatch';
|
||||
const NOT_DETECTED = 'fileHashHashNotDetected';
|
||||
const NOT_FOUND = 'fileHashNotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_NOT_MATCH => "File '%value%' does not match the given hashes",
|
||||
self::NOT_DETECTED => "A hash could not be evaluated for the given file",
|
||||
self::NOT_FOUND => "File '%value%' could not be found"
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash of the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_hash;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_scalar($options)) {
|
||||
$options = array('hash1' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
$options['algorithm'] = func_get_arg(1);
|
||||
}
|
||||
|
||||
$this->setHash($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set hash values as array, the hash as key and the algorithm the value
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getHash()
|
||||
{
|
||||
return $this->_hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setHash($options)
|
||||
{
|
||||
$this->_hash = null;
|
||||
$this->addHash($options);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addHash($options)
|
||||
{
|
||||
if (is_string($options)) {
|
||||
$options = array($options);
|
||||
} else if (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("False parameter given");
|
||||
}
|
||||
|
||||
$known = hash_algos();
|
||||
if (!isset($options['algorithm'])) {
|
||||
$algorithm = 'crc32';
|
||||
} else {
|
||||
$algorithm = $options['algorithm'];
|
||||
unset($options['algorithm']);
|
||||
}
|
||||
|
||||
if (!in_array($algorithm, $known)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Unknown algorithm '{$algorithm}'");
|
||||
}
|
||||
|
||||
foreach ($options as $value) {
|
||||
$this->_hash[$value] = $algorithm;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the given file confirms the set hash
|
||||
*
|
||||
* @param string $value Filename to check for hash
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
$algos = array_unique(array_values($this->_hash));
|
||||
$hashes = array_unique(array_keys($this->_hash));
|
||||
foreach ($algos as $algorithm) {
|
||||
$filehash = hash_file($algorithm, $value);
|
||||
if ($filehash === false) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
foreach($hashes as $hash) {
|
||||
if ($filehash === $hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::DOES_NOT_MATCH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
364
airtime_mvc/library/Zend/Validate/File/ImageSize.php
Normal file
364
airtime_mvc/library/Zend/Validate/File/ImageSize.php
Normal file
|
@ -0,0 +1,364 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ImageSize.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the image size of a image file
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig';
|
||||
const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall';
|
||||
const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig';
|
||||
const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall';
|
||||
const NOT_DETECTED = 'fileImageSizeNotDetected';
|
||||
const NOT_READABLE = 'fileImageSizeNotReadable';
|
||||
|
||||
/**
|
||||
* @var array Error message template
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected",
|
||||
self::WIDTH_TOO_SMALL => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected",
|
||||
self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected",
|
||||
self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected",
|
||||
self::NOT_DETECTED => "The size of image '%value%' could not be detected",
|
||||
self::NOT_READABLE => "File '%value%' can not be read",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Error message template variables
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'minwidth' => '_minwidth',
|
||||
'maxwidth' => '_maxwidth',
|
||||
'minheight' => '_minheight',
|
||||
'maxheight' => '_maxheight',
|
||||
'width' => '_width',
|
||||
'height' => '_height'
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum image width
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_minwidth;
|
||||
|
||||
/**
|
||||
* Maximum image width
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_maxwidth;
|
||||
|
||||
/**
|
||||
* Minimum image height
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_minheight;
|
||||
|
||||
/**
|
||||
* Maximum image height
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_maxheight;
|
||||
|
||||
/**
|
||||
* Detected width
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_width;
|
||||
|
||||
/**
|
||||
* Detected height
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_height;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* Accepts the following option keys:
|
||||
* - minheight
|
||||
* - minwidth
|
||||
* - maxheight
|
||||
* - maxwidth
|
||||
*
|
||||
* @param Zend_Config|array $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (1 < func_num_args()) {
|
||||
if (!is_array($options)) {
|
||||
$options = array('minwidth' => $options);
|
||||
}
|
||||
$argv = func_get_args();
|
||||
array_shift($argv);
|
||||
$options['minheight'] = array_shift($argv);
|
||||
if (!empty($argv)) {
|
||||
$options['maxwidth'] = array_shift($argv);
|
||||
if (!empty($argv)) {
|
||||
$options['maxheight'] = array_shift($argv);
|
||||
}
|
||||
}
|
||||
} else if (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
if (isset($options['minheight']) || isset($options['minwidth'])) {
|
||||
$this->setImageMin($options);
|
||||
}
|
||||
|
||||
if (isset($options['maxheight']) || isset($options['maxwidth'])) {
|
||||
$this->setImageMax($options);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set minimum image sizes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getImageMin()
|
||||
{
|
||||
return array('minwidth' => $this->_minwidth, 'minheight' => $this->_minheight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set maximum image sizes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getImageMax()
|
||||
{
|
||||
return array('maxwidth' => $this->_maxwidth, 'maxheight' => $this->_maxheight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set image width sizes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getImageWidth()
|
||||
{
|
||||
return array('minwidth' => $this->_minwidth, 'maxwidth' => $this->_maxwidth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set image height sizes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getImageHeight()
|
||||
{
|
||||
return array('minheight' => $this->_minheight, 'maxheight' => $this->_maxheight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum image size
|
||||
*
|
||||
* @param array $options The minimum image dimensions
|
||||
* @throws Zend_Validate_Exception When minwidth is greater than maxwidth
|
||||
* @throws Zend_Validate_Exception When minheight is greater than maxheight
|
||||
* @return Zend_Validate_File_ImageSize Provides a fluent interface
|
||||
*/
|
||||
public function setImageMin($options)
|
||||
{
|
||||
if (isset($options['minwidth'])) {
|
||||
if (($this->_maxwidth !== null) and ($options['minwidth'] > $this->_maxwidth)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The minimum image width must be less than or equal to the "
|
||||
. " maximum image width, but {$options['minwidth']} > {$this->_maxwidth}");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['maxheight'])) {
|
||||
if (($this->_maxheight !== null) and ($options['minheight'] > $this->_maxheight)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The minimum image height must be less than or equal to the "
|
||||
. " maximum image height, but {$options['minheight']} > {$this->_maxheight}");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['minwidth'])) {
|
||||
$this->_minwidth = (int) $options['minwidth'];
|
||||
}
|
||||
|
||||
if (isset($options['minheight'])) {
|
||||
$this->_minheight = (int) $options['minheight'];
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum image size
|
||||
*
|
||||
* @param array $options The maximum image dimensions
|
||||
* @throws Zend_Validate_Exception When maxwidth is smaller than minwidth
|
||||
* @throws Zend_Validate_Exception When maxheight is smaller than minheight
|
||||
* @return Zend_Validate_StringLength Provides a fluent interface
|
||||
*/
|
||||
public function setImageMax($options)
|
||||
{
|
||||
if (isset($options['maxwidth'])) {
|
||||
if (($this->_minwidth !== null) and ($options['maxwidth'] < $this->_minwidth)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The maximum image width must be greater than or equal to the "
|
||||
. "minimum image width, but {$options['maxwidth']} < {$this->_minwidth}");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['maxheight'])) {
|
||||
if (($this->_minheight !== null) and ($options['maxheight'] < $this->_minheight)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The maximum image height must be greater than or equal to the "
|
||||
. "minimum image height, but {$options['maxheight']} < {$this->_minwidth}");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['maxwidth'])) {
|
||||
$this->_maxwidth = (int) $options['maxwidth'];
|
||||
}
|
||||
|
||||
if (isset($options['maxheight'])) {
|
||||
$this->_maxheight = (int) $options['maxheight'];
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mimimum and maximum image width
|
||||
*
|
||||
* @param array $options The image width dimensions
|
||||
* @return Zend_Validate_File_ImageSize Provides a fluent interface
|
||||
*/
|
||||
public function setImageWidth($options)
|
||||
{
|
||||
$this->setImageMin($options);
|
||||
$this->setImageMax($options);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mimimum and maximum image height
|
||||
*
|
||||
* @param array $options The image height dimensions
|
||||
* @return Zend_Validate_File_ImageSize Provides a fluent interface
|
||||
*/
|
||||
public function setImageHeight($options)
|
||||
{
|
||||
$this->setImageMin($options);
|
||||
$this->setImageMax($options);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the imagesize of $value is at least min and
|
||||
* not bigger than max
|
||||
*
|
||||
* @param string $value Real file to check for image size
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_READABLE);
|
||||
}
|
||||
|
||||
$size = @getimagesize($value);
|
||||
$this->_setValue($file);
|
||||
|
||||
if (empty($size) or ($size[0] === 0) or ($size[1] === 0)) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
$this->_width = $size[0];
|
||||
$this->_height = $size[1];
|
||||
if ($this->_width < $this->_minwidth) {
|
||||
$this->_throw($file, self::WIDTH_TOO_SMALL);
|
||||
}
|
||||
|
||||
if (($this->_maxwidth !== null) and ($this->_maxwidth < $this->_width)) {
|
||||
$this->_throw($file, self::WIDTH_TOO_BIG);
|
||||
}
|
||||
|
||||
if ($this->_height < $this->_minheight) {
|
||||
$this->_throw($file, self::HEIGHT_TOO_SMALL);
|
||||
}
|
||||
|
||||
if (($this->_maxheight !== null) and ($this->_maxheight < $this->_height)) {
|
||||
$this->_throw($file, self::HEIGHT_TOO_BIG);
|
||||
}
|
||||
|
||||
if (count($this->_messages) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
149
airtime_mvc/library/Zend/Validate/File/IsCompressed.php
Normal file
149
airtime_mvc/library/Zend/Validate/File/IsCompressed.php
Normal file
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: IsCompressed.php 21138 2010-02-22 22:37:11Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_MimeType
|
||||
*/
|
||||
require_once 'Zend/Validate/File/MimeType.php';
|
||||
|
||||
/**
|
||||
* Validator which checks if the file already exists in the directory
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_IsCompressed extends Zend_Validate_File_MimeType
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const FALSE_TYPE = 'fileIsCompressedFalseType';
|
||||
const NOT_DETECTED = 'fileIsCompressedNotDetected';
|
||||
const NOT_READABLE = 'fileIsCompressedNotReadable';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::FALSE_TYPE => "File '%value%' is not compressed, '%type%' detected",
|
||||
self::NOT_DETECTED => "The mimetype of file '%value%' could not been detected",
|
||||
self::NOT_READABLE => "File '%value%' can not be read",
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array|Zend_Config $compression
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($mimetype = array())
|
||||
{
|
||||
if ($mimetype instanceof Zend_Config) {
|
||||
$mimetype = $mimetype->toArray();
|
||||
}
|
||||
|
||||
$temp = array();
|
||||
// http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
|
||||
$default = array(
|
||||
'application/arj',
|
||||
'application/gnutar',
|
||||
'application/lha',
|
||||
'application/lzx',
|
||||
'application/vnd.ms-cab-compressed',
|
||||
'application/x-ace-compressed',
|
||||
'application/x-arc',
|
||||
'application/x-archive',
|
||||
'application/x-arj',
|
||||
'application/x-bzip',
|
||||
'application/x-bzip2',
|
||||
'application/x-cab-compressed',
|
||||
'application/x-compress',
|
||||
'application/x-compressed',
|
||||
'application/x-cpio',
|
||||
'application/x-debian-package',
|
||||
'application/x-eet',
|
||||
'application/x-gzip',
|
||||
'application/x-java-pack200',
|
||||
'application/x-lha',
|
||||
'application/x-lharc',
|
||||
'application/x-lzh',
|
||||
'application/x-lzma',
|
||||
'application/x-lzx',
|
||||
'application/x-rar',
|
||||
'application/x-sit',
|
||||
'application/x-stuffit',
|
||||
'application/x-tar',
|
||||
'application/zip',
|
||||
'application/zoo',
|
||||
'multipart/x-gzip',
|
||||
);
|
||||
|
||||
if (is_array($mimetype)) {
|
||||
$temp = $mimetype;
|
||||
if (array_key_exists('magicfile', $temp)) {
|
||||
unset($temp['magicfile']);
|
||||
}
|
||||
|
||||
if (array_key_exists('headerCheck', $temp)) {
|
||||
unset($temp['headerCheck']);
|
||||
}
|
||||
|
||||
if (empty($temp)) {
|
||||
$mimetype += $default;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($mimetype)) {
|
||||
$mimetype = $default;
|
||||
}
|
||||
|
||||
parent::__construct($mimetype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
* Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
$this->_value = $file['name'];
|
||||
switch($errorType) {
|
||||
case Zend_Validate_File_MimeType::FALSE_TYPE :
|
||||
$errorType = self::FALSE_TYPE;
|
||||
break;
|
||||
case Zend_Validate_File_MimeType::NOT_DETECTED :
|
||||
$errorType = self::NOT_DETECTED;
|
||||
break;
|
||||
case Zend_Validate_File_MimeType::NOT_READABLE :
|
||||
$errorType = self::NOT_READABLE;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
173
airtime_mvc/library/Zend/Validate/File/IsImage.php
Normal file
173
airtime_mvc/library/Zend/Validate/File/IsImage.php
Normal file
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: IsImage.php 21138 2010-02-22 22:37:11Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_MimeType
|
||||
*/
|
||||
require_once 'Zend/Validate/File/MimeType.php';
|
||||
|
||||
/**
|
||||
* Validator which checks if the file already exists in the directory
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_IsImage extends Zend_Validate_File_MimeType
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const FALSE_TYPE = 'fileIsImageFalseType';
|
||||
const NOT_DETECTED = 'fileIsImageNotDetected';
|
||||
const NOT_READABLE = 'fileIsImageNotReadable';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::FALSE_TYPE => "File '%value%' is no image, '%type%' detected",
|
||||
self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
|
||||
self::NOT_READABLE => "File '%value%' can not be read",
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|array|Zend_Config $mimetype
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($mimetype = array())
|
||||
{
|
||||
if ($mimetype instanceof Zend_Config) {
|
||||
$mimetype = $mimetype->toArray();
|
||||
}
|
||||
|
||||
$temp = array();
|
||||
// http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
|
||||
// http://www.iana.org/assignments/media-types/image/
|
||||
$default = array(
|
||||
'application/cdf',
|
||||
'application/dicom',
|
||||
'application/fractals',
|
||||
'application/postscript',
|
||||
'application/vnd.hp-hpgl',
|
||||
'application/vnd.oasis.opendocument.graphics',
|
||||
'application/x-cdf',
|
||||
'application/x-cmu-raster',
|
||||
'application/x-ima',
|
||||
'application/x-inventor',
|
||||
'application/x-koan',
|
||||
'application/x-portable-anymap',
|
||||
'application/x-world-x-3dmf',
|
||||
'image/bmp',
|
||||
'image/c',
|
||||
'image/cgm',
|
||||
'image/fif',
|
||||
'image/gif',
|
||||
'image/jpeg',
|
||||
'image/jpm',
|
||||
'image/jpx',
|
||||
'image/jp2',
|
||||
'image/naplps',
|
||||
'image/pjpeg',
|
||||
'image/png',
|
||||
'image/svg',
|
||||
'image/svg+xml',
|
||||
'image/tiff',
|
||||
'image/vnd.adobe.photoshop',
|
||||
'image/vnd.djvu',
|
||||
'image/vnd.fpx',
|
||||
'image/vnd.net-fpx',
|
||||
'image/x-cmu-raster',
|
||||
'image/x-cmx',
|
||||
'image/x-coreldraw',
|
||||
'image/x-cpi',
|
||||
'image/x-emf',
|
||||
'image/x-ico',
|
||||
'image/x-icon',
|
||||
'image/x-jg',
|
||||
'image/x-ms-bmp',
|
||||
'image/x-niff',
|
||||
'image/x-pict',
|
||||
'image/x-pcx',
|
||||
'image/x-portable-anymap',
|
||||
'image/x-portable-bitmap',
|
||||
'image/x-portable-greymap',
|
||||
'image/x-portable-pixmap',
|
||||
'image/x-quicktime',
|
||||
'image/x-rgb',
|
||||
'image/x-tiff',
|
||||
'image/x-unknown',
|
||||
'image/x-windows-bmp',
|
||||
'image/x-xpmi',
|
||||
);
|
||||
|
||||
if (is_array($mimetype)) {
|
||||
$temp = $mimetype;
|
||||
if (array_key_exists('magicfile', $temp)) {
|
||||
unset($temp['magicfile']);
|
||||
}
|
||||
|
||||
if (array_key_exists('headerCheck', $temp)) {
|
||||
unset($temp['headerCheck']);
|
||||
}
|
||||
|
||||
if (empty($temp)) {
|
||||
$mimetype += $default;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($mimetype)) {
|
||||
$mimetype = $default;
|
||||
}
|
||||
|
||||
parent::__construct($mimetype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
* Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
$this->_value = $file['name'];
|
||||
switch($errorType) {
|
||||
case Zend_Validate_File_MimeType::FALSE_TYPE :
|
||||
$errorType = self::FALSE_TYPE;
|
||||
break;
|
||||
case Zend_Validate_File_MimeType::NOT_DETECTED :
|
||||
$errorType = self::NOT_DETECTED;
|
||||
break;
|
||||
case Zend_Validate_File_MimeType::NOT_READABLE :
|
||||
$errorType = self::NOT_READABLE;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
183
airtime_mvc/library/Zend/Validate/File/Md5.php
Normal file
183
airtime_mvc/library/Zend/Validate/File/Md5.php
Normal file
|
@ -0,0 +1,183 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Md5.php 20442 2010-01-20 15:15:40Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Hash
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Hash.php';
|
||||
|
||||
/**
|
||||
* Validator for the md5 hash of given files
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_NOT_MATCH = 'fileMd5DoesNotMatch';
|
||||
const NOT_DETECTED = 'fileMd5NotDetected';
|
||||
const NOT_FOUND = 'fileMd5NotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_NOT_MATCH => "File '%value%' does not match the given md5 hashes",
|
||||
self::NOT_DETECTED => "A md5 hash could not be evaluated for the given file",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash of the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_hash;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* $hash is the hash we accept for the file $file
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_scalar($options)) {
|
||||
$options = array('hash1' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$this->setMd5($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set md5 hashes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMd5()
|
||||
{
|
||||
return $this->getHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the md5 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @param string $algorithm (Deprecated) Algorithm to use, fixed to md5
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = (array) $options;
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'md5';
|
||||
parent::setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the md5 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setMd5($options)
|
||||
{
|
||||
$this->setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the md5 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @param string $algorithm (Deprecated) Algorithm to use, fixed to md5
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = (array) $options;
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'md5';
|
||||
parent::addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the md5 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addMd5($options)
|
||||
{
|
||||
$this->addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the given file confirms the set hash
|
||||
*
|
||||
* @param string $value Filename to check for hash
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
$hashes = array_unique(array_keys($this->_hash));
|
||||
$filehash = hash_file('md5', $value);
|
||||
if ($filehash === false) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
foreach($hashes as $hash) {
|
||||
if ($filehash === $hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::DOES_NOT_MATCH);
|
||||
}
|
||||
}
|
393
airtime_mvc/library/Zend/Validate/File/MimeType.php
Normal file
393
airtime_mvc/library/Zend/Validate/File/MimeType.php
Normal file
|
@ -0,0 +1,393 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MimeType.php 21472 2010-03-11 22:16:55Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the mime type of a file
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
|
||||
{
|
||||
/**#@+
|
||||
* @const Error type constants
|
||||
*/
|
||||
const FALSE_TYPE = 'fileMimeTypeFalse';
|
||||
const NOT_DETECTED = 'fileMimeTypeNotDetected';
|
||||
const NOT_READABLE = 'fileMimeTypeNotReadable';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::FALSE_TYPE => "File '%value%' has a false mimetype of '%type%'",
|
||||
self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
|
||||
self::NOT_READABLE => "File '%value%' can not be read",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'type' => '_type'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_type;
|
||||
|
||||
/**
|
||||
* Mimetypes
|
||||
*
|
||||
* If null, there is no mimetype
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_mimetype;
|
||||
|
||||
/**
|
||||
* Magicfile to use
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_magicfile;
|
||||
|
||||
/**
|
||||
* Finfo object to use
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
protected $_finfo;
|
||||
|
||||
/**
|
||||
* If no $_ENV['MAGIC'] is set, try and autodiscover it based on common locations
|
||||
* @var array
|
||||
*/
|
||||
protected $_magicFiles = array(
|
||||
'/usr/share/misc/magic',
|
||||
'/usr/share/misc/magic.mime',
|
||||
'/usr/share/misc/magic.mgc',
|
||||
'/usr/share/mime/magic',
|
||||
'/usr/share/mime/magic.mime',
|
||||
'/usr/share/mime/magic.mgc',
|
||||
'/usr/share/file/magic',
|
||||
'/usr/share/file/magic.mime',
|
||||
'/usr/share/file/magic.mgc',
|
||||
);
|
||||
|
||||
/**
|
||||
* Option to allow header check
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_headerCheck = false;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* Mimetype to accept
|
||||
*
|
||||
* @param string|array $mimetype MimeType
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($mimetype)
|
||||
{
|
||||
if ($mimetype instanceof Zend_Config) {
|
||||
$mimetype = $mimetype->toArray();
|
||||
} elseif (is_string($mimetype)) {
|
||||
$mimetype = explode(',', $mimetype);
|
||||
} elseif (!is_array($mimetype)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Invalid options to validator provided");
|
||||
}
|
||||
|
||||
if (isset($mimetype['magicfile'])) {
|
||||
$this->setMagicFile($mimetype['magicfile']);
|
||||
unset($mimetype['magicfile']);
|
||||
}
|
||||
|
||||
if (isset($mimetype['headerCheck'])) {
|
||||
$this->enableHeaderCheck($mimetype['headerCheck']);
|
||||
unset($mimetype['headerCheck']);
|
||||
}
|
||||
|
||||
$this->setMimeType($mimetype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the actual set magicfile
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMagicFile()
|
||||
{
|
||||
if (null === $this->_magicfile) {
|
||||
if (!empty($_ENV['MAGIC'])) {
|
||||
$this->setMagicFile($_ENV['MAGIC']);
|
||||
} elseif (!(@ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
foreach ($this->_magicFiles as $file) {
|
||||
// supressing errors which are thrown due to openbase_dir restrictions
|
||||
try {
|
||||
$this->setMagicFile($file);
|
||||
if ($this->_magicfile !== null) {
|
||||
break;
|
||||
}
|
||||
} catch (Zend_Validate_Exception $e) {
|
||||
// Intentionally, catch and fall through
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->_magicfile === null) {
|
||||
$this->_magicfile = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_magicfile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the magicfile to use
|
||||
* if null, the MAGIC constant from php is used
|
||||
* if the MAGIC file is errorous, no file will be set
|
||||
*
|
||||
* @param string $file
|
||||
* @throws Zend_Validate_Exception When finfo can not read the magicfile
|
||||
* @return Zend_Validate_File_MimeType Provides fluid interface
|
||||
*/
|
||||
public function setMagicFile($file)
|
||||
{
|
||||
if (empty($file)) {
|
||||
$this->_magicfile = null;
|
||||
} else if (!(class_exists('finfo', false))) {
|
||||
$this->_magicfile = null;
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
|
||||
} else if (!is_readable($file)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('The given magicfile can not be read');
|
||||
} else {
|
||||
$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
|
||||
$this->_finfo = @finfo_open($const, $file);
|
||||
if ($this->_finfo === false) {
|
||||
$this->_finfo = null;
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('The given magicfile is not accepted by finfo');
|
||||
} else {
|
||||
$this->_magicfile = $file;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Header Check option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getHeaderCheck()
|
||||
{
|
||||
return $this->_headerCheck;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines if the http header should be used
|
||||
* Note that this is unsave and therefor the default value is false
|
||||
*
|
||||
* @param boolean $checkHeader
|
||||
* @return Zend_Validate_File_MimeType Provides fluid interface
|
||||
*/
|
||||
public function enableHeaderCheck($headerCheck = true)
|
||||
{
|
||||
$this->_headerCheck = (boolean) $headerCheck;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set mimetypes
|
||||
*
|
||||
* @param boolean $asArray Returns the values as array, when false an concated string is returned
|
||||
* @return string|array
|
||||
*/
|
||||
public function getMimeType($asArray = false)
|
||||
{
|
||||
$asArray = (bool) $asArray;
|
||||
$mimetype = (string) $this->_mimetype;
|
||||
if ($asArray) {
|
||||
$mimetype = explode(',', $mimetype);
|
||||
}
|
||||
|
||||
return $mimetype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mimetypes
|
||||
*
|
||||
* @param string|array $mimetype The mimetypes to validate
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function setMimeType($mimetype)
|
||||
{
|
||||
$this->_mimetype = null;
|
||||
$this->addMimeType($mimetype);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the mimetypes
|
||||
*
|
||||
* @param string|array $mimetype The mimetypes to add for validation
|
||||
* @return Zend_Validate_File_Extension Provides a fluent interface
|
||||
*/
|
||||
public function addMimeType($mimetype)
|
||||
{
|
||||
$mimetypes = $this->getMimeType(true);
|
||||
|
||||
if (is_string($mimetype)) {
|
||||
$mimetype = explode(',', $mimetype);
|
||||
} elseif (!is_array($mimetype)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Invalid options to validator provided");
|
||||
}
|
||||
|
||||
if (isset($mimetype['magicfile'])) {
|
||||
unset($mimetype['magicfile']);
|
||||
}
|
||||
|
||||
foreach ($mimetype as $content) {
|
||||
if (empty($content) || !is_string($content)) {
|
||||
continue;
|
||||
}
|
||||
$mimetypes[] = trim($content);
|
||||
}
|
||||
$mimetypes = array_unique($mimetypes);
|
||||
|
||||
// Sanity check to ensure no empty values
|
||||
foreach ($mimetypes as $key => $mt) {
|
||||
if (empty($mt)) {
|
||||
unset($mimetypes[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_mimetype = implode(',', $mimetypes);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if the mimetype of the file matches the given ones. Also parts
|
||||
* of mimetypes can be checked. If you give for example "image" all image
|
||||
* mime types will be accepted like "image/gif", "image/jpeg" and so on.
|
||||
*
|
||||
* @param string $value Real file to check for mimetype
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
if ($file === null) {
|
||||
$file = array(
|
||||
'type' => null,
|
||||
'name' => $value
|
||||
);
|
||||
}
|
||||
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_READABLE);
|
||||
}
|
||||
|
||||
$mimefile = $this->getMagicFile();
|
||||
if (class_exists('finfo', false)) {
|
||||
$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
|
||||
if (!empty($mimefile) && !empty($this->_finfo)) {
|
||||
$this->_finfo = @finfo_open($const, $mimefile);
|
||||
}
|
||||
|
||||
if ($this->_finfo === false) {
|
||||
$this->_finfo = @finfo_open($const);
|
||||
}
|
||||
|
||||
if ($this->_finfo !== false) {
|
||||
$this->_type = finfo_file($this->_finfo, $value);
|
||||
}
|
||||
|
||||
unset($this->_finfo);
|
||||
}
|
||||
|
||||
if (empty($this->_type) &&
|
||||
(function_exists('mime_content_type') && ini_get('mime_magic.magicfile'))) {
|
||||
$this->_type = mime_content_type($value);
|
||||
}
|
||||
|
||||
if (empty($this->_type) && $this->_headerCheck) {
|
||||
$this->_type = $file['type'];
|
||||
}
|
||||
|
||||
if (empty($this->_type)) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
$mimetype = $this->getMimeType(true);
|
||||
if (in_array($this->_type, $mimetype)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$types = explode('/', $this->_type);
|
||||
$types = array_merge($types, explode('-', $this->_type));
|
||||
$types = array_merge($types, explode(';', $this->_type));
|
||||
foreach($mimetype as $mime) {
|
||||
if (in_array($mime, $types)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::FALSE_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
$this->_value = $file['name'];
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
84
airtime_mvc/library/Zend/Validate/File/NotExists.php
Normal file
84
airtime_mvc/library/Zend/Validate/File/NotExists.php
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: NotExists.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Exists
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Exists.php';
|
||||
|
||||
/**
|
||||
* Validator which checks if the destination file does not exist
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_NotExists extends Zend_Validate_File_Exists
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_EXIST = 'fileNotExistsDoesExist';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_EXIST => "File '%value%' exists",
|
||||
);
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the file does not exist in the set destinations
|
||||
*
|
||||
* @param string $value Real file to check for
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
$directories = $this->getDirectory(true);
|
||||
if (($file !== null) and (!empty($file['destination']))) {
|
||||
$directories[] = $file['destination'];
|
||||
} else if (!isset($file['name'])) {
|
||||
$file['name'] = $value;
|
||||
}
|
||||
|
||||
foreach ($directories as $directory) {
|
||||
if (empty($directory)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$check = true;
|
||||
if (file_exists($directory . DIRECTORY_SEPARATOR . $file['name'])) {
|
||||
return $this->_throw($file, self::DOES_EXIST);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($check)) {
|
||||
return $this->_throw($file, self::DOES_EXIST);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
181
airtime_mvc/library/Zend/Validate/File/Sha1.php
Normal file
181
airtime_mvc/library/Zend/Validate/File/Sha1.php
Normal file
|
@ -0,0 +1,181 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Sha1.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Hash
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Hash.php';
|
||||
|
||||
/**
|
||||
* Validator for the sha1 hash of given files
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash
|
||||
{
|
||||
/**
|
||||
* @const string Error constants
|
||||
*/
|
||||
const DOES_NOT_MATCH = 'fileSha1DoesNotMatch';
|
||||
const NOT_DETECTED = 'fileSha1NotDetected';
|
||||
const NOT_FOUND = 'fileSha1NotFound';
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::DOES_NOT_MATCH => "File '%value%' does not match the given sha1 hashes",
|
||||
self::NOT_DETECTED => "A sha1 hash could not be evaluated for the given file",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Hash of the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_hash;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* $hash is the hash we accept for the file $file
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_scalar($options)) {
|
||||
$options = array('hash1' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$this->setHash($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set sha1 hashes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSha1()
|
||||
{
|
||||
return $this->getHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sha1 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = (array) $options;
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'sha1';
|
||||
parent::setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sha1 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function setSha1($options)
|
||||
{
|
||||
$this->setHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the sha1 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addHash($options)
|
||||
{
|
||||
if (!is_array($options)) {
|
||||
$options = (array) $options;
|
||||
}
|
||||
|
||||
$options['algorithm'] = 'sha1';
|
||||
parent::addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the sha1 hash for one or multiple files
|
||||
*
|
||||
* @param string|array $options
|
||||
* @return Zend_Validate_File_Hash Provides a fluent interface
|
||||
*/
|
||||
public function addSha1($options)
|
||||
{
|
||||
$this->addHash($options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the given file confirms the set hash
|
||||
*
|
||||
* @param string $value Filename to check for hash
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
$hashes = array_unique(array_keys($this->_hash));
|
||||
$filehash = hash_file('sha1', $value);
|
||||
if ($filehash === false) {
|
||||
return $this->_throw($file, self::NOT_DETECTED);
|
||||
}
|
||||
|
||||
foreach ($hashes as $hash) {
|
||||
if ($filehash === $hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_throw($file, self::DOES_NOT_MATCH);
|
||||
}
|
||||
}
|
404
airtime_mvc/library/Zend/Validate/File/Size.php
Normal file
404
airtime_mvc/library/Zend/Validate/File/Size.php
Normal file
|
@ -0,0 +1,404 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Size.php 20455 2010-01-20 22:54:18Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the maximum size of a file up to a max of 2GB
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Size extends Zend_Validate_Abstract
|
||||
{
|
||||
/**#@+
|
||||
* @const string Error constants
|
||||
*/
|
||||
const TOO_BIG = 'fileSizeTooBig';
|
||||
const TOO_SMALL = 'fileSizeTooSmall';
|
||||
const NOT_FOUND = 'fileSizeNotFound';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::TOO_BIG => "Maximum allowed size for file '%value%' is '%max%' but '%size%' detected",
|
||||
self::TOO_SMALL => "Minimum expected size for file '%value%' is '%min%' but '%size%' detected",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Error message template variables
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'min' => '_min',
|
||||
'max' => '_max',
|
||||
'size' => '_size',
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum filesize
|
||||
* @var integer
|
||||
*/
|
||||
protected $_min;
|
||||
|
||||
/**
|
||||
* Maximum filesize
|
||||
*
|
||||
* If null, there is no maximum filesize
|
||||
*
|
||||
* @var integer|null
|
||||
*/
|
||||
protected $_max;
|
||||
|
||||
/**
|
||||
* Detected size
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_size;
|
||||
|
||||
/**
|
||||
* Use bytestring ?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_useByteString = true;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* If $options is a integer, it will be used as maximum filesize
|
||||
* As Array is accepts the following keys:
|
||||
* 'min': Minimum filesize
|
||||
* 'max': Maximum filesize
|
||||
* 'bytestring': Use bytestring or real size for messages
|
||||
*
|
||||
* @param integer|array $options Options for the adapter
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} elseif (is_string($options) || is_numeric($options)) {
|
||||
$options = array('max' => $options);
|
||||
} elseif (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
$argv = func_get_args();
|
||||
array_shift($argv);
|
||||
$options['max'] = array_shift($argv);
|
||||
if (!empty($argv)) {
|
||||
$options['bytestring'] = array_shift($argv);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['bytestring'])) {
|
||||
$this->setUseByteString($options['bytestring']);
|
||||
}
|
||||
|
||||
if (isset($options['min'])) {
|
||||
$this->setMin($options['min']);
|
||||
}
|
||||
|
||||
if (isset($options['max'])) {
|
||||
$this->setMax($options['max']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum filesize
|
||||
*
|
||||
* @param boolean $byteString Use bytestring ?
|
||||
* @return integer
|
||||
*/
|
||||
public function setUseByteString($byteString = true)
|
||||
{
|
||||
$this->_useByteString = (bool) $byteString;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will bytestring be used?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function useByteString()
|
||||
{
|
||||
return $this->_useByteString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum filesize
|
||||
*
|
||||
* @param bool $raw Whether or not to force return of the raw value (defaults off)
|
||||
* @return integer|string
|
||||
*/
|
||||
public function getMin($raw = false)
|
||||
{
|
||||
$min = $this->_min;
|
||||
if (!$raw && $this->useByteString()) {
|
||||
$min = $this->_toByteString($min);
|
||||
}
|
||||
|
||||
return $min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum filesize
|
||||
*
|
||||
* @param integer $min The minimum filesize
|
||||
* @throws Zend_Validate_Exception When min is greater than max
|
||||
* @return Zend_Validate_File_Size Provides a fluent interface
|
||||
*/
|
||||
public function setMin($min)
|
||||
{
|
||||
if (!is_string($min) and !is_numeric($min)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$min = (integer) $this->_fromByteString($min);
|
||||
$max = $this->getMax(true);
|
||||
if (($max !== null) && ($min > $max)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum filesize, but $min >"
|
||||
. " $max");
|
||||
}
|
||||
|
||||
$this->_min = $min;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum filesize
|
||||
*
|
||||
* @param bool $raw Whether or not to force return of the raw value (defaults off)
|
||||
* @return integer|string
|
||||
*/
|
||||
public function getMax($raw = false)
|
||||
{
|
||||
$max = $this->_max;
|
||||
if (!$raw && $this->useByteString()) {
|
||||
$max = $this->_toByteString($max);
|
||||
}
|
||||
|
||||
return $max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum filesize
|
||||
*
|
||||
* @param integer $max The maximum filesize
|
||||
* @throws Zend_Validate_Exception When max is smaller than min
|
||||
* @return Zend_Validate_StringLength Provides a fluent interface
|
||||
*/
|
||||
public function setMax($max)
|
||||
{
|
||||
if (!is_string($max) && !is_numeric($max)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception ('Invalid options to validator provided');
|
||||
}
|
||||
|
||||
$max = (integer) $this->_fromByteString($max);
|
||||
$min = $this->getMin(true);
|
||||
if (($min !== null) && ($max < $min)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum filesize, but "
|
||||
. "$max < $min");
|
||||
}
|
||||
|
||||
$this->_max = $max;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve current detected file size
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function _getSize()
|
||||
{
|
||||
return $this->_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current size
|
||||
*
|
||||
* @param int $size
|
||||
* @return Zend_Validate_File_Size
|
||||
*/
|
||||
protected function _setSize($size)
|
||||
{
|
||||
$this->_size = $size;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the filesize of $value is at least min and
|
||||
* not bigger than max (when max is not null).
|
||||
*
|
||||
* @param string $value Real file to check for size
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
// limited to 4GB files
|
||||
$size = sprintf("%u", @filesize($value));
|
||||
$this->_size = $size;
|
||||
|
||||
// Check to see if it's smaller than min size
|
||||
$min = $this->getMin(true);
|
||||
$max = $this->getMax(true);
|
||||
if (($min !== null) && ($size < $min)) {
|
||||
if ($this->useByteString()) {
|
||||
$this->_min = $this->_toByteString($min);
|
||||
$this->_size = $this->_toByteString($size);
|
||||
$this->_throw($file, self::TOO_SMALL);
|
||||
$this->_min = $min;
|
||||
$this->_size = $size;
|
||||
} else {
|
||||
$this->_throw($file, self::TOO_SMALL);
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if it's larger than max size
|
||||
if (($max !== null) && ($max < $size)) {
|
||||
if ($this->useByteString()) {
|
||||
$this->_max = $this->_toByteString($max);
|
||||
$this->_size = $this->_toByteString($size);
|
||||
$this->_throw($file, self::TOO_BIG);
|
||||
$this->_max = $max;
|
||||
$this->_size = $size;
|
||||
} else {
|
||||
$this->_throw($file, self::TOO_BIG);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->_messages) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the formatted size
|
||||
*
|
||||
* @param integer $size
|
||||
* @return string
|
||||
*/
|
||||
protected function _toByteString($size)
|
||||
{
|
||||
$sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
for ($i=0; $size >= 1024 && $i < 9; $i++) {
|
||||
$size /= 1024;
|
||||
}
|
||||
|
||||
return round($size, 2) . $sizes[$i];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unformatted size
|
||||
*
|
||||
* @param string $size
|
||||
* @return integer
|
||||
*/
|
||||
protected function _fromByteString($size)
|
||||
{
|
||||
if (is_numeric($size)) {
|
||||
return (integer) $size;
|
||||
}
|
||||
|
||||
$type = trim(substr($size, -2, 1));
|
||||
|
||||
$value = substr($size, 0, -1);
|
||||
if (!is_numeric($value)) {
|
||||
$value = substr($value, 0, -1);
|
||||
}
|
||||
|
||||
switch (strtoupper($type)) {
|
||||
case 'Y':
|
||||
$value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'Z':
|
||||
$value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'E':
|
||||
$value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'P':
|
||||
$value *= (1024 * 1024 * 1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'T':
|
||||
$value *= (1024 * 1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'G':
|
||||
$value *= (1024 * 1024 * 1024);
|
||||
break;
|
||||
case 'M':
|
||||
$value *= (1024 * 1024);
|
||||
break;
|
||||
case 'K':
|
||||
$value *= 1024;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
245
airtime_mvc/library/Zend/Validate/File/Upload.php
Normal file
245
airtime_mvc/library/Zend/Validate/File/Upload.php
Normal file
|
@ -0,0 +1,245 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Upload.php 20431 2010-01-19 21:36:05Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validator for the maximum size of a file up to a max of 2GB
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_Upload extends Zend_Validate_Abstract
|
||||
{
|
||||
/**@#+
|
||||
* @const string Error constants
|
||||
*/
|
||||
const INI_SIZE = 'fileUploadErrorIniSize';
|
||||
const FORM_SIZE = 'fileUploadErrorFormSize';
|
||||
const PARTIAL = 'fileUploadErrorPartial';
|
||||
const NO_FILE = 'fileUploadErrorNoFile';
|
||||
const NO_TMP_DIR = 'fileUploadErrorNoTmpDir';
|
||||
const CANT_WRITE = 'fileUploadErrorCantWrite';
|
||||
const EXTENSION = 'fileUploadErrorExtension';
|
||||
const ATTACK = 'fileUploadErrorAttack';
|
||||
const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound';
|
||||
const UNKNOWN = 'fileUploadErrorUnknown';
|
||||
/**@#-*/
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INI_SIZE => "File '%value%' exceeds the defined ini size",
|
||||
self::FORM_SIZE => "File '%value%' exceeds the defined form size",
|
||||
self::PARTIAL => "File '%value%' was only partially uploaded",
|
||||
self::NO_FILE => "File '%value%' was not uploaded",
|
||||
self::NO_TMP_DIR => "No temporary directory was found for file '%value%'",
|
||||
self::CANT_WRITE => "File '%value%' can't be written",
|
||||
self::EXTENSION => "A PHP extension returned an error while uploading the file '%value%'",
|
||||
self::ATTACK => "File '%value%' was illegally uploaded. This could be a possible attack",
|
||||
self::FILE_NOT_FOUND => "File '%value%' was not found",
|
||||
self::UNKNOWN => "Unknown error while uploading file '%value%'"
|
||||
);
|
||||
|
||||
/**
|
||||
* Internal array of files
|
||||
* @var array
|
||||
*/
|
||||
protected $_files = array();
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* The array $files must be given in syntax of Zend_File_Transfer to be checked
|
||||
* If no files are given the $_FILES array will be used automatically.
|
||||
* NOTE: This validator will only work with HTTP POST uploads!
|
||||
*
|
||||
* @param array|Zend_Config $files Array of files in syntax of Zend_File_Transfer
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($files = array())
|
||||
{
|
||||
if ($files instanceof Zend_Config) {
|
||||
$files = $files->toArray();
|
||||
}
|
||||
|
||||
$this->setFiles($files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array of set files
|
||||
*
|
||||
* @param string $files (Optional) The file to return in detail
|
||||
* @return array
|
||||
* @throws Zend_Validate_Exception If file is not found
|
||||
*/
|
||||
public function getFiles($file = null)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$return = array();
|
||||
foreach ($this->_files as $name => $content) {
|
||||
if ($name === $file) {
|
||||
$return[$file] = $this->_files[$name];
|
||||
}
|
||||
|
||||
if ($content['name'] === $file) {
|
||||
$return[$name] = $this->_files[$name];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($return) === 0) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The file '$file' was not found");
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
return $this->_files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the files to be checked
|
||||
*
|
||||
* @param array $files The files to check in syntax of Zend_File_Transfer
|
||||
* @return Zend_Validate_File_Upload Provides a fluent interface
|
||||
*/
|
||||
public function setFiles($files = array())
|
||||
{
|
||||
if (count($files) === 0) {
|
||||
$this->_files = $_FILES;
|
||||
} else {
|
||||
$this->_files = $files;
|
||||
}
|
||||
|
||||
foreach($this->_files as $file => $content) {
|
||||
if (!isset($content['error'])) {
|
||||
unset($this->_files[$file]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the file was uploaded without errors
|
||||
*
|
||||
* @param string $value Single file to check for upload errors, when giving null the $_FILES array
|
||||
* from initialization will be used
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
if (array_key_exists($value, $this->_files)) {
|
||||
$files[$value] = $this->_files[$value];
|
||||
} else {
|
||||
foreach ($this->_files as $file => $content) {
|
||||
if (isset($content['name']) && ($content['name'] === $value)) {
|
||||
$files[$file] = $this->_files[$file];
|
||||
}
|
||||
|
||||
if (isset($content['tmp_name']) && ($content['tmp_name'] === $value)) {
|
||||
$files[$file] = $this->_files[$file];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($files)) {
|
||||
return $this->_throw($file, self::FILE_NOT_FOUND);
|
||||
}
|
||||
|
||||
foreach ($files as $file => $content) {
|
||||
$this->_value = $file;
|
||||
switch($content['error']) {
|
||||
case 0:
|
||||
if (!is_uploaded_file($content['tmp_name'])) {
|
||||
$this->_throw($file, self::ATTACK);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$this->_throw($file, self::INI_SIZE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$this->_throw($file, self::FORM_SIZE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$this->_throw($file, self::PARTIAL);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$this->_throw($file, self::NO_FILE);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$this->_throw($file, self::NO_TMP_DIR);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
$this->_throw($file, self::CANT_WRITE);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
$this->_throw($file, self::EXTENSION);
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->_throw($file, self::UNKNOWN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->_messages) > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
if (is_array($file) and !empty($file['name'])) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
101
airtime_mvc/library/Zend/Validate/File/WordCount.php
Normal file
101
airtime_mvc/library/Zend/Validate/File/WordCount.php
Normal file
|
@ -0,0 +1,101 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: WordCount.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_File_Count
|
||||
*/
|
||||
require_once 'Zend/Validate/File/Count.php';
|
||||
|
||||
/**
|
||||
* Validator for counting all words in a file
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_File_WordCount extends Zend_Validate_File_Count
|
||||
{
|
||||
/**#@+
|
||||
* @const string Error constants
|
||||
*/
|
||||
const TOO_MUCH = 'fileWordCountTooMuch';
|
||||
const TOO_LESS = 'fileWordCountTooLess';
|
||||
const NOT_FOUND = 'fileWordCountNotFound';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* @var array Error message templates
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::TOO_MUCH => "Too much words, maximum '%max%' are allowed but '%count%' were counted",
|
||||
self::TOO_LESS => "Too less words, minimum '%min%' are expected but '%count%' were counted",
|
||||
self::NOT_FOUND => "File '%value%' could not be found",
|
||||
);
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the counted words are at least min and
|
||||
* not bigger than max (when max is not null).
|
||||
*
|
||||
* @param string $value Filename to check for word count
|
||||
* @param array $file File data from Zend_File_Transfer
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value, $file = null)
|
||||
{
|
||||
// Is file readable ?
|
||||
require_once 'Zend/Loader.php';
|
||||
if (!Zend_Loader::isReadable($value)) {
|
||||
return $this->_throw($file, self::NOT_FOUND);
|
||||
}
|
||||
|
||||
$content = file_get_contents($value);
|
||||
$this->_count = str_word_count($content);
|
||||
if (($this->_max !== null) && ($this->_count > $this->_max)) {
|
||||
return $this->_throw($file, self::TOO_MUCH);
|
||||
}
|
||||
|
||||
if (($this->_min !== null) && ($this->_count < $this->_min)) {
|
||||
return $this->_throw($file, self::TOO_LESS);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error of the given type
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $errorType
|
||||
* @return false
|
||||
*/
|
||||
protected function _throw($file, $errorType)
|
||||
{
|
||||
if ($file !== null) {
|
||||
$this->_value = $file['name'];
|
||||
}
|
||||
|
||||
$this->_error($errorType);
|
||||
return false;
|
||||
}
|
||||
}
|
134
airtime_mvc/library/Zend/Validate/Float.php
Normal file
134
airtime_mvc/library/Zend/Validate/Float.php
Normal file
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Float.php 21664 2010-03-27 21:39:38Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Locale_Format
|
||||
*/
|
||||
require_once 'Zend/Locale/Format.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Float extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'floatInvalid';
|
||||
const NOT_FLOAT = 'notFloat';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be float, string, or integer",
|
||||
self::NOT_FLOAT => "'%value%' does not appear to be a float",
|
||||
);
|
||||
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* Constructor for the float validator
|
||||
*
|
||||
* @param string|Zend_Config|Zend_Locale $locale
|
||||
*/
|
||||
public function __construct($locale = null)
|
||||
{
|
||||
if ($locale instanceof Zend_Config) {
|
||||
$locale = $locale->toArray();
|
||||
}
|
||||
|
||||
if (is_array($locale)) {
|
||||
if (array_key_exists('locale', $locale)) {
|
||||
$locale = $locale['locale'];
|
||||
} else {
|
||||
$locale = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($locale)) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale')) {
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
}
|
||||
}
|
||||
|
||||
$this->setLocale($locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set locale
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->_locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the locale to use
|
||||
*
|
||||
* @param string|Zend_Locale $locale
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
require_once 'Zend/Locale.php';
|
||||
$this->_locale = Zend_Locale::findLocale($locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is a floating-point value
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_float($value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
try {
|
||||
if (!Zend_Locale_Format::isFloat($value, array('locale' => $this->_locale))) {
|
||||
$this->_error(self::NOT_FLOAT);
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Locale_Exception $e) {
|
||||
$this->_error(self::NOT_FLOAT);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
124
airtime_mvc/library/Zend/Validate/GreaterThan.php
Normal file
124
airtime_mvc/library/Zend/Validate/GreaterThan.php
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: GreaterThan.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_GreaterThan extends Zend_Validate_Abstract
|
||||
{
|
||||
|
||||
const NOT_GREATER = 'notGreaterThan';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_GREATER => "'%value%' is not greater than '%min%'",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'min' => '_min'
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum value
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_min;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param mixed|Zend_Config $min
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($min)
|
||||
{
|
||||
if ($min instanceof Zend_Config) {
|
||||
$min = $min->toArray();
|
||||
}
|
||||
|
||||
if (is_array($min)) {
|
||||
if (array_key_exists('min', $min)) {
|
||||
$min = $min['min'];
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Missing option 'min'");
|
||||
}
|
||||
}
|
||||
|
||||
$this->setMin($min);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min option
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMin()
|
||||
{
|
||||
return $this->_min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min option
|
||||
*
|
||||
* @param mixed $min
|
||||
* @return Zend_Validate_GreaterThan Provides a fluent interface
|
||||
*/
|
||||
public function setMin($min)
|
||||
{
|
||||
$this->_min = $min;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is greater than min option
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
if ($this->_min >= $value) {
|
||||
$this->_error(self::NOT_GREATER);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
72
airtime_mvc/library/Zend/Validate/Hex.php
Normal file
72
airtime_mvc/library/Zend/Validate/Hex.php
Normal file
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Hex.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Hex extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'hexInvalid';
|
||||
const NOT_HEX = 'notHex';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::NOT_HEX => "'%value%' has not only hexadecimal digit characters",
|
||||
);
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value contains only hexadecimal digit characters
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
if (!ctype_xdigit((string) $value)) {
|
||||
$this->_error(self::NOT_HEX);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
740
airtime_mvc/library/Zend/Validate/Hostname.php
Normal file
740
airtime_mvc/library/Zend/Validate/Hostname.php
Normal file
|
@ -0,0 +1,740 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Hostname.php 21063 2010-02-15 23:00:17Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Ip
|
||||
*/
|
||||
require_once 'Zend/Validate/Ip.php';
|
||||
|
||||
/**
|
||||
* Please note there are two standalone test scripts for testing IDN characters due to problems
|
||||
* with file encoding.
|
||||
*
|
||||
* The first is tests/Zend/Validate/HostnameTestStandalone.php which is designed to be run on
|
||||
* the command line.
|
||||
*
|
||||
* The second is tests/Zend/Validate/HostnameTestForm.php which is designed to be run via HTML
|
||||
* to allow users to test entering UTF-8 characters in a form.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Hostname extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'hostnameInvalid';
|
||||
const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed';
|
||||
const UNKNOWN_TLD = 'hostnameUnknownTld';
|
||||
const INVALID_DASH = 'hostnameDashCharacter';
|
||||
const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema';
|
||||
const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld';
|
||||
const INVALID_HOSTNAME = 'hostnameInvalidHostname';
|
||||
const INVALID_LOCAL_NAME = 'hostnameInvalidLocalName';
|
||||
const LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed';
|
||||
const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed",
|
||||
self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list",
|
||||
self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position",
|
||||
self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'",
|
||||
self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part",
|
||||
self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname",
|
||||
self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name",
|
||||
self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed",
|
||||
self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'tld' => '_tld'
|
||||
);
|
||||
|
||||
/**
|
||||
* Allows Internet domain names (e.g., example.com)
|
||||
*/
|
||||
const ALLOW_DNS = 1;
|
||||
|
||||
/**
|
||||
* Allows IP addresses
|
||||
*/
|
||||
const ALLOW_IP = 2;
|
||||
|
||||
/**
|
||||
* Allows local network names (e.g., localhost, www.localdomain)
|
||||
*/
|
||||
const ALLOW_LOCAL = 4;
|
||||
|
||||
/**
|
||||
* Allows all types of hostnames
|
||||
*/
|
||||
const ALLOW_ALL = 7;
|
||||
|
||||
/**
|
||||
* Array of valid top-level-domains
|
||||
*
|
||||
* @see ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
|
||||
* @see http://www.iana.org/domains/root/db/ Official list of supported TLDs
|
||||
* @var array
|
||||
*/
|
||||
protected $_validTlds = array(
|
||||
'ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa',
|
||||
'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi',
|
||||
'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc',
|
||||
'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu',
|
||||
'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er',
|
||||
'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg',
|
||||
'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk',
|
||||
'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq',
|
||||
'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp',
|
||||
'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly',
|
||||
'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp',
|
||||
'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc',
|
||||
'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe',
|
||||
'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're',
|
||||
'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl',
|
||||
'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th',
|
||||
'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'travel', 'tt', 'tv', 'tw', 'tz', 'ua',
|
||||
'ug', 'uk', 'um', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws',
|
||||
'ye', 'yt', 'yu', 'za', 'zm', 'zw'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_tld;
|
||||
|
||||
/**
|
||||
* Array for valid Idns
|
||||
* @see http://www.iana.org/domains/idn-tables/ Official list of supported IDN Chars
|
||||
* (.AC) Ascension Island http://www.nic.ac/pdf/AC-IDN-Policy.pdf
|
||||
* (.AR) Argentinia http://www.nic.ar/faqidn.html
|
||||
* (.AS) American Samoa http://www.nic.as/idn/chars.cfm
|
||||
* (.AT) Austria http://www.nic.at/en/service/technical_information/idn/charset_converter/
|
||||
* (.BIZ) International http://www.iana.org/domains/idn-tables/
|
||||
* (.BR) Brazil http://registro.br/faq/faq6.html
|
||||
* (.BV) Bouvett Island http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
|
||||
* (.CAT) Catalan http://www.iana.org/domains/idn-tables/tables/cat_ca_1.0.html
|
||||
* (.CH) Switzerland https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1
|
||||
* (.CL) Chile http://www.iana.org/domains/idn-tables/tables/cl_latn_1.0.html
|
||||
* (.COM) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html
|
||||
* (.DE) Germany http://www.denic.de/en/domains/idns/liste.html
|
||||
* (.DK) Danmark http://www.dk-hostmaster.dk/index.php?id=151
|
||||
* (.ES) Spain https://www.nic.es/media/2008-05/1210147705287.pdf
|
||||
* (.FI) Finland http://www.ficora.fi/en/index/palvelut/fiverkkotunnukset/aakkostenkaytto.html
|
||||
* (.GR) Greece https://grweb.ics.forth.gr/CharacterTable1_en.jsp
|
||||
* (.HU) Hungary http://www.domain.hu/domain/English/szabalyzat/szabalyzat.html
|
||||
* (.INFO) International http://www.nic.info/info/idn
|
||||
* (.IO) British Indian Ocean Territory http://www.nic.io/IO-IDN-Policy.pdf
|
||||
* (.IR) Iran http://www.nic.ir/Allowable_Characters_dot-iran
|
||||
* (.IS) Iceland http://www.isnic.is/domain/rules.php
|
||||
* (.KR) Korea http://www.iana.org/domains/idn-tables/tables/kr_ko-kr_1.0.html
|
||||
* (.LI) Liechtenstein https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1
|
||||
* (.LT) Lithuania http://www.domreg.lt/static/doc/public/idn_symbols-en.pdf
|
||||
* (.MD) Moldova http://www.register.md/
|
||||
* (.MUSEUM) International http://www.iana.org/domains/idn-tables/tables/museum_latn_1.0.html
|
||||
* (.NET) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html
|
||||
* (.NO) Norway http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
|
||||
* (.NU) Niue http://www.worldnames.net/
|
||||
* (.ORG) International http://www.pir.org/index.php?db=content/FAQs&tbl=FAQs_Registrant&id=2
|
||||
* (.PE) Peru https://www.nic.pe/nuevas_politicas_faq_2.php
|
||||
* (.PL) Poland http://www.dns.pl/IDN/allowed_character_sets.pdf
|
||||
* (.PR) Puerto Rico http://www.nic.pr/idn_rules.asp
|
||||
* (.PT) Portugal https://online.dns.pt/dns_2008/do?com=DS;8216320233;111;+PAGE(4000058)+K-CAT-CODIGO(C.125)+RCNT(100);
|
||||
* (.RU) Russia http://www.iana.org/domains/idn-tables/tables/ru_ru-ru_1.0.html
|
||||
* (.SA) Saudi Arabia http://www.iana.org/domains/idn-tables/tables/sa_ar_1.0.html
|
||||
* (.SE) Sweden http://www.iis.se/english/IDN_campaignsite.shtml?lang=en
|
||||
* (.SH) Saint Helena http://www.nic.sh/SH-IDN-Policy.pdf
|
||||
* (.SJ) Svalbard and Jan Mayen http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
|
||||
* (.TH) Thailand http://www.iana.org/domains/idn-tables/tables/th_th-th_1.0.html
|
||||
* (.TM) Turkmenistan http://www.nic.tm/TM-IDN-Policy.pdf
|
||||
* (.TR) Turkey https://www.nic.tr/index.php
|
||||
* (.VE) Venice http://www.iana.org/domains/idn-tables/tables/ve_es_1.0.html
|
||||
* (.VN) Vietnam http://www.vnnic.vn/english/5-6-300-2-2-04-20071115.htm#1.%20Introduction
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_validIdns = array(
|
||||
'AC' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
|
||||
'AR' => array(1 => '/^[\x{002d}0-9a-zà-ãç-êìíñ-õü]{1,63}$/iu'),
|
||||
'AS' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźż]{1,63}$/iu'),
|
||||
'AT' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœšž]{1,63}$/iu'),
|
||||
'BIZ' => 'Hostname/Biz.php',
|
||||
'BR' => array(1 => '/^[\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'),
|
||||
'BV' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
|
||||
'CAT' => array(1 => '/^[\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'),
|
||||
'CH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
|
||||
'CL' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
|
||||
'CN' => 'Hostname/Cn.php',
|
||||
'COM' => 'Zend/Validate/Hostname/Com.php',
|
||||
'DE' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
|
||||
'DK' => array(1 => '/^[\x{002d}0-9a-zäéöü]{1,63}$/iu'),
|
||||
'ES' => array(1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'),
|
||||
'EU' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
|
||||
2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
|
||||
3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu',
|
||||
4 => '/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu',
|
||||
5 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu',
|
||||
6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'),
|
||||
'FI' => array(1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'),
|
||||
'GR' => array(1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'),
|
||||
'HK' => 'Zend/Validate/Hostname/Cn.php',
|
||||
'HU' => array(1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'),
|
||||
'INFO'=> array(1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',
|
||||
2 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
|
||||
3 => '/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',
|
||||
4 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',
|
||||
5 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',
|
||||
6 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
|
||||
7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
|
||||
8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
|
||||
'IO' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
|
||||
'IS' => array(1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'),
|
||||
'JP' => 'Zend/Validate/Hostname/Jp.php',
|
||||
'KR' => array(1 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'),
|
||||
'LI' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
|
||||
'LT' => array(1 => '/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'),
|
||||
'MD' => array(1 => '/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'),
|
||||
'MUSEUM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'),
|
||||
'NET' => 'Zend/Validate/Hostname/Com.php',
|
||||
'NO' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
|
||||
'NU' => 'Zend/Validate/Hostname/Com.php',
|
||||
'ORG' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
|
||||
2 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
|
||||
3 => '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',
|
||||
4 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
|
||||
5 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
|
||||
6 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',
|
||||
7 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu'),
|
||||
'PE' => array(1 => '/^[\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'),
|
||||
'PL' => array(1 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',
|
||||
2 => '/^[\x{002d}а-ик-ш\x{0450}ѓѕјљњќџ]{1,63}$/iu',
|
||||
3 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',
|
||||
4 => '/^[\x{002d}0-9а-яё\x{04C2}]{1,63}$/iu',
|
||||
5 => '/^[\x{002d}0-9a-zàáâèéêìíîòóôùúûċġħż]{1,63}$/iu',
|
||||
6 => '/^[\x{002d}0-9a-zàäåæéêòóôöøü]{1,63}$/iu',
|
||||
7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
|
||||
8 => '/^[\x{002d}0-9a-zàáâãçéêíòóôõúü]{1,63}$/iu',
|
||||
9 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',
|
||||
10=> '/^[\x{002d}0-9a-záäéíóôúýčďĺľňŕšťž]{1,63}$/iu',
|
||||
11=> '/^[\x{002d}0-9a-zçë]{1,63}$/iu',
|
||||
12=> '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu',
|
||||
13=> '/^[\x{002d}0-9a-zćčđšž]{1,63}$/iu',
|
||||
14=> '/^[\x{002d}0-9a-zâçöûüğış]{1,63}$/iu',
|
||||
15=> '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
|
||||
16=> '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu',
|
||||
17=> '/^[\x{002d}0-9a-zĉĝĥĵŝŭ]{1,63}$/iu',
|
||||
18=> '/^[\x{002d}0-9a-zâäéëîô]{1,63}$/iu',
|
||||
19=> '/^[\x{002d}0-9a-zàáâäåæçèéêëìíîïðñòôöøùúûüýćčłńřśš]{1,63}$/iu',
|
||||
20=> '/^[\x{002d}0-9a-zäåæõöøüšž]{1,63}$/iu',
|
||||
21=> '/^[\x{002d}0-9a-zàáçèéìíòóùú]{1,63}$/iu',
|
||||
22=> '/^[\x{002d}0-9a-zàáéíóöúüőű]{1,63}$/iu',
|
||||
23=> '/^[\x{002d}0-9ΐά-ώ]{1,63}$/iu',
|
||||
24=> '/^[\x{002d}0-9a-zàáâåæçèéêëðóôöøüþœ]{1,63}$/iu',
|
||||
25=> '/^[\x{002d}0-9a-záäéíóöúüýčďěňřšťůž]{1,63}$/iu',
|
||||
26=> '/^[\x{002d}0-9a-z·àçèéíïòóúü]{1,63}$/iu',
|
||||
27=> '/^[\x{002d}0-9а-ъьюя\x{0450}\x{045D}]{1,63}$/iu',
|
||||
28=> '/^[\x{002d}0-9а-яёіў]{1,63}$/iu',
|
||||
29=> '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
|
||||
30=> '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',
|
||||
31=> '/^[\x{002d}0-9a-zàâæçèéêëîïñôùûüÿœ]{1,63}$/iu',
|
||||
32=> '/^[\x{002d}0-9а-щъыьэюяёєіїґ]{1,63}$/iu',
|
||||
33=> '/^[\x{002d}0-9א-ת]{1,63}$/iu'),
|
||||
'PR' => array(1 => '/^[\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'),
|
||||
'PT' => array(1 => '/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'),
|
||||
'RU' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'),
|
||||
'SA' => array(1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'),
|
||||
'SE' => array(1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'),
|
||||
'SH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
|
||||
'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
|
||||
'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
|
||||
'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
|
||||
'TW' => 'Zend/Validate/Hostname/Cn.php',
|
||||
'TR' => array(1 => '/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'),
|
||||
'VE' => array(1 => '/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'),
|
||||
'VN' => array(1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'),
|
||||
'ایران' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
|
||||
'中国' => 'Zend/Validate/Hostname/Cn.php',
|
||||
'公司' => 'Zend/Validate/Hostname/Cn.php',
|
||||
'网络' => 'Zend/Validate/Hostname/Cn.php'
|
||||
);
|
||||
|
||||
protected $_idnLength = array(
|
||||
'BIZ' => array(5 => 17, 11 => 15, 12 => 20),
|
||||
'CN' => array(1 => 20),
|
||||
'COM' => array(3 => 17, 5 => 20),
|
||||
'HK' => array(1 => 15),
|
||||
'INFO'=> array(4 => 17),
|
||||
'KR' => array(1 => 17),
|
||||
'NET' => array(3 => 17, 5 => 20),
|
||||
'ORG' => array(6 => 17),
|
||||
'TW' => array(1 => 20),
|
||||
'ایران' => array(1 => 30),
|
||||
'中国' => array(1 => 20),
|
||||
'公司' => array(1 => 20),
|
||||
'网络' => array(1 => 20),
|
||||
);
|
||||
|
||||
protected $_options = array(
|
||||
'allow' => self::ALLOW_DNS,
|
||||
'idn' => true,
|
||||
'tld' => true,
|
||||
'ip' => null
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param integer $allow OPTIONAL Set what types of hostname to allow (default ALLOW_DNS)
|
||||
* @param boolean $validateIdn OPTIONAL Set whether IDN domains are validated (default true)
|
||||
* @param boolean $validateTld OPTIONAL Set whether the TLD element of a hostname is validated (default true)
|
||||
* @param Zend_Validate_Ip $ipValidator OPTIONAL
|
||||
* @return void
|
||||
* @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm Technical Specifications for ccTLDs
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['allow'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['idn'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['tld'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['ip'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
$options += $this->_options;
|
||||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set options
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the options for this validator
|
||||
*
|
||||
* @param array $options
|
||||
* @return Zend_Validate_Hostname
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
if (array_key_exists('allow', $options)) {
|
||||
$this->setAllow($options['allow']);
|
||||
}
|
||||
|
||||
if (array_key_exists('idn', $options)) {
|
||||
$this->setValidateIdn($options['idn']);
|
||||
}
|
||||
|
||||
if (array_key_exists('tld', $options)) {
|
||||
$this->setValidateTld($options['tld']);
|
||||
}
|
||||
|
||||
if (array_key_exists('ip', $options)) {
|
||||
$this->setIpValidator($options['ip']);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set ip validator
|
||||
*
|
||||
* @return Zend_Validate_Ip
|
||||
*/
|
||||
public function getIpValidator()
|
||||
{
|
||||
return $this->_options['ip'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Validate_Ip $ipValidator OPTIONAL
|
||||
* @return void;
|
||||
*/
|
||||
public function setIpValidator(Zend_Validate_Ip $ipValidator = null)
|
||||
{
|
||||
if ($ipValidator === null) {
|
||||
$ipValidator = new Zend_Validate_Ip();
|
||||
}
|
||||
|
||||
$this->_options['ip'] = $ipValidator;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allow option
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getAllow()
|
||||
{
|
||||
return $this->_options['allow'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the allow option
|
||||
*
|
||||
* @param integer $allow
|
||||
* @return Zend_Validate_Hostname Provides a fluent interface
|
||||
*/
|
||||
public function setAllow($allow)
|
||||
{
|
||||
$this->_options['allow'] = $allow;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set idn option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getValidateIdn()
|
||||
{
|
||||
return $this->_options['idn'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether IDN domains are validated
|
||||
*
|
||||
* This only applies when DNS hostnames are validated
|
||||
*
|
||||
* @param boolean $allowed Set allowed to true to validate IDNs, and false to not validate them
|
||||
*/
|
||||
public function setValidateIdn ($allowed)
|
||||
{
|
||||
$this->_options['idn'] = (bool) $allowed;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set tld option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getValidateTld()
|
||||
{
|
||||
return $this->_options['tld'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the TLD element of a hostname is validated
|
||||
*
|
||||
* This only applies when DNS hostnames are validated
|
||||
*
|
||||
* @param boolean $allowed Set allowed to true to validate TLDs, and false to not validate them
|
||||
*/
|
||||
public function setValidateTld ($allowed)
|
||||
{
|
||||
$this->_options['tld'] = (bool) $allowed;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the $value is a valid hostname with respect to the current allow option
|
||||
*
|
||||
* @param string $value
|
||||
* @throws Zend_Validate_Exception if a fatal error occurs for validation process
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
// Check input against IP address schema
|
||||
if (preg_match('/^[0-9.a-e:.]*$/i', $value) &&
|
||||
$this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
|
||||
if (!($this->_options['allow'] & self::ALLOW_IP)) {
|
||||
$this->_error(self::IP_ADDRESS_NOT_ALLOWED);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check input against DNS hostname schema
|
||||
$domainParts = explode('.', $value);
|
||||
if ((count($domainParts) > 1) && (strlen($value) >= 4) && (strlen($value) <= 254)) {
|
||||
$status = false;
|
||||
|
||||
$origenc = iconv_get_encoding('internal_encoding');
|
||||
iconv_set_encoding('internal_encoding', 'UTF-8');
|
||||
do {
|
||||
// First check TLD
|
||||
$matches = array();
|
||||
if (preg_match('/([^.]{2,10})$/i', end($domainParts), $matches) ||
|
||||
(end($domainParts) == 'ایران') || (end($domainParts) == '中国') ||
|
||||
(end($domainParts) == '公司') || (end($domainParts) == '网络')) {
|
||||
|
||||
reset($domainParts);
|
||||
|
||||
// Hostname characters are: *(label dot)(label dot label); max 254 chars
|
||||
// label: id-prefix [*ldh{61} id-prefix]; max 63 chars
|
||||
// id-prefix: alpha / digit
|
||||
// ldh: alpha / digit / dash
|
||||
|
||||
// Match TLD against known list
|
||||
$this->_tld = strtolower($matches[1]);
|
||||
if ($this->_options['tld']) {
|
||||
if (!in_array($this->_tld, $this->_validTlds)) {
|
||||
$this->_error(self::UNKNOWN_TLD);
|
||||
$status = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Match against IDN hostnames
|
||||
* Note: Keep label regex short to avoid issues with long patterns when matching IDN hostnames
|
||||
* @see Zend_Validate_Hostname_Interface
|
||||
*/
|
||||
$regexChars = array(0 => '/^[a-z0-9\x2d]{1,63}$/i');
|
||||
if ($this->_options['idn'] && isset($this->_validIdns[strtoupper($this->_tld)])) {
|
||||
if (is_string($this->_validIdns[strtoupper($this->_tld)])) {
|
||||
$regexChars += include($this->_validIdns[strtoupper($this->_tld)]);
|
||||
} else {
|
||||
$regexChars += $this->_validIdns[strtoupper($this->_tld)];
|
||||
}
|
||||
}
|
||||
|
||||
// Check each hostname part
|
||||
$check = 0;
|
||||
foreach ($domainParts as $domainPart) {
|
||||
// Decode Punycode domainnames to IDN
|
||||
if (strpos($domainPart, 'xn--') === 0) {
|
||||
$domainPart = $this->decodePunycode(substr($domainPart, 4));
|
||||
if ($domainPart === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check dash (-) does not start, end or appear in 3rd and 4th positions
|
||||
if ((strpos($domainPart, '-') === 0)
|
||||
|| ((strlen($domainPart) > 2) && (strpos($domainPart, '-', 2) == 2) && (strpos($domainPart, '-', 3) == 3))
|
||||
|| (strpos($domainPart, '-') === (strlen($domainPart) - 1))) {
|
||||
$this->_error(self::INVALID_DASH);
|
||||
$status = false;
|
||||
break 2;
|
||||
}
|
||||
|
||||
// Check each domain part
|
||||
$checked = false;
|
||||
foreach($regexChars as $regexKey => $regexChar) {
|
||||
$status = @preg_match($regexChar, $domainPart);
|
||||
if ($status > 0) {
|
||||
$length = 63;
|
||||
if (array_key_exists(strtoupper($this->_tld), $this->_idnLength)
|
||||
&& (array_key_exists($regexKey, $this->_idnLength[strtoupper($this->_tld)]))) {
|
||||
$length = $this->_idnLength[strtoupper($this->_tld)];
|
||||
}
|
||||
|
||||
if (iconv_strlen($domainPart, 'UTF-8') > $length) {
|
||||
$this->_error(self::INVALID_HOSTNAME);
|
||||
} else {
|
||||
$checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($checked) {
|
||||
++$check;
|
||||
}
|
||||
}
|
||||
|
||||
// If one of the labels doesn't match, the hostname is invalid
|
||||
if ($check !== count($domainParts)) {
|
||||
$this->_error(self::INVALID_HOSTNAME_SCHEMA);
|
||||
$status = false;
|
||||
}
|
||||
} else {
|
||||
// Hostname not long enough
|
||||
$this->_error(self::UNDECIPHERABLE_TLD);
|
||||
$status = false;
|
||||
}
|
||||
} while (false);
|
||||
|
||||
iconv_set_encoding('internal_encoding', $origenc);
|
||||
// If the input passes as an Internet domain name, and domain names are allowed, then the hostname
|
||||
// passes validation
|
||||
if ($status && ($this->_options['allow'] & self::ALLOW_DNS)) {
|
||||
return true;
|
||||
}
|
||||
} else if ($this->_options['allow'] & self::ALLOW_DNS) {
|
||||
$this->_error(self::INVALID_HOSTNAME);
|
||||
}
|
||||
|
||||
// Check input against local network name schema; last chance to pass validation
|
||||
$regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}){1,254}$/';
|
||||
$status = @preg_match($regexLocal, $value);
|
||||
|
||||
// If the input passes as a local network name, and local network names are allowed, then the
|
||||
// hostname passes validation
|
||||
$allowLocal = $this->_options['allow'] & self::ALLOW_LOCAL;
|
||||
if ($status && $allowLocal) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the input does not pass as a local network name, add a message
|
||||
if (!$status) {
|
||||
$this->_error(self::INVALID_LOCAL_NAME);
|
||||
}
|
||||
|
||||
// If local network names are not allowed, add a message
|
||||
if ($status && !$allowLocal) {
|
||||
$this->_error(self::LOCAL_NAME_NOT_ALLOWED);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a punycode encoded string to it's original utf8 string
|
||||
* In case of a decoding failure the original string is returned
|
||||
*
|
||||
* @param string $encoded Punycode encoded string to decode
|
||||
* @return string
|
||||
*/
|
||||
protected function decodePunycode($encoded)
|
||||
{
|
||||
$found = preg_match('/([^a-z0-9\x2d]{1,10})$/i', $encoded);
|
||||
if (empty($encoded) || ($found > 0)) {
|
||||
// no punycode encoded string, return as is
|
||||
$this->_error(self::CANNOT_DECODE_PUNYCODE);
|
||||
return false;
|
||||
}
|
||||
|
||||
$separator = strrpos($encoded, '-');
|
||||
if ($separator > 0) {
|
||||
for ($x = 0; $x < $separator; ++$x) {
|
||||
// prepare decoding matrix
|
||||
$decoded[] = ord($encoded[$x]);
|
||||
}
|
||||
} else {
|
||||
$this->_error(self::CANNOT_DECODE_PUNYCODE);
|
||||
return false;
|
||||
}
|
||||
|
||||
$lengthd = count($decoded);
|
||||
$lengthe = strlen($encoded);
|
||||
|
||||
// decoding
|
||||
$init = true;
|
||||
$base = 72;
|
||||
$index = 0;
|
||||
$char = 0x80;
|
||||
|
||||
for ($indexe = ($separator) ? ($separator + 1) : 0; $indexe < $lengthe; ++$lengthd) {
|
||||
for ($old_index = $index, $pos = 1, $key = 36; 1 ; $key += 36) {
|
||||
$hex = ord($encoded[$indexe++]);
|
||||
$digit = ($hex - 48 < 10) ? $hex - 22
|
||||
: (($hex - 65 < 26) ? $hex - 65
|
||||
: (($hex - 97 < 26) ? $hex - 97
|
||||
: 36));
|
||||
|
||||
$index += $digit * $pos;
|
||||
$tag = ($key <= $base) ? 1 : (($key >= $base + 26) ? 26 : ($key - $base));
|
||||
if ($digit < $tag) {
|
||||
break;
|
||||
}
|
||||
|
||||
$pos = (int) ($pos * (36 - $tag));
|
||||
}
|
||||
|
||||
$delta = intval($init ? (($index - $old_index) / 700) : (($index - $old_index) / 2));
|
||||
$delta += intval($delta / ($lengthd + 1));
|
||||
for ($key = 0; $delta > 910 / 2; $key += 36) {
|
||||
$delta = intval($delta / 35);
|
||||
}
|
||||
|
||||
$base = intval($key + 36 * $delta / ($delta + 38));
|
||||
$init = false;
|
||||
$char += (int) ($index / ($lengthd + 1));
|
||||
$index %= ($lengthd + 1);
|
||||
if ($lengthd > 0) {
|
||||
for ($i = $lengthd; $i > $index; $i--) {
|
||||
$decoded[$i] = $decoded[($i - 1)];
|
||||
}
|
||||
}
|
||||
|
||||
$decoded[$index++] = $char;
|
||||
}
|
||||
|
||||
// convert decoded ucs4 to utf8 string
|
||||
foreach ($decoded as $key => $value) {
|
||||
if ($value < 128) {
|
||||
$decoded[$key] = chr($value);
|
||||
} elseif ($value < (1 << 11)) {
|
||||
$decoded[$key] = chr(192 + ($value >> 6));
|
||||
$decoded[$key] .= chr(128 + ($value & 63));
|
||||
} elseif ($value < (1 << 16)) {
|
||||
$decoded[$key] = chr(224 + ($value >> 12));
|
||||
$decoded[$key] .= chr(128 + (($value >> 6) & 63));
|
||||
$decoded[$key] .= chr(128 + ($value & 63));
|
||||
} elseif ($value < (1 << 21)) {
|
||||
$decoded[$key] = chr(240 + ($value >> 18));
|
||||
$decoded[$key] .= chr(128 + (($value >> 12) & 63));
|
||||
$decoded[$key] .= chr(128 + (($value >> 6) & 63));
|
||||
$decoded[$key] .= chr(128 + ($value & 63));
|
||||
} else {
|
||||
$this->_error(self::CANNOT_DECODE_PUNYCODE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return implode($decoded);
|
||||
}
|
||||
}
|
2917
airtime_mvc/library/Zend/Validate/Hostname/Biz.php
Normal file
2917
airtime_mvc/library/Zend/Validate/Hostname/Biz.php
Normal file
File diff suppressed because it is too large
Load diff
2199
airtime_mvc/library/Zend/Validate/Hostname/Cn.php
Normal file
2199
airtime_mvc/library/Zend/Validate/Hostname/Cn.php
Normal file
File diff suppressed because it is too large
Load diff
198
airtime_mvc/library/Zend/Validate/Hostname/Com.php
Normal file
198
airtime_mvc/library/Zend/Validate/Hostname/Com.php
Normal file
|
@ -0,0 +1,198 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Com.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ressource file for com and net idn validation
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
return array(
|
||||
1 => '/^[\x{002d}0-9\x{0400}-\x{052f}]{1,63}$/iu',
|
||||
2 => '/^[\x{002d}0-9\x{0370}-\x{03ff}]{1,63}$/iu',
|
||||
3 => '/^[\x{002d}0-9a-z\x{ac00}-\x{d7a3}]{1,17}$/iu',
|
||||
4 => '/^[\x{002d}0-9a-z·à-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž]{1,63}$/iu',
|
||||
5 => '/^[\x{002d}0-9A-Za-z\x{3400}-\x{3401}\x{3404}-\x{3406}\x{340C}\x{3416}\x{341C}' .
|
||||
'\x{3421}\x{3424}\x{3428}-\x{3429}\x{342B}-\x{342E}\x{3430}-\x{3434}\x{3436}' .
|
||||
'\x{3438}-\x{343C}\x{343E}\x{3441}-\x{3445}\x{3447}\x{3449}-\x{3451}\x{3453}' .
|
||||
'\x{3457}-\x{345F}\x{3463}-\x{3467}\x{346E}-\x{3471}\x{3473}-\x{3477}\x{3479}-\x{348E}\x{3491}-\x{3497}' .
|
||||
'\x{3499}-\x{34A1}\x{34A4}-\x{34AD}\x{34AF}-\x{34B0}\x{34B2}-\x{34BF}\x{34C2}-\x{34C5}\x{34C7}-\x{34CC}' .
|
||||
'\x{34CE}-\x{34D1}\x{34D3}-\x{34D8}\x{34DA}-\x{34E4}\x{34E7}-\x{34E9}\x{34EC}-\x{34EF}\x{34F1}-\x{34FE}' .
|
||||
'\x{3500}-\x{3507}\x{350A}-\x{3513}\x{3515}\x{3517}-\x{351A}\x{351C}-\x{351E}\x{3520}-\x{352A}' .
|
||||
'\x{352C}-\x{3552}\x{3554}-\x{355C}\x{355E}-\x{3567}\x{3569}-\x{3573}\x{3575}-\x{357C}\x{3580}-\x{3588}' .
|
||||
'\x{358F}-\x{3598}\x{359E}-\x{35AB}\x{35B4}-\x{35CD}\x{35D0}\x{35D3}-\x{35DC}\x{35E2}-\x{35ED}' .
|
||||
'\x{35F0}-\x{35F6}\x{35FB}-\x{3602}\x{3605}-\x{360E}\x{3610}-\x{3611}\x{3613}-\x{3616}\x{3619}-\x{362D}' .
|
||||
'\x{362F}-\x{3634}\x{3636}-\x{363B}\x{363F}-\x{3645}\x{3647}-\x{364B}\x{364D}-\x{3653}\x{3655}' .
|
||||
'\x{3659}-\x{365E}\x{3660}-\x{3665}\x{3667}-\x{367C}\x{367E}\x{3680}-\x{3685}\x{3687}' .
|
||||
'\x{3689}-\x{3690}\x{3692}-\x{3698}\x{369A}\x{369C}-\x{36AE}\x{36B0}-\x{36BF}\x{36C1}-\x{36C5}' .
|
||||
'\x{36C9}-\x{36CA}\x{36CD}-\x{36DE}\x{36E1}-\x{36E2}\x{36E5}-\x{36FE}\x{3701}-\x{3713}\x{3715}-\x{371E}' .
|
||||
'\x{3720}-\x{372C}\x{372E}-\x{3745}\x{3747}-\x{3748}\x{374A}\x{374C}-\x{3759}\x{375B}-\x{3760}' .
|
||||
'\x{3762}-\x{3767}\x{3769}-\x{3772}\x{3774}-\x{378C}\x{378F}-\x{379C}\x{379F}\x{37A1}-\x{37AD}' .
|
||||
'\x{37AF}-\x{37B7}\x{37B9}-\x{37C1}\x{37C3}-\x{37C5}\x{37C7}-\x{37D4}\x{37D6}-\x{37E0}\x{37E2}' .
|
||||
'\x{37E5}-\x{37ED}\x{37EF}-\x{37F6}\x{37F8}-\x{3802}\x{3804}-\x{381D}\x{3820}-\x{3822}\x{3825}-\x{382A}' .
|
||||
'\x{382D}-\x{382F}\x{3831}-\x{3832}\x{3834}-\x{384C}\x{384E}-\x{3860}\x{3862}-\x{3863}\x{3865}-\x{386B}' .
|
||||
'\x{386D}-\x{3886}\x{3888}-\x{38A1}\x{38A3}\x{38A5}-\x{38AA}\x{38AC}\x{38AE}-\x{38B0}' .
|
||||
'\x{38B2}-\x{38B6}\x{38B8}\x{38BA}-\x{38BE}\x{38C0}-\x{38C9}\x{38CB}-\x{38D4}\x{38D8}-\x{38E0}' .
|
||||
'\x{38E2}-\x{38E6}\x{38EB}-\x{38ED}\x{38EF}-\x{38F2}\x{38F5}-\x{38F7}\x{38FA}-\x{38FF}\x{3901}-\x{392A}' .
|
||||
'\x{392C}\x{392E}-\x{393B}\x{393E}-\x{3956}\x{395A}-\x{3969}\x{396B}-\x{397A}\x{397C}-\x{3987}' .
|
||||
'\x{3989}-\x{3998}\x{399A}-\x{39B0}\x{39B2}\x{39B4}-\x{39D0}\x{39D2}-\x{39DA}\x{39DE}-\x{39DF}' .
|
||||
'\x{39E1}-\x{39EF}\x{39F1}-\x{3A17}\x{3A19}-\x{3A2A}\x{3A2D}-\x{3A40}\x{3A43}-\x{3A4E}\x{3A50}' .
|
||||
'\x{3A52}-\x{3A5E}\x{3A60}-\x{3A6D}\x{3A6F}-\x{3A77}\x{3A79}-\x{3A82}\x{3A84}-\x{3A85}\x{3A87}-\x{3A89}' .
|
||||
'\x{3A8B}-\x{3A8F}\x{3A91}-\x{3A93}\x{3A95}-\x{3A96}\x{3A9A}\x{3A9C}-\x{3AA6}\x{3AA8}-\x{3AA9}' .
|
||||
'\x{3AAB}-\x{3AB1}\x{3AB4}-\x{3ABC}\x{3ABE}-\x{3AC5}\x{3ACA}-\x{3ACB}\x{3ACD}-\x{3AD5}\x{3AD7}-\x{3AE1}' .
|
||||
'\x{3AE4}-\x{3AE7}\x{3AE9}-\x{3AEC}\x{3AEE}-\x{3AFD}\x{3B01}-\x{3B10}\x{3B12}-\x{3B15}\x{3B17}-\x{3B1E}' .
|
||||
'\x{3B20}-\x{3B23}\x{3B25}-\x{3B27}\x{3B29}-\x{3B36}\x{3B38}-\x{3B39}\x{3B3B}-\x{3B3C}\x{3B3F}' .
|
||||
'\x{3B41}-\x{3B44}\x{3B47}-\x{3B4C}\x{3B4E}\x{3B51}-\x{3B55}\x{3B58}-\x{3B62}\x{3B68}-\x{3B72}' .
|
||||
'\x{3B78}-\x{3B88}\x{3B8B}-\x{3B9F}\x{3BA1}\x{3BA3}-\x{3BBA}\x{3BBC}\x{3BBF}-\x{3BD0}' .
|
||||
'\x{3BD3}-\x{3BE6}\x{3BEA}-\x{3BFB}\x{3BFE}-\x{3C12}\x{3C14}-\x{3C1B}\x{3C1D}-\x{3C37}\x{3C39}-\x{3C4F}' .
|
||||
'\x{3C52}\x{3C54}-\x{3C5C}\x{3C5E}-\x{3C68}\x{3C6A}-\x{3C76}\x{3C78}-\x{3C8F}\x{3C91}-\x{3CA8}' .
|
||||
'\x{3CAA}-\x{3CAD}\x{3CAF}-\x{3CBE}\x{3CC0}-\x{3CC8}\x{3CCA}-\x{3CD3}\x{3CD6}-\x{3CE0}\x{3CE4}-\x{3CEE}' .
|
||||
'\x{3CF3}-\x{3D0A}\x{3D0E}-\x{3D1E}\x{3D20}-\x{3D21}\x{3D25}-\x{3D38}\x{3D3B}-\x{3D46}\x{3D4A}-\x{3D59}' .
|
||||
'\x{3D5D}-\x{3D7B}\x{3D7D}-\x{3D81}\x{3D84}-\x{3D88}\x{3D8C}-\x{3D8F}\x{3D91}-\x{3D98}\x{3D9A}-\x{3D9C}' .
|
||||
'\x{3D9E}-\x{3DA1}\x{3DA3}-\x{3DB0}\x{3DB2}-\x{3DB5}\x{3DB9}-\x{3DBC}\x{3DBE}-\x{3DCB}\x{3DCD}-\x{3DDB}' .
|
||||
'\x{3DDF}-\x{3DE8}\x{3DEB}-\x{3DF0}\x{3DF3}-\x{3DF9}\x{3DFB}-\x{3DFC}\x{3DFE}-\x{3E05}\x{3E08}-\x{3E33}' .
|
||||
'\x{3E35}-\x{3E3E}\x{3E40}-\x{3E47}\x{3E49}-\x{3E67}\x{3E6B}-\x{3E6F}\x{3E71}-\x{3E85}\x{3E87}-\x{3E8C}' .
|
||||
'\x{3E8E}-\x{3E98}\x{3E9A}-\x{3EA1}\x{3EA3}-\x{3EAE}\x{3EB0}-\x{3EB5}\x{3EB7}-\x{3EBA}\x{3EBD}' .
|
||||
'\x{3EBF}-\x{3EC4}\x{3EC7}-\x{3ECE}\x{3ED1}-\x{3ED7}\x{3ED9}-\x{3EDA}\x{3EDD}-\x{3EE3}\x{3EE7}-\x{3EE8}' .
|
||||
'\x{3EEB}-\x{3EF2}\x{3EF5}-\x{3EFF}\x{3F01}-\x{3F02}\x{3F04}-\x{3F07}\x{3F09}-\x{3F44}\x{3F46}-\x{3F4E}' .
|
||||
'\x{3F50}-\x{3F53}\x{3F55}-\x{3F72}\x{3F74}-\x{3F75}\x{3F77}-\x{3F7B}\x{3F7D}-\x{3FB0}\x{3FB6}-\x{3FBF}' .
|
||||
'\x{3FC1}-\x{3FCF}\x{3FD1}-\x{3FD3}\x{3FD5}-\x{3FDF}\x{3FE1}-\x{400B}\x{400D}-\x{401C}\x{401E}-\x{4024}' .
|
||||
'\x{4027}-\x{403F}\x{4041}-\x{4060}\x{4062}-\x{4069}\x{406B}-\x{408A}\x{408C}-\x{40A7}\x{40A9}-\x{40B4}' .
|
||||
'\x{40B6}-\x{40C2}\x{40C7}-\x{40CF}\x{40D1}-\x{40DE}\x{40E0}-\x{40E7}\x{40E9}-\x{40EE}\x{40F0}-\x{40FB}' .
|
||||
'\x{40FD}-\x{4109}\x{410B}-\x{4115}\x{4118}-\x{411D}\x{411F}-\x{4122}\x{4124}-\x{4133}\x{4136}-\x{4138}' .
|
||||
'\x{413A}-\x{4148}\x{414A}-\x{4169}\x{416C}-\x{4185}\x{4188}-\x{418B}\x{418D}-\x{41AD}\x{41AF}-\x{41B3}' .
|
||||
'\x{41B5}-\x{41C3}\x{41C5}-\x{41C9}\x{41CB}-\x{41F2}\x{41F5}-\x{41FE}\x{4200}-\x{4227}\x{422A}-\x{4246}' .
|
||||
'\x{4248}-\x{4263}\x{4265}-\x{428B}\x{428D}-\x{42A1}\x{42A3}-\x{42C4}\x{42C8}-\x{42DC}\x{42DE}-\x{430A}' .
|
||||
'\x{430C}-\x{4335}\x{4337}\x{4342}-\x{435F}\x{4361}-\x{439A}\x{439C}-\x{439D}\x{439F}-\x{43A4}' .
|
||||
'\x{43A6}-\x{43EC}\x{43EF}-\x{4405}\x{4407}-\x{4429}\x{442B}-\x{4455}\x{4457}-\x{4468}\x{446A}-\x{446D}' .
|
||||
'\x{446F}-\x{4476}\x{4479}-\x{447D}\x{447F}-\x{4486}\x{4488}-\x{4490}\x{4492}-\x{4498}\x{449A}-\x{44AD}' .
|
||||
'\x{44B0}-\x{44BD}\x{44C1}-\x{44D3}\x{44D6}-\x{44E7}\x{44EA}\x{44EC}-\x{44FA}\x{44FC}-\x{4541}' .
|
||||
'\x{4543}-\x{454F}\x{4551}-\x{4562}\x{4564}-\x{4575}\x{4577}-\x{45AB}\x{45AD}-\x{45BD}\x{45BF}-\x{45D5}' .
|
||||
'\x{45D7}-\x{45EC}\x{45EE}-\x{45F2}\x{45F4}-\x{45FA}\x{45FC}-\x{461A}\x{461C}-\x{461D}\x{461F}-\x{4631}' .
|
||||
'\x{4633}-\x{4649}\x{464C}\x{464E}-\x{4652}\x{4654}-\x{466A}\x{466C}-\x{4675}\x{4677}-\x{467A}' .
|
||||
'\x{467C}-\x{4694}\x{4696}-\x{46A3}\x{46A5}-\x{46AB}\x{46AD}-\x{46D2}\x{46D4}-\x{4723}\x{4729}-\x{4732}' .
|
||||
'\x{4734}-\x{4758}\x{475A}\x{475C}-\x{478B}\x{478D}\x{4791}-\x{47B1}\x{47B3}-\x{47F1}' .
|
||||
'\x{47F3}-\x{480B}\x{480D}-\x{4815}\x{4817}-\x{4839}\x{483B}-\x{4870}\x{4872}-\x{487A}\x{487C}-\x{487F}' .
|
||||
'\x{4883}-\x{488E}\x{4890}-\x{4896}\x{4899}-\x{48A2}\x{48A4}-\x{48B9}\x{48BB}-\x{48C8}\x{48CA}-\x{48D1}' .
|
||||
'\x{48D3}-\x{48E5}\x{48E7}-\x{48F2}\x{48F4}-\x{48FF}\x{4901}-\x{4922}\x{4924}-\x{4928}\x{492A}-\x{4931}' .
|
||||
'\x{4933}-\x{495B}\x{495D}-\x{4978}\x{497A}\x{497D}\x{4982}-\x{4983}\x{4985}-\x{49A8}' .
|
||||
'\x{49AA}-\x{49AF}\x{49B1}-\x{49B7}\x{49B9}-\x{49BD}\x{49C1}-\x{49C7}\x{49C9}-\x{49CE}\x{49D0}-\x{49E8}' .
|
||||
'\x{49EA}\x{49EC}\x{49EE}-\x{4A19}\x{4A1B}-\x{4A43}\x{4A45}-\x{4A4D}\x{4A4F}-\x{4A9E}' .
|
||||
'\x{4AA0}-\x{4AA9}\x{4AAB}-\x{4B4E}\x{4B50}-\x{4B5B}\x{4B5D}-\x{4B69}\x{4B6B}-\x{4BC2}\x{4BC6}-\x{4BE8}' .
|
||||
'\x{4BEA}-\x{4BFA}\x{4BFC}-\x{4C06}\x{4C08}-\x{4C2D}\x{4C2F}-\x{4C32}\x{4C34}-\x{4C35}\x{4C37}-\x{4C69}' .
|
||||
'\x{4C6B}-\x{4C73}\x{4C75}-\x{4C86}\x{4C88}-\x{4C97}\x{4C99}-\x{4C9C}\x{4C9F}-\x{4CA3}\x{4CA5}-\x{4CB5}' .
|
||||
'\x{4CB7}-\x{4CF8}\x{4CFA}-\x{4D27}\x{4D29}-\x{4DAC}\x{4DAE}-\x{4DB1}\x{4DB3}-\x{4DB5}\x{4E00}-\x{4E54}' .
|
||||
'\x{4E56}-\x{4E89}\x{4E8B}-\x{4EEC}\x{4EEE}-\x{4FAC}\x{4FAE}-\x{503C}\x{503E}-\x{51E5}\x{51E7}-\x{5270}' .
|
||||
'\x{5272}-\x{56A1}\x{56A3}-\x{5840}\x{5842}-\x{58B5}\x{58B7}-\x{58CB}\x{58CD}-\x{5BC8}\x{5BCA}-\x{5C01}' .
|
||||
'\x{5C03}-\x{5C25}\x{5C27}-\x{5D5B}\x{5D5D}-\x{5F08}\x{5F0A}-\x{61F3}\x{61F5}-\x{63BA}\x{63BC}-\x{6441}' .
|
||||
'\x{6443}-\x{657C}\x{657E}-\x{663E}\x{6640}-\x{66FC}\x{66FE}-\x{6728}\x{672A}-\x{6766}\x{6768}-\x{67A8}' .
|
||||
'\x{67AA}-\x{685B}\x{685D}-\x{685E}\x{6860}-\x{68B9}\x{68BB}-\x{6AC8}\x{6ACA}-\x{6BB0}\x{6BB2}-\x{6C16}' .
|
||||
'\x{6C18}-\x{6D9B}\x{6D9D}-\x{6E12}\x{6E14}-\x{6E8B}\x{6E8D}-\x{704D}\x{704F}-\x{7113}\x{7115}-\x{713B}' .
|
||||
'\x{713D}-\x{7154}\x{7156}-\x{729F}\x{72A1}-\x{731E}\x{7320}-\x{7362}\x{7364}-\x{7533}\x{7535}-\x{7551}' .
|
||||
'\x{7553}-\x{7572}\x{7574}-\x{75E8}\x{75EA}-\x{7679}\x{767B}-\x{783E}\x{7840}-\x{7A62}\x{7A64}-\x{7AC2}' .
|
||||
'\x{7AC4}-\x{7B06}\x{7B08}-\x{7B79}\x{7B7B}-\x{7BCE}\x{7BD0}-\x{7D99}\x{7D9B}-\x{7E49}\x{7E4C}-\x{8132}' .
|
||||
'\x{8134}\x{8136}-\x{81D2}\x{81D4}-\x{8216}\x{8218}-\x{822D}\x{822F}-\x{83B4}\x{83B6}-\x{841F}' .
|
||||
'\x{8421}-\x{86CC}\x{86CE}-\x{874A}\x{874C}-\x{877E}\x{8780}-\x{8A32}\x{8A34}-\x{8B71}\x{8B73}-\x{8B8E}' .
|
||||
'\x{8B90}-\x{8DE4}\x{8DE6}-\x{8E9A}\x{8E9C}-\x{8EE1}\x{8EE4}-\x{8F0B}\x{8F0D}-\x{8FB9}\x{8FBB}-\x{9038}' .
|
||||
'\x{903A}-\x{9196}\x{9198}-\x{91A3}\x{91A5}-\x{91B7}\x{91B9}-\x{91C7}\x{91C9}-\x{91E0}\x{91E2}-\x{91FB}' .
|
||||
'\x{91FD}-\x{922B}\x{922D}-\x{9270}\x{9272}-\x{9420}\x{9422}-\x{9664}\x{9666}-\x{9679}\x{967B}-\x{9770}' .
|
||||
'\x{9772}-\x{982B}\x{982D}-\x{98ED}\x{98EF}-\x{99C4}\x{99C6}-\x{9A11}\x{9A14}-\x{9A27}\x{9A29}-\x{9D0D}' .
|
||||
'\x{9D0F}-\x{9D2B}\x{9D2D}-\x{9D8E}\x{9D90}-\x{9DC5}\x{9DC7}-\x{9E77}\x{9E79}-\x{9EB8}\x{9EBB}-\x{9F20}' .
|
||||
'\x{9F22}-\x{9F61}\x{9F63}-\x{9FA5}\x{FA28}]{1,20}$/iu',
|
||||
6 => '/^[\x{002d}0-9A-Za-z]{1,63}$/iu',
|
||||
7 => '/^[\x{00A1}-\x{00FF}]{1,63}$/iu',
|
||||
8 => '/^[\x{0100}-\x{017f}]{1,63}$/iu',
|
||||
9 => '/^[\x{0180}-\x{024f}]{1,63}$/iu',
|
||||
10 => '/^[\x{0250}-\x{02af}]{1,63}$/iu',
|
||||
11 => '/^[\x{02b0}-\x{02ff}]{1,63}$/iu',
|
||||
12 => '/^[\x{0300}-\x{036f}]{1,63}$/iu',
|
||||
13 => '/^[\x{0370}-\x{03ff}]{1,63}$/iu',
|
||||
14 => '/^[\x{0400}-\x{04ff}]{1,63}$/iu',
|
||||
15 => '/^[\x{0500}-\x{052f}]{1,63}$/iu',
|
||||
16 => '/^[\x{0530}-\x{058F}]{1,63}$/iu',
|
||||
17 => '/^[\x{0590}-\x{05FF}]{1,63}$/iu',
|
||||
18 => '/^[\x{0600}-\x{06FF}]{1,63}$/iu',
|
||||
19 => '/^[\x{0700}-\x{074F}]{1,63}$/iu',
|
||||
20 => '/^[\x{0780}-\x{07BF}]{1,63}$/iu',
|
||||
21 => '/^[\x{0900}-\x{097F}]{1,63}$/iu',
|
||||
22 => '/^[\x{0980}-\x{09FF}]{1,63}$/iu',
|
||||
23 => '/^[\x{0A00}-\x{0A7F}]{1,63}$/iu',
|
||||
24 => '/^[\x{0A80}-\x{0AFF}]{1,63}$/iu',
|
||||
25 => '/^[\x{0B00}-\x{0B7F}]{1,63}$/iu',
|
||||
26 => '/^[\x{0B80}-\x{0BFF}]{1,63}$/iu',
|
||||
27 => '/^[\x{0C00}-\x{0C7F}]{1,63}$/iu',
|
||||
28 => '/^[\x{0C80}-\x{0CFF}]{1,63}$/iu',
|
||||
29 => '/^[\x{0D00}-\x{0D7F}]{1,63}$/iu',
|
||||
30 => '/^[\x{0D80}-\x{0DFF}]{1,63}$/iu',
|
||||
31 => '/^[\x{0E00}-\x{0E7F}]{1,63}$/iu',
|
||||
32 => '/^[\x{0E80}-\x{0EFF}]{1,63}$/iu',
|
||||
33 => '/^[\x{0F00}-\x{0FFF}]{1,63}$/iu',
|
||||
34 => '/^[\x{1000}-\x{109F}]{1,63}$/iu',
|
||||
35 => '/^[\x{10A0}-\x{10FF}]{1,63}$/iu',
|
||||
36 => '/^[\x{1100}-\x{11FF}]{1,63}$/iu',
|
||||
37 => '/^[\x{1200}-\x{137F}]{1,63}$/iu',
|
||||
38 => '/^[\x{13A0}-\x{13FF}]{1,63}$/iu',
|
||||
39 => '/^[\x{1400}-\x{167F}]{1,63}$/iu',
|
||||
40 => '/^[\x{1680}-\x{169F}]{1,63}$/iu',
|
||||
41 => '/^[\x{16A0}-\x{16FF}]{1,63}$/iu',
|
||||
42 => '/^[\x{1700}-\x{171F}]{1,63}$/iu',
|
||||
43 => '/^[\x{1720}-\x{173F}]{1,63}$/iu',
|
||||
44 => '/^[\x{1740}-\x{175F}]{1,63}$/iu',
|
||||
45 => '/^[\x{1760}-\x{177F}]{1,63}$/iu',
|
||||
46 => '/^[\x{1780}-\x{17FF}]{1,63}$/iu',
|
||||
47 => '/^[\x{1800}-\x{18AF}]{1,63}$/iu',
|
||||
48 => '/^[\x{1E00}-\x{1EFF}]{1,63}$/iu',
|
||||
49 => '/^[\x{1F00}-\x{1FFF}]{1,63}$/iu',
|
||||
50 => '/^[\x{2070}-\x{209F}]{1,63}$/iu',
|
||||
51 => '/^[\x{2100}-\x{214F}]{1,63}$/iu',
|
||||
52 => '/^[\x{2150}-\x{218F}]{1,63}$/iu',
|
||||
53 => '/^[\x{2460}-\x{24FF}]{1,63}$/iu',
|
||||
54 => '/^[\x{2E80}-\x{2EFF}]{1,63}$/iu',
|
||||
55 => '/^[\x{2F00}-\x{2FDF}]{1,63}$/iu',
|
||||
56 => '/^[\x{2FF0}-\x{2FFF}]{1,63}$/iu',
|
||||
57 => '/^[\x{3040}-\x{309F}]{1,63}$/iu',
|
||||
58 => '/^[\x{30A0}-\x{30FF}]{1,63}$/iu',
|
||||
59 => '/^[\x{3100}-\x{312F}]{1,63}$/iu',
|
||||
60 => '/^[\x{3130}-\x{318F}]{1,63}$/iu',
|
||||
61 => '/^[\x{3190}-\x{319F}]{1,63}$/iu',
|
||||
62 => '/^[\x{31A0}-\x{31BF}]{1,63}$/iu',
|
||||
63 => '/^[\x{31F0}-\x{31FF}]{1,63}$/iu',
|
||||
64 => '/^[\x{3200}-\x{32FF}]{1,63}$/iu',
|
||||
65 => '/^[\x{3300}-\x{33FF}]{1,63}$/iu',
|
||||
66 => '/^[\x{3400}-\x{4DBF}]{1,63}$/iu',
|
||||
67 => '/^[\x{4E00}-\x{9FFF}]{1,63}$/iu',
|
||||
68 => '/^[\x{A000}-\x{A48F}]{1,63}$/iu',
|
||||
69 => '/^[\x{A490}-\x{A4CF}]{1,63}$/iu',
|
||||
70 => '/^[\x{AC00}-\x{D7AF}]{1,63}$/iu',
|
||||
71 => '/^[\x{D800}-\x{DB7F}]{1,63}$/iu',
|
||||
72 => '/^[\x{DC00}-\x{DFFF}]{1,63}$/iu',
|
||||
73 => '/^[\x{F900}-\x{FAFF}]{1,63}$/iu',
|
||||
74 => '/^[\x{FB00}-\x{FB4F}]{1,63}$/iu',
|
||||
75 => '/^[\x{FB50}-\x{FDFF}]{1,63}$/iu',
|
||||
76 => '/^[\x{FE20}-\x{FE2F}]{1,63}$/iu',
|
||||
77 => '/^[\x{FE70}-\x{FEFF}]{1,63}$/iu',
|
||||
78 => '/^[\x{FF00}-\x{FFEF}]{1,63}$/iu',
|
||||
79 => '/^[\x{20000}-\x{2A6DF}]{1,63}$/iu',
|
||||
80 => '/^[\x{2F800}-\x{2FA1F}]{1,63}$/iu'
|
||||
|
||||
);
|
739
airtime_mvc/library/Zend/Validate/Hostname/Jp.php
Normal file
739
airtime_mvc/library/Zend/Validate/Hostname/Jp.php
Normal file
|
@ -0,0 +1,739 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Jp.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ressource file for japanese idn validation
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
return array(
|
||||
1 => '/^[\x{002d}0-9a-z\x{3005}-\x{3007}\x{3041}-\x{3093}\x{309D}\x{309E}' .
|
||||
'\x{30A1}-\x{30F6}\x{30FC}' .
|
||||
'\x{30FD}\x{30FE}\x{4E00}\x{4E01}\x{4E03}\x{4E07}\x{4E08}\x{4E09}\x{4E0A}' .
|
||||
'\x{4E0B}\x{4E0D}\x{4E0E}\x{4E10}\x{4E11}\x{4E14}\x{4E15}\x{4E16}\x{4E17}' .
|
||||
'\x{4E18}\x{4E19}\x{4E1E}\x{4E21}\x{4E26}\x{4E2A}\x{4E2D}\x{4E31}\x{4E32}' .
|
||||
'\x{4E36}\x{4E38}\x{4E39}\x{4E3B}\x{4E3C}\x{4E3F}\x{4E42}\x{4E43}\x{4E45}' .
|
||||
'\x{4E4B}\x{4E4D}\x{4E4E}\x{4E4F}\x{4E55}\x{4E56}\x{4E57}\x{4E58}\x{4E59}' .
|
||||
'\x{4E5D}\x{4E5E}\x{4E5F}\x{4E62}\x{4E71}\x{4E73}\x{4E7E}\x{4E80}\x{4E82}' .
|
||||
'\x{4E85}\x{4E86}\x{4E88}\x{4E89}\x{4E8A}\x{4E8B}\x{4E8C}\x{4E8E}\x{4E91}' .
|
||||
'\x{4E92}\x{4E94}\x{4E95}\x{4E98}\x{4E99}\x{4E9B}\x{4E9C}\x{4E9E}\x{4E9F}' .
|
||||
'\x{4EA0}\x{4EA1}\x{4EA2}\x{4EA4}\x{4EA5}\x{4EA6}\x{4EA8}\x{4EAB}\x{4EAC}' .
|
||||
'\x{4EAD}\x{4EAE}\x{4EB0}\x{4EB3}\x{4EB6}\x{4EBA}\x{4EC0}\x{4EC1}\x{4EC2}' .
|
||||
'\x{4EC4}\x{4EC6}\x{4EC7}\x{4ECA}\x{4ECB}\x{4ECD}\x{4ECE}\x{4ECF}\x{4ED4}' .
|
||||
'\x{4ED5}\x{4ED6}\x{4ED7}\x{4ED8}\x{4ED9}\x{4EDD}\x{4EDE}\x{4EDF}\x{4EE3}' .
|
||||
'\x{4EE4}\x{4EE5}\x{4EED}\x{4EEE}\x{4EF0}\x{4EF2}\x{4EF6}\x{4EF7}\x{4EFB}' .
|
||||
'\x{4F01}\x{4F09}\x{4F0A}\x{4F0D}\x{4F0E}\x{4F0F}\x{4F10}\x{4F11}\x{4F1A}' .
|
||||
'\x{4F1C}\x{4F1D}\x{4F2F}\x{4F30}\x{4F34}\x{4F36}\x{4F38}\x{4F3A}\x{4F3C}' .
|
||||
'\x{4F3D}\x{4F43}\x{4F46}\x{4F47}\x{4F4D}\x{4F4E}\x{4F4F}\x{4F50}\x{4F51}' .
|
||||
'\x{4F53}\x{4F55}\x{4F57}\x{4F59}\x{4F5A}\x{4F5B}\x{4F5C}\x{4F5D}\x{4F5E}' .
|
||||
'\x{4F69}\x{4F6F}\x{4F70}\x{4F73}\x{4F75}\x{4F76}\x{4F7B}\x{4F7C}\x{4F7F}' .
|
||||
'\x{4F83}\x{4F86}\x{4F88}\x{4F8B}\x{4F8D}\x{4F8F}\x{4F91}\x{4F96}\x{4F98}' .
|
||||
'\x{4F9B}\x{4F9D}\x{4FA0}\x{4FA1}\x{4FAB}\x{4FAD}\x{4FAE}\x{4FAF}\x{4FB5}' .
|
||||
'\x{4FB6}\x{4FBF}\x{4FC2}\x{4FC3}\x{4FC4}\x{4FCA}\x{4FCE}\x{4FD0}\x{4FD1}' .
|
||||
'\x{4FD4}\x{4FD7}\x{4FD8}\x{4FDA}\x{4FDB}\x{4FDD}\x{4FDF}\x{4FE1}\x{4FE3}' .
|
||||
'\x{4FE4}\x{4FE5}\x{4FEE}\x{4FEF}\x{4FF3}\x{4FF5}\x{4FF6}\x{4FF8}\x{4FFA}' .
|
||||
'\x{4FFE}\x{5005}\x{5006}\x{5009}\x{500B}\x{500D}\x{500F}\x{5011}\x{5012}' .
|
||||
'\x{5014}\x{5016}\x{5019}\x{501A}\x{501F}\x{5021}\x{5023}\x{5024}\x{5025}' .
|
||||
'\x{5026}\x{5028}\x{5029}\x{502A}\x{502B}\x{502C}\x{502D}\x{5036}\x{5039}' .
|
||||
'\x{5043}\x{5047}\x{5048}\x{5049}\x{504F}\x{5050}\x{5055}\x{5056}\x{505A}' .
|
||||
'\x{505C}\x{5065}\x{506C}\x{5072}\x{5074}\x{5075}\x{5076}\x{5078}\x{507D}' .
|
||||
'\x{5080}\x{5085}\x{508D}\x{5091}\x{5098}\x{5099}\x{509A}\x{50AC}\x{50AD}' .
|
||||
'\x{50B2}\x{50B3}\x{50B4}\x{50B5}\x{50B7}\x{50BE}\x{50C2}\x{50C5}\x{50C9}' .
|
||||
'\x{50CA}\x{50CD}\x{50CF}\x{50D1}\x{50D5}\x{50D6}\x{50DA}\x{50DE}\x{50E3}' .
|
||||
'\x{50E5}\x{50E7}\x{50ED}\x{50EE}\x{50F5}\x{50F9}\x{50FB}\x{5100}\x{5101}' .
|
||||
'\x{5102}\x{5104}\x{5109}\x{5112}\x{5114}\x{5115}\x{5116}\x{5118}\x{511A}' .
|
||||
'\x{511F}\x{5121}\x{512A}\x{5132}\x{5137}\x{513A}\x{513B}\x{513C}\x{513F}' .
|
||||
'\x{5140}\x{5141}\x{5143}\x{5144}\x{5145}\x{5146}\x{5147}\x{5148}\x{5149}' .
|
||||
'\x{514B}\x{514C}\x{514D}\x{514E}\x{5150}\x{5152}\x{5154}\x{515A}\x{515C}' .
|
||||
'\x{5162}\x{5165}\x{5168}\x{5169}\x{516A}\x{516B}\x{516C}\x{516D}\x{516E}' .
|
||||
'\x{5171}\x{5175}\x{5176}\x{5177}\x{5178}\x{517C}\x{5180}\x{5182}\x{5185}' .
|
||||
'\x{5186}\x{5189}\x{518A}\x{518C}\x{518D}\x{518F}\x{5190}\x{5191}\x{5192}' .
|
||||
'\x{5193}\x{5195}\x{5196}\x{5197}\x{5199}\x{51A0}\x{51A2}\x{51A4}\x{51A5}' .
|
||||
'\x{51A6}\x{51A8}\x{51A9}\x{51AA}\x{51AB}\x{51AC}\x{51B0}\x{51B1}\x{51B2}' .
|
||||
'\x{51B3}\x{51B4}\x{51B5}\x{51B6}\x{51B7}\x{51BD}\x{51C4}\x{51C5}\x{51C6}' .
|
||||
'\x{51C9}\x{51CB}\x{51CC}\x{51CD}\x{51D6}\x{51DB}\x{51DC}\x{51DD}\x{51E0}' .
|
||||
'\x{51E1}\x{51E6}\x{51E7}\x{51E9}\x{51EA}\x{51ED}\x{51F0}\x{51F1}\x{51F5}' .
|
||||
'\x{51F6}\x{51F8}\x{51F9}\x{51FA}\x{51FD}\x{51FE}\x{5200}\x{5203}\x{5204}' .
|
||||
'\x{5206}\x{5207}\x{5208}\x{520A}\x{520B}\x{520E}\x{5211}\x{5214}\x{5217}' .
|
||||
'\x{521D}\x{5224}\x{5225}\x{5227}\x{5229}\x{522A}\x{522E}\x{5230}\x{5233}' .
|
||||
'\x{5236}\x{5237}\x{5238}\x{5239}\x{523A}\x{523B}\x{5243}\x{5244}\x{5247}' .
|
||||
'\x{524A}\x{524B}\x{524C}\x{524D}\x{524F}\x{5254}\x{5256}\x{525B}\x{525E}' .
|
||||
'\x{5263}\x{5264}\x{5265}\x{5269}\x{526A}\x{526F}\x{5270}\x{5271}\x{5272}' .
|
||||
'\x{5273}\x{5274}\x{5275}\x{527D}\x{527F}\x{5283}\x{5287}\x{5288}\x{5289}' .
|
||||
'\x{528D}\x{5291}\x{5292}\x{5294}\x{529B}\x{529F}\x{52A0}\x{52A3}\x{52A9}' .
|
||||
'\x{52AA}\x{52AB}\x{52AC}\x{52AD}\x{52B1}\x{52B4}\x{52B5}\x{52B9}\x{52BC}' .
|
||||
'\x{52BE}\x{52C1}\x{52C3}\x{52C5}\x{52C7}\x{52C9}\x{52CD}\x{52D2}\x{52D5}' .
|
||||
'\x{52D7}\x{52D8}\x{52D9}\x{52DD}\x{52DE}\x{52DF}\x{52E0}\x{52E2}\x{52E3}' .
|
||||
'\x{52E4}\x{52E6}\x{52E7}\x{52F2}\x{52F3}\x{52F5}\x{52F8}\x{52F9}\x{52FA}' .
|
||||
'\x{52FE}\x{52FF}\x{5301}\x{5302}\x{5305}\x{5306}\x{5308}\x{530D}\x{530F}' .
|
||||
'\x{5310}\x{5315}\x{5316}\x{5317}\x{5319}\x{531A}\x{531D}\x{5320}\x{5321}' .
|
||||
'\x{5323}\x{532A}\x{532F}\x{5331}\x{5333}\x{5338}\x{5339}\x{533A}\x{533B}' .
|
||||
'\x{533F}\x{5340}\x{5341}\x{5343}\x{5345}\x{5346}\x{5347}\x{5348}\x{5349}' .
|
||||
'\x{534A}\x{534D}\x{5351}\x{5352}\x{5353}\x{5354}\x{5357}\x{5358}\x{535A}' .
|
||||
'\x{535C}\x{535E}\x{5360}\x{5366}\x{5369}\x{536E}\x{536F}\x{5370}\x{5371}' .
|
||||
'\x{5373}\x{5374}\x{5375}\x{5377}\x{5378}\x{537B}\x{537F}\x{5382}\x{5384}' .
|
||||
'\x{5396}\x{5398}\x{539A}\x{539F}\x{53A0}\x{53A5}\x{53A6}\x{53A8}\x{53A9}' .
|
||||
'\x{53AD}\x{53AE}\x{53B0}\x{53B3}\x{53B6}\x{53BB}\x{53C2}\x{53C3}\x{53C8}' .
|
||||
'\x{53C9}\x{53CA}\x{53CB}\x{53CC}\x{53CD}\x{53CE}\x{53D4}\x{53D6}\x{53D7}' .
|
||||
'\x{53D9}\x{53DB}\x{53DF}\x{53E1}\x{53E2}\x{53E3}\x{53E4}\x{53E5}\x{53E8}' .
|
||||
'\x{53E9}\x{53EA}\x{53EB}\x{53EC}\x{53ED}\x{53EE}\x{53EF}\x{53F0}\x{53F1}' .
|
||||
'\x{53F2}\x{53F3}\x{53F6}\x{53F7}\x{53F8}\x{53FA}\x{5401}\x{5403}\x{5404}' .
|
||||
'\x{5408}\x{5409}\x{540A}\x{540B}\x{540C}\x{540D}\x{540E}\x{540F}\x{5410}' .
|
||||
'\x{5411}\x{541B}\x{541D}\x{541F}\x{5420}\x{5426}\x{5429}\x{542B}\x{542C}' .
|
||||
'\x{542D}\x{542E}\x{5436}\x{5438}\x{5439}\x{543B}\x{543C}\x{543D}\x{543E}' .
|
||||
'\x{5440}\x{5442}\x{5446}\x{5448}\x{5449}\x{544A}\x{544E}\x{5451}\x{545F}' .
|
||||
'\x{5468}\x{546A}\x{5470}\x{5471}\x{5473}\x{5475}\x{5476}\x{5477}\x{547B}' .
|
||||
'\x{547C}\x{547D}\x{5480}\x{5484}\x{5486}\x{548B}\x{548C}\x{548E}\x{548F}' .
|
||||
'\x{5490}\x{5492}\x{54A2}\x{54A4}\x{54A5}\x{54A8}\x{54AB}\x{54AC}\x{54AF}' .
|
||||
'\x{54B2}\x{54B3}\x{54B8}\x{54BC}\x{54BD}\x{54BE}\x{54C0}\x{54C1}\x{54C2}' .
|
||||
'\x{54C4}\x{54C7}\x{54C8}\x{54C9}\x{54D8}\x{54E1}\x{54E2}\x{54E5}\x{54E6}' .
|
||||
'\x{54E8}\x{54E9}\x{54ED}\x{54EE}\x{54F2}\x{54FA}\x{54FD}\x{5504}\x{5506}' .
|
||||
'\x{5507}\x{550F}\x{5510}\x{5514}\x{5516}\x{552E}\x{552F}\x{5531}\x{5533}' .
|
||||
'\x{5538}\x{5539}\x{553E}\x{5540}\x{5544}\x{5545}\x{5546}\x{554C}\x{554F}' .
|
||||
'\x{5553}\x{5556}\x{5557}\x{555C}\x{555D}\x{5563}\x{557B}\x{557C}\x{557E}' .
|
||||
'\x{5580}\x{5583}\x{5584}\x{5587}\x{5589}\x{558A}\x{558B}\x{5598}\x{5599}' .
|
||||
'\x{559A}\x{559C}\x{559D}\x{559E}\x{559F}\x{55A7}\x{55A8}\x{55A9}\x{55AA}' .
|
||||
'\x{55AB}\x{55AC}\x{55AE}\x{55B0}\x{55B6}\x{55C4}\x{55C5}\x{55C7}\x{55D4}' .
|
||||
'\x{55DA}\x{55DC}\x{55DF}\x{55E3}\x{55E4}\x{55F7}\x{55F9}\x{55FD}\x{55FE}' .
|
||||
'\x{5606}\x{5609}\x{5614}\x{5616}\x{5617}\x{5618}\x{561B}\x{5629}\x{562F}' .
|
||||
'\x{5631}\x{5632}\x{5634}\x{5636}\x{5638}\x{5642}\x{564C}\x{564E}\x{5650}' .
|
||||
'\x{565B}\x{5664}\x{5668}\x{566A}\x{566B}\x{566C}\x{5674}\x{5678}\x{567A}' .
|
||||
'\x{5680}\x{5686}\x{5687}\x{568A}\x{568F}\x{5694}\x{56A0}\x{56A2}\x{56A5}' .
|
||||
'\x{56AE}\x{56B4}\x{56B6}\x{56BC}\x{56C0}\x{56C1}\x{56C2}\x{56C3}\x{56C8}' .
|
||||
'\x{56CE}\x{56D1}\x{56D3}\x{56D7}\x{56D8}\x{56DA}\x{56DB}\x{56DE}\x{56E0}' .
|
||||
'\x{56E3}\x{56EE}\x{56F0}\x{56F2}\x{56F3}\x{56F9}\x{56FA}\x{56FD}\x{56FF}' .
|
||||
'\x{5700}\x{5703}\x{5704}\x{5708}\x{5709}\x{570B}\x{570D}\x{570F}\x{5712}' .
|
||||
'\x{5713}\x{5716}\x{5718}\x{571C}\x{571F}\x{5726}\x{5727}\x{5728}\x{572D}' .
|
||||
'\x{5730}\x{5737}\x{5738}\x{573B}\x{5740}\x{5742}\x{5747}\x{574A}\x{574E}' .
|
||||
'\x{574F}\x{5750}\x{5751}\x{5761}\x{5764}\x{5766}\x{5769}\x{576A}\x{577F}' .
|
||||
'\x{5782}\x{5788}\x{5789}\x{578B}\x{5793}\x{57A0}\x{57A2}\x{57A3}\x{57A4}' .
|
||||
'\x{57AA}\x{57B0}\x{57B3}\x{57C0}\x{57C3}\x{57C6}\x{57CB}\x{57CE}\x{57D2}' .
|
||||
'\x{57D3}\x{57D4}\x{57D6}\x{57DC}\x{57DF}\x{57E0}\x{57E3}\x{57F4}\x{57F7}' .
|
||||
'\x{57F9}\x{57FA}\x{57FC}\x{5800}\x{5802}\x{5805}\x{5806}\x{580A}\x{580B}' .
|
||||
'\x{5815}\x{5819}\x{581D}\x{5821}\x{5824}\x{582A}\x{582F}\x{5830}\x{5831}' .
|
||||
'\x{5834}\x{5835}\x{583A}\x{583D}\x{5840}\x{5841}\x{584A}\x{584B}\x{5851}' .
|
||||
'\x{5852}\x{5854}\x{5857}\x{5858}\x{5859}\x{585A}\x{585E}\x{5862}\x{5869}' .
|
||||
'\x{586B}\x{5870}\x{5872}\x{5875}\x{5879}\x{587E}\x{5883}\x{5885}\x{5893}' .
|
||||
'\x{5897}\x{589C}\x{589F}\x{58A8}\x{58AB}\x{58AE}\x{58B3}\x{58B8}\x{58B9}' .
|
||||
'\x{58BA}\x{58BB}\x{58BE}\x{58C1}\x{58C5}\x{58C7}\x{58CA}\x{58CC}\x{58D1}' .
|
||||
'\x{58D3}\x{58D5}\x{58D7}\x{58D8}\x{58D9}\x{58DC}\x{58DE}\x{58DF}\x{58E4}' .
|
||||
'\x{58E5}\x{58EB}\x{58EC}\x{58EE}\x{58EF}\x{58F0}\x{58F1}\x{58F2}\x{58F7}' .
|
||||
'\x{58F9}\x{58FA}\x{58FB}\x{58FC}\x{58FD}\x{5902}\x{5909}\x{590A}\x{590F}' .
|
||||
'\x{5910}\x{5915}\x{5916}\x{5918}\x{5919}\x{591A}\x{591B}\x{591C}\x{5922}' .
|
||||
'\x{5925}\x{5927}\x{5929}\x{592A}\x{592B}\x{592C}\x{592D}\x{592E}\x{5931}' .
|
||||
'\x{5932}\x{5937}\x{5938}\x{593E}\x{5944}\x{5947}\x{5948}\x{5949}\x{594E}' .
|
||||
'\x{594F}\x{5950}\x{5951}\x{5954}\x{5955}\x{5957}\x{5958}\x{595A}\x{5960}' .
|
||||
'\x{5962}\x{5965}\x{5967}\x{5968}\x{5969}\x{596A}\x{596C}\x{596E}\x{5973}' .
|
||||
'\x{5974}\x{5978}\x{597D}\x{5981}\x{5982}\x{5983}\x{5984}\x{598A}\x{598D}' .
|
||||
'\x{5993}\x{5996}\x{5999}\x{599B}\x{599D}\x{59A3}\x{59A5}\x{59A8}\x{59AC}' .
|
||||
'\x{59B2}\x{59B9}\x{59BB}\x{59BE}\x{59C6}\x{59C9}\x{59CB}\x{59D0}\x{59D1}' .
|
||||
'\x{59D3}\x{59D4}\x{59D9}\x{59DA}\x{59DC}\x{59E5}\x{59E6}\x{59E8}\x{59EA}' .
|
||||
'\x{59EB}\x{59F6}\x{59FB}\x{59FF}\x{5A01}\x{5A03}\x{5A09}\x{5A11}\x{5A18}' .
|
||||
'\x{5A1A}\x{5A1C}\x{5A1F}\x{5A20}\x{5A25}\x{5A29}\x{5A2F}\x{5A35}\x{5A36}' .
|
||||
'\x{5A3C}\x{5A40}\x{5A41}\x{5A46}\x{5A49}\x{5A5A}\x{5A62}\x{5A66}\x{5A6A}' .
|
||||
'\x{5A6C}\x{5A7F}\x{5A92}\x{5A9A}\x{5A9B}\x{5ABC}\x{5ABD}\x{5ABE}\x{5AC1}' .
|
||||
'\x{5AC2}\x{5AC9}\x{5ACB}\x{5ACC}\x{5AD0}\x{5AD6}\x{5AD7}\x{5AE1}\x{5AE3}' .
|
||||
'\x{5AE6}\x{5AE9}\x{5AFA}\x{5AFB}\x{5B09}\x{5B0B}\x{5B0C}\x{5B16}\x{5B22}' .
|
||||
'\x{5B2A}\x{5B2C}\x{5B30}\x{5B32}\x{5B36}\x{5B3E}\x{5B40}\x{5B43}\x{5B45}' .
|
||||
'\x{5B50}\x{5B51}\x{5B54}\x{5B55}\x{5B57}\x{5B58}\x{5B5A}\x{5B5B}\x{5B5C}' .
|
||||
'\x{5B5D}\x{5B5F}\x{5B63}\x{5B64}\x{5B65}\x{5B66}\x{5B69}\x{5B6B}\x{5B70}' .
|
||||
'\x{5B71}\x{5B73}\x{5B75}\x{5B78}\x{5B7A}\x{5B80}\x{5B83}\x{5B85}\x{5B87}' .
|
||||
'\x{5B88}\x{5B89}\x{5B8B}\x{5B8C}\x{5B8D}\x{5B8F}\x{5B95}\x{5B97}\x{5B98}' .
|
||||
'\x{5B99}\x{5B9A}\x{5B9B}\x{5B9C}\x{5B9D}\x{5B9F}\x{5BA2}\x{5BA3}\x{5BA4}' .
|
||||
'\x{5BA5}\x{5BA6}\x{5BAE}\x{5BB0}\x{5BB3}\x{5BB4}\x{5BB5}\x{5BB6}\x{5BB8}' .
|
||||
'\x{5BB9}\x{5BBF}\x{5BC2}\x{5BC3}\x{5BC4}\x{5BC5}\x{5BC6}\x{5BC7}\x{5BC9}' .
|
||||
'\x{5BCC}\x{5BD0}\x{5BD2}\x{5BD3}\x{5BD4}\x{5BDB}\x{5BDD}\x{5BDE}\x{5BDF}' .
|
||||
'\x{5BE1}\x{5BE2}\x{5BE4}\x{5BE5}\x{5BE6}\x{5BE7}\x{5BE8}\x{5BE9}\x{5BEB}' .
|
||||
'\x{5BEE}\x{5BF0}\x{5BF3}\x{5BF5}\x{5BF6}\x{5BF8}\x{5BFA}\x{5BFE}\x{5BFF}' .
|
||||
'\x{5C01}\x{5C02}\x{5C04}\x{5C05}\x{5C06}\x{5C07}\x{5C08}\x{5C09}\x{5C0A}' .
|
||||
'\x{5C0B}\x{5C0D}\x{5C0E}\x{5C0F}\x{5C11}\x{5C13}\x{5C16}\x{5C1A}\x{5C20}' .
|
||||
'\x{5C22}\x{5C24}\x{5C28}\x{5C2D}\x{5C31}\x{5C38}\x{5C39}\x{5C3A}\x{5C3B}' .
|
||||
'\x{5C3C}\x{5C3D}\x{5C3E}\x{5C3F}\x{5C40}\x{5C41}\x{5C45}\x{5C46}\x{5C48}' .
|
||||
'\x{5C4A}\x{5C4B}\x{5C4D}\x{5C4E}\x{5C4F}\x{5C50}\x{5C51}\x{5C53}\x{5C55}' .
|
||||
'\x{5C5E}\x{5C60}\x{5C61}\x{5C64}\x{5C65}\x{5C6C}\x{5C6E}\x{5C6F}\x{5C71}' .
|
||||
'\x{5C76}\x{5C79}\x{5C8C}\x{5C90}\x{5C91}\x{5C94}\x{5CA1}\x{5CA8}\x{5CA9}' .
|
||||
'\x{5CAB}\x{5CAC}\x{5CB1}\x{5CB3}\x{5CB6}\x{5CB7}\x{5CB8}\x{5CBB}\x{5CBC}' .
|
||||
'\x{5CBE}\x{5CC5}\x{5CC7}\x{5CD9}\x{5CE0}\x{5CE1}\x{5CE8}\x{5CE9}\x{5CEA}' .
|
||||
'\x{5CED}\x{5CEF}\x{5CF0}\x{5CF6}\x{5CFA}\x{5CFB}\x{5CFD}\x{5D07}\x{5D0B}' .
|
||||
'\x{5D0E}\x{5D11}\x{5D14}\x{5D15}\x{5D16}\x{5D17}\x{5D18}\x{5D19}\x{5D1A}' .
|
||||
'\x{5D1B}\x{5D1F}\x{5D22}\x{5D29}\x{5D4B}\x{5D4C}\x{5D4E}\x{5D50}\x{5D52}' .
|
||||
'\x{5D5C}\x{5D69}\x{5D6C}\x{5D6F}\x{5D73}\x{5D76}\x{5D82}\x{5D84}\x{5D87}' .
|
||||
'\x{5D8B}\x{5D8C}\x{5D90}\x{5D9D}\x{5DA2}\x{5DAC}\x{5DAE}\x{5DB7}\x{5DBA}' .
|
||||
'\x{5DBC}\x{5DBD}\x{5DC9}\x{5DCC}\x{5DCD}\x{5DD2}\x{5DD3}\x{5DD6}\x{5DDB}' .
|
||||
'\x{5DDD}\x{5DDE}\x{5DE1}\x{5DE3}\x{5DE5}\x{5DE6}\x{5DE7}\x{5DE8}\x{5DEB}' .
|
||||
'\x{5DEE}\x{5DF1}\x{5DF2}\x{5DF3}\x{5DF4}\x{5DF5}\x{5DF7}\x{5DFB}\x{5DFD}' .
|
||||
'\x{5DFE}\x{5E02}\x{5E03}\x{5E06}\x{5E0B}\x{5E0C}\x{5E11}\x{5E16}\x{5E19}' .
|
||||
'\x{5E1A}\x{5E1B}\x{5E1D}\x{5E25}\x{5E2B}\x{5E2D}\x{5E2F}\x{5E30}\x{5E33}' .
|
||||
'\x{5E36}\x{5E37}\x{5E38}\x{5E3D}\x{5E40}\x{5E43}\x{5E44}\x{5E45}\x{5E47}' .
|
||||
'\x{5E4C}\x{5E4E}\x{5E54}\x{5E55}\x{5E57}\x{5E5F}\x{5E61}\x{5E62}\x{5E63}' .
|
||||
'\x{5E64}\x{5E72}\x{5E73}\x{5E74}\x{5E75}\x{5E76}\x{5E78}\x{5E79}\x{5E7A}' .
|
||||
'\x{5E7B}\x{5E7C}\x{5E7D}\x{5E7E}\x{5E7F}\x{5E81}\x{5E83}\x{5E84}\x{5E87}' .
|
||||
'\x{5E8A}\x{5E8F}\x{5E95}\x{5E96}\x{5E97}\x{5E9A}\x{5E9C}\x{5EA0}\x{5EA6}' .
|
||||
'\x{5EA7}\x{5EAB}\x{5EAD}\x{5EB5}\x{5EB6}\x{5EB7}\x{5EB8}\x{5EC1}\x{5EC2}' .
|
||||
'\x{5EC3}\x{5EC8}\x{5EC9}\x{5ECA}\x{5ECF}\x{5ED0}\x{5ED3}\x{5ED6}\x{5EDA}' .
|
||||
'\x{5EDB}\x{5EDD}\x{5EDF}\x{5EE0}\x{5EE1}\x{5EE2}\x{5EE3}\x{5EE8}\x{5EE9}' .
|
||||
'\x{5EEC}\x{5EF0}\x{5EF1}\x{5EF3}\x{5EF4}\x{5EF6}\x{5EF7}\x{5EF8}\x{5EFA}' .
|
||||
'\x{5EFB}\x{5EFC}\x{5EFE}\x{5EFF}\x{5F01}\x{5F03}\x{5F04}\x{5F09}\x{5F0A}' .
|
||||
'\x{5F0B}\x{5F0C}\x{5F0D}\x{5F0F}\x{5F10}\x{5F11}\x{5F13}\x{5F14}\x{5F15}' .
|
||||
'\x{5F16}\x{5F17}\x{5F18}\x{5F1B}\x{5F1F}\x{5F25}\x{5F26}\x{5F27}\x{5F29}' .
|
||||
'\x{5F2D}\x{5F2F}\x{5F31}\x{5F35}\x{5F37}\x{5F38}\x{5F3C}\x{5F3E}\x{5F41}' .
|
||||
'\x{5F48}\x{5F4A}\x{5F4C}\x{5F4E}\x{5F51}\x{5F53}\x{5F56}\x{5F57}\x{5F59}' .
|
||||
'\x{5F5C}\x{5F5D}\x{5F61}\x{5F62}\x{5F66}\x{5F69}\x{5F6A}\x{5F6B}\x{5F6C}' .
|
||||
'\x{5F6D}\x{5F70}\x{5F71}\x{5F73}\x{5F77}\x{5F79}\x{5F7C}\x{5F7F}\x{5F80}' .
|
||||
'\x{5F81}\x{5F82}\x{5F83}\x{5F84}\x{5F85}\x{5F87}\x{5F88}\x{5F8A}\x{5F8B}' .
|
||||
'\x{5F8C}\x{5F90}\x{5F91}\x{5F92}\x{5F93}\x{5F97}\x{5F98}\x{5F99}\x{5F9E}' .
|
||||
'\x{5FA0}\x{5FA1}\x{5FA8}\x{5FA9}\x{5FAA}\x{5FAD}\x{5FAE}\x{5FB3}\x{5FB4}' .
|
||||
'\x{5FB9}\x{5FBC}\x{5FBD}\x{5FC3}\x{5FC5}\x{5FCC}\x{5FCD}\x{5FD6}\x{5FD7}' .
|
||||
'\x{5FD8}\x{5FD9}\x{5FDC}\x{5FDD}\x{5FE0}\x{5FE4}\x{5FEB}\x{5FF0}\x{5FF1}' .
|
||||
'\x{5FF5}\x{5FF8}\x{5FFB}\x{5FFD}\x{5FFF}\x{600E}\x{600F}\x{6010}\x{6012}' .
|
||||
'\x{6015}\x{6016}\x{6019}\x{601B}\x{601C}\x{601D}\x{6020}\x{6021}\x{6025}' .
|
||||
'\x{6026}\x{6027}\x{6028}\x{6029}\x{602A}\x{602B}\x{602F}\x{6031}\x{603A}' .
|
||||
'\x{6041}\x{6042}\x{6043}\x{6046}\x{604A}\x{604B}\x{604D}\x{6050}\x{6052}' .
|
||||
'\x{6055}\x{6059}\x{605A}\x{605F}\x{6060}\x{6062}\x{6063}\x{6064}\x{6065}' .
|
||||
'\x{6068}\x{6069}\x{606A}\x{606B}\x{606C}\x{606D}\x{606F}\x{6070}\x{6075}' .
|
||||
'\x{6077}\x{6081}\x{6083}\x{6084}\x{6089}\x{608B}\x{608C}\x{608D}\x{6092}' .
|
||||
'\x{6094}\x{6096}\x{6097}\x{609A}\x{609B}\x{609F}\x{60A0}\x{60A3}\x{60A6}' .
|
||||
'\x{60A7}\x{60A9}\x{60AA}\x{60B2}\x{60B3}\x{60B4}\x{60B5}\x{60B6}\x{60B8}' .
|
||||
'\x{60BC}\x{60BD}\x{60C5}\x{60C6}\x{60C7}\x{60D1}\x{60D3}\x{60D8}\x{60DA}' .
|
||||
'\x{60DC}\x{60DF}\x{60E0}\x{60E1}\x{60E3}\x{60E7}\x{60E8}\x{60F0}\x{60F1}' .
|
||||
'\x{60F3}\x{60F4}\x{60F6}\x{60F7}\x{60F9}\x{60FA}\x{60FB}\x{6100}\x{6101}' .
|
||||
'\x{6103}\x{6106}\x{6108}\x{6109}\x{610D}\x{610E}\x{610F}\x{6115}\x{611A}' .
|
||||
'\x{611B}\x{611F}\x{6121}\x{6127}\x{6128}\x{612C}\x{6134}\x{613C}\x{613D}' .
|
||||
'\x{613E}\x{613F}\x{6142}\x{6144}\x{6147}\x{6148}\x{614A}\x{614B}\x{614C}' .
|
||||
'\x{614D}\x{614E}\x{6153}\x{6155}\x{6158}\x{6159}\x{615A}\x{615D}\x{615F}' .
|
||||
'\x{6162}\x{6163}\x{6165}\x{6167}\x{6168}\x{616B}\x{616E}\x{616F}\x{6170}' .
|
||||
'\x{6171}\x{6173}\x{6174}\x{6175}\x{6176}\x{6177}\x{617E}\x{6182}\x{6187}' .
|
||||
'\x{618A}\x{618E}\x{6190}\x{6191}\x{6194}\x{6196}\x{6199}\x{619A}\x{61A4}' .
|
||||
'\x{61A7}\x{61A9}\x{61AB}\x{61AC}\x{61AE}\x{61B2}\x{61B6}\x{61BA}\x{61BE}' .
|
||||
'\x{61C3}\x{61C6}\x{61C7}\x{61C8}\x{61C9}\x{61CA}\x{61CB}\x{61CC}\x{61CD}' .
|
||||
'\x{61D0}\x{61E3}\x{61E6}\x{61F2}\x{61F4}\x{61F6}\x{61F7}\x{61F8}\x{61FA}' .
|
||||
'\x{61FC}\x{61FD}\x{61FE}\x{61FF}\x{6200}\x{6208}\x{6209}\x{620A}\x{620C}' .
|
||||
'\x{620D}\x{620E}\x{6210}\x{6211}\x{6212}\x{6214}\x{6216}\x{621A}\x{621B}' .
|
||||
'\x{621D}\x{621E}\x{621F}\x{6221}\x{6226}\x{622A}\x{622E}\x{622F}\x{6230}' .
|
||||
'\x{6232}\x{6233}\x{6234}\x{6238}\x{623B}\x{623F}\x{6240}\x{6241}\x{6247}' .
|
||||
'\x{6248}\x{6249}\x{624B}\x{624D}\x{624E}\x{6253}\x{6255}\x{6258}\x{625B}' .
|
||||
'\x{625E}\x{6260}\x{6263}\x{6268}\x{626E}\x{6271}\x{6276}\x{6279}\x{627C}' .
|
||||
'\x{627E}\x{627F}\x{6280}\x{6282}\x{6283}\x{6284}\x{6289}\x{628A}\x{6291}' .
|
||||
'\x{6292}\x{6293}\x{6294}\x{6295}\x{6296}\x{6297}\x{6298}\x{629B}\x{629C}' .
|
||||
'\x{629E}\x{62AB}\x{62AC}\x{62B1}\x{62B5}\x{62B9}\x{62BB}\x{62BC}\x{62BD}' .
|
||||
'\x{62C2}\x{62C5}\x{62C6}\x{62C7}\x{62C8}\x{62C9}\x{62CA}\x{62CC}\x{62CD}' .
|
||||
'\x{62CF}\x{62D0}\x{62D1}\x{62D2}\x{62D3}\x{62D4}\x{62D7}\x{62D8}\x{62D9}' .
|
||||
'\x{62DB}\x{62DC}\x{62DD}\x{62E0}\x{62E1}\x{62EC}\x{62ED}\x{62EE}\x{62EF}' .
|
||||
'\x{62F1}\x{62F3}\x{62F5}\x{62F6}\x{62F7}\x{62FE}\x{62FF}\x{6301}\x{6302}' .
|
||||
'\x{6307}\x{6308}\x{6309}\x{630C}\x{6311}\x{6319}\x{631F}\x{6327}\x{6328}' .
|
||||
'\x{632B}\x{632F}\x{633A}\x{633D}\x{633E}\x{633F}\x{6349}\x{634C}\x{634D}' .
|
||||
'\x{634F}\x{6350}\x{6355}\x{6357}\x{635C}\x{6367}\x{6368}\x{6369}\x{636B}' .
|
||||
'\x{636E}\x{6372}\x{6376}\x{6377}\x{637A}\x{637B}\x{6380}\x{6383}\x{6388}' .
|
||||
'\x{6389}\x{638C}\x{638E}\x{638F}\x{6392}\x{6396}\x{6398}\x{639B}\x{639F}' .
|
||||
'\x{63A0}\x{63A1}\x{63A2}\x{63A3}\x{63A5}\x{63A7}\x{63A8}\x{63A9}\x{63AA}' .
|
||||
'\x{63AB}\x{63AC}\x{63B2}\x{63B4}\x{63B5}\x{63BB}\x{63BE}\x{63C0}\x{63C3}' .
|
||||
'\x{63C4}\x{63C6}\x{63C9}\x{63CF}\x{63D0}\x{63D2}\x{63D6}\x{63DA}\x{63DB}' .
|
||||
'\x{63E1}\x{63E3}\x{63E9}\x{63EE}\x{63F4}\x{63F6}\x{63FA}\x{6406}\x{640D}' .
|
||||
'\x{640F}\x{6413}\x{6416}\x{6417}\x{641C}\x{6426}\x{6428}\x{642C}\x{642D}' .
|
||||
'\x{6434}\x{6436}\x{643A}\x{643E}\x{6442}\x{644E}\x{6458}\x{6467}\x{6469}' .
|
||||
'\x{646F}\x{6476}\x{6478}\x{647A}\x{6483}\x{6488}\x{6492}\x{6493}\x{6495}' .
|
||||
'\x{649A}\x{649E}\x{64A4}\x{64A5}\x{64A9}\x{64AB}\x{64AD}\x{64AE}\x{64B0}' .
|
||||
'\x{64B2}\x{64B9}\x{64BB}\x{64BC}\x{64C1}\x{64C2}\x{64C5}\x{64C7}\x{64CD}' .
|
||||
'\x{64D2}\x{64D4}\x{64D8}\x{64DA}\x{64E0}\x{64E1}\x{64E2}\x{64E3}\x{64E6}' .
|
||||
'\x{64E7}\x{64EC}\x{64EF}\x{64F1}\x{64F2}\x{64F4}\x{64F6}\x{64FA}\x{64FD}' .
|
||||
'\x{64FE}\x{6500}\x{6505}\x{6518}\x{651C}\x{651D}\x{6523}\x{6524}\x{652A}' .
|
||||
'\x{652B}\x{652C}\x{652F}\x{6534}\x{6535}\x{6536}\x{6537}\x{6538}\x{6539}' .
|
||||
'\x{653B}\x{653E}\x{653F}\x{6545}\x{6548}\x{654D}\x{654F}\x{6551}\x{6555}' .
|
||||
'\x{6556}\x{6557}\x{6558}\x{6559}\x{655D}\x{655E}\x{6562}\x{6563}\x{6566}' .
|
||||
'\x{656C}\x{6570}\x{6572}\x{6574}\x{6575}\x{6577}\x{6578}\x{6582}\x{6583}' .
|
||||
'\x{6587}\x{6588}\x{6589}\x{658C}\x{658E}\x{6590}\x{6591}\x{6597}\x{6599}' .
|
||||
'\x{659B}\x{659C}\x{659F}\x{65A1}\x{65A4}\x{65A5}\x{65A7}\x{65AB}\x{65AC}' .
|
||||
'\x{65AD}\x{65AF}\x{65B0}\x{65B7}\x{65B9}\x{65BC}\x{65BD}\x{65C1}\x{65C3}' .
|
||||
'\x{65C4}\x{65C5}\x{65C6}\x{65CB}\x{65CC}\x{65CF}\x{65D2}\x{65D7}\x{65D9}' .
|
||||
'\x{65DB}\x{65E0}\x{65E1}\x{65E2}\x{65E5}\x{65E6}\x{65E7}\x{65E8}\x{65E9}' .
|
||||
'\x{65EC}\x{65ED}\x{65F1}\x{65FA}\x{65FB}\x{6602}\x{6603}\x{6606}\x{6607}' .
|
||||
'\x{660A}\x{660C}\x{660E}\x{660F}\x{6613}\x{6614}\x{661C}\x{661F}\x{6620}' .
|
||||
'\x{6625}\x{6627}\x{6628}\x{662D}\x{662F}\x{6634}\x{6635}\x{6636}\x{663C}' .
|
||||
'\x{663F}\x{6641}\x{6642}\x{6643}\x{6644}\x{6649}\x{664B}\x{664F}\x{6652}' .
|
||||
'\x{665D}\x{665E}\x{665F}\x{6662}\x{6664}\x{6666}\x{6667}\x{6668}\x{6669}' .
|
||||
'\x{666E}\x{666F}\x{6670}\x{6674}\x{6676}\x{667A}\x{6681}\x{6683}\x{6684}' .
|
||||
'\x{6687}\x{6688}\x{6689}\x{668E}\x{6691}\x{6696}\x{6697}\x{6698}\x{669D}' .
|
||||
'\x{66A2}\x{66A6}\x{66AB}\x{66AE}\x{66B4}\x{66B8}\x{66B9}\x{66BC}\x{66BE}' .
|
||||
'\x{66C1}\x{66C4}\x{66C7}\x{66C9}\x{66D6}\x{66D9}\x{66DA}\x{66DC}\x{66DD}' .
|
||||
'\x{66E0}\x{66E6}\x{66E9}\x{66F0}\x{66F2}\x{66F3}\x{66F4}\x{66F5}\x{66F7}' .
|
||||
'\x{66F8}\x{66F9}\x{66FC}\x{66FD}\x{66FE}\x{66FF}\x{6700}\x{6703}\x{6708}' .
|
||||
'\x{6709}\x{670B}\x{670D}\x{670F}\x{6714}\x{6715}\x{6716}\x{6717}\x{671B}' .
|
||||
'\x{671D}\x{671E}\x{671F}\x{6726}\x{6727}\x{6728}\x{672A}\x{672B}\x{672C}' .
|
||||
'\x{672D}\x{672E}\x{6731}\x{6734}\x{6736}\x{6737}\x{6738}\x{673A}\x{673D}' .
|
||||
'\x{673F}\x{6741}\x{6746}\x{6749}\x{674E}\x{674F}\x{6750}\x{6751}\x{6753}' .
|
||||
'\x{6756}\x{6759}\x{675C}\x{675E}\x{675F}\x{6760}\x{6761}\x{6762}\x{6763}' .
|
||||
'\x{6764}\x{6765}\x{676A}\x{676D}\x{676F}\x{6770}\x{6771}\x{6772}\x{6773}' .
|
||||
'\x{6775}\x{6777}\x{677C}\x{677E}\x{677F}\x{6785}\x{6787}\x{6789}\x{678B}' .
|
||||
'\x{678C}\x{6790}\x{6795}\x{6797}\x{679A}\x{679C}\x{679D}\x{67A0}\x{67A1}' .
|
||||
'\x{67A2}\x{67A6}\x{67A9}\x{67AF}\x{67B3}\x{67B4}\x{67B6}\x{67B7}\x{67B8}' .
|
||||
'\x{67B9}\x{67C1}\x{67C4}\x{67C6}\x{67CA}\x{67CE}\x{67CF}\x{67D0}\x{67D1}' .
|
||||
'\x{67D3}\x{67D4}\x{67D8}\x{67DA}\x{67DD}\x{67DE}\x{67E2}\x{67E4}\x{67E7}' .
|
||||
'\x{67E9}\x{67EC}\x{67EE}\x{67EF}\x{67F1}\x{67F3}\x{67F4}\x{67F5}\x{67FB}' .
|
||||
'\x{67FE}\x{67FF}\x{6802}\x{6803}\x{6804}\x{6813}\x{6816}\x{6817}\x{681E}' .
|
||||
'\x{6821}\x{6822}\x{6829}\x{682A}\x{682B}\x{6832}\x{6834}\x{6838}\x{6839}' .
|
||||
'\x{683C}\x{683D}\x{6840}\x{6841}\x{6842}\x{6843}\x{6846}\x{6848}\x{684D}' .
|
||||
'\x{684E}\x{6850}\x{6851}\x{6853}\x{6854}\x{6859}\x{685C}\x{685D}\x{685F}' .
|
||||
'\x{6863}\x{6867}\x{6874}\x{6876}\x{6877}\x{687E}\x{687F}\x{6881}\x{6883}' .
|
||||
'\x{6885}\x{688D}\x{688F}\x{6893}\x{6894}\x{6897}\x{689B}\x{689D}\x{689F}' .
|
||||
'\x{68A0}\x{68A2}\x{68A6}\x{68A7}\x{68A8}\x{68AD}\x{68AF}\x{68B0}\x{68B1}' .
|
||||
'\x{68B3}\x{68B5}\x{68B6}\x{68B9}\x{68BA}\x{68BC}\x{68C4}\x{68C6}\x{68C9}' .
|
||||
'\x{68CA}\x{68CB}\x{68CD}\x{68D2}\x{68D4}\x{68D5}\x{68D7}\x{68D8}\x{68DA}' .
|
||||
'\x{68DF}\x{68E0}\x{68E1}\x{68E3}\x{68E7}\x{68EE}\x{68EF}\x{68F2}\x{68F9}' .
|
||||
'\x{68FA}\x{6900}\x{6901}\x{6904}\x{6905}\x{6908}\x{690B}\x{690C}\x{690D}' .
|
||||
'\x{690E}\x{690F}\x{6912}\x{6919}\x{691A}\x{691B}\x{691C}\x{6921}\x{6922}' .
|
||||
'\x{6923}\x{6925}\x{6926}\x{6928}\x{692A}\x{6930}\x{6934}\x{6936}\x{6939}' .
|
||||
'\x{693D}\x{693F}\x{694A}\x{6953}\x{6954}\x{6955}\x{6959}\x{695A}\x{695C}' .
|
||||
'\x{695D}\x{695E}\x{6960}\x{6961}\x{6962}\x{696A}\x{696B}\x{696D}\x{696E}' .
|
||||
'\x{696F}\x{6973}\x{6974}\x{6975}\x{6977}\x{6978}\x{6979}\x{697C}\x{697D}' .
|
||||
'\x{697E}\x{6981}\x{6982}\x{698A}\x{698E}\x{6991}\x{6994}\x{6995}\x{699B}' .
|
||||
'\x{699C}\x{69A0}\x{69A7}\x{69AE}\x{69B1}\x{69B2}\x{69B4}\x{69BB}\x{69BE}' .
|
||||
'\x{69BF}\x{69C1}\x{69C3}\x{69C7}\x{69CA}\x{69CB}\x{69CC}\x{69CD}\x{69CE}' .
|
||||
'\x{69D0}\x{69D3}\x{69D8}\x{69D9}\x{69DD}\x{69DE}\x{69E7}\x{69E8}\x{69EB}' .
|
||||
'\x{69ED}\x{69F2}\x{69F9}\x{69FB}\x{69FD}\x{69FF}\x{6A02}\x{6A05}\x{6A0A}' .
|
||||
'\x{6A0B}\x{6A0C}\x{6A12}\x{6A13}\x{6A14}\x{6A17}\x{6A19}\x{6A1B}\x{6A1E}' .
|
||||
'\x{6A1F}\x{6A21}\x{6A22}\x{6A23}\x{6A29}\x{6A2A}\x{6A2B}\x{6A2E}\x{6A35}' .
|
||||
'\x{6A36}\x{6A38}\x{6A39}\x{6A3A}\x{6A3D}\x{6A44}\x{6A47}\x{6A48}\x{6A4B}' .
|
||||
'\x{6A58}\x{6A59}\x{6A5F}\x{6A61}\x{6A62}\x{6A66}\x{6A72}\x{6A78}\x{6A7F}' .
|
||||
'\x{6A80}\x{6A84}\x{6A8D}\x{6A8E}\x{6A90}\x{6A97}\x{6A9C}\x{6AA0}\x{6AA2}' .
|
||||
'\x{6AA3}\x{6AAA}\x{6AAC}\x{6AAE}\x{6AB3}\x{6AB8}\x{6ABB}\x{6AC1}\x{6AC2}' .
|
||||
'\x{6AC3}\x{6AD1}\x{6AD3}\x{6ADA}\x{6ADB}\x{6ADE}\x{6ADF}\x{6AE8}\x{6AEA}' .
|
||||
'\x{6AFA}\x{6AFB}\x{6B04}\x{6B05}\x{6B0A}\x{6B12}\x{6B16}\x{6B1D}\x{6B1F}' .
|
||||
'\x{6B20}\x{6B21}\x{6B23}\x{6B27}\x{6B32}\x{6B37}\x{6B38}\x{6B39}\x{6B3A}' .
|
||||
'\x{6B3D}\x{6B3E}\x{6B43}\x{6B47}\x{6B49}\x{6B4C}\x{6B4E}\x{6B50}\x{6B53}' .
|
||||
'\x{6B54}\x{6B59}\x{6B5B}\x{6B5F}\x{6B61}\x{6B62}\x{6B63}\x{6B64}\x{6B66}' .
|
||||
'\x{6B69}\x{6B6A}\x{6B6F}\x{6B73}\x{6B74}\x{6B78}\x{6B79}\x{6B7B}\x{6B7F}' .
|
||||
'\x{6B80}\x{6B83}\x{6B84}\x{6B86}\x{6B89}\x{6B8A}\x{6B8B}\x{6B8D}\x{6B95}' .
|
||||
'\x{6B96}\x{6B98}\x{6B9E}\x{6BA4}\x{6BAA}\x{6BAB}\x{6BAF}\x{6BB1}\x{6BB2}' .
|
||||
'\x{6BB3}\x{6BB4}\x{6BB5}\x{6BB7}\x{6BBA}\x{6BBB}\x{6BBC}\x{6BBF}\x{6BC0}' .
|
||||
'\x{6BC5}\x{6BC6}\x{6BCB}\x{6BCD}\x{6BCE}\x{6BD2}\x{6BD3}\x{6BD4}\x{6BD8}' .
|
||||
'\x{6BDB}\x{6BDF}\x{6BEB}\x{6BEC}\x{6BEF}\x{6BF3}\x{6C08}\x{6C0F}\x{6C11}' .
|
||||
'\x{6C13}\x{6C14}\x{6C17}\x{6C1B}\x{6C23}\x{6C24}\x{6C34}\x{6C37}\x{6C38}' .
|
||||
'\x{6C3E}\x{6C40}\x{6C41}\x{6C42}\x{6C4E}\x{6C50}\x{6C55}\x{6C57}\x{6C5A}' .
|
||||
'\x{6C5D}\x{6C5E}\x{6C5F}\x{6C60}\x{6C62}\x{6C68}\x{6C6A}\x{6C70}\x{6C72}' .
|
||||
'\x{6C73}\x{6C7A}\x{6C7D}\x{6C7E}\x{6C81}\x{6C82}\x{6C83}\x{6C88}\x{6C8C}' .
|
||||
'\x{6C8D}\x{6C90}\x{6C92}\x{6C93}\x{6C96}\x{6C99}\x{6C9A}\x{6C9B}\x{6CA1}' .
|
||||
'\x{6CA2}\x{6CAB}\x{6CAE}\x{6CB1}\x{6CB3}\x{6CB8}\x{6CB9}\x{6CBA}\x{6CBB}' .
|
||||
'\x{6CBC}\x{6CBD}\x{6CBE}\x{6CBF}\x{6CC1}\x{6CC4}\x{6CC5}\x{6CC9}\x{6CCA}' .
|
||||
'\x{6CCC}\x{6CD3}\x{6CD5}\x{6CD7}\x{6CD9}\x{6CDB}\x{6CDD}\x{6CE1}\x{6CE2}' .
|
||||
'\x{6CE3}\x{6CE5}\x{6CE8}\x{6CEA}\x{6CEF}\x{6CF0}\x{6CF1}\x{6CF3}\x{6D0B}' .
|
||||
'\x{6D0C}\x{6D12}\x{6D17}\x{6D19}\x{6D1B}\x{6D1E}\x{6D1F}\x{6D25}\x{6D29}' .
|
||||
'\x{6D2A}\x{6D2B}\x{6D32}\x{6D33}\x{6D35}\x{6D36}\x{6D38}\x{6D3B}\x{6D3D}' .
|
||||
'\x{6D3E}\x{6D41}\x{6D44}\x{6D45}\x{6D59}\x{6D5A}\x{6D5C}\x{6D63}\x{6D64}' .
|
||||
'\x{6D66}\x{6D69}\x{6D6A}\x{6D6C}\x{6D6E}\x{6D74}\x{6D77}\x{6D78}\x{6D79}' .
|
||||
'\x{6D85}\x{6D88}\x{6D8C}\x{6D8E}\x{6D93}\x{6D95}\x{6D99}\x{6D9B}\x{6D9C}' .
|
||||
'\x{6DAF}\x{6DB2}\x{6DB5}\x{6DB8}\x{6DBC}\x{6DC0}\x{6DC5}\x{6DC6}\x{6DC7}' .
|
||||
'\x{6DCB}\x{6DCC}\x{6DD1}\x{6DD2}\x{6DD5}\x{6DD8}\x{6DD9}\x{6DDE}\x{6DE1}' .
|
||||
'\x{6DE4}\x{6DE6}\x{6DE8}\x{6DEA}\x{6DEB}\x{6DEC}\x{6DEE}\x{6DF1}\x{6DF3}' .
|
||||
'\x{6DF5}\x{6DF7}\x{6DF9}\x{6DFA}\x{6DFB}\x{6E05}\x{6E07}\x{6E08}\x{6E09}' .
|
||||
'\x{6E0A}\x{6E0B}\x{6E13}\x{6E15}\x{6E19}\x{6E1A}\x{6E1B}\x{6E1D}\x{6E1F}' .
|
||||
'\x{6E20}\x{6E21}\x{6E23}\x{6E24}\x{6E25}\x{6E26}\x{6E29}\x{6E2B}\x{6E2C}' .
|
||||
'\x{6E2D}\x{6E2E}\x{6E2F}\x{6E38}\x{6E3A}\x{6E3E}\x{6E43}\x{6E4A}\x{6E4D}' .
|
||||
'\x{6E4E}\x{6E56}\x{6E58}\x{6E5B}\x{6E5F}\x{6E67}\x{6E6B}\x{6E6E}\x{6E6F}' .
|
||||
'\x{6E72}\x{6E76}\x{6E7E}\x{6E7F}\x{6E80}\x{6E82}\x{6E8C}\x{6E8F}\x{6E90}' .
|
||||
'\x{6E96}\x{6E98}\x{6E9C}\x{6E9D}\x{6E9F}\x{6EA2}\x{6EA5}\x{6EAA}\x{6EAF}' .
|
||||
'\x{6EB2}\x{6EB6}\x{6EB7}\x{6EBA}\x{6EBD}\x{6EC2}\x{6EC4}\x{6EC5}\x{6EC9}' .
|
||||
'\x{6ECB}\x{6ECC}\x{6ED1}\x{6ED3}\x{6ED4}\x{6ED5}\x{6EDD}\x{6EDE}\x{6EEC}' .
|
||||
'\x{6EEF}\x{6EF2}\x{6EF4}\x{6EF7}\x{6EF8}\x{6EFE}\x{6EFF}\x{6F01}\x{6F02}' .
|
||||
'\x{6F06}\x{6F09}\x{6F0F}\x{6F11}\x{6F13}\x{6F14}\x{6F15}\x{6F20}\x{6F22}' .
|
||||
'\x{6F23}\x{6F2B}\x{6F2C}\x{6F31}\x{6F32}\x{6F38}\x{6F3E}\x{6F3F}\x{6F41}' .
|
||||
'\x{6F45}\x{6F54}\x{6F58}\x{6F5B}\x{6F5C}\x{6F5F}\x{6F64}\x{6F66}\x{6F6D}' .
|
||||
'\x{6F6E}\x{6F6F}\x{6F70}\x{6F74}\x{6F78}\x{6F7A}\x{6F7C}\x{6F80}\x{6F81}' .
|
||||
'\x{6F82}\x{6F84}\x{6F86}\x{6F8E}\x{6F91}\x{6F97}\x{6FA1}\x{6FA3}\x{6FA4}' .
|
||||
'\x{6FAA}\x{6FB1}\x{6FB3}\x{6FB9}\x{6FC0}\x{6FC1}\x{6FC2}\x{6FC3}\x{6FC6}' .
|
||||
'\x{6FD4}\x{6FD5}\x{6FD8}\x{6FDB}\x{6FDF}\x{6FE0}\x{6FE1}\x{6FE4}\x{6FEB}' .
|
||||
'\x{6FEC}\x{6FEE}\x{6FEF}\x{6FF1}\x{6FF3}\x{6FF6}\x{6FFA}\x{6FFE}\x{7001}' .
|
||||
'\x{7009}\x{700B}\x{700F}\x{7011}\x{7015}\x{7018}\x{701A}\x{701B}\x{701D}' .
|
||||
'\x{701E}\x{701F}\x{7026}\x{7027}\x{702C}\x{7030}\x{7032}\x{703E}\x{704C}' .
|
||||
'\x{7051}\x{7058}\x{7063}\x{706B}\x{706F}\x{7070}\x{7078}\x{707C}\x{707D}' .
|
||||
'\x{7089}\x{708A}\x{708E}\x{7092}\x{7099}\x{70AC}\x{70AD}\x{70AE}\x{70AF}' .
|
||||
'\x{70B3}\x{70B8}\x{70B9}\x{70BA}\x{70C8}\x{70CB}\x{70CF}\x{70D9}\x{70DD}' .
|
||||
'\x{70DF}\x{70F1}\x{70F9}\x{70FD}\x{7109}\x{7114}\x{7119}\x{711A}\x{711C}' .
|
||||
'\x{7121}\x{7126}\x{7136}\x{713C}\x{7149}\x{714C}\x{714E}\x{7155}\x{7156}' .
|
||||
'\x{7159}\x{7162}\x{7164}\x{7165}\x{7166}\x{7167}\x{7169}\x{716C}\x{716E}' .
|
||||
'\x{717D}\x{7184}\x{7188}\x{718A}\x{718F}\x{7194}\x{7195}\x{7199}\x{719F}' .
|
||||
'\x{71A8}\x{71AC}\x{71B1}\x{71B9}\x{71BE}\x{71C3}\x{71C8}\x{71C9}\x{71CE}' .
|
||||
'\x{71D0}\x{71D2}\x{71D4}\x{71D5}\x{71D7}\x{71DF}\x{71E0}\x{71E5}\x{71E6}' .
|
||||
'\x{71E7}\x{71EC}\x{71ED}\x{71EE}\x{71F5}\x{71F9}\x{71FB}\x{71FC}\x{71FF}' .
|
||||
'\x{7206}\x{720D}\x{7210}\x{721B}\x{7228}\x{722A}\x{722C}\x{722D}\x{7230}' .
|
||||
'\x{7232}\x{7235}\x{7236}\x{723A}\x{723B}\x{723C}\x{723D}\x{723E}\x{723F}' .
|
||||
'\x{7240}\x{7246}\x{7247}\x{7248}\x{724B}\x{724C}\x{7252}\x{7258}\x{7259}' .
|
||||
'\x{725B}\x{725D}\x{725F}\x{7261}\x{7262}\x{7267}\x{7269}\x{7272}\x{7274}' .
|
||||
'\x{7279}\x{727D}\x{727E}\x{7280}\x{7281}\x{7282}\x{7287}\x{7292}\x{7296}' .
|
||||
'\x{72A0}\x{72A2}\x{72A7}\x{72AC}\x{72AF}\x{72B2}\x{72B6}\x{72B9}\x{72C2}' .
|
||||
'\x{72C3}\x{72C4}\x{72C6}\x{72CE}\x{72D0}\x{72D2}\x{72D7}\x{72D9}\x{72DB}' .
|
||||
'\x{72E0}\x{72E1}\x{72E2}\x{72E9}\x{72EC}\x{72ED}\x{72F7}\x{72F8}\x{72F9}' .
|
||||
'\x{72FC}\x{72FD}\x{730A}\x{7316}\x{7317}\x{731B}\x{731C}\x{731D}\x{731F}' .
|
||||
'\x{7325}\x{7329}\x{732A}\x{732B}\x{732E}\x{732F}\x{7334}\x{7336}\x{7337}' .
|
||||
'\x{733E}\x{733F}\x{7344}\x{7345}\x{734E}\x{734F}\x{7357}\x{7363}\x{7368}' .
|
||||
'\x{736A}\x{7370}\x{7372}\x{7375}\x{7378}\x{737A}\x{737B}\x{7384}\x{7387}' .
|
||||
'\x{7389}\x{738B}\x{7396}\x{73A9}\x{73B2}\x{73B3}\x{73BB}\x{73C0}\x{73C2}' .
|
||||
'\x{73C8}\x{73CA}\x{73CD}\x{73CE}\x{73DE}\x{73E0}\x{73E5}\x{73EA}\x{73ED}' .
|
||||
'\x{73EE}\x{73F1}\x{73F8}\x{73FE}\x{7403}\x{7405}\x{7406}\x{7409}\x{7422}' .
|
||||
'\x{7425}\x{7432}\x{7433}\x{7434}\x{7435}\x{7436}\x{743A}\x{743F}\x{7441}' .
|
||||
'\x{7455}\x{7459}\x{745A}\x{745B}\x{745C}\x{745E}\x{745F}\x{7460}\x{7463}' .
|
||||
'\x{7464}\x{7469}\x{746A}\x{746F}\x{7470}\x{7473}\x{7476}\x{747E}\x{7483}' .
|
||||
'\x{748B}\x{749E}\x{74A2}\x{74A7}\x{74B0}\x{74BD}\x{74CA}\x{74CF}\x{74D4}' .
|
||||
'\x{74DC}\x{74E0}\x{74E2}\x{74E3}\x{74E6}\x{74E7}\x{74E9}\x{74EE}\x{74F0}' .
|
||||
'\x{74F1}\x{74F2}\x{74F6}\x{74F7}\x{74F8}\x{7503}\x{7504}\x{7505}\x{750C}' .
|
||||
'\x{750D}\x{750E}\x{7511}\x{7513}\x{7515}\x{7518}\x{751A}\x{751C}\x{751E}' .
|
||||
'\x{751F}\x{7523}\x{7525}\x{7526}\x{7528}\x{752B}\x{752C}\x{7530}\x{7531}' .
|
||||
'\x{7532}\x{7533}\x{7537}\x{7538}\x{753A}\x{753B}\x{753C}\x{7544}\x{7546}' .
|
||||
'\x{7549}\x{754A}\x{754B}\x{754C}\x{754D}\x{754F}\x{7551}\x{7554}\x{7559}' .
|
||||
'\x{755A}\x{755B}\x{755C}\x{755D}\x{7560}\x{7562}\x{7564}\x{7565}\x{7566}' .
|
||||
'\x{7567}\x{7569}\x{756A}\x{756B}\x{756D}\x{7570}\x{7573}\x{7574}\x{7576}' .
|
||||
'\x{7577}\x{7578}\x{757F}\x{7582}\x{7586}\x{7587}\x{7589}\x{758A}\x{758B}' .
|
||||
'\x{758E}\x{758F}\x{7591}\x{7594}\x{759A}\x{759D}\x{75A3}\x{75A5}\x{75AB}' .
|
||||
'\x{75B1}\x{75B2}\x{75B3}\x{75B5}\x{75B8}\x{75B9}\x{75BC}\x{75BD}\x{75BE}' .
|
||||
'\x{75C2}\x{75C3}\x{75C5}\x{75C7}\x{75CA}\x{75CD}\x{75D2}\x{75D4}\x{75D5}' .
|
||||
'\x{75D8}\x{75D9}\x{75DB}\x{75DE}\x{75E2}\x{75E3}\x{75E9}\x{75F0}\x{75F2}' .
|
||||
'\x{75F3}\x{75F4}\x{75FA}\x{75FC}\x{75FE}\x{75FF}\x{7601}\x{7609}\x{760B}' .
|
||||
'\x{760D}\x{761F}\x{7620}\x{7621}\x{7622}\x{7624}\x{7627}\x{7630}\x{7634}' .
|
||||
'\x{763B}\x{7642}\x{7646}\x{7647}\x{7648}\x{764C}\x{7652}\x{7656}\x{7658}' .
|
||||
'\x{765C}\x{7661}\x{7662}\x{7667}\x{7668}\x{7669}\x{766A}\x{766C}\x{7670}' .
|
||||
'\x{7672}\x{7676}\x{7678}\x{767A}\x{767B}\x{767C}\x{767D}\x{767E}\x{7680}' .
|
||||
'\x{7683}\x{7684}\x{7686}\x{7687}\x{7688}\x{768B}\x{768E}\x{7690}\x{7693}' .
|
||||
'\x{7696}\x{7699}\x{769A}\x{76AE}\x{76B0}\x{76B4}\x{76B7}\x{76B8}\x{76B9}' .
|
||||
'\x{76BA}\x{76BF}\x{76C2}\x{76C3}\x{76C6}\x{76C8}\x{76CA}\x{76CD}\x{76D2}' .
|
||||
'\x{76D6}\x{76D7}\x{76DB}\x{76DC}\x{76DE}\x{76DF}\x{76E1}\x{76E3}\x{76E4}' .
|
||||
'\x{76E5}\x{76E7}\x{76EA}\x{76EE}\x{76F2}\x{76F4}\x{76F8}\x{76FB}\x{76FE}' .
|
||||
'\x{7701}\x{7704}\x{7707}\x{7708}\x{7709}\x{770B}\x{770C}\x{771B}\x{771E}' .
|
||||
'\x{771F}\x{7720}\x{7724}\x{7725}\x{7726}\x{7729}\x{7737}\x{7738}\x{773A}' .
|
||||
'\x{773C}\x{7740}\x{7747}\x{775A}\x{775B}\x{7761}\x{7763}\x{7765}\x{7766}' .
|
||||
'\x{7768}\x{776B}\x{7779}\x{777E}\x{777F}\x{778B}\x{778E}\x{7791}\x{779E}' .
|
||||
'\x{77A0}\x{77A5}\x{77AC}\x{77AD}\x{77B0}\x{77B3}\x{77B6}\x{77B9}\x{77BB}' .
|
||||
'\x{77BC}\x{77BD}\x{77BF}\x{77C7}\x{77CD}\x{77D7}\x{77DA}\x{77DB}\x{77DC}' .
|
||||
'\x{77E2}\x{77E3}\x{77E5}\x{77E7}\x{77E9}\x{77ED}\x{77EE}\x{77EF}\x{77F3}' .
|
||||
'\x{77FC}\x{7802}\x{780C}\x{7812}\x{7814}\x{7815}\x{7820}\x{7825}\x{7826}' .
|
||||
'\x{7827}\x{7832}\x{7834}\x{783A}\x{783F}\x{7845}\x{785D}\x{786B}\x{786C}' .
|
||||
'\x{786F}\x{7872}\x{7874}\x{787C}\x{7881}\x{7886}\x{7887}\x{788C}\x{788D}' .
|
||||
'\x{788E}\x{7891}\x{7893}\x{7895}\x{7897}\x{789A}\x{78A3}\x{78A7}\x{78A9}' .
|
||||
'\x{78AA}\x{78AF}\x{78B5}\x{78BA}\x{78BC}\x{78BE}\x{78C1}\x{78C5}\x{78C6}' .
|
||||
'\x{78CA}\x{78CB}\x{78D0}\x{78D1}\x{78D4}\x{78DA}\x{78E7}\x{78E8}\x{78EC}' .
|
||||
'\x{78EF}\x{78F4}\x{78FD}\x{7901}\x{7907}\x{790E}\x{7911}\x{7912}\x{7919}' .
|
||||
'\x{7926}\x{792A}\x{792B}\x{792C}\x{793A}\x{793C}\x{793E}\x{7940}\x{7941}' .
|
||||
'\x{7947}\x{7948}\x{7949}\x{7950}\x{7953}\x{7955}\x{7956}\x{7957}\x{795A}' .
|
||||
'\x{795D}\x{795E}\x{795F}\x{7960}\x{7962}\x{7965}\x{7968}\x{796D}\x{7977}' .
|
||||
'\x{797A}\x{797F}\x{7980}\x{7981}\x{7984}\x{7985}\x{798A}\x{798D}\x{798E}' .
|
||||
'\x{798F}\x{799D}\x{79A6}\x{79A7}\x{79AA}\x{79AE}\x{79B0}\x{79B3}\x{79B9}' .
|
||||
'\x{79BA}\x{79BD}\x{79BE}\x{79BF}\x{79C0}\x{79C1}\x{79C9}\x{79CB}\x{79D1}' .
|
||||
'\x{79D2}\x{79D5}\x{79D8}\x{79DF}\x{79E1}\x{79E3}\x{79E4}\x{79E6}\x{79E7}' .
|
||||
'\x{79E9}\x{79EC}\x{79F0}\x{79FB}\x{7A00}\x{7A08}\x{7A0B}\x{7A0D}\x{7A0E}' .
|
||||
'\x{7A14}\x{7A17}\x{7A18}\x{7A19}\x{7A1A}\x{7A1C}\x{7A1F}\x{7A20}\x{7A2E}' .
|
||||
'\x{7A31}\x{7A32}\x{7A37}\x{7A3B}\x{7A3C}\x{7A3D}\x{7A3E}\x{7A3F}\x{7A40}' .
|
||||
'\x{7A42}\x{7A43}\x{7A46}\x{7A49}\x{7A4D}\x{7A4E}\x{7A4F}\x{7A50}\x{7A57}' .
|
||||
'\x{7A61}\x{7A62}\x{7A63}\x{7A69}\x{7A6B}\x{7A70}\x{7A74}\x{7A76}\x{7A79}' .
|
||||
'\x{7A7A}\x{7A7D}\x{7A7F}\x{7A81}\x{7A83}\x{7A84}\x{7A88}\x{7A92}\x{7A93}' .
|
||||
'\x{7A95}\x{7A96}\x{7A97}\x{7A98}\x{7A9F}\x{7AA9}\x{7AAA}\x{7AAE}\x{7AAF}' .
|
||||
'\x{7AB0}\x{7AB6}\x{7ABA}\x{7ABF}\x{7AC3}\x{7AC4}\x{7AC5}\x{7AC7}\x{7AC8}' .
|
||||
'\x{7ACA}\x{7ACB}\x{7ACD}\x{7ACF}\x{7AD2}\x{7AD3}\x{7AD5}\x{7AD9}\x{7ADA}' .
|
||||
'\x{7ADC}\x{7ADD}\x{7ADF}\x{7AE0}\x{7AE1}\x{7AE2}\x{7AE3}\x{7AE5}\x{7AE6}' .
|
||||
'\x{7AEA}\x{7AED}\x{7AEF}\x{7AF0}\x{7AF6}\x{7AF8}\x{7AF9}\x{7AFA}\x{7AFF}' .
|
||||
'\x{7B02}\x{7B04}\x{7B06}\x{7B08}\x{7B0A}\x{7B0B}\x{7B0F}\x{7B11}\x{7B18}' .
|
||||
'\x{7B19}\x{7B1B}\x{7B1E}\x{7B20}\x{7B25}\x{7B26}\x{7B28}\x{7B2C}\x{7B33}' .
|
||||
'\x{7B35}\x{7B36}\x{7B39}\x{7B45}\x{7B46}\x{7B48}\x{7B49}\x{7B4B}\x{7B4C}' .
|
||||
'\x{7B4D}\x{7B4F}\x{7B50}\x{7B51}\x{7B52}\x{7B54}\x{7B56}\x{7B5D}\x{7B65}' .
|
||||
'\x{7B67}\x{7B6C}\x{7B6E}\x{7B70}\x{7B71}\x{7B74}\x{7B75}\x{7B7A}\x{7B86}' .
|
||||
'\x{7B87}\x{7B8B}\x{7B8D}\x{7B8F}\x{7B92}\x{7B94}\x{7B95}\x{7B97}\x{7B98}' .
|
||||
'\x{7B99}\x{7B9A}\x{7B9C}\x{7B9D}\x{7B9F}\x{7BA1}\x{7BAA}\x{7BAD}\x{7BB1}' .
|
||||
'\x{7BB4}\x{7BB8}\x{7BC0}\x{7BC1}\x{7BC4}\x{7BC6}\x{7BC7}\x{7BC9}\x{7BCB}' .
|
||||
'\x{7BCC}\x{7BCF}\x{7BDD}\x{7BE0}\x{7BE4}\x{7BE5}\x{7BE6}\x{7BE9}\x{7BED}' .
|
||||
'\x{7BF3}\x{7BF6}\x{7BF7}\x{7C00}\x{7C07}\x{7C0D}\x{7C11}\x{7C12}\x{7C13}' .
|
||||
'\x{7C14}\x{7C17}\x{7C1F}\x{7C21}\x{7C23}\x{7C27}\x{7C2A}\x{7C2B}\x{7C37}' .
|
||||
'\x{7C38}\x{7C3D}\x{7C3E}\x{7C3F}\x{7C40}\x{7C43}\x{7C4C}\x{7C4D}\x{7C4F}' .
|
||||
'\x{7C50}\x{7C54}\x{7C56}\x{7C58}\x{7C5F}\x{7C60}\x{7C64}\x{7C65}\x{7C6C}' .
|
||||
'\x{7C73}\x{7C75}\x{7C7E}\x{7C81}\x{7C82}\x{7C83}\x{7C89}\x{7C8B}\x{7C8D}' .
|
||||
'\x{7C90}\x{7C92}\x{7C95}\x{7C97}\x{7C98}\x{7C9B}\x{7C9F}\x{7CA1}\x{7CA2}' .
|
||||
'\x{7CA4}\x{7CA5}\x{7CA7}\x{7CA8}\x{7CAB}\x{7CAD}\x{7CAE}\x{7CB1}\x{7CB2}' .
|
||||
'\x{7CB3}\x{7CB9}\x{7CBD}\x{7CBE}\x{7CC0}\x{7CC2}\x{7CC5}\x{7CCA}\x{7CCE}' .
|
||||
'\x{7CD2}\x{7CD6}\x{7CD8}\x{7CDC}\x{7CDE}\x{7CDF}\x{7CE0}\x{7CE2}\x{7CE7}' .
|
||||
'\x{7CEF}\x{7CF2}\x{7CF4}\x{7CF6}\x{7CF8}\x{7CFA}\x{7CFB}\x{7CFE}\x{7D00}' .
|
||||
'\x{7D02}\x{7D04}\x{7D05}\x{7D06}\x{7D0A}\x{7D0B}\x{7D0D}\x{7D10}\x{7D14}' .
|
||||
'\x{7D15}\x{7D17}\x{7D18}\x{7D19}\x{7D1A}\x{7D1B}\x{7D1C}\x{7D20}\x{7D21}' .
|
||||
'\x{7D22}\x{7D2B}\x{7D2C}\x{7D2E}\x{7D2F}\x{7D30}\x{7D32}\x{7D33}\x{7D35}' .
|
||||
'\x{7D39}\x{7D3A}\x{7D3F}\x{7D42}\x{7D43}\x{7D44}\x{7D45}\x{7D46}\x{7D4B}' .
|
||||
'\x{7D4C}\x{7D4E}\x{7D4F}\x{7D50}\x{7D56}\x{7D5B}\x{7D5E}\x{7D61}\x{7D62}' .
|
||||
'\x{7D63}\x{7D66}\x{7D68}\x{7D6E}\x{7D71}\x{7D72}\x{7D73}\x{7D75}\x{7D76}' .
|
||||
'\x{7D79}\x{7D7D}\x{7D89}\x{7D8F}\x{7D93}\x{7D99}\x{7D9A}\x{7D9B}\x{7D9C}' .
|
||||
'\x{7D9F}\x{7DA2}\x{7DA3}\x{7DAB}\x{7DAC}\x{7DAD}\x{7DAE}\x{7DAF}\x{7DB0}' .
|
||||
'\x{7DB1}\x{7DB2}\x{7DB4}\x{7DB5}\x{7DB8}\x{7DBA}\x{7DBB}\x{7DBD}\x{7DBE}' .
|
||||
'\x{7DBF}\x{7DC7}\x{7DCA}\x{7DCB}\x{7DCF}\x{7DD1}\x{7DD2}\x{7DD5}\x{7DD8}' .
|
||||
'\x{7DDA}\x{7DDC}\x{7DDD}\x{7DDE}\x{7DE0}\x{7DE1}\x{7DE4}\x{7DE8}\x{7DE9}' .
|
||||
'\x{7DEC}\x{7DEF}\x{7DF2}\x{7DF4}\x{7DFB}\x{7E01}\x{7E04}\x{7E05}\x{7E09}' .
|
||||
'\x{7E0A}\x{7E0B}\x{7E12}\x{7E1B}\x{7E1E}\x{7E1F}\x{7E21}\x{7E22}\x{7E23}' .
|
||||
'\x{7E26}\x{7E2B}\x{7E2E}\x{7E31}\x{7E32}\x{7E35}\x{7E37}\x{7E39}\x{7E3A}' .
|
||||
'\x{7E3B}\x{7E3D}\x{7E3E}\x{7E41}\x{7E43}\x{7E46}\x{7E4A}\x{7E4B}\x{7E4D}' .
|
||||
'\x{7E54}\x{7E55}\x{7E56}\x{7E59}\x{7E5A}\x{7E5D}\x{7E5E}\x{7E66}\x{7E67}' .
|
||||
'\x{7E69}\x{7E6A}\x{7E6D}\x{7E70}\x{7E79}\x{7E7B}\x{7E7C}\x{7E7D}\x{7E7F}' .
|
||||
'\x{7E82}\x{7E83}\x{7E88}\x{7E89}\x{7E8C}\x{7E8E}\x{7E8F}\x{7E90}\x{7E92}' .
|
||||
'\x{7E93}\x{7E94}\x{7E96}\x{7E9B}\x{7E9C}\x{7F36}\x{7F38}\x{7F3A}\x{7F45}' .
|
||||
'\x{7F4C}\x{7F4D}\x{7F4E}\x{7F50}\x{7F51}\x{7F54}\x{7F55}\x{7F58}\x{7F5F}' .
|
||||
'\x{7F60}\x{7F67}\x{7F68}\x{7F69}\x{7F6A}\x{7F6B}\x{7F6E}\x{7F70}\x{7F72}' .
|
||||
'\x{7F75}\x{7F77}\x{7F78}\x{7F79}\x{7F82}\x{7F83}\x{7F85}\x{7F86}\x{7F87}' .
|
||||
'\x{7F88}\x{7F8A}\x{7F8C}\x{7F8E}\x{7F94}\x{7F9A}\x{7F9D}\x{7F9E}\x{7FA3}' .
|
||||
'\x{7FA4}\x{7FA8}\x{7FA9}\x{7FAE}\x{7FAF}\x{7FB2}\x{7FB6}\x{7FB8}\x{7FB9}' .
|
||||
'\x{7FBD}\x{7FC1}\x{7FC5}\x{7FC6}\x{7FCA}\x{7FCC}\x{7FD2}\x{7FD4}\x{7FD5}' .
|
||||
'\x{7FE0}\x{7FE1}\x{7FE6}\x{7FE9}\x{7FEB}\x{7FF0}\x{7FF3}\x{7FF9}\x{7FFB}' .
|
||||
'\x{7FFC}\x{8000}\x{8001}\x{8003}\x{8004}\x{8005}\x{8006}\x{800B}\x{800C}' .
|
||||
'\x{8010}\x{8012}\x{8015}\x{8017}\x{8018}\x{8019}\x{801C}\x{8021}\x{8028}' .
|
||||
'\x{8033}\x{8036}\x{803B}\x{803D}\x{803F}\x{8046}\x{804A}\x{8052}\x{8056}' .
|
||||
'\x{8058}\x{805A}\x{805E}\x{805F}\x{8061}\x{8062}\x{8068}\x{806F}\x{8070}' .
|
||||
'\x{8072}\x{8073}\x{8074}\x{8076}\x{8077}\x{8079}\x{807D}\x{807E}\x{807F}' .
|
||||
'\x{8084}\x{8085}\x{8086}\x{8087}\x{8089}\x{808B}\x{808C}\x{8093}\x{8096}' .
|
||||
'\x{8098}\x{809A}\x{809B}\x{809D}\x{80A1}\x{80A2}\x{80A5}\x{80A9}\x{80AA}' .
|
||||
'\x{80AC}\x{80AD}\x{80AF}\x{80B1}\x{80B2}\x{80B4}\x{80BA}\x{80C3}\x{80C4}' .
|
||||
'\x{80C6}\x{80CC}\x{80CE}\x{80D6}\x{80D9}\x{80DA}\x{80DB}\x{80DD}\x{80DE}' .
|
||||
'\x{80E1}\x{80E4}\x{80E5}\x{80EF}\x{80F1}\x{80F4}\x{80F8}\x{80FC}\x{80FD}' .
|
||||
'\x{8102}\x{8105}\x{8106}\x{8107}\x{8108}\x{8109}\x{810A}\x{811A}\x{811B}' .
|
||||
'\x{8123}\x{8129}\x{812F}\x{8131}\x{8133}\x{8139}\x{813E}\x{8146}\x{814B}' .
|
||||
'\x{814E}\x{8150}\x{8151}\x{8153}\x{8154}\x{8155}\x{815F}\x{8165}\x{8166}' .
|
||||
'\x{816B}\x{816E}\x{8170}\x{8171}\x{8174}\x{8178}\x{8179}\x{817A}\x{817F}' .
|
||||
'\x{8180}\x{8182}\x{8183}\x{8188}\x{818A}\x{818F}\x{8193}\x{8195}\x{819A}' .
|
||||
'\x{819C}\x{819D}\x{81A0}\x{81A3}\x{81A4}\x{81A8}\x{81A9}\x{81B0}\x{81B3}' .
|
||||
'\x{81B5}\x{81B8}\x{81BA}\x{81BD}\x{81BE}\x{81BF}\x{81C0}\x{81C2}\x{81C6}' .
|
||||
'\x{81C8}\x{81C9}\x{81CD}\x{81D1}\x{81D3}\x{81D8}\x{81D9}\x{81DA}\x{81DF}' .
|
||||
'\x{81E0}\x{81E3}\x{81E5}\x{81E7}\x{81E8}\x{81EA}\x{81ED}\x{81F3}\x{81F4}' .
|
||||
'\x{81FA}\x{81FB}\x{81FC}\x{81FE}\x{8201}\x{8202}\x{8205}\x{8207}\x{8208}' .
|
||||
'\x{8209}\x{820A}\x{820C}\x{820D}\x{820E}\x{8210}\x{8212}\x{8216}\x{8217}' .
|
||||
'\x{8218}\x{821B}\x{821C}\x{821E}\x{821F}\x{8229}\x{822A}\x{822B}\x{822C}' .
|
||||
'\x{822E}\x{8233}\x{8235}\x{8236}\x{8237}\x{8238}\x{8239}\x{8240}\x{8247}' .
|
||||
'\x{8258}\x{8259}\x{825A}\x{825D}\x{825F}\x{8262}\x{8264}\x{8266}\x{8268}' .
|
||||
'\x{826A}\x{826B}\x{826E}\x{826F}\x{8271}\x{8272}\x{8276}\x{8277}\x{8278}' .
|
||||
'\x{827E}\x{828B}\x{828D}\x{8292}\x{8299}\x{829D}\x{829F}\x{82A5}\x{82A6}' .
|
||||
'\x{82AB}\x{82AC}\x{82AD}\x{82AF}\x{82B1}\x{82B3}\x{82B8}\x{82B9}\x{82BB}' .
|
||||
'\x{82BD}\x{82C5}\x{82D1}\x{82D2}\x{82D3}\x{82D4}\x{82D7}\x{82D9}\x{82DB}' .
|
||||
'\x{82DC}\x{82DE}\x{82DF}\x{82E1}\x{82E3}\x{82E5}\x{82E6}\x{82E7}\x{82EB}' .
|
||||
'\x{82F1}\x{82F3}\x{82F4}\x{82F9}\x{82FA}\x{82FB}\x{8302}\x{8303}\x{8304}' .
|
||||
'\x{8305}\x{8306}\x{8309}\x{830E}\x{8316}\x{8317}\x{8318}\x{831C}\x{8323}' .
|
||||
'\x{8328}\x{832B}\x{832F}\x{8331}\x{8332}\x{8334}\x{8335}\x{8336}\x{8338}' .
|
||||
'\x{8339}\x{8340}\x{8345}\x{8349}\x{834A}\x{834F}\x{8350}\x{8352}\x{8358}' .
|
||||
'\x{8373}\x{8375}\x{8377}\x{837B}\x{837C}\x{8385}\x{8387}\x{8389}\x{838A}' .
|
||||
'\x{838E}\x{8393}\x{8396}\x{839A}\x{839E}\x{839F}\x{83A0}\x{83A2}\x{83A8}' .
|
||||
'\x{83AA}\x{83AB}\x{83B1}\x{83B5}\x{83BD}\x{83C1}\x{83C5}\x{83CA}\x{83CC}' .
|
||||
'\x{83CE}\x{83D3}\x{83D6}\x{83D8}\x{83DC}\x{83DF}\x{83E0}\x{83E9}\x{83EB}' .
|
||||
'\x{83EF}\x{83F0}\x{83F1}\x{83F2}\x{83F4}\x{83F7}\x{83FB}\x{83FD}\x{8403}' .
|
||||
'\x{8404}\x{8407}\x{840B}\x{840C}\x{840D}\x{840E}\x{8413}\x{8420}\x{8422}' .
|
||||
'\x{8429}\x{842A}\x{842C}\x{8431}\x{8435}\x{8438}\x{843C}\x{843D}\x{8446}' .
|
||||
'\x{8449}\x{844E}\x{8457}\x{845B}\x{8461}\x{8462}\x{8463}\x{8466}\x{8469}' .
|
||||
'\x{846B}\x{846C}\x{846D}\x{846E}\x{846F}\x{8471}\x{8475}\x{8477}\x{8479}' .
|
||||
'\x{847A}\x{8482}\x{8484}\x{848B}\x{8490}\x{8494}\x{8499}\x{849C}\x{849F}' .
|
||||
'\x{84A1}\x{84AD}\x{84B2}\x{84B8}\x{84B9}\x{84BB}\x{84BC}\x{84BF}\x{84C1}' .
|
||||
'\x{84C4}\x{84C6}\x{84C9}\x{84CA}\x{84CB}\x{84CD}\x{84D0}\x{84D1}\x{84D6}' .
|
||||
'\x{84D9}\x{84DA}\x{84EC}\x{84EE}\x{84F4}\x{84FC}\x{84FF}\x{8500}\x{8506}' .
|
||||
'\x{8511}\x{8513}\x{8514}\x{8515}\x{8517}\x{8518}\x{851A}\x{851F}\x{8521}' .
|
||||
'\x{8526}\x{852C}\x{852D}\x{8535}\x{853D}\x{8540}\x{8541}\x{8543}\x{8548}' .
|
||||
'\x{8549}\x{854A}\x{854B}\x{854E}\x{8555}\x{8557}\x{8558}\x{855A}\x{8563}' .
|
||||
'\x{8568}\x{8569}\x{856A}\x{856D}\x{8577}\x{857E}\x{8580}\x{8584}\x{8587}' .
|
||||
'\x{8588}\x{858A}\x{8590}\x{8591}\x{8594}\x{8597}\x{8599}\x{859B}\x{859C}' .
|
||||
'\x{85A4}\x{85A6}\x{85A8}\x{85A9}\x{85AA}\x{85AB}\x{85AC}\x{85AE}\x{85AF}' .
|
||||
'\x{85B9}\x{85BA}\x{85C1}\x{85C9}\x{85CD}\x{85CF}\x{85D0}\x{85D5}\x{85DC}' .
|
||||
'\x{85DD}\x{85E4}\x{85E5}\x{85E9}\x{85EA}\x{85F7}\x{85F9}\x{85FA}\x{85FB}' .
|
||||
'\x{85FE}\x{8602}\x{8606}\x{8607}\x{860A}\x{860B}\x{8613}\x{8616}\x{8617}' .
|
||||
'\x{861A}\x{8622}\x{862D}\x{862F}\x{8630}\x{863F}\x{864D}\x{864E}\x{8650}' .
|
||||
'\x{8654}\x{8655}\x{865A}\x{865C}\x{865E}\x{865F}\x{8667}\x{866B}\x{8671}' .
|
||||
'\x{8679}\x{867B}\x{868A}\x{868B}\x{868C}\x{8693}\x{8695}\x{86A3}\x{86A4}' .
|
||||
'\x{86A9}\x{86AA}\x{86AB}\x{86AF}\x{86B0}\x{86B6}\x{86C4}\x{86C6}\x{86C7}' .
|
||||
'\x{86C9}\x{86CB}\x{86CD}\x{86CE}\x{86D4}\x{86D9}\x{86DB}\x{86DE}\x{86DF}' .
|
||||
'\x{86E4}\x{86E9}\x{86EC}\x{86ED}\x{86EE}\x{86EF}\x{86F8}\x{86F9}\x{86FB}' .
|
||||
'\x{86FE}\x{8700}\x{8702}\x{8703}\x{8706}\x{8708}\x{8709}\x{870A}\x{870D}' .
|
||||
'\x{8711}\x{8712}\x{8718}\x{871A}\x{871C}\x{8725}\x{8729}\x{8734}\x{8737}' .
|
||||
'\x{873B}\x{873F}\x{8749}\x{874B}\x{874C}\x{874E}\x{8753}\x{8755}\x{8757}' .
|
||||
'\x{8759}\x{875F}\x{8760}\x{8763}\x{8766}\x{8768}\x{876A}\x{876E}\x{8774}' .
|
||||
'\x{8776}\x{8778}\x{877F}\x{8782}\x{878D}\x{879F}\x{87A2}\x{87AB}\x{87AF}' .
|
||||
'\x{87B3}\x{87BA}\x{87BB}\x{87BD}\x{87C0}\x{87C4}\x{87C6}\x{87C7}\x{87CB}' .
|
||||
'\x{87D0}\x{87D2}\x{87E0}\x{87EF}\x{87F2}\x{87F6}\x{87F7}\x{87F9}\x{87FB}' .
|
||||
'\x{87FE}\x{8805}\x{880D}\x{880E}\x{880F}\x{8811}\x{8815}\x{8816}\x{8821}' .
|
||||
'\x{8822}\x{8823}\x{8827}\x{8831}\x{8836}\x{8839}\x{883B}\x{8840}\x{8842}' .
|
||||
'\x{8844}\x{8846}\x{884C}\x{884D}\x{8852}\x{8853}\x{8857}\x{8859}\x{885B}' .
|
||||
'\x{885D}\x{885E}\x{8861}\x{8862}\x{8863}\x{8868}\x{886B}\x{8870}\x{8872}' .
|
||||
'\x{8875}\x{8877}\x{887D}\x{887E}\x{887F}\x{8881}\x{8882}\x{8888}\x{888B}' .
|
||||
'\x{888D}\x{8892}\x{8896}\x{8897}\x{8899}\x{889E}\x{88A2}\x{88A4}\x{88AB}' .
|
||||
'\x{88AE}\x{88B0}\x{88B1}\x{88B4}\x{88B5}\x{88B7}\x{88BF}\x{88C1}\x{88C2}' .
|
||||
'\x{88C3}\x{88C4}\x{88C5}\x{88CF}\x{88D4}\x{88D5}\x{88D8}\x{88D9}\x{88DC}' .
|
||||
'\x{88DD}\x{88DF}\x{88E1}\x{88E8}\x{88F2}\x{88F3}\x{88F4}\x{88F8}\x{88F9}' .
|
||||
'\x{88FC}\x{88FD}\x{88FE}\x{8902}\x{8904}\x{8907}\x{890A}\x{890C}\x{8910}' .
|
||||
'\x{8912}\x{8913}\x{891D}\x{891E}\x{8925}\x{892A}\x{892B}\x{8936}\x{8938}' .
|
||||
'\x{893B}\x{8941}\x{8943}\x{8944}\x{894C}\x{894D}\x{8956}\x{895E}\x{895F}' .
|
||||
'\x{8960}\x{8964}\x{8966}\x{896A}\x{896D}\x{896F}\x{8972}\x{8974}\x{8977}' .
|
||||
'\x{897E}\x{897F}\x{8981}\x{8983}\x{8986}\x{8987}\x{8988}\x{898A}\x{898B}' .
|
||||
'\x{898F}\x{8993}\x{8996}\x{8997}\x{8998}\x{899A}\x{89A1}\x{89A6}\x{89A7}' .
|
||||
'\x{89A9}\x{89AA}\x{89AC}\x{89AF}\x{89B2}\x{89B3}\x{89BA}\x{89BD}\x{89BF}' .
|
||||
'\x{89C0}\x{89D2}\x{89DA}\x{89DC}\x{89DD}\x{89E3}\x{89E6}\x{89E7}\x{89F4}' .
|
||||
'\x{89F8}\x{8A00}\x{8A02}\x{8A03}\x{8A08}\x{8A0A}\x{8A0C}\x{8A0E}\x{8A10}' .
|
||||
'\x{8A13}\x{8A16}\x{8A17}\x{8A18}\x{8A1B}\x{8A1D}\x{8A1F}\x{8A23}\x{8A25}' .
|
||||
'\x{8A2A}\x{8A2D}\x{8A31}\x{8A33}\x{8A34}\x{8A36}\x{8A3A}\x{8A3B}\x{8A3C}' .
|
||||
'\x{8A41}\x{8A46}\x{8A48}\x{8A50}\x{8A51}\x{8A52}\x{8A54}\x{8A55}\x{8A5B}' .
|
||||
'\x{8A5E}\x{8A60}\x{8A62}\x{8A63}\x{8A66}\x{8A69}\x{8A6B}\x{8A6C}\x{8A6D}' .
|
||||
'\x{8A6E}\x{8A70}\x{8A71}\x{8A72}\x{8A73}\x{8A7C}\x{8A82}\x{8A84}\x{8A85}' .
|
||||
'\x{8A87}\x{8A89}\x{8A8C}\x{8A8D}\x{8A91}\x{8A93}\x{8A95}\x{8A98}\x{8A9A}' .
|
||||
'\x{8A9E}\x{8AA0}\x{8AA1}\x{8AA3}\x{8AA4}\x{8AA5}\x{8AA6}\x{8AA8}\x{8AAC}' .
|
||||
'\x{8AAD}\x{8AB0}\x{8AB2}\x{8AB9}\x{8ABC}\x{8ABF}\x{8AC2}\x{8AC4}\x{8AC7}' .
|
||||
'\x{8ACB}\x{8ACC}\x{8ACD}\x{8ACF}\x{8AD2}\x{8AD6}\x{8ADA}\x{8ADB}\x{8ADC}' .
|
||||
'\x{8ADE}\x{8AE0}\x{8AE1}\x{8AE2}\x{8AE4}\x{8AE6}\x{8AE7}\x{8AEB}\x{8AED}' .
|
||||
'\x{8AEE}\x{8AF1}\x{8AF3}\x{8AF7}\x{8AF8}\x{8AFA}\x{8AFE}\x{8B00}\x{8B01}' .
|
||||
'\x{8B02}\x{8B04}\x{8B07}\x{8B0C}\x{8B0E}\x{8B10}\x{8B14}\x{8B16}\x{8B17}' .
|
||||
'\x{8B19}\x{8B1A}\x{8B1B}\x{8B1D}\x{8B20}\x{8B21}\x{8B26}\x{8B28}\x{8B2B}' .
|
||||
'\x{8B2C}\x{8B33}\x{8B39}\x{8B3E}\x{8B41}\x{8B49}\x{8B4C}\x{8B4E}\x{8B4F}' .
|
||||
'\x{8B56}\x{8B58}\x{8B5A}\x{8B5B}\x{8B5C}\x{8B5F}\x{8B66}\x{8B6B}\x{8B6C}' .
|
||||
'\x{8B6F}\x{8B70}\x{8B71}\x{8B72}\x{8B74}\x{8B77}\x{8B7D}\x{8B80}\x{8B83}' .
|
||||
'\x{8B8A}\x{8B8C}\x{8B8E}\x{8B90}\x{8B92}\x{8B93}\x{8B96}\x{8B99}\x{8B9A}' .
|
||||
'\x{8C37}\x{8C3A}\x{8C3F}\x{8C41}\x{8C46}\x{8C48}\x{8C4A}\x{8C4C}\x{8C4E}' .
|
||||
'\x{8C50}\x{8C55}\x{8C5A}\x{8C61}\x{8C62}\x{8C6A}\x{8C6B}\x{8C6C}\x{8C78}' .
|
||||
'\x{8C79}\x{8C7A}\x{8C7C}\x{8C82}\x{8C85}\x{8C89}\x{8C8A}\x{8C8C}\x{8C8D}' .
|
||||
'\x{8C8E}\x{8C94}\x{8C98}\x{8C9D}\x{8C9E}\x{8CA0}\x{8CA1}\x{8CA2}\x{8CA7}' .
|
||||
'\x{8CA8}\x{8CA9}\x{8CAA}\x{8CAB}\x{8CAC}\x{8CAD}\x{8CAE}\x{8CAF}\x{8CB0}' .
|
||||
'\x{8CB2}\x{8CB3}\x{8CB4}\x{8CB6}\x{8CB7}\x{8CB8}\x{8CBB}\x{8CBC}\x{8CBD}' .
|
||||
'\x{8CBF}\x{8CC0}\x{8CC1}\x{8CC2}\x{8CC3}\x{8CC4}\x{8CC7}\x{8CC8}\x{8CCA}' .
|
||||
'\x{8CCD}\x{8CCE}\x{8CD1}\x{8CD3}\x{8CDA}\x{8CDB}\x{8CDC}\x{8CDE}\x{8CE0}' .
|
||||
'\x{8CE2}\x{8CE3}\x{8CE4}\x{8CE6}\x{8CEA}\x{8CED}\x{8CFA}\x{8CFB}\x{8CFC}' .
|
||||
'\x{8CFD}\x{8D04}\x{8D05}\x{8D07}\x{8D08}\x{8D0A}\x{8D0B}\x{8D0D}\x{8D0F}' .
|
||||
'\x{8D10}\x{8D13}\x{8D14}\x{8D16}\x{8D64}\x{8D66}\x{8D67}\x{8D6B}\x{8D6D}' .
|
||||
'\x{8D70}\x{8D71}\x{8D73}\x{8D74}\x{8D77}\x{8D81}\x{8D85}\x{8D8A}\x{8D99}' .
|
||||
'\x{8DA3}\x{8DA8}\x{8DB3}\x{8DBA}\x{8DBE}\x{8DC2}\x{8DCB}\x{8DCC}\x{8DCF}' .
|
||||
'\x{8DD6}\x{8DDA}\x{8DDB}\x{8DDD}\x{8DDF}\x{8DE1}\x{8DE3}\x{8DE8}\x{8DEA}' .
|
||||
'\x{8DEB}\x{8DEF}\x{8DF3}\x{8DF5}\x{8DFC}\x{8DFF}\x{8E08}\x{8E09}\x{8E0A}' .
|
||||
'\x{8E0F}\x{8E10}\x{8E1D}\x{8E1E}\x{8E1F}\x{8E2A}\x{8E30}\x{8E34}\x{8E35}' .
|
||||
'\x{8E42}\x{8E44}\x{8E47}\x{8E48}\x{8E49}\x{8E4A}\x{8E4C}\x{8E50}\x{8E55}' .
|
||||
'\x{8E59}\x{8E5F}\x{8E60}\x{8E63}\x{8E64}\x{8E72}\x{8E74}\x{8E76}\x{8E7C}' .
|
||||
'\x{8E81}\x{8E84}\x{8E85}\x{8E87}\x{8E8A}\x{8E8B}\x{8E8D}\x{8E91}\x{8E93}' .
|
||||
'\x{8E94}\x{8E99}\x{8EA1}\x{8EAA}\x{8EAB}\x{8EAC}\x{8EAF}\x{8EB0}\x{8EB1}' .
|
||||
'\x{8EBE}\x{8EC5}\x{8EC6}\x{8EC8}\x{8ECA}\x{8ECB}\x{8ECC}\x{8ECD}\x{8ED2}' .
|
||||
'\x{8EDB}\x{8EDF}\x{8EE2}\x{8EE3}\x{8EEB}\x{8EF8}\x{8EFB}\x{8EFC}\x{8EFD}' .
|
||||
'\x{8EFE}\x{8F03}\x{8F05}\x{8F09}\x{8F0A}\x{8F0C}\x{8F12}\x{8F13}\x{8F14}' .
|
||||
'\x{8F15}\x{8F19}\x{8F1B}\x{8F1C}\x{8F1D}\x{8F1F}\x{8F26}\x{8F29}\x{8F2A}' .
|
||||
'\x{8F2F}\x{8F33}\x{8F38}\x{8F39}\x{8F3B}\x{8F3E}\x{8F3F}\x{8F42}\x{8F44}' .
|
||||
'\x{8F45}\x{8F46}\x{8F49}\x{8F4C}\x{8F4D}\x{8F4E}\x{8F57}\x{8F5C}\x{8F5F}' .
|
||||
'\x{8F61}\x{8F62}\x{8F63}\x{8F64}\x{8F9B}\x{8F9C}\x{8F9E}\x{8F9F}\x{8FA3}' .
|
||||
'\x{8FA7}\x{8FA8}\x{8FAD}\x{8FAE}\x{8FAF}\x{8FB0}\x{8FB1}\x{8FB2}\x{8FB7}' .
|
||||
'\x{8FBA}\x{8FBB}\x{8FBC}\x{8FBF}\x{8FC2}\x{8FC4}\x{8FC5}\x{8FCE}\x{8FD1}' .
|
||||
'\x{8FD4}\x{8FDA}\x{8FE2}\x{8FE5}\x{8FE6}\x{8FE9}\x{8FEA}\x{8FEB}\x{8FED}' .
|
||||
'\x{8FEF}\x{8FF0}\x{8FF4}\x{8FF7}\x{8FF8}\x{8FF9}\x{8FFA}\x{8FFD}\x{9000}' .
|
||||
'\x{9001}\x{9003}\x{9005}\x{9006}\x{900B}\x{900D}\x{900E}\x{900F}\x{9010}' .
|
||||
'\x{9011}\x{9013}\x{9014}\x{9015}\x{9016}\x{9017}\x{9019}\x{901A}\x{901D}' .
|
||||
'\x{901E}\x{901F}\x{9020}\x{9021}\x{9022}\x{9023}\x{9027}\x{902E}\x{9031}' .
|
||||
'\x{9032}\x{9035}\x{9036}\x{9038}\x{9039}\x{903C}\x{903E}\x{9041}\x{9042}' .
|
||||
'\x{9045}\x{9047}\x{9049}\x{904A}\x{904B}\x{904D}\x{904E}\x{904F}\x{9050}' .
|
||||
'\x{9051}\x{9052}\x{9053}\x{9054}\x{9055}\x{9056}\x{9058}\x{9059}\x{905C}' .
|
||||
'\x{905E}\x{9060}\x{9061}\x{9063}\x{9065}\x{9068}\x{9069}\x{906D}\x{906E}' .
|
||||
'\x{906F}\x{9072}\x{9075}\x{9076}\x{9077}\x{9078}\x{907A}\x{907C}\x{907D}' .
|
||||
'\x{907F}\x{9080}\x{9081}\x{9082}\x{9083}\x{9084}\x{9087}\x{9089}\x{908A}' .
|
||||
'\x{908F}\x{9091}\x{90A3}\x{90A6}\x{90A8}\x{90AA}\x{90AF}\x{90B1}\x{90B5}' .
|
||||
'\x{90B8}\x{90C1}\x{90CA}\x{90CE}\x{90DB}\x{90E1}\x{90E2}\x{90E4}\x{90E8}' .
|
||||
'\x{90ED}\x{90F5}\x{90F7}\x{90FD}\x{9102}\x{9112}\x{9119}\x{912D}\x{9130}' .
|
||||
'\x{9132}\x{9149}\x{914A}\x{914B}\x{914C}\x{914D}\x{914E}\x{9152}\x{9154}' .
|
||||
'\x{9156}\x{9158}\x{9162}\x{9163}\x{9165}\x{9169}\x{916A}\x{916C}\x{9172}' .
|
||||
'\x{9173}\x{9175}\x{9177}\x{9178}\x{9182}\x{9187}\x{9189}\x{918B}\x{918D}' .
|
||||
'\x{9190}\x{9192}\x{9197}\x{919C}\x{91A2}\x{91A4}\x{91AA}\x{91AB}\x{91AF}' .
|
||||
'\x{91B4}\x{91B5}\x{91B8}\x{91BA}\x{91C0}\x{91C1}\x{91C6}\x{91C7}\x{91C8}' .
|
||||
'\x{91C9}\x{91CB}\x{91CC}\x{91CD}\x{91CE}\x{91CF}\x{91D0}\x{91D1}\x{91D6}' .
|
||||
'\x{91D8}\x{91DB}\x{91DC}\x{91DD}\x{91DF}\x{91E1}\x{91E3}\x{91E6}\x{91E7}' .
|
||||
'\x{91F5}\x{91F6}\x{91FC}\x{91FF}\x{920D}\x{920E}\x{9211}\x{9214}\x{9215}' .
|
||||
'\x{921E}\x{9229}\x{922C}\x{9234}\x{9237}\x{923F}\x{9244}\x{9245}\x{9248}' .
|
||||
'\x{9249}\x{924B}\x{9250}\x{9257}\x{925A}\x{925B}\x{925E}\x{9262}\x{9264}' .
|
||||
'\x{9266}\x{9271}\x{927E}\x{9280}\x{9283}\x{9285}\x{9291}\x{9293}\x{9295}' .
|
||||
'\x{9296}\x{9298}\x{929A}\x{929B}\x{929C}\x{92AD}\x{92B7}\x{92B9}\x{92CF}' .
|
||||
'\x{92D2}\x{92E4}\x{92E9}\x{92EA}\x{92ED}\x{92F2}\x{92F3}\x{92F8}\x{92FA}' .
|
||||
'\x{92FC}\x{9306}\x{930F}\x{9310}\x{9318}\x{9319}\x{931A}\x{9320}\x{9322}' .
|
||||
'\x{9323}\x{9326}\x{9328}\x{932B}\x{932C}\x{932E}\x{932F}\x{9332}\x{9335}' .
|
||||
'\x{933A}\x{933B}\x{9344}\x{934B}\x{934D}\x{9354}\x{9356}\x{935B}\x{935C}' .
|
||||
'\x{9360}\x{936C}\x{936E}\x{9375}\x{937C}\x{937E}\x{938C}\x{9394}\x{9396}' .
|
||||
'\x{9397}\x{939A}\x{93A7}\x{93AC}\x{93AD}\x{93AE}\x{93B0}\x{93B9}\x{93C3}' .
|
||||
'\x{93C8}\x{93D0}\x{93D1}\x{93D6}\x{93D7}\x{93D8}\x{93DD}\x{93E1}\x{93E4}' .
|
||||
'\x{93E5}\x{93E8}\x{9403}\x{9407}\x{9410}\x{9413}\x{9414}\x{9418}\x{9419}' .
|
||||
'\x{941A}\x{9421}\x{942B}\x{9435}\x{9436}\x{9438}\x{943A}\x{9441}\x{9444}' .
|
||||
'\x{9451}\x{9452}\x{9453}\x{945A}\x{945B}\x{945E}\x{9460}\x{9462}\x{946A}' .
|
||||
'\x{9470}\x{9475}\x{9477}\x{947C}\x{947D}\x{947E}\x{947F}\x{9481}\x{9577}' .
|
||||
'\x{9580}\x{9582}\x{9583}\x{9587}\x{9589}\x{958A}\x{958B}\x{958F}\x{9591}' .
|
||||
'\x{9593}\x{9594}\x{9596}\x{9598}\x{9599}\x{95A0}\x{95A2}\x{95A3}\x{95A4}' .
|
||||
'\x{95A5}\x{95A7}\x{95A8}\x{95AD}\x{95B2}\x{95B9}\x{95BB}\x{95BC}\x{95BE}' .
|
||||
'\x{95C3}\x{95C7}\x{95CA}\x{95CC}\x{95CD}\x{95D4}\x{95D5}\x{95D6}\x{95D8}' .
|
||||
'\x{95DC}\x{95E1}\x{95E2}\x{95E5}\x{961C}\x{9621}\x{9628}\x{962A}\x{962E}' .
|
||||
'\x{962F}\x{9632}\x{963B}\x{963F}\x{9640}\x{9642}\x{9644}\x{964B}\x{964C}' .
|
||||
'\x{964D}\x{964F}\x{9650}\x{965B}\x{965C}\x{965D}\x{965E}\x{965F}\x{9662}' .
|
||||
'\x{9663}\x{9664}\x{9665}\x{9666}\x{966A}\x{966C}\x{9670}\x{9672}\x{9673}' .
|
||||
'\x{9675}\x{9676}\x{9677}\x{9678}\x{967A}\x{967D}\x{9685}\x{9686}\x{9688}' .
|
||||
'\x{968A}\x{968B}\x{968D}\x{968E}\x{968F}\x{9694}\x{9695}\x{9697}\x{9698}' .
|
||||
'\x{9699}\x{969B}\x{969C}\x{96A0}\x{96A3}\x{96A7}\x{96A8}\x{96AA}\x{96B0}' .
|
||||
'\x{96B1}\x{96B2}\x{96B4}\x{96B6}\x{96B7}\x{96B8}\x{96B9}\x{96BB}\x{96BC}' .
|
||||
'\x{96C0}\x{96C1}\x{96C4}\x{96C5}\x{96C6}\x{96C7}\x{96C9}\x{96CB}\x{96CC}' .
|
||||
'\x{96CD}\x{96CE}\x{96D1}\x{96D5}\x{96D6}\x{96D9}\x{96DB}\x{96DC}\x{96E2}' .
|
||||
'\x{96E3}\x{96E8}\x{96EA}\x{96EB}\x{96F0}\x{96F2}\x{96F6}\x{96F7}\x{96F9}' .
|
||||
'\x{96FB}\x{9700}\x{9704}\x{9706}\x{9707}\x{9708}\x{970A}\x{970D}\x{970E}' .
|
||||
'\x{970F}\x{9711}\x{9713}\x{9716}\x{9719}\x{971C}\x{971E}\x{9724}\x{9727}' .
|
||||
'\x{972A}\x{9730}\x{9732}\x{9738}\x{9739}\x{973D}\x{973E}\x{9742}\x{9744}' .
|
||||
'\x{9746}\x{9748}\x{9749}\x{9752}\x{9756}\x{9759}\x{975C}\x{975E}\x{9760}' .
|
||||
'\x{9761}\x{9762}\x{9764}\x{9766}\x{9768}\x{9769}\x{976B}\x{976D}\x{9771}' .
|
||||
'\x{9774}\x{9779}\x{977A}\x{977C}\x{9781}\x{9784}\x{9785}\x{9786}\x{978B}' .
|
||||
'\x{978D}\x{978F}\x{9790}\x{9798}\x{979C}\x{97A0}\x{97A3}\x{97A6}\x{97A8}' .
|
||||
'\x{97AB}\x{97AD}\x{97B3}\x{97B4}\x{97C3}\x{97C6}\x{97C8}\x{97CB}\x{97D3}' .
|
||||
'\x{97DC}\x{97ED}\x{97EE}\x{97F2}\x{97F3}\x{97F5}\x{97F6}\x{97FB}\x{97FF}' .
|
||||
'\x{9801}\x{9802}\x{9803}\x{9805}\x{9806}\x{9808}\x{980C}\x{980F}\x{9810}' .
|
||||
'\x{9811}\x{9812}\x{9813}\x{9817}\x{9818}\x{981A}\x{9821}\x{9824}\x{982C}' .
|
||||
'\x{982D}\x{9834}\x{9837}\x{9838}\x{983B}\x{983C}\x{983D}\x{9846}\x{984B}' .
|
||||
'\x{984C}\x{984D}\x{984E}\x{984F}\x{9854}\x{9855}\x{9858}\x{985B}\x{985E}' .
|
||||
'\x{9867}\x{986B}\x{986F}\x{9870}\x{9871}\x{9873}\x{9874}\x{98A8}\x{98AA}' .
|
||||
'\x{98AF}\x{98B1}\x{98B6}\x{98C3}\x{98C4}\x{98C6}\x{98DB}\x{98DC}\x{98DF}' .
|
||||
'\x{98E2}\x{98E9}\x{98EB}\x{98ED}\x{98EE}\x{98EF}\x{98F2}\x{98F4}\x{98FC}' .
|
||||
'\x{98FD}\x{98FE}\x{9903}\x{9905}\x{9909}\x{990A}\x{990C}\x{9910}\x{9912}' .
|
||||
'\x{9913}\x{9914}\x{9918}\x{991D}\x{991E}\x{9920}\x{9921}\x{9924}\x{9928}' .
|
||||
'\x{992C}\x{992E}\x{993D}\x{993E}\x{9942}\x{9945}\x{9949}\x{994B}\x{994C}' .
|
||||
'\x{9950}\x{9951}\x{9952}\x{9955}\x{9957}\x{9996}\x{9997}\x{9998}\x{9999}' .
|
||||
'\x{99A5}\x{99A8}\x{99AC}\x{99AD}\x{99AE}\x{99B3}\x{99B4}\x{99BC}\x{99C1}' .
|
||||
'\x{99C4}\x{99C5}\x{99C6}\x{99C8}\x{99D0}\x{99D1}\x{99D2}\x{99D5}\x{99D8}' .
|
||||
'\x{99DB}\x{99DD}\x{99DF}\x{99E2}\x{99ED}\x{99EE}\x{99F1}\x{99F2}\x{99F8}' .
|
||||
'\x{99FB}\x{99FF}\x{9A01}\x{9A05}\x{9A0E}\x{9A0F}\x{9A12}\x{9A13}\x{9A19}' .
|
||||
'\x{9A28}\x{9A2B}\x{9A30}\x{9A37}\x{9A3E}\x{9A40}\x{9A42}\x{9A43}\x{9A45}' .
|
||||
'\x{9A4D}\x{9A55}\x{9A57}\x{9A5A}\x{9A5B}\x{9A5F}\x{9A62}\x{9A64}\x{9A65}' .
|
||||
'\x{9A69}\x{9A6A}\x{9A6B}\x{9AA8}\x{9AAD}\x{9AB0}\x{9AB8}\x{9ABC}\x{9AC0}' .
|
||||
'\x{9AC4}\x{9ACF}\x{9AD1}\x{9AD3}\x{9AD4}\x{9AD8}\x{9ADE}\x{9ADF}\x{9AE2}' .
|
||||
'\x{9AE3}\x{9AE6}\x{9AEA}\x{9AEB}\x{9AED}\x{9AEE}\x{9AEF}\x{9AF1}\x{9AF4}' .
|
||||
'\x{9AF7}\x{9AFB}\x{9B06}\x{9B18}\x{9B1A}\x{9B1F}\x{9B22}\x{9B23}\x{9B25}' .
|
||||
'\x{9B27}\x{9B28}\x{9B29}\x{9B2A}\x{9B2E}\x{9B2F}\x{9B31}\x{9B32}\x{9B3B}' .
|
||||
'\x{9B3C}\x{9B41}\x{9B42}\x{9B43}\x{9B44}\x{9B45}\x{9B4D}\x{9B4E}\x{9B4F}' .
|
||||
'\x{9B51}\x{9B54}\x{9B58}\x{9B5A}\x{9B6F}\x{9B74}\x{9B83}\x{9B8E}\x{9B91}' .
|
||||
'\x{9B92}\x{9B93}\x{9B96}\x{9B97}\x{9B9F}\x{9BA0}\x{9BA8}\x{9BAA}\x{9BAB}' .
|
||||
'\x{9BAD}\x{9BAE}\x{9BB4}\x{9BB9}\x{9BC0}\x{9BC6}\x{9BC9}\x{9BCA}\x{9BCF}' .
|
||||
'\x{9BD1}\x{9BD2}\x{9BD4}\x{9BD6}\x{9BDB}\x{9BE1}\x{9BE2}\x{9BE3}\x{9BE4}' .
|
||||
'\x{9BE8}\x{9BF0}\x{9BF1}\x{9BF2}\x{9BF5}\x{9C04}\x{9C06}\x{9C08}\x{9C09}' .
|
||||
'\x{9C0A}\x{9C0C}\x{9C0D}\x{9C10}\x{9C12}\x{9C13}\x{9C14}\x{9C15}\x{9C1B}' .
|
||||
'\x{9C21}\x{9C24}\x{9C25}\x{9C2D}\x{9C2E}\x{9C2F}\x{9C30}\x{9C32}\x{9C39}' .
|
||||
'\x{9C3A}\x{9C3B}\x{9C3E}\x{9C46}\x{9C47}\x{9C48}\x{9C52}\x{9C57}\x{9C5A}' .
|
||||
'\x{9C60}\x{9C67}\x{9C76}\x{9C78}\x{9CE5}\x{9CE7}\x{9CE9}\x{9CEB}\x{9CEC}' .
|
||||
'\x{9CF0}\x{9CF3}\x{9CF4}\x{9CF6}\x{9D03}\x{9D06}\x{9D07}\x{9D08}\x{9D09}' .
|
||||
'\x{9D0E}\x{9D12}\x{9D15}\x{9D1B}\x{9D1F}\x{9D23}\x{9D26}\x{9D28}\x{9D2A}' .
|
||||
'\x{9D2B}\x{9D2C}\x{9D3B}\x{9D3E}\x{9D3F}\x{9D41}\x{9D44}\x{9D46}\x{9D48}' .
|
||||
'\x{9D50}\x{9D51}\x{9D59}\x{9D5C}\x{9D5D}\x{9D5E}\x{9D60}\x{9D61}\x{9D64}' .
|
||||
'\x{9D6C}\x{9D6F}\x{9D72}\x{9D7A}\x{9D87}\x{9D89}\x{9D8F}\x{9D9A}\x{9DA4}' .
|
||||
'\x{9DA9}\x{9DAB}\x{9DAF}\x{9DB2}\x{9DB4}\x{9DB8}\x{9DBA}\x{9DBB}\x{9DC1}' .
|
||||
'\x{9DC2}\x{9DC4}\x{9DC6}\x{9DCF}\x{9DD3}\x{9DD9}\x{9DE6}\x{9DED}\x{9DEF}' .
|
||||
'\x{9DF2}\x{9DF8}\x{9DF9}\x{9DFA}\x{9DFD}\x{9E1A}\x{9E1B}\x{9E1E}\x{9E75}' .
|
||||
'\x{9E78}\x{9E79}\x{9E7D}\x{9E7F}\x{9E81}\x{9E88}\x{9E8B}\x{9E8C}\x{9E91}' .
|
||||
'\x{9E92}\x{9E93}\x{9E95}\x{9E97}\x{9E9D}\x{9E9F}\x{9EA5}\x{9EA6}\x{9EA9}' .
|
||||
'\x{9EAA}\x{9EAD}\x{9EB8}\x{9EB9}\x{9EBA}\x{9EBB}\x{9EBC}\x{9EBE}\x{9EBF}' .
|
||||
'\x{9EC4}\x{9ECC}\x{9ECD}\x{9ECE}\x{9ECF}\x{9ED0}\x{9ED2}\x{9ED4}\x{9ED8}' .
|
||||
'\x{9ED9}\x{9EDB}\x{9EDC}\x{9EDD}\x{9EDE}\x{9EE0}\x{9EE5}\x{9EE8}\x{9EEF}' .
|
||||
'\x{9EF4}\x{9EF6}\x{9EF7}\x{9EF9}\x{9EFB}\x{9EFC}\x{9EFD}\x{9F07}\x{9F08}' .
|
||||
'\x{9F0E}\x{9F13}\x{9F15}\x{9F20}\x{9F21}\x{9F2C}\x{9F3B}\x{9F3E}\x{9F4A}' .
|
||||
'\x{9F4B}\x{9F4E}\x{9F4F}\x{9F52}\x{9F54}\x{9F5F}\x{9F60}\x{9F61}\x{9F62}' .
|
||||
'\x{9F63}\x{9F66}\x{9F67}\x{9F6A}\x{9F6C}\x{9F72}\x{9F76}\x{9F77}\x{9F8D}' .
|
||||
'\x{9F95}\x{9F9C}\x{9F9D}\x{9FA0}]{1,15}$/iu');
|
223
airtime_mvc/library/Zend/Validate/Iban.php
Normal file
223
airtime_mvc/library/Zend/Validate/Iban.php
Normal file
|
@ -0,0 +1,223 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Iban.php 21563 2010-03-19 10:10:45Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validates IBAN Numbers (International Bank Account Numbers)
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Iban extends Zend_Validate_Abstract
|
||||
{
|
||||
const NOTSUPPORTED = 'ibanNotSupported';
|
||||
const FALSEFORMAT = 'ibanFalseFormat';
|
||||
const CHECKFAILED = 'ibanCheckFailed';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOTSUPPORTED => "Unknown country within the IBAN '%value%'",
|
||||
self::FALSEFORMAT => "'%value%' has a false IBAN format",
|
||||
self::CHECKFAILED => "'%value%' has failed the IBAN check",
|
||||
);
|
||||
|
||||
/**
|
||||
* Optional locale
|
||||
*
|
||||
* @var string|Zend_Locale|null
|
||||
*/
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* IBAN regexes by region
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_ibanregex = array(
|
||||
'AD' => '/^AD[0-9]{2}[0-9]{8}[A-Z0-9]{12}$/',
|
||||
'AT' => '/^AT[0-9]{2}[0-9]{5}[0-9]{11}$/',
|
||||
'BA' => '/^BA[0-9]{2}[0-9]{6}[0-9]{10}$/',
|
||||
'BE' => '/^BE[0-9]{2}[0-9]{3}[0-9]{9}$/',
|
||||
'BG' => '/^BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}$/',
|
||||
'CH' => '/^CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}$/',
|
||||
'CS' => '/^CS[0-9]{2}[0-9]{3}[0-9]{15}$/',
|
||||
'CY' => '/^CY[0-9]{2}[0-9]{8}[A-Z0-9]{16}$/',
|
||||
'CZ' => '/^CZ[0-9]{2}[0-9]{4}[0-9]{16}$/',
|
||||
'DE' => '/^DE[0-9]{2}[0-9]{8}[0-9]{10}$/',
|
||||
'DK' => '/^DK[0-9]{2}[0-9]{4}[0-9]{10}$/',
|
||||
'EE' => '/^EE[0-9]{2}[0-9]{4}[0-9]{12}$/',
|
||||
'ES' => '/^ES[0-9]{2}[0-9]{8}[0-9]{12}$/',
|
||||
'FR' => '/^FR[0-9]{2}[0-9]{10}[A-Z0-9]{13}$/',
|
||||
'FI' => '/^FI[0-9]{2}[0-9]{6}[0-9]{8}$/',
|
||||
'GB' => '/^GB[0-9]{2}[A-Z]{4}[0-9]{14}$/',
|
||||
'GI' => '/^GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}$/',
|
||||
'GR' => '/^GR[0-9]{2}[0-9]{7}[A-Z0-9]{16}$/',
|
||||
'HR' => '/^HR[0-9]{2}[0-9]{7}[0-9]{10}$/',
|
||||
'HU' => '/^HU[0-9]{2}[0-9]{7}[0-9]{1}[0-9]{15}[0-9]{1}$/',
|
||||
'IE' => '/^IE[0-9]{2}[A-Z0-9]{4}[0-9]{6}[0-9]{8}$/',
|
||||
'IS' => '/^IS[0-9]{2}[0-9]{4}[0-9]{18}$/',
|
||||
'IT' => '/^IT[0-9]{2}[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$/',
|
||||
'LI' => '/^LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}$/',
|
||||
'LU' => '/^LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}$/',
|
||||
'LT' => '/^LT[0-9]{2}[0-9]{5}[0-9]{11}$/',
|
||||
'LV' => '/^LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}$/',
|
||||
'MK' => '/^MK[0-9]{2}[A-Z]{3}[A-Z0-9]{10}[0-9]{2}$/',
|
||||
'MT' => '/^MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}$/',
|
||||
'NL' => '/^NL[0-9]{2}[A-Z]{4}[0-9]{10}$/',
|
||||
'NO' => '/^NO[0-9]{2}[0-9]{4}[0-9]{7}$/',
|
||||
'PL' => '/^PL[0-9]{2}[0-9]{8}[0-9]{16}$/',
|
||||
'PT' => '/^PT[0-9]{2}[0-9]{8}[0-9]{13}$/',
|
||||
'RO' => '/^RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}$/',
|
||||
'SE' => '/^SE[0-9]{2}[0-9]{3}[0-9]{17}$/',
|
||||
'SI' => '/^SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}$/',
|
||||
'SK' => '/^SK[0-9]{2}[0-9]{4}[0-9]{16}$/',
|
||||
'TN' => '/^TN[0-9]{2}[0-9]{5}[0-9]{15}$/',
|
||||
'TR' => '/^TR[0-9]{2}[0-9]{5}[A-Z0-9]{17}$/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|Zend_Config|Zend_Locale $locale OPTIONAL
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($locale = null)
|
||||
{
|
||||
if ($locale instanceof Zend_Config) {
|
||||
$locale = $locale->toArray();
|
||||
}
|
||||
|
||||
if (is_array($locale)) {
|
||||
if (array_key_exists('locale', $locale)) {
|
||||
$locale = $locale['locale'];
|
||||
} else {
|
||||
$locale = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($locale !== false) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale')) {
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($locale)) {
|
||||
$this->setLocale($locale);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the locale option
|
||||
*
|
||||
* @return string|Zend_Locale|null
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->_locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the locale option
|
||||
*
|
||||
* @param string|Zend_Locale $locale
|
||||
* @return Zend_Validate_Date provides a fluent interface
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
if ($locale !== false) {
|
||||
require_once 'Zend/Locale.php';
|
||||
$locale = Zend_Locale::findLocale($locale);
|
||||
if (strlen($locale) < 4) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Region must be given for IBAN validation');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_locale = $locale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if $value is a valid IBAN
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$value = strtoupper($value);
|
||||
$this->_setValue($value);
|
||||
|
||||
if (empty($this->_locale)) {
|
||||
$region = substr($value, 0, 2);
|
||||
} else {
|
||||
$region = new Zend_Locale($this->_locale);
|
||||
$region = $region->getRegion();
|
||||
}
|
||||
|
||||
if (!array_key_exists($region, $this->_ibanregex)) {
|
||||
$this->_setValue($region);
|
||||
$this->_error(self::NOTSUPPORTED);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!preg_match($this->_ibanregex[$region], $value)) {
|
||||
$this->_error(self::FALSEFORMAT);
|
||||
return false;
|
||||
}
|
||||
|
||||
$format = substr($value, 4) . substr($value, 0, 4);
|
||||
$format = str_replace(
|
||||
array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'),
|
||||
array('10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22',
|
||||
'23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35'),
|
||||
$format);
|
||||
|
||||
$temp = intval(substr($format, 0, 1));
|
||||
$len = strlen($format);
|
||||
for ($x = 1; $x < $len; ++$x) {
|
||||
$temp *= 10;
|
||||
$temp += intval(substr($format, $x, 1));
|
||||
$temp %= 97;
|
||||
}
|
||||
|
||||
if ($temp != 1) {
|
||||
$this->_error(self::CHECKFAILED);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
133
airtime_mvc/library/Zend/Validate/Identical.php
Normal file
133
airtime_mvc/library/Zend/Validate/Identical.php
Normal file
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Identical.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/** @see Zend_Validate_Abstract */
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Identical extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Error codes
|
||||
* @const string
|
||||
*/
|
||||
const NOT_SAME = 'notSame';
|
||||
const MISSING_TOKEN = 'missingToken';
|
||||
|
||||
/**
|
||||
* Error messages
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_SAME => "The token '%token%' does not match the given token '%value%'",
|
||||
self::MISSING_TOKEN => 'No token was provided to match against',
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'token' => '_tokenString'
|
||||
);
|
||||
|
||||
/**
|
||||
* Original token against which to validate
|
||||
* @var string
|
||||
*/
|
||||
protected $_tokenString;
|
||||
protected $_token;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param mixed $token
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($token = null)
|
||||
{
|
||||
if ($token instanceof Zend_Config) {
|
||||
$token = $token->toArray();
|
||||
}
|
||||
|
||||
if (is_array($token) && (count($token) == 1) && array_key_exists('token', $token)) {
|
||||
$token = $token['token'];
|
||||
}
|
||||
|
||||
if (null !== $token) {
|
||||
$this->setToken($token);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set token against which to compare
|
||||
*
|
||||
* @param mixed $token
|
||||
* @return Zend_Validate_Identical
|
||||
*/
|
||||
public function setToken($token)
|
||||
{
|
||||
$this->_tokenString = (string) $token;
|
||||
$this->_token = $token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getToken()
|
||||
{
|
||||
return $this->_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if a token has been set and the provided value
|
||||
* matches that token.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue((string) $value);
|
||||
$token = $this->getToken();
|
||||
|
||||
if ($token === null) {
|
||||
$this->_error(self::MISSING_TOKEN);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($value !== $token) {
|
||||
$this->_error(self::NOT_SAME);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
204
airtime_mvc/library/Zend/Validate/InArray.php
Normal file
204
airtime_mvc/library/Zend/Validate/InArray.php
Normal file
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InArray.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_InArray extends Zend_Validate_Abstract
|
||||
{
|
||||
const NOT_IN_ARRAY = 'notInArray';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_IN_ARRAY => "'%value%' was not found in the haystack",
|
||||
);
|
||||
|
||||
/**
|
||||
* Haystack of possible values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_haystack;
|
||||
|
||||
/**
|
||||
* Whether a strict in_array() invocation is used
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_strict = false;
|
||||
|
||||
/**
|
||||
* Whether a recursive search should be done
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_recursive = false;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param array|Zend_Config $haystack
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Array expected as parameter');
|
||||
} else {
|
||||
$count = func_num_args();
|
||||
$temp = array();
|
||||
if ($count > 1) {
|
||||
$temp['haystack'] = func_get_arg(0);
|
||||
$temp['strict'] = func_get_arg(1);
|
||||
$options = $temp;
|
||||
} else {
|
||||
$temp = func_get_arg(0);
|
||||
if (!array_key_exists('haystack', $options)) {
|
||||
$options = array();
|
||||
$options['haystack'] = $temp;
|
||||
} else {
|
||||
$options = $temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setHaystack($options['haystack']);
|
||||
if (array_key_exists('strict', $options)) {
|
||||
$this->setStrict($options['strict']);
|
||||
}
|
||||
|
||||
if (array_key_exists('recursive', $options)) {
|
||||
$this->setRecursive($options['recursive']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the haystack option
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHaystack()
|
||||
{
|
||||
return $this->_haystack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the haystack option
|
||||
*
|
||||
* @param mixed $haystack
|
||||
* @return Zend_Validate_InArray Provides a fluent interface
|
||||
*/
|
||||
public function setHaystack(array $haystack)
|
||||
{
|
||||
$this->_haystack = $haystack;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the strict option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getStrict()
|
||||
{
|
||||
return $this->_strict;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the strict option
|
||||
*
|
||||
* @param boolean $strict
|
||||
* @return Zend_Validate_InArray Provides a fluent interface
|
||||
*/
|
||||
public function setStrict($strict)
|
||||
{
|
||||
$this->_strict = (boolean) $strict;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the recursive option
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getRecursive()
|
||||
{
|
||||
return $this->_recursive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the recursive option
|
||||
*
|
||||
* @param boolean $recursive
|
||||
* @return Zend_Validate_InArray Provides a fluent interface
|
||||
*/
|
||||
public function setRecursive($recursive)
|
||||
{
|
||||
$this->_recursive = (boolean) $recursive;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is contained in the haystack option. If the strict
|
||||
* option is true, then the type of $value is also checked.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
if ($this->getRecursive()) {
|
||||
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($this->_haystack));
|
||||
foreach($iterator as $element) {
|
||||
if ($this->_strict) {
|
||||
if ($element === $value) {
|
||||
return true;
|
||||
}
|
||||
} else if ($element == $value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (in_array($value, $this->_haystack, $this->_strict)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_error(self::NOT_IN_ARRAY);
|
||||
return false;
|
||||
}
|
||||
}
|
148
airtime_mvc/library/Zend/Validate/Int.php
Normal file
148
airtime_mvc/library/Zend/Validate/Int.php
Normal file
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Int.php 20532 2010-01-22 20:18:23Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Locale_Format
|
||||
*/
|
||||
require_once 'Zend/Locale/Format.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Int extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'intInvalid';
|
||||
const NOT_INT = 'notInt';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be string or integer",
|
||||
self::NOT_INT => "'%value%' does not appear to be an integer",
|
||||
);
|
||||
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* Constructor for the integer validator
|
||||
*
|
||||
* @param string|Zend_Config|Zend_Locale $locale
|
||||
*/
|
||||
public function __construct($locale = null)
|
||||
{
|
||||
if ($locale instanceof Zend_Config) {
|
||||
$locale = $locale->toArray();
|
||||
}
|
||||
|
||||
if (is_array($locale)) {
|
||||
if (array_key_exists('locale', $locale)) {
|
||||
$locale = $locale['locale'];
|
||||
} else {
|
||||
$locale = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($locale)) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale')) {
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
}
|
||||
}
|
||||
|
||||
if ($locale !== null) {
|
||||
$this->setLocale($locale);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set locale
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->_locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the locale to use
|
||||
*
|
||||
* @param string|Zend_Locale $locale
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
require_once 'Zend/Locale.php';
|
||||
$this->_locale = Zend_Locale::findLocale($locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is a valid integer
|
||||
*
|
||||
* @param string|integer $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_int($value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
if ($this->_locale === null) {
|
||||
$locale = localeconv();
|
||||
$valueFiltered = str_replace($locale['decimal_point'], '.', $value);
|
||||
$valueFiltered = str_replace($locale['thousands_sep'], '', $valueFiltered);
|
||||
|
||||
if (strval(intval($valueFiltered)) != $valueFiltered) {
|
||||
$this->_error(self::NOT_INT);
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
if (!Zend_Locale_Format::isInteger($value, array('locale' => $this->_locale))) {
|
||||
$this->_error(self::NOT_INT);
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Locale_Exception $e) {
|
||||
$this->_error(self::NOT_INT);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
54
airtime_mvc/library/Zend/Validate/Interface.php
Normal file
54
airtime_mvc/library/Zend/Validate/Interface.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Validate_Interface
|
||||
{
|
||||
/**
|
||||
* Returns true if and only if $value meets the validation requirements
|
||||
*
|
||||
* If $value fails validation, then this method returns false, and
|
||||
* getMessages() will return an array of messages that explain why the
|
||||
* validation failed.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
* @throws Zend_Valid_Exception If validation of $value is impossible
|
||||
*/
|
||||
public function isValid($value);
|
||||
|
||||
/**
|
||||
* Returns an array of messages that explain why the most recent isValid()
|
||||
* call returned false. The array keys are validation failure message identifiers,
|
||||
* and the array values are the corresponding human-readable message strings.
|
||||
*
|
||||
* If isValid() was never called or if the most recent isValid() call
|
||||
* returned true, then this method returns an empty array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessages();
|
||||
}
|
191
airtime_mvc/library/Zend/Validate/Ip.php
Normal file
191
airtime_mvc/library/Zend/Validate/Ip.php
Normal file
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ip.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Ip extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'ipInvalid';
|
||||
const NOT_IP_ADDRESS = 'notIpAddress';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::NOT_IP_ADDRESS => "'%value%' does not appear to be a valid IP address",
|
||||
);
|
||||
|
||||
/**
|
||||
* internal options
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_options = array(
|
||||
'allowipv6' => true,
|
||||
'allowipv4' => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param array $options OPTIONAL Options to set, see the manual for all available options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['allowipv6'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['allowipv4'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
$options += $this->_options;
|
||||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all set options
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the options for this validator
|
||||
*
|
||||
* @param array $options
|
||||
* @return Zend_Validate_Ip
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
if (array_key_exists('allowipv6', $options)) {
|
||||
$this->_options['allowipv6'] = (boolean) $options['allowipv6'];
|
||||
}
|
||||
|
||||
if (array_key_exists('allowipv4', $options)) {
|
||||
$this->_options['allowipv4'] = (boolean) $options['allowipv4'];
|
||||
}
|
||||
|
||||
if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Nothing to validate. Check your options');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is a valid IP address
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
if (($this->_options['allowipv4'] && !$this->_options['allowipv6'] && !$this->_validateIPv4($value)) ||
|
||||
(!$this->_options['allowipv4'] && $this->_options['allowipv6'] && !$this->_validateIPv6($value)) ||
|
||||
($this->_options['allowipv4'] && $this->_options['allowipv6'] && !$this->_validateIPv4($value) && !$this->_validateIPv6($value))) {
|
||||
$this->_error(self::NOT_IP_ADDRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an IPv4 address
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
protected function _validateIPv4($value) {
|
||||
$ip2long = ip2long($value);
|
||||
if($ip2long === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $value == long2ip($ip2long);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an IPv6 address
|
||||
*
|
||||
* @param string $value Value to check against
|
||||
* @return boolean True when $value is a valid ipv6 address
|
||||
* False otherwise
|
||||
*/
|
||||
protected function _validateIPv6($value) {
|
||||
if (strlen($value) < 3) {
|
||||
return $value == '::';
|
||||
}
|
||||
|
||||
if (strpos($value, '.')) {
|
||||
$lastcolon = strrpos($value, ':');
|
||||
if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = substr($value, 0, $lastcolon) . ':0:0';
|
||||
}
|
||||
|
||||
if (strpos($value, '::') === false) {
|
||||
return preg_match('/\A(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}\z/i', $value);
|
||||
}
|
||||
|
||||
$colonCount = substr_count($value, ':');
|
||||
if ($colonCount < 8) {
|
||||
return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\z/i', $value);
|
||||
}
|
||||
|
||||
// special case with ending or starting double colon
|
||||
if ($colonCount == 8) {
|
||||
return preg_match('/\A(?:::)?(?:[a-f0-9]{1,4}:){6}[a-f0-9]{1,4}(?:::)?\z/i', $value);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
273
airtime_mvc/library/Zend/Validate/Isbn.php
Normal file
273
airtime_mvc/library/Zend/Validate/Isbn.php
Normal file
|
@ -0,0 +1,273 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Isbn.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Isbn extends Zend_Validate_Abstract
|
||||
{
|
||||
const AUTO = 'auto';
|
||||
const ISBN10 = '10';
|
||||
const ISBN13 = '13';
|
||||
const INVALID = 'isbnInvalid';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "'%value%' is no valid ISBN number",
|
||||
);
|
||||
|
||||
/**
|
||||
* Allowed type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_type = self::AUTO;
|
||||
|
||||
/**
|
||||
* Separator character.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_separator = '';
|
||||
|
||||
/**
|
||||
* Set up options.
|
||||
*
|
||||
* @param Zend_Config|array $options
|
||||
* @throws Zend_Validate_Exception When $options is not valid
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
// prepare options
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
}
|
||||
if (!is_array($options)) {
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid options provided.');
|
||||
}
|
||||
|
||||
// set type
|
||||
if (array_key_exists('type', $options)) {
|
||||
$this->setType($options['type']);
|
||||
}
|
||||
|
||||
// set separator
|
||||
if (array_key_exists('separator', $options)) {
|
||||
$this->setSeparator($options['separator']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect input format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectFormat()
|
||||
{
|
||||
// prepare separator and pattern list
|
||||
$sep = quotemeta($this->_separator);
|
||||
$patterns = array();
|
||||
$lengths = array();
|
||||
|
||||
// check for ISBN-10
|
||||
if ($this->_type == self::ISBN10 || $this->_type == self::AUTO) {
|
||||
if (empty($sep)) {
|
||||
$pattern = '/^[0-9]{9}[0-9X]{1}$/';
|
||||
$length = 10;
|
||||
} else {
|
||||
$pattern = "/^[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9X]{1}$/";
|
||||
$length = 13;
|
||||
}
|
||||
|
||||
$patterns[$pattern] = self::ISBN10;
|
||||
$lengths[$pattern] = $length;
|
||||
}
|
||||
|
||||
// check for ISBN-13
|
||||
if ($this->_type == self::ISBN13 || $this->_type == self::AUTO) {
|
||||
if (empty($sep)) {
|
||||
$pattern = '/^[0-9]{13}$/';
|
||||
$length = 13;
|
||||
} else {
|
||||
$pattern = "/^[0-9]{1,9}[{$sep}]{1}[0-9]{1,5}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1}$/";
|
||||
$length = 17;
|
||||
}
|
||||
|
||||
$patterns[$pattern] = self::ISBN13;
|
||||
$lengths[$pattern] = $length;
|
||||
}
|
||||
|
||||
// check pattern list
|
||||
foreach ($patterns as $pattern => $type) {
|
||||
if ((strlen($this->_value) == $lengths[$pattern]) && preg_match($pattern, $this->_value)) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface.
|
||||
*
|
||||
* Returns true if and only if $value contains a valid ISBN.
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
// save value
|
||||
$value = (string) $value;
|
||||
$this->_setValue($value);
|
||||
|
||||
switch ($this->_detectFormat()) {
|
||||
case self::ISBN10:
|
||||
// sum
|
||||
$isbn10 = preg_replace('/[^0-9X]/', '', $value);
|
||||
$sum = 0;
|
||||
for ($i = 0; $i < 9; $i++) {
|
||||
$sum += (10 - $i) * $isbn10{$i};
|
||||
}
|
||||
|
||||
// checksum
|
||||
$checksum = 11 - ($sum % 11);
|
||||
if ($checksum == 11) {
|
||||
$checksum = '0';
|
||||
} elseif ($checksum == 10) {
|
||||
$checksum = 'X';
|
||||
}
|
||||
break;
|
||||
|
||||
case self::ISBN13:
|
||||
// sum
|
||||
$isbn13 = preg_replace('/[^0-9]/', '', $value);
|
||||
$sum = 0;
|
||||
for ($i = 0; $i < 12; $i++) {
|
||||
if ($i % 2 == 0) {
|
||||
$sum += $isbn13{$i};
|
||||
} else {
|
||||
$sum += 3 * $isbn13{$i};
|
||||
}
|
||||
}
|
||||
// checksum
|
||||
$checksum = 10 - ($sum % 10);
|
||||
if ($checksum == 10) {
|
||||
$checksum = '0';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate
|
||||
if (substr($this->_value, -1) != $checksum) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set separator characters.
|
||||
*
|
||||
* It is allowed only empty string, hyphen and space.
|
||||
*
|
||||
* @param string $separator
|
||||
* @throws Zend_Validate_Exception When $separator is not valid
|
||||
* @return Zend_Validate_Isbn Provides a fluent interface
|
||||
*/
|
||||
public function setSeparator($separator)
|
||||
{
|
||||
// check separator
|
||||
if (!in_array($separator, array('-', ' ', ''))) {
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid ISBN separator.');
|
||||
}
|
||||
|
||||
$this->_separator = $separator;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get separator characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSeparator()
|
||||
{
|
||||
return $this->_separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set allowed ISBN type.
|
||||
*
|
||||
* @param string $type
|
||||
* @throws Zend_Validate_Exception When $type is not valid
|
||||
* @return Zend_Validate_Isbn Provides a fluent interface
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
// check type
|
||||
if (!in_array($type, array(self::AUTO, self::ISBN10, self::ISBN13))) {
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Invalid ISBN type');
|
||||
}
|
||||
|
||||
$this->_type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowed ISBN type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
}
|
122
airtime_mvc/library/Zend/Validate/LessThan.php
Normal file
122
airtime_mvc/library/Zend/Validate/LessThan.php
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: LessThan.php 20182 2010-01-10 21:12:01Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_LessThan extends Zend_Validate_Abstract
|
||||
{
|
||||
const NOT_LESS = 'notLessThan';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_LESS => "'%value%' is not less than '%max%'"
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'max' => '_max'
|
||||
);
|
||||
|
||||
/**
|
||||
* Maximum value
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_max;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param mixed|Zend_Config $max
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($max)
|
||||
{
|
||||
if ($max instanceof Zend_Config) {
|
||||
$max = $max->toArray();
|
||||
}
|
||||
|
||||
if (is_array($max)) {
|
||||
if (array_key_exists('max', $max)) {
|
||||
$max = $max['max'];
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Missing option 'max'");
|
||||
}
|
||||
}
|
||||
|
||||
$this->setMax($max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the max option
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMax()
|
||||
{
|
||||
return $this->_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max option
|
||||
*
|
||||
* @param mixed $max
|
||||
* @return Zend_Validate_LessThan Provides a fluent interface
|
||||
*/
|
||||
public function setMax($max)
|
||||
{
|
||||
$this->_max = $max;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is less than max option
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
if ($this->_max <= $value) {
|
||||
$this->_error(self::NOT_LESS);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
237
airtime_mvc/library/Zend/Validate/NotEmpty.php
Normal file
237
airtime_mvc/library/Zend/Validate/NotEmpty.php
Normal file
|
@ -0,0 +1,237 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: NotEmpty.php 20193 2010-01-11 10:40:43Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_NotEmpty extends Zend_Validate_Abstract
|
||||
{
|
||||
const BOOLEAN = 1;
|
||||
const INTEGER = 2;
|
||||
const FLOAT = 4;
|
||||
const STRING = 8;
|
||||
const ZERO = 16;
|
||||
const EMPTY_ARRAY = 32;
|
||||
const NULL = 64;
|
||||
const PHP = 127;
|
||||
const SPACE = 128;
|
||||
const ALL = 255;
|
||||
|
||||
const INVALID = 'notEmptyInvalid';
|
||||
const IS_EMPTY = 'isEmpty';
|
||||
|
||||
protected $_constants = array(
|
||||
self::BOOLEAN => 'boolean',
|
||||
self::INTEGER => 'integer',
|
||||
self::FLOAT => 'float',
|
||||
self::STRING => 'string',
|
||||
self::ZERO => 'zero',
|
||||
self::EMPTY_ARRAY => 'array',
|
||||
self::NULL => 'null',
|
||||
self::PHP => 'php',
|
||||
self::SPACE => 'space',
|
||||
self::ALL => 'all'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::IS_EMPTY => "Value is required and can't be empty",
|
||||
self::INVALID => "Invalid type given, value should be float, string, array, boolean or integer",
|
||||
);
|
||||
|
||||
/**
|
||||
* Internal type to detect
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_type = 237;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string|array|Zend_Config $options OPTIONAL
|
||||
*/
|
||||
public function __construct($options = null)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp = array();
|
||||
if (!empty($options)) {
|
||||
$temp['type'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (is_array($options) && array_key_exists('type', $options)) {
|
||||
$this->setType($options['type']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the types
|
||||
*
|
||||
* @param integer|array $type
|
||||
* @throws Zend_Validate_Exception
|
||||
* @return Zend_Validate_NotEmpty
|
||||
*/
|
||||
public function setType($type = null)
|
||||
{
|
||||
if (is_array($type)) {
|
||||
$detected = 0;
|
||||
foreach($type as $value) {
|
||||
if (is_int($value)) {
|
||||
$detected += $value;
|
||||
} else if (in_array($value, $this->_constants)) {
|
||||
$detected += array_search($value, $this->_constants);
|
||||
}
|
||||
}
|
||||
|
||||
$type = $detected;
|
||||
} else if (is_string($type) && in_array($type, $this->_constants)) {
|
||||
$type = array_search($type, $this->_constants);
|
||||
}
|
||||
|
||||
if (!is_int($type) || ($type < 0) || ($type > self::ALL)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Unknown type');
|
||||
}
|
||||
|
||||
$this->_type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is not an empty value.
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_null($value) && !is_string($value) && !is_int($value) && !is_float($value) &&
|
||||
!is_bool($value) && !is_array($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$type = $this->getType();
|
||||
$this->_setValue($value);
|
||||
|
||||
// SPACE (' ')
|
||||
if ($type >= self::SPACE) {
|
||||
$type -= self::SPACE;
|
||||
if (is_string($value) && (preg_match('/^\s+$/s', $value))) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// NULL (null)
|
||||
if ($type >= self::NULL) {
|
||||
$type -= self::NULL;
|
||||
if (is_null($value)) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// EMPTY_ARRAY (array())
|
||||
if ($type >= self::EMPTY_ARRAY) {
|
||||
$type -= self::EMPTY_ARRAY;
|
||||
if (is_array($value) && ($value == array())) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ZERO ('0')
|
||||
if ($type >= self::ZERO) {
|
||||
$type -= self::ZERO;
|
||||
if (is_string($value) && ($value == '0')) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// STRING ('')
|
||||
if ($type >= self::STRING) {
|
||||
$type -= self::STRING;
|
||||
if (is_string($value) && ($value == '')) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// FLOAT (0.0)
|
||||
if ($type >= self::FLOAT) {
|
||||
$type -= self::FLOAT;
|
||||
if (is_float($value) && ($value == 0.0)) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// INTEGER (0)
|
||||
if ($type >= self::INTEGER) {
|
||||
$type -= self::INTEGER;
|
||||
if (is_int($value) && ($value == 0)) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// BOOLEAN (false)
|
||||
if ($type >= self::BOOLEAN) {
|
||||
$type -= self::BOOLEAN;
|
||||
if (is_bool($value) && ($value == false)) {
|
||||
$this->_error(self::IS_EMPTY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
210
airtime_mvc/library/Zend/Validate/PostCode.php
Normal file
210
airtime_mvc/library/Zend/Validate/PostCode.php
Normal file
|
@ -0,0 +1,210 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: PostCode.php 21487 2010-03-14 10:17:35Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Locale_Format
|
||||
*/
|
||||
require_once 'Zend/Locale/Format.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_PostCode extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'postcodeInvalid';
|
||||
const NO_MATCH = 'postcodeNoMatch';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given. The value should be a string or a integer",
|
||||
self::NO_MATCH => "'%value%' does not appear to be a postal code",
|
||||
);
|
||||
|
||||
/**
|
||||
* Locale to use
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* Manual postal code format
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $_format;
|
||||
|
||||
/**
|
||||
* Constructor for the integer validator
|
||||
*
|
||||
* Accepts either a string locale, a Zend_Locale object, or an array or
|
||||
* Zend_Config object containing the keys "locale" and/or "format".
|
||||
*
|
||||
* @param string|Zend_Locale|array|Zend_Config $options
|
||||
* @throws Zend_Validate_Exception On empty format
|
||||
*/
|
||||
public function __construct($options = null)
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
}
|
||||
|
||||
if (empty($options)) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale')) {
|
||||
$this->setLocale(Zend_Registry::get('Zend_Locale'));
|
||||
}
|
||||
} elseif (is_array($options)) {
|
||||
// Received
|
||||
if (array_key_exists('locale', $options)) {
|
||||
$this->setLocale($options['locale']);
|
||||
}
|
||||
|
||||
if (array_key_exists('format', $options)) {
|
||||
$this->setFormat($options['format']);
|
||||
}
|
||||
} elseif ($options instanceof Zend_Locale || is_string($options)) {
|
||||
// Received Locale object or string locale
|
||||
$this->setLocale($options);
|
||||
}
|
||||
|
||||
$format = $this->getFormat();
|
||||
if (empty($format)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set locale
|
||||
*
|
||||
* @return string|Zend_Locale The set locale
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->_locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the locale to use
|
||||
*
|
||||
* @param string|Zend_Locale $locale
|
||||
* @throws Zend_Validate_Exception On unrecognised region
|
||||
* @throws Zend_Validate_Exception On not detected format
|
||||
* @return Zend_Validate_PostCode Provides fluid interface
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
require_once 'Zend/Locale.php';
|
||||
$this->_locale = Zend_Locale::findLocale($locale);
|
||||
$locale = new Zend_Locale($this->_locale);
|
||||
$region = $locale->getRegion();
|
||||
if (empty($region)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'");
|
||||
}
|
||||
|
||||
$format = Zend_Locale::getTranslation(
|
||||
$locale->getRegion(),
|
||||
'postaltoterritory',
|
||||
$this->_locale
|
||||
);
|
||||
|
||||
if (empty($format)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Unable to detect a postcode format for the region '{$locale->getRegion()}'");
|
||||
}
|
||||
|
||||
$this->setFormat($format);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set postal code format
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a self defined postal format as regex
|
||||
*
|
||||
* @param string $format
|
||||
* @throws Zend_Validate_Exception On empty format
|
||||
* @return Zend_Validate_PostCode Provides fluid interface
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
if (empty($format) || !is_string($format)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
|
||||
}
|
||||
|
||||
if ($format[0] !== '/') {
|
||||
$format = '/^' . $format;
|
||||
}
|
||||
|
||||
if ($format[strlen($format) - 1] !== '/') {
|
||||
$format .= '$/';
|
||||
}
|
||||
|
||||
$this->_format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value is a valid postalcode
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
if (!is_string($value) && !is_int($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$format = $this->getFormat();
|
||||
if (!preg_match($format, $value)) {
|
||||
$this->_error(self::NO_MATCH);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
147
airtime_mvc/library/Zend/Validate/Regex.php
Normal file
147
airtime_mvc/library/Zend/Validate/Regex.php
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Regex.php 21574 2010-03-19 20:00:37Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Regex extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'regexInvalid';
|
||||
const NOT_MATCH = 'regexNotMatch';
|
||||
const ERROROUS = 'regexErrorous';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be string, integer or float",
|
||||
self::NOT_MATCH => "'%value%' does not match against pattern '%pattern%'",
|
||||
self::ERROROUS => "There was an internal error while using the pattern '%pattern%'",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'pattern' => '_pattern'
|
||||
);
|
||||
|
||||
/**
|
||||
* Regular expression pattern
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_pattern;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param string|Zend_Config $pattern
|
||||
* @throws Zend_Validate_Exception On missing 'pattern' parameter
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($pattern)
|
||||
{
|
||||
if ($pattern instanceof Zend_Config) {
|
||||
$pattern = $pattern->toArray();
|
||||
}
|
||||
|
||||
if (is_array($pattern)) {
|
||||
if (array_key_exists('pattern', $pattern)) {
|
||||
$pattern = $pattern['pattern'];
|
||||
} else {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Missing option 'pattern'");
|
||||
}
|
||||
}
|
||||
|
||||
$this->setPattern($pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pattern option
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPattern()
|
||||
{
|
||||
return $this->_pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the pattern option
|
||||
*
|
||||
* @param string $pattern
|
||||
* @throws Zend_Validate_Exception if there is a fatal error in pattern matching
|
||||
* @return Zend_Validate_Regex Provides a fluent interface
|
||||
*/
|
||||
public function setPattern($pattern)
|
||||
{
|
||||
$this->_pattern = (string) $pattern;
|
||||
$status = @preg_match($this->_pattern, "Test");
|
||||
|
||||
if (false === $status) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("Internal error while using the pattern '$this->_pattern'");
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if $value matches against the pattern option
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value) && !is_float($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
|
||||
$status = @preg_match($this->_pattern, $value);
|
||||
if (false === $status) {
|
||||
$this->_error(self::ERROROUS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$status) {
|
||||
$this->_error(self::NOT_MATCH);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
95
airtime_mvc/library/Zend/Validate/Sitemap/Changefreq.php
Normal file
95
airtime_mvc/library/Zend/Validate/Sitemap/Changefreq.php
Normal file
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Changefreq.php 21365 2010-03-07 09:38:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validates whether a given value is valid as a sitemap <changefreq> value
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php Sitemaps XML format
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Sitemap_Changefreq extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Validation key for not valid
|
||||
*
|
||||
*/
|
||||
const NOT_VALID = 'sitemapChangefreqNotValid';
|
||||
const INVALID = 'sitemapChangefreqInvalid';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_VALID => "'%value%' is no valid sitemap changefreq",
|
||||
self::INVALID => "Invalid type given, the value should be a string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Valid change frequencies
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_changeFreqs = array(
|
||||
'always', 'hourly', 'daily', 'weekly',
|
||||
'monthly', 'yearly', 'never'
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates if a string is valid as a sitemap changefreq
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php#changefreqdef <changefreq>
|
||||
*
|
||||
* @param string $value value to validate
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!in_array($value, $this->_changeFreqs, true)) {
|
||||
$this->_error(self::NOT_VALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
88
airtime_mvc/library/Zend/Validate/Sitemap/Lastmod.php
Normal file
88
airtime_mvc/library/Zend/Validate/Sitemap/Lastmod.php
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Lastmod.php 21365 2010-03-07 09:38:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validates whether a given value is valid as a sitemap <lastmod> value
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php Sitemaps XML format
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Regular expression to use when validating
|
||||
*
|
||||
*/
|
||||
const LASTMOD_REGEX = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9])(:[0-5][0-9])?(\\+|-)([0-1][0-9]|2[0-3]):[0-5][0-9])?$/';
|
||||
|
||||
/**
|
||||
* Validation key for not valid
|
||||
*
|
||||
*/
|
||||
const NOT_VALID = 'sitemapLastmodNotValid';
|
||||
const INVALID = 'sitemapLastmodInvalid';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_VALID => "'%value%' is no valid sitemap lastmod",
|
||||
self::INVALID => "Invalid type given, the value should be a string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates if a string is valid as a sitemap lastmod
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php#lastmoddef <lastmod>
|
||||
*
|
||||
* @param string $value value to validate
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
$result = @preg_match(self::LASTMOD_REGEX, $value);
|
||||
if ($result != 1) {
|
||||
$this->_error(self::NOT_VALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
87
airtime_mvc/library/Zend/Validate/Sitemap/Loc.php
Normal file
87
airtime_mvc/library/Zend/Validate/Sitemap/Loc.php
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Loc.php 21365 2010-03-07 09:38:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Uri
|
||||
*/
|
||||
require_once 'Zend/Uri.php';
|
||||
|
||||
/**
|
||||
* Validates whether a given value is valid as a sitemap <loc> value
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php Sitemaps XML format
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Sitemap_Loc extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Validation key for not valid
|
||||
*
|
||||
*/
|
||||
const NOT_VALID = 'sitemapLocNotValid';
|
||||
const INVALID = 'sitemapLocInvalid';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_VALID => "'%value%' is no valid sitemap location",
|
||||
self::INVALID => "Invalid type given, the value should be a string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates if a string is valid as a sitemap location
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php#locdef <loc>
|
||||
*
|
||||
* @param string $value value to validate
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
$result = Zend_Uri::check($value);
|
||||
if ($result !== true) {
|
||||
$this->_error(self::NOT_VALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
82
airtime_mvc/library/Zend/Validate/Sitemap/Priority.php
Normal file
82
airtime_mvc/library/Zend/Validate/Sitemap/Priority.php
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Priority.php 21365 2010-03-07 09:38:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* Validates whether a given value is valid as a sitemap <priority> value
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php Sitemaps XML format
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @subpackage Sitemap
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_Sitemap_Priority extends Zend_Validate_Abstract
|
||||
{
|
||||
/**
|
||||
* Validation key for not valid
|
||||
*
|
||||
*/
|
||||
const NOT_VALID = 'sitemapPriorityNotValid';
|
||||
const INVALID = 'sitemapPriorityInvalid';
|
||||
|
||||
/**
|
||||
* Validation failure message template definitions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::NOT_VALID => "'%value%' is no valid sitemap priority",
|
||||
self::INVALID => "Invalid type given, the value should be a integer, a float or a numeric string",
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates if a string is valid as a sitemap priority
|
||||
*
|
||||
* @link http://www.sitemaps.org/protocol.php#prioritydef <priority>
|
||||
*
|
||||
* @param string $value value to validate
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_numeric($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
$value = (float) $value;
|
||||
if ($value < 0 || $value > 1) {
|
||||
$this->_error(self::NOT_VALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
253
airtime_mvc/library/Zend/Validate/StringLength.php
Normal file
253
airtime_mvc/library/Zend/Validate/StringLength.php
Normal file
|
@ -0,0 +1,253 @@
|
|||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: StringLength.php 20358 2010-01-17 19:03:49Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Validate_StringLength extends Zend_Validate_Abstract
|
||||
{
|
||||
const INVALID = 'stringLengthInvalid';
|
||||
const TOO_SHORT = 'stringLengthTooShort';
|
||||
const TOO_LONG = 'stringLengthTooLong';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageTemplates = array(
|
||||
self::INVALID => "Invalid type given, value should be a string",
|
||||
self::TOO_SHORT => "'%value%' is less than %min% characters long",
|
||||
self::TOO_LONG => "'%value%' is more than %max% characters long",
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_messageVariables = array(
|
||||
'min' => '_min',
|
||||
'max' => '_max'
|
||||
);
|
||||
|
||||
/**
|
||||
* Minimum length
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_min;
|
||||
|
||||
/**
|
||||
* Maximum length
|
||||
*
|
||||
* If null, there is no maximum length
|
||||
*
|
||||
* @var integer|null
|
||||
*/
|
||||
protected $_max;
|
||||
|
||||
/**
|
||||
* Encoding to use
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_encoding;
|
||||
|
||||
/**
|
||||
* Sets validator options
|
||||
*
|
||||
* @param integer|array|Zend_Config $options
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($options = array())
|
||||
{
|
||||
if ($options instanceof Zend_Config) {
|
||||
$options = $options->toArray();
|
||||
} else if (!is_array($options)) {
|
||||
$options = func_get_args();
|
||||
$temp['min'] = array_shift($options);
|
||||
if (!empty($options)) {
|
||||
$temp['max'] = array_shift($options);
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$temp['encoding'] = array_shift($options);
|
||||
}
|
||||
|
||||
$options = $temp;
|
||||
}
|
||||
|
||||
if (!array_key_exists('min', $options)) {
|
||||
$options['min'] = 0;
|
||||
}
|
||||
|
||||
$this->setMin($options['min']);
|
||||
if (array_key_exists('max', $options)) {
|
||||
$this->setMax($options['max']);
|
||||
}
|
||||
|
||||
if (array_key_exists('encoding', $options)) {
|
||||
$this->setEncoding($options['encoding']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min option
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMin()
|
||||
{
|
||||
return $this->_min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min option
|
||||
*
|
||||
* @param integer $min
|
||||
* @throws Zend_Validate_Exception
|
||||
* @return Zend_Validate_StringLength Provides a fluent interface
|
||||
*/
|
||||
public function setMin($min)
|
||||
{
|
||||
if (null !== $this->_max && $min > $this->_max) {
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum length, but $min >"
|
||||
. " $this->_max");
|
||||
}
|
||||
$this->_min = max(0, (integer) $min);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the max option
|
||||
*
|
||||
* @return integer|null
|
||||
*/
|
||||
public function getMax()
|
||||
{
|
||||
return $this->_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max option
|
||||
*
|
||||
* @param integer|null $max
|
||||
* @throws Zend_Validate_Exception
|
||||
* @return Zend_Validate_StringLength Provides a fluent interface
|
||||
*/
|
||||
public function setMax($max)
|
||||
{
|
||||
if (null === $max) {
|
||||
$this->_max = null;
|
||||
} else if ($max < $this->_min) {
|
||||
/**
|
||||
* @see Zend_Validate_Exception
|
||||
*/
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum length, but "
|
||||
. "$max < $this->_min");
|
||||
} else {
|
||||
$this->_max = (integer) $max;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the actual encoding
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new encoding to use
|
||||
*
|
||||
* @param string $encoding
|
||||
* @return Zend_Validate_StringLength
|
||||
*/
|
||||
public function setEncoding($encoding = null)
|
||||
{
|
||||
if ($encoding !== null) {
|
||||
$orig = iconv_get_encoding('internal_encoding');
|
||||
$result = iconv_set_encoding('internal_encoding', $encoding);
|
||||
if (!$result) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception('Given encoding not supported on this OS!');
|
||||
}
|
||||
|
||||
iconv_set_encoding('internal_encoding', $orig);
|
||||
}
|
||||
|
||||
$this->_encoding = $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defined by Zend_Validate_Interface
|
||||
*
|
||||
* Returns true if and only if the string length of $value is at least the min option and
|
||||
* no greater than the max option (when the max option is not null).
|
||||
*
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (!is_string($value)) {
|
||||
$this->_error(self::INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_setValue($value);
|
||||
if ($this->_encoding !== null) {
|
||||
$length = iconv_strlen($value, $this->_encoding);
|
||||
} else {
|
||||
$length = iconv_strlen($value);
|
||||
}
|
||||
|
||||
if ($length < $this->_min) {
|
||||
$this->_error(self::TOO_SHORT);
|
||||
}
|
||||
|
||||
if (null !== $this->_max && $this->_max < $length) {
|
||||
$this->_error(self::TOO_LONG);
|
||||
}
|
||||
|
||||
if (count($this->_messages)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue