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 | |
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')
25 files changed, 85 insertions, 54 deletions
diff --git a/libs/Zend/Config/Writer.php b/libs/Zend/Config/Writer.php index 093f50132c..689ec43c98 100644 --- a/libs/Zend/Config/Writer.php +++ b/libs/Zend/Config/Writer.php @@ -16,7 +16,7 @@ * @package Zend_Config * @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: Writer.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Writer.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Config/Yaml.php b/libs/Zend/Config/Yaml.php index 440465b436..e9fe719f59 100755 --- a/libs/Zend/Config/Yaml.php +++ b/libs/Zend/Config/Yaml.php @@ -16,7 +16,7 @@ * @package Zend_Config * @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: Yaml.php 23808 2011-03-16 21:26:56Z matthew $ + * @version $Id: Yaml.php 23952 2011-05-03 05:45:06Z ralph $ */ /** @@ -315,7 +315,7 @@ class Zend_Config_Yaml extends Zend_Config // key: value if (strlen($m[2])) { // simple key: value - $value = $m[2]; + $value = rtrim(preg_replace("/#.*$/", "", $m[2])); // Check for booleans and constants if (preg_match('/^(t(rue)?|on|y(es)?)$/i', $value)) { $value = true; diff --git a/libs/Zend/Db/Adapter/Pdo/Mysql.php b/libs/Zend/Db/Adapter/Pdo/Mysql.php index 490001eaa9..363196334f 100644 --- a/libs/Zend/Db/Adapter/Pdo/Mysql.php +++ b/libs/Zend/Db/Adapter/Pdo/Mysql.php @@ -17,7 +17,7 @@ * @subpackage Adapter * @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: Mysql.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Mysql.php 23986 2011-05-03 20:10:42Z ralph $ */ @@ -77,6 +77,19 @@ class Zend_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Abstract ); /** + * Override _dsn() and ensure that charset is incorporated in mysql + * @see Zend_Db_Adapter_Pdo_Abstract::_dsn() + */ + protected function _dsn() + { + $dsn = parent::_dsn(); + if (isset($this->_config['charset'])) { + $dsn .= ';charset=' . $this->_config['charset']; + } + return $dsn; + } + + /** * Creates a PDO object and connects to the database. * * @return void diff --git a/libs/Zend/Db/Statement/Oracle.php b/libs/Zend/Db/Statement/Oracle.php index 3e9dde7d4e..0d267b0599 100644 --- a/libs/Zend/Db/Statement/Oracle.php +++ b/libs/Zend/Db/Statement/Oracle.php @@ -17,7 +17,7 @@ * @subpackage Statement * @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: Oracle.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Oracle.php 23959 2011-05-03 10:45:47Z yoshida@zend.co.jp $ */ /** @@ -87,7 +87,7 @@ class Zend_Db_Statement_Oracle extends Zend_Db_Statement protected function _prepare($sql) { $connection = $this->_adapter->getConnection(); - $this->_stmt = oci_parse($connection, $sql); + $this->_stmt = @oci_parse($connection, $sql); if (!$this->_stmt) { /** * @see Zend_Db_Statement_Oracle_Exception diff --git a/libs/Zend/Db/Table/Abstract.php b/libs/Zend/Db/Table/Abstract.php index 05e2222439..91fb8311c5 100644 --- a/libs/Zend/Db/Table/Abstract.php +++ b/libs/Zend/Db/Table/Abstract.php @@ -17,7 +17,7 @@ * @subpackage Table * @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: Abstract.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Abstract.php 23994 2011-05-04 06:09:42Z ralph $ */ /** @@ -1363,10 +1363,11 @@ abstract class Zend_Db_Table_Abstract * * @param string|array|Zend_Db_Table_Select $where OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object. * @param string|array $order OPTIONAL An SQL ORDER clause. + * @param int $offset OPTIONAL An SQL OFFSET value. * @return Zend_Db_Table_Row_Abstract|null The row results per the * Zend_Db_Adapter fetch mode, or null if no row found. */ - public function fetchRow($where = null, $order = null) + public function fetchRow($where = null, $order = null, $offset = null) { if (!($where instanceof Zend_Db_Table_Select)) { $select = $this->select(); @@ -1379,10 +1380,10 @@ abstract class Zend_Db_Table_Abstract $this->_order($select, $order); } - $select->limit(1); + $select->limit(1, ((is_numeric($offset)) ? (int) $offset : null)); } else { - $select = $where->limit(1); + $select = $where->limit(1, $where->getPart(Zend_Db_Select::LIMIT_OFFSET)); } $rows = $this->_fetch($select); diff --git a/libs/Zend/Feed/Reader.php b/libs/Zend/Feed/Reader.php index fcb349d8c1..b6dc3e788a 100644 --- a/libs/Zend/Feed/Reader.php +++ b/libs/Zend/Feed/Reader.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: Reader.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Reader.php 23975 2011-05-03 16:43:46Z ralph $ */ /** @@ -266,6 +266,10 @@ class Zend_Feed_Reader $cache->save($response->getHeader('Last-Modified'), $cacheId.'_lastmodified'); } } + if (empty($responseXml)) { + // require_once 'Zend/Feed/Exception.php'; + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } return self::importString($responseXml); } elseif ($cache) { $data = $cache->load($cacheId); @@ -279,6 +283,10 @@ class Zend_Feed_Reader } $responseXml = $response->getBody(); $cache->save($responseXml, $cacheId); + if (empty($responseXml)) { + // require_once 'Zend/Feed/Exception.php'; + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } return self::importString($responseXml); } else { $response = $client->request('GET'); @@ -286,7 +294,12 @@ class Zend_Feed_Reader // require_once 'Zend/Feed/Exception.php'; throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus()); } - $reader = self::importString($response->getBody()); + $responseXml = $response->getBody(); + if (empty($responseXml)) { + // require_once 'Zend/Feed/Exception.php'; + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } + $reader = self::importString($responseXml); $reader->setOriginalSourceUri($uri); return $reader; } @@ -320,6 +333,7 @@ class Zend_Feed_Reader */ public static function importString($string) { + $libxml_errflag = libxml_use_internal_errors(true); $dom = new DOMDocument; $status = $dom->loadXML($string); diff --git a/libs/Zend/Feed/Reader/EntryAbstract.php b/libs/Zend/Feed/Reader/EntryAbstract.php index 8fa74d7747..61a85593fa 100644 --- a/libs/Zend/Feed/Reader/EntryAbstract.php +++ b/libs/Zend/Feed/Reader/EntryAbstract.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: EntryAbstract.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: EntryAbstract.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/EntryInterface.php b/libs/Zend/Feed/Reader/EntryInterface.php index d018cb55ef..7179518336 100644 --- a/libs/Zend/Feed/Reader/EntryInterface.php +++ b/libs/Zend/Feed/Reader/EntryInterface.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: EntryInterface.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: EntryInterface.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php b/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php index 3b37554410..894f44d960 100644 --- a/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php +++ b/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: Entry.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Entry.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/Extension/DublinCore/Feed.php b/libs/Zend/Feed/Reader/Extension/DublinCore/Feed.php index 8696e5cd48..6415988aa5 100644 --- a/libs/Zend/Feed/Reader/Extension/DublinCore/Feed.php +++ b/libs/Zend/Feed/Reader/Extension/DublinCore/Feed.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: Feed.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Feed.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/Extension/EntryAbstract.php b/libs/Zend/Feed/Reader/Extension/EntryAbstract.php index dbf68207f2..c3e7ac0ebe 100644 --- a/libs/Zend/Feed/Reader/Extension/EntryAbstract.php +++ b/libs/Zend/Feed/Reader/Extension/EntryAbstract.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: EntryAbstract.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: EntryAbstract.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/Extension/FeedAbstract.php b/libs/Zend/Feed/Reader/Extension/FeedAbstract.php index 5fed735ecc..444f1ca245 100644 --- a/libs/Zend/Feed/Reader/Extension/FeedAbstract.php +++ b/libs/Zend/Feed/Reader/Extension/FeedAbstract.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: FeedAbstract.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: FeedAbstract.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/FeedAbstract.php b/libs/Zend/Feed/Reader/FeedAbstract.php index fa8981dff4..b4c574e813 100644 --- a/libs/Zend/Feed/Reader/FeedAbstract.php +++ b/libs/Zend/Feed/Reader/FeedAbstract.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: FeedAbstract.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: FeedAbstract.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Reader/FeedInterface.php b/libs/Zend/Feed/Reader/FeedInterface.php index a131a53a23..2ba54b6806 100644 --- a/libs/Zend/Feed/Reader/FeedInterface.php +++ b/libs/Zend/Feed/Reader/FeedInterface.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Reader * @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: FeedInterface.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: FeedInterface.php 23953 2011-05-03 05:47:39Z ralph $ */ /** diff --git a/libs/Zend/Feed/Writer/Entry.php b/libs/Zend/Feed/Writer/Entry.php index aa2cb0d12b..9efba8525b 100644 --- a/libs/Zend/Feed/Writer/Entry.php +++ b/libs/Zend/Feed/Writer/Entry.php @@ -16,7 +16,7 @@ * @package Zend_Feed_Writer * @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: Entry.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Entry.php 23965 2011-05-03 14:25:41Z adamlundrigan $ */ /** @@ -295,7 +295,7 @@ class Zend_Feed_Writer_Entry */ public function setCommentCount($count) { - if (empty($count) || !is_numeric($count) || (int) $count < 0) { + if ( !is_numeric($count) || (int) $count < 0) { // require_once 'Zend/Feed/Exception.php'; throw new Zend_Feed_Exception('Invalid parameter: "count" must be a non-empty integer number'); } diff --git a/libs/Zend/Http/Client.php b/libs/Zend/Http/Client.php index 289cd92d5a..fa9aa0b663 100644 --- a/libs/Zend/Http/Client.php +++ b/libs/Zend/Http/Client.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Http * @subpackage Client - * @version $Id: Client.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Client.php 23864 2011-04-19 16:14:07Z shahar $ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -1028,6 +1028,10 @@ class Zend_Http_Client // If we got redirected, look for the Location header if ($response->isRedirect() && ($location = $response->getHeader('location'))) { + // Avoid problems with buggy servers that add whitespace at the + // end of some headers (See ZF-11283) + $location = trim($location); + // Check whether we send the exact same request again, or drop the parameters // and send a GET request if ($response->getStatus() == 303 || @@ -1039,7 +1043,7 @@ class Zend_Http_Client } // If we got a well formed absolute URI - if (Zend_Uri_Http::check($location)) { + if (($scheme = substr($location, 0, 6)) && ($scheme == 'http:/' || $scheme == 'https:')) { $this->setHeaders('host', null); $this->setUri($location); diff --git a/libs/Zend/Http/UserAgent/AbstractDevice.php b/libs/Zend/Http/UserAgent/AbstractDevice.php index 4ef8afcda2..58372ba65b 100644 --- a/libs/Zend/Http/UserAgent/AbstractDevice.php +++ b/libs/Zend/Http/UserAgent/AbstractDevice.php @@ -648,7 +648,9 @@ abstract class Zend_Http_UserAgent_AbstractDevice if (isset($comment[4])) { $result['browser_build'] = trim($comment[4]); } - $result['browser_language'] = trim($comment[3]); + if (isset($comment[3])) { + $result['browser_language'] = trim($comment[3]); + } // Netscape if ($result['browser_name'] == 'Navigator' || $result['browser_name'] == 'Netscape6') { diff --git a/libs/Zend/Http/UserAgent/Mobile.php b/libs/Zend/Http/UserAgent/Mobile.php index 3bb3258a89..c2498bbebf 100644 --- a/libs/Zend/Http/UserAgent/Mobile.php +++ b/libs/Zend/Http/UserAgent/Mobile.php @@ -76,7 +76,6 @@ class Zend_Http_UserAgent_Mobile extends Zend_Http_UserAgent_AbstractDevice 'htc-', 'htc_', 'iemobile', - 'ipad', 'iris', 'j-phone', 'kddi', diff --git a/libs/Zend/Log/Formatter/Xml.php b/libs/Zend/Log/Formatter/Xml.php index ea07eaf1aa..7df86e077d 100644 --- a/libs/Zend/Log/Formatter/Xml.php +++ b/libs/Zend/Log/Formatter/Xml.php @@ -17,7 +17,7 @@ * @subpackage Formatter * @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: Xml.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Xml.php 23981 2011-05-03 19:01:03Z ralph $ */ /** Zend_Log_Formatter_Abstract */ @@ -29,7 +29,7 @@ * @subpackage Formatter * @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: Xml.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Xml.php 23981 2011-05-03 19:01:03Z ralph $ */ class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract { @@ -63,7 +63,7 @@ class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract $args = func_get_args(); $options = array( - 'rootElement' => array_shift($args) + 'rootElement' => array_shift($args) ); if (count($args)) { @@ -92,10 +92,10 @@ class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract } /** - * Factory for Zend_Log_Formatter_Xml classe - * - * @param array|Zend_Config $options - * @return Zend_Log_Formatter_Xml + * Factory for Zend_Log_Formatter_Xml classe + * + * @param array|Zend_Config $options + * @return Zend_Log_Formatter_Xml */ public static function factory($options) { diff --git a/libs/Zend/Log/Writer/Syslog.php b/libs/Zend/Log/Writer/Syslog.php index 1536250b72..1a935c6207 100644 --- a/libs/Zend/Log/Writer/Syslog.php +++ b/libs/Zend/Log/Writer/Syslog.php @@ -17,7 +17,7 @@ * @subpackage Writer * @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: Syslog.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Syslog.php 23953 2011-05-03 05:47:39Z ralph $ */ /** Zend_Log */ diff --git a/libs/Zend/Mime/Decode.php b/libs/Zend/Mime/Decode.php index de8f012fb8..72ff56f9fa 100644 --- a/libs/Zend/Mime/Decode.php +++ b/libs/Zend/Mime/Decode.php @@ -16,7 +16,7 @@ * @package Zend_Mime * @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: Decode.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Decode.php 23984 2011-05-03 19:35:48Z ralph $ */ /** @@ -239,6 +239,6 @@ class Zend_Mime_Decode */ public static function decodeQuotedPrintable($string) { - return iconv_mime_decode($string, ICONV_MIME_DECODE_CONTINUE_ON_ERROR); + return quoted_printable_decode($string); } } diff --git a/libs/Zend/Session.php b/libs/Zend/Session.php index c7f92d6ca3..59c3980362 100644 --- a/libs/Zend/Session.php +++ b/libs/Zend/Session.php @@ -17,7 +17,7 @@ * @package Zend_Session * @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: Session.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Session.php 23955 2011-05-03 09:58:12Z yoshida@zend.co.jp $ * @since Preview Release 0.2 */ @@ -575,10 +575,10 @@ class Zend_Session extends Zend_Session_Abstract unset($_SESSION['__ZF'][$namespace]['ENVGH']); } } - } - if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) { - unset($_SESSION['__ZF'][$namespace]); + if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) { + unset($_SESSION['__ZF'][$namespace]); + } } } diff --git a/libs/Zend/Uri/Http.php b/libs/Zend/Uri/Http.php index 92baf895f1..7378754c4f 100644 --- a/libs/Zend/Uri/Http.php +++ b/libs/Zend/Uri/Http.php @@ -16,7 +16,7 @@ * @package Zend_Uri * @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: Http.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Http.php 23970 2011-05-03 15:46:57Z ralph $ */ /** @@ -217,24 +217,20 @@ class Zend_Uri_Http extends Zend_Uri // Additional decomposition to get username, password, host, and port $combo = isset($matches[3]) === true ? $matches[3] : ''; - $pattern = '~^(([^:@]*)(:([^@]*))?@)?([^:]+)(:(.*))?$~'; + $pattern = '~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~'; $status = @preg_match($pattern, $combo, $matches); if ($status === false) { // require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: authority decomposition failed'); } - - // Failed decomposition; no further processing needed - if ($status === false) { - return; - } - + // Save remaining URI components $this->_username = isset($matches[2]) === true ? $matches[2] : ''; $this->_password = isset($matches[4]) === true ? $matches[4] : ''; - $this->_host = isset($matches[5]) === true ? $matches[5] : ''; + $this->_host = isset($matches[5]) === true + ? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal + : ''; $this->_port = isset($matches[7]) === true ? $matches[7] : ''; - } /** 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); diff --git a/libs/Zend/Version.php b/libs/Zend/Version.php index 5e815224ee..83ef742e78 100644 --- a/libs/Zend/Version.php +++ b/libs/Zend/Version.php @@ -16,7 +16,7 @@ * @package Zend_Version * @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: Version.php 23849 2011-04-06 15:23:21Z matthew $ + * @version $Id: Version.php 24016 2011-05-05 16:18:45Z matthew $ */ /** @@ -32,7 +32,7 @@ final class Zend_Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '1.11.5'; + const VERSION = '1.11.6'; /** * The latest stable version Zend Framework available |