diff options
author | robocoder <anthon.pang@gmail.com> | 2011-05-07 23:57:30 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2011-05-07 23:57:30 +0400 |
commit | 6a9b7c04ac3edd54214f6728ed06bdd94e5edbd4 (patch) | |
tree | 5b7033aae3056ef96898ea7fb2a9efa7a6e6f9b1 /libs/Zend/Validate | |
parent | c16d36676f78ae7d0a8c23ce22d7501884de53ae (diff) |
fixes #2412
git-svn-id: http://dev.piwik.org/svn/trunk@4657 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'libs/Zend/Validate')
-rw-r--r-- | libs/Zend/Validate/Hostname.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/Zend/Validate/Hostname.php b/libs/Zend/Validate/Hostname.php index 98b5fc2e75..b94e94f6d0 100644 --- a/libs/Zend/Validate/Hostname.php +++ b/libs/Zend/Validate/Hostname.php @@ -16,7 +16,7 @@ * @package Zend_Validate * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Hostname.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Hostname.php 23972 2011-05-03 16:26:36Z ralph $ */ /** @@ -495,6 +495,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract */ public function isValid($value) { + if (!is_string($value)) { $this->_error(self::INVALID); return false; @@ -502,7 +503,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract $this->_setValue($value); // 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)) { if (!($this->_options['allow'] & self::ALLOW_IP)) { $this->_error(self::IP_ADDRESS_NOT_ALLOWED); |