|
@@ -495,6 +495,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
|
|
|
*/
|
|
*/
|
|
|
public function isValid($value)
|
|
public function isValid($value)
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
if (!is_string($value)) {
|
|
if (!is_string($value)) {
|
|
|
$this->_error(self::INVALID);
|
|
$this->_error(self::INVALID);
|
|
|
return false;
|
|
return false;
|
|
@@ -502,7 +503,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
|
|
|
|
|
|
|
|
$this->_setValue($value);
|
|
$this->_setValue($value);
|
|
|
// Check input against IP address schema
|
|
// Check input against IP address schema
|
|
|
- if (preg_match('/^[0-9.a-e:.]*$/i', $value) &&
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (preg_match('/^[0-9a-f:.]*$/i', $value) &&
|
|
|
$this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
|
|
$this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
|
|
|
if (!($this->_options['allow'] & self::ALLOW_IP)) {
|
|
if (!($this->_options['allow'] & self::ALLOW_IP)) {
|
|
|
$this->_error(self::IP_ADDRESS_NOT_ALLOWED);
|
|
$this->_error(self::IP_ADDRESS_NOT_ALLOWED);
|