cvs: pear /HTTP_Download Download.php
| From: | Michael Wallner | Date: | Tue, 19 Jul 2005 10:15:49 +0000 |
| Subject: | cvs: pear /HTTP_Download Download.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33147@lists.php.net to get a copy of this message | ||
mike Tue Jul 19 06:15:49 2005 EDT
Modified files:
/pear/HTTP_Download Download.php
Log:
- use abs() for max age and buffer size
http://cvs.php.net/diff.php/pear/HTTP_Download/Download.php?r1=1.73&r2=1.74&ty=u
Index: pear/HTTP_Download/Download.php
diff -u pear/HTTP_Download/Download.php:1.73 pear/HTTP_Download/Download.php:1.74
--- pear/HTTP_Download/Download.php:1.73 Tue Jul 19 06:04:47 2005
+++ pear/HTTP_Download/Download.php Tue Jul 19 06:15:48 2005
@@ -17,7 +17,7 @@
* @author Michael Wallner <mike@php.net>
* @copyright 2003-2005 Michael Wallner
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Download.php,v 1.73 2005/07/19 10:04:47 mike Exp $
+ * @version CVS: $Id: Download.php,v 1.74 2005/07/19 10:15:48 mike Exp $
* @link http://pear.php.net/package/HTTP_Download
*/
@@ -92,7 +92,7 @@
* if you want to send already gzipped data!
*
* @access public
- * @version $Revision: 1.73 $
+ * @version $Revision: 1.74 $
*/
class HTTP_Download
{
@@ -420,7 +420,7 @@
case 'private':
case 'public':
$this->headers['Cache-Control'] =
- $cache .', must-revalidate, max-age='. $maxage;
+ $cache .', must-revalidate, max-age='. abs($maxage);
return true;
break;
}
@@ -460,12 +460,12 @@
*/
function setBufferSize($bytes = 2097152)
{
- if (0 >= (int) $bytes) {
+ if (0 >= $bytes) {
return PEAR::raiseError(
'Buffer size must be greater than 0 bytes ('. $bytes .'
given)',
HTTP_DOWNLOAD_E_INVALID_PARAM);
}
- $this->bufferSize = (int) $bytes;
+ $this->bufferSize = abs($bytes);
return true;
}