cvs: php4 /pear/PEAR Common.php
| From: | Tomas V.V.Cox | Date: | Wed, 15 May 2002 11:23:01 +0000 |
| Subject: | cvs: php4 /pear/PEAR Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3831@lists.php.net to get a copy of this message | ||
cox Wed May 15 07:23:01 2002 EDT
Modified files:
/php4/pear/PEAR Common.php
Log:
make downloadHttp() detect HTTP errors
Index: php4/pear/PEAR/Common.php
diff -u php4/pear/PEAR/Common.php:1.57 php4/pear/PEAR/Common.php:1.58
--- php4/pear/PEAR/Common.php:1.57 Mon Apr 29 02:23:05 2002
+++ php4/pear/PEAR/Common.php Wed May 15 07:23:01 2002
@@ -17,7 +17,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.57 2002/04/29 06:23:05 ssb Exp $
+// $Id: Common.php,v 1.58 2002/05/15 11:23:01 cox Exp $
require_once 'PEAR.php';
require_once 'Archive/Tar.php';
@@ -1395,6 +1395,10 @@
while (trim($line = fgets($fp, 1024))) {
if (preg_match('/^([^:]+):\s+(.*)\s*$/', $line, $matches)) {
$headers[strtolower($matches[1])] = trim($matches[2]);
+ } elseif (preg_match('|^HTTP/1.[01] ([0-9]{3}) |', $line, $matches)) {
+ if ($matches[1] != 200) {
+ return PEAR::raiseError("File http://$host:$port$path not valid (received: $line)");
+ }
}
}
if (isset($headers['content-disposition']) &&