Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libs/Zend
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2011-09-04 00:07:08 +0400
committerrobocoder <anthon.pang@gmail.com>2011-09-04 00:07:08 +0400
commit79f6c4ebb727a1f3449c9df6c5859f36964966a2 (patch)
tree3bd7136fbe6b9ce7e0afcd20aae99d198453c5bd /libs/Zend
parent63f46f8ac47793c0f514636d34bbb14aef897317 (diff)
fixes #2581 - update to ZF 1.11.10
git-svn-id: http://dev.piwik.org/svn/trunk@5123 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'libs/Zend')
-rw-r--r--libs/Zend/Cache/Backend/TwoLevels.php18
-rw-r--r--libs/Zend/Http/Client.php29
-rw-r--r--libs/Zend/Http/Client/Adapter/Curl.php5
-rw-r--r--libs/Zend/Http/Client/Adapter/Test.php12
-rw-r--r--libs/Zend/Http/UserAgent/AbstractDevice.php17
-rw-r--r--libs/Zend/Mail/Transport/File.php2
-rw-r--r--libs/Zend/Validate/EmailAddress.php5
-rw-r--r--libs/Zend/Validate/Hostname.php37
-rw-r--r--libs/Zend/Version.php4
9 files changed, 82 insertions, 47 deletions
diff --git a/libs/Zend/Cache/Backend/TwoLevels.php b/libs/Zend/Cache/Backend/TwoLevels.php
index 2c4637d116..eee8fb0ae7 100644
--- a/libs/Zend/Cache/Backend/TwoLevels.php
+++ b/libs/Zend/Cache/Backend/TwoLevels.php
@@ -17,7 +17,7 @@
* @subpackage Zend_Cache_Backend
* @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: TwoLevels.php 23775 2011-03-01 17:25:24Z ralph $
+ * @version $Id: TwoLevels.php 24254 2011-07-22 12:04:41Z mabe $
*/
@@ -383,7 +383,6 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
return $this->_slowBackend->getIdsMatchingAnyTags($tags);
}
-
/**
* Return the filling percentage of the backend storage
*
@@ -481,18 +480,19 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
*/
private function _getFastLifetime($lifetime, $priority, $maxLifetime = null)
{
- if ($lifetime === null) {
- // if lifetime is null, we have an infinite lifetime
+ if ($lifetime <= 0) {
+ // if no lifetime, we have an infinite lifetime
// we need to use arbitrary lifetimes
$fastLifetime = (int) (2592000 / (11 - $priority));
} else {
- $fastLifetime = (int) ($lifetime / (11 - $priority));
+ // prevent computed infinite lifetime (0) by ceil
+ $fastLifetime = (int) ceil($lifetime / (11 - $priority));
}
- if (($maxLifetime !== null) && ($maxLifetime >= 0)) {
- if ($fastLifetime > $maxLifetime) {
- return $maxLifetime;
- }
+
+ if ($maxLifetime >= 0 && $fastLifetime > $maxLifetime) {
+ return $maxLifetime;
}
+
return $fastLifetime;
}
diff --git a/libs/Zend/Http/Client.php b/libs/Zend/Http/Client.php
index f3e7a31e92..b1b0d25d90 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 24194 2011-07-05 15:53:45Z matthew $
+ * @version $Id: Client.php 24337 2011-08-01 13:04:41Z ezimuel $
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@@ -282,7 +282,10 @@ class Zend_Http_Client
*/
public function setUri($uri)
{
- if (is_string($uri)) {
+ if ($uri instanceof Zend_Uri_Http) {
+ // clone the URI in order to keep the passed parameter constant
+ $uri = clone $uri;
+ } elseif (is_string($uri)) {
$uri = Zend_Uri::factory($uri);
}
@@ -371,7 +374,7 @@ class Zend_Http_Client
throw new Zend_Http_Client_Exception("'{$method}' is not a valid HTTP request method.");
}
- if ($method == self::POST && $this->enctype === null) {
+ if (($method == self::POST || $method == self::PUT || $method == self::DELETE) && $this->enctype === null) {
$this->setEncType(self::ENC_URLENCODED);
}
@@ -900,6 +903,10 @@ class Zend_Http_Client
*/
public function getAdapter()
{
+ if (null === $this->adapter) {
+ $this->setAdapter($this->config['adapter']);
+ }
+
return $this->adapter;
}
@@ -1028,7 +1035,10 @@ class Zend_Http_Client
}
if($this->config['output_stream']) {
- rewind($stream);
+ $streamMetaData = stream_get_meta_data($stream);
+ if ($streamMetaData['seekable']) {
+ rewind($stream);
+ }
// cleanup the adapter
$this->adapter->setOutputStream(null);
$response = Zend_Http_Response_Stream::fromStream($response, $stream);
@@ -1235,20 +1245,13 @@ class Zend_Http_Client
// Encode body as multipart/form-data
$boundary = '---ZENDHTTPCLIENT-' . md5(microtime());
$this->setHeaders(self::CONTENT_TYPE, self::ENC_FORMDATA . "; boundary={$boundary}");
-
- // Map the formname of each file to the array index it is stored in
- $fileIndexMap = array();
- foreach ($this->files as $key=>$fdata ) {
- $fileIndexMap[$fdata['formname']] = $key;
- }
// Encode all files and POST vars in the order they were given
foreach ($this->body_field_order as $fieldName=>$fieldType) {
switch ($fieldType) {
case self::VTYPE_FILE:
- if (isset($fileIndexMap[$fieldName])) {
- if (isset($this->files[$fileIndexMap[$fieldName]])) {
- $file = $this->files[$fileIndexMap[$fieldName]];
+ foreach ($this->files as $file) {
+ if ($file['formname']===$fieldName) {
$fhead = array(self::CONTENT_TYPE => $file['ctype']);
$body .= self::encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
}
diff --git a/libs/Zend/Http/Client/Adapter/Curl.php b/libs/Zend/Http/Client/Adapter/Curl.php
index 0576b60dad..81c1e40be6 100644
--- a/libs/Zend/Http/Client/Adapter/Curl.php
+++ b/libs/Zend/Http/Client/Adapter/Curl.php
@@ -16,7 +16,7 @@
* @category Zend
* @package Zend_Http
* @subpackage Client_Adapter
- * @version $Id: Curl.php 23775 2011-03-01 17:25:24Z ralph $
+ * @version $Id: Curl.php 24272 2011-07-27 21:12:08Z mcleod@spaceweb.nl $
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@@ -393,6 +393,9 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
} elseif ($method == Zend_Http_Client::PUT) {
// This is a PUT by a setRawData string, not by file-handle
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
+ } elseif ($method == Zend_Http_Client::DELETE) {
+ // This is a DELETE by a setRawData string
+ curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
}
// set additional curl options
diff --git a/libs/Zend/Http/Client/Adapter/Test.php b/libs/Zend/Http/Client/Adapter/Test.php
index dccd984eab..413a90b993 100644
--- a/libs/Zend/Http/Client/Adapter/Test.php
+++ b/libs/Zend/Http/Client/Adapter/Test.php
@@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Http
* @subpackage Client_Adapter
- * @version $Id: Test.php 23775 2011-03-01 17:25:24Z ralph $
+ * @version $Id: Test.php 24309 2011-07-30 02:52:32Z ramon $
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@@ -235,4 +235,14 @@ class Zend_Http_Client_Adapter_Test implements Zend_Http_Client_Adapter_Interfac
}
$this->responseIndex = $index;
}
+
+ /**
+ * Retrieve the array of all configuration options
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
}
diff --git a/libs/Zend/Http/UserAgent/AbstractDevice.php b/libs/Zend/Http/UserAgent/AbstractDevice.php
index 58372ba65b..585e5a3c38 100644
--- a/libs/Zend/Http/UserAgent/AbstractDevice.php
+++ b/libs/Zend/Http/UserAgent/AbstractDevice.php
@@ -555,7 +555,11 @@ abstract class Zend_Http_UserAgent_AbstractDevice
$result['device'] = strtolower($result['compatibility_flag']);
$result['device_os_token'] = 'iPhone OS';
$result['browser_language'] = trim($comment[3]);
- $result['browser_version'] = $result['others']['detail'][1][2];
+ if (isset($result['others']['detail'][1])) {
+ $result['browser_version'] = $result['others']['detail'][1][2];
+ } elseif (count($result['others']['detail'])) {
+ $result['browser_version'] = $result['others']['detail'][0][2];
+ }
if (!empty($result['others']['detail'][2])) {
$result['firmware'] = $result['others']['detail'][2][2];
}
@@ -570,7 +574,7 @@ abstract class Zend_Http_UserAgent_AbstractDevice
if (isset($result['others'])) {
if ($result['others']['detail'][0][1] == 'AppleWebKit') {
$result['browser_engine'] = 'AppleWebKit';
- if ($result['others']['detail'][1][1] == 'Version') {
+ if (isset($result['others']['detail'][1]) && $result['others']['detail'][1][1] == 'Version') {
$result['browser_version'] = $result['others']['detail'][1][2];
} else {
$result['browser_version'] = $result['others']['detail'][count($result['others']['detail']) - 1][2];
@@ -582,8 +586,13 @@ abstract class Zend_Http_UserAgent_AbstractDevice
$last = $result['others']['detail'][count($result['others']['detail']) - 1][1];
if (empty($result['others']['detail'][2][1]) || $result['others']['detail'][2][1] == 'Safari') {
- $result['browser_name'] = ($result['others']['detail'][1][1] && $result['others']['detail'][1][1] != 'Version' ? $result['others']['detail'][1][1] : 'Safari');
- $result['browser_version'] = ($result['others']['detail'][1][2] ? $result['others']['detail'][1][2] : $result['others']['detail'][0][2]);
+ if (isset($result['others']['detail'][1])) {
+ $result['browser_name'] = ($result['others']['detail'][1][1] && $result['others']['detail'][1][1] != 'Version' ? $result['others']['detail'][1][1] : 'Safari');
+ $result['browser_version'] = ($result['others']['detail'][1][2] ? $result['others']['detail'][1][2] : $result['others']['detail'][0][2]);
+ } else {
+ $result['browser_name'] = ($result['others']['detail'][0][1] && $result['others']['detail'][0][1] != 'Version' ? $result['others']['detail'][0][1] : 'Safari');
+ $result['browser_version'] = $result['others']['detail'][0][2];
+ }
} else {
$result['browser_name'] = $result['others']['detail'][2][1];
$result['browser_version'] = $result['others']['detail'][2][2];
diff --git a/libs/Zend/Mail/Transport/File.php b/libs/Zend/Mail/Transport/File.php
index d9e22a2ed9..276ead6deb 100644
--- a/libs/Zend/Mail/Transport/File.php
+++ b/libs/Zend/Mail/Transport/File.php
@@ -86,7 +86,7 @@ class Zend_Mail_Transport_File extends Zend_Mail_Transport_Abstract
*/
public function setOptions(array $options)
{
- if (isset($options['path'])&& is_dir($options['path'])) {
+ if (isset($options['path']) && is_dir($options['path'])) {
$this->_path = $options['path'];
}
if (isset($options['callback']) && is_callable($options['callback'])) {
diff --git a/libs/Zend/Validate/EmailAddress.php b/libs/Zend/Validate/EmailAddress.php
index 6cc567daea..48db3e5490 100644
--- a/libs/Zend/Validate/EmailAddress.php
+++ b/libs/Zend/Validate/EmailAddress.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: EmailAddress.php 24125 2011-06-07 16:13:26Z adamlundrigan $
+ * @version $Id: EmailAddress.php 24304 2011-07-30 01:12:35Z adamlundrigan $
*/
/**
@@ -527,9 +527,8 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract
$this->_setValue($value);
// Split email address up and disallow '..'
- // and disallow addresses ending with a '.'
if ((strpos($value, '..') !== false) or
- (!preg_match('/^(.+)@([^@]+[^.])$/', $value, $matches))) {
+ (!preg_match('/^(.+)@([^@]+)$/', $value, $matches))) {
$this->_error(self::INVALID_FORMAT);
return false;
}
diff --git a/libs/Zend/Validate/Hostname.php b/libs/Zend/Validate/Hostname.php
index b94e94f6d0..97779239f8 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 23972 2011-05-03 16:26:36Z ralph $
+ * @version $Id: Hostname.php 24307 2011-07-30 02:13:14Z adamlundrigan $
*/
/**
@@ -100,12 +100,12 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
/**
* Allows all types of hostnames
*/
- const ALLOW_ALL = 7;
+ const ALLOW_URI = 8;
/**
* Allows all types of hostnames
*/
- const ALLOW_URI = 8;
+ const ALLOW_ALL = 15;
/**
* Array of valid top-level-domains
@@ -495,7 +495,6 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
*/
public function isValid($value)
{
-
if (!is_string($value)) {
$this->_error(self::INVALID);
return false;
@@ -503,7 +502,6 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
$this->_setValue($value);
// Check input against IP address schema
-
if (preg_match('/^[0-9a-f:.]*$/i', $value) &&
$this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
if (!($this->_options['allow'] & self::ALLOW_IP)) {
@@ -521,16 +519,29 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
// necessary to distinguish between the complete domain name and
// some local domain.
//
- // Strip trailing '.' since it is not necessary to validate a non-IP
- // hostname.
- //
// (see ZF-6363)
- if (substr($value, -1) === '.') {
- $value = substr($value, 0, strlen($value)-1);
- }
- // Check input against DNS hostname schema
+ // Local hostnames are allowed to be partitial (ending '.')
+ if ($this->_options['allow'] & self::ALLOW_LOCAL) {
+ if (substr($value, -1) === '.') {
+ $value = substr($value, 0, -1);
+ if (substr($value, -1) === '.') {
+ // Empty hostnames (ending '..') are not allowed
+ $this->_error(self::INVALID_LOCAL_NAME);
+ return false;
+ }
+ }
+ }
+
$domainParts = explode('.', $value);
+
+ // Prevent partitial IP V4 adresses (ending '.')
+ if ((count($domainParts) == 4) && preg_match('/^[0-9.a-e:.]*$/i', $value) &&
+ $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
+ $this->_error(self::INVALID_LOCAL_NAME);
+ }
+
+ // Check input against DNS hostname schema
if ((count($domainParts) > 1) && (strlen($value) >= 4) && (strlen($value) <= 254)) {
$status = false;
@@ -651,7 +662,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
}
// 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}$/';
+ $regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}[\x2e]{0,1}){1,254}$/';
$status = @preg_match($regexLocal, $value);
// If the input passes as a local network name, and local network names are allowed, then the
diff --git a/libs/Zend/Version.php b/libs/Zend/Version.php
index a34e2c14a3..e9622d7e3c 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 24230 2011-07-13 17:44:57Z matthew $
+ * @version $Id: Version.php 24344 2011-08-02 19:49:32Z matthew $
*/
/**
@@ -32,7 +32,7 @@ final class Zend_Version
/**
* Zend Framework version identification - see compareVersion()
*/
- const VERSION = '1.11.9';
+ const VERSION = '1.11.10';
/**
* The latest stable version Zend Framework available