cvs: pear /HTTP_Download Download.php
| From: | Michael Wallner | Date: | Tue, 31 Aug 2004 11:40:51 +0000 |
| Subject: | cvs: pear /HTTP_Download Download.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-23532@lists.php.net to get a copy of this message | ||
mike Tue Aug 31 07:40:51 2004 EDT
Modified files:
/pear/HTTP_Download Download.php
Log:
* added the possibility to send http responses without the "Content-Disposition" header
http://cvs.php.net/diff.php/pear/HTTP_Download/Download.php?r1=1.44&r2=1.45&ty=u
Index: pear/HTTP_Download/Download.php
diff -u pear/HTTP_Download/Download.php:1.44 pear/HTTP_Download/Download.php:1.45
--- pear/HTTP_Download/Download.php:1.44 Tue Aug 31 07:35:24 2004
+++ pear/HTTP_Download/Download.php Tue Aug 31 07:40:51 2004
@@ -11,7 +11,7 @@
// | Copyright (c) 2003-2004 Michael Wallner <mike@iworks.at> |
// +----------------------------------------------------------------------+
//
-// $Id: Download.php,v 1.44 2004/08/31 11:35:24 mike Exp $
+// $Id: Download.php,v 1.45 2004/08/31 11:40:51 mike Exp $
/**
* Manage HTTP Downloads.
@@ -93,7 +93,7 @@
* if you want to send already gzipped data!
*
* @access public
- * @version $Revision: 1.44 $
+ * @version $Revision: 1.45 $
*/
class HTTP_Download
{
@@ -589,8 +589,10 @@
*
* @access public
* @return mixed Returns true on success or PEAR_Error on failure.
+ * @param bool $autoSetContentDisposition Whether to set the
+ * Content-Disposition header if it isn't already.
*/
- function send()
+ function send($autoSetContentDisposition = true)
{
if (headers_sent()) {
return PEAR::raiseError(
@@ -601,7 +603,8 @@
set_time_limit(0);
- if (!isset($this->headers['Content-Disposition'])) {
+ if ($autoSetContentDisposition &&
+ !isset($this->headers['Content-Disposition'])) {
$this->setContentDisposition();
}