import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -1,4 +1,5 @@
<?php
/**
* Zend Framework
*
@ -16,12 +17,13 @@
* @package Zend_Http
* @subpackage Cookie
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com/)
* @version $Id: Cookie.php 9098 2008-03-30 19:29:10Z thomas $
* @version $Id: Cookie.php 14530 2009-03-29 14:17:14Z shahar $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
require_once 'Zend/Uri/Http.php';
/**
* Zend_Http_Cookie is a class describing an HTTP cookie and all it's parameters.
*
@ -34,8 +36,8 @@ require_once 'Zend/Uri/Http.php';
*
* See http://wp.netscape.com/newsref/std/cookie_spec.html for some specs.
*
* @category Zend
* @package Zend_Http
* @category Zend
* @package Zend_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com/)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -90,8 +92,8 @@ class Zend_Http_Cookie
*
* @param string $name
* @param string $value
* @param int $expires
* @param string $domain
* @param int $expires
* @param string $path
* @param bool $secure
*/
@ -222,7 +224,7 @@ class Zend_Http_Cookie
// Make sure we have a valid Zend_Uri_Http object
if (! ($uri->valid() && ($uri->getScheme() == 'http' || $uri->getScheme() =='https'))) {
require_once 'Zend/Http/Exception.php';
require_once 'Zend/Http/Exception.php';
throw new Zend_Http_Exception('Passed URI is not a valid HTTP or HTTPS URI');
}
@ -304,14 +306,29 @@ class Zend_Http_Cookie
list($k, $v) = $keyValue;
switch (strtolower($k)) {
case 'expires':
$expires = strtotime($v);
if(($expires = strtotime($v)) === false) {
/**
* The expiration is past Tue, 19 Jan 2038 03:14:07 UTC
* the maximum for 32-bit signed integer. Zend_Date
* can get around that limit.
*
* @see Zend_Date
*/
require_once 'Zend/Date.php';
$expireDate = new Zend_Date($v);
$expires = $expireDate->getTimestamp();
}
break;
case 'path':
$path = $v;
break;
case 'domain':
$domain = $v;
break;
default:
break;
}
@ -319,7 +336,7 @@ class Zend_Http_Cookie
}
if ($name !== '') {
return new Zend_Http_Cookie($name, $value, $domain, $expires, $path, $secure);
return new self($name, $value, $domain, $expires, $path, $secure);
} else {
return false;
}