cvs: php4 /pear/Mail RFC822.php
| From: | Richard Heyes | Date: | Sun, 02 Sep 2001 18:31:09 +0000 |
| Subject: | cvs: php4 /pear/Mail RFC822.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-755@lists.php.net to get a copy of this message | ||
heyesr Sun Sep 2 14:31:09 2001 EDT
Modified files:
/php4/pear/Mail RFC822.php
Log:
Modified php4/pear/Mail/RFC822.php to use PEAR error handling. Now returns
a pear error object instead of an array.
Index: php4/pear/Mail/RFC822.php
diff -u php4/pear/Mail/RFC822.php:1.9 php4/pear/Mail/RFC822.php:1.10
--- php4/pear/Mail/RFC822.php:1.9 Wed Aug 8 20:53:56 2001
+++ php4/pear/Mail/RFC822.php Sun Sep 2 14:31:09 2001
@@ -17,15 +17,17 @@
// | Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
+require_once ('PEAR.php');
+
/**
- * RFC 822 Email address list validation Utility
- *
- * @author Richard Heyes <richard.heyes@heyes-computing.net>
- * @author Chuck Hagenbuch <chuck@horde.org>
- * @version $Revision: 1.9 $
- * @package Mail
- */
-class Mail_RFC822 {
+* RFC 822 Email address list validation Utility
+*
+* @author Richard Heyes <richard.heyes@heyes-computing.net>
+* @author Chuck Hagenbuch <chuck@horde.org>
+* @version $Revision: 1.10 $
+* @package Mail
+*/
+class Mail_RFC822 extends PEAR{
/**
* The address being parsed by the RFC822 object.
@@ -141,13 +143,13 @@
$this->index = null;
if (!$this->splitAddresses($this->address) || isset($this->error)) {
- return (array)$this->error;
+ return $this->raiseError($this->error);
}
for ($i = 0; $i < count($this->addresses); $i++){
if (($return = $this->validateAddress($this->addresses[$i])) === false
|| isset($this->error)) {
- return (array)$this->error;
+ return $this->raiseError($this->error);
}
if (!$this->nestGroups) {
@@ -407,7 +409,7 @@
// Groupname:;
// Then errors were appearing.
if (!isset($addresses)){
- $this->error[] = 'Empty group.';
+ $this->error = 'Empty group.';
return false;
}
@@ -807,4 +809,4 @@
}
}
-?>
+?>
\ No newline at end of file