Skip to content
This repository
Browse code

Enhanced the error checking in fSMTP::write() and fMailbox::write()

  • Loading branch information...
commit a868b440931836221855b9512d61340c5bfc827c 1 parent 7987bd5
Will Bond authored
6  classes/fMailbox.php
@@ -12,7 +12,8 @@
12 12
  * @package    Flourish
13 13
  * @link       http://flourishlib.com/fMailbox
14 14
  * 
15  
- * @version    1.0.0b11
  15
+ * @version    1.0.0b12
  16
+ * @changes    1.0.0b12  Enhanced the error checking in ::write() [wb, 2011-06-03]
16 17
  * @changes    1.0.0b11  Added code to work around PHP bug #42682 (http://bugs.php.net/bug.php?id=42682) where `stream_select()` doesn't work on 64bit machines from PHP 5.2.0 to 5.2.5, improved connectivity error handling and timeouts while reading data [wb, 2011-01-10]
17 18
  * @changes    1.0.0b10  Fixed ::parseMessage() to properly handle a header format edge case and properly set the `text` and `html` keys even when the email has an explicit `Content-disposition: inline` header [wb, 2010-11-25]
18 19
  * @changes    1.0.0b9   Fixed a bug in ::parseMessage() that could cause HTML alternate content to be included in the `inline` content array instead of the `html` element [wb, 2010-09-20]
@@ -1426,7 +1427,8 @@ private function write($command, $expected=NULL)
1426 1427
 		}
1427 1428
 		
1428 1429
 		$res = fwrite($this->connection, $command);
1429  
-		if ($res === FALSE) {
  1430
+
  1431
+		if ($res === FALSE || $res === 0) {
1430 1432
 			throw new fConnectivityException(
1431 1433
 				'Unable to write data to %1$s server %2$s on port %3$s',
1432 1434
 				strtoupper($this->type),
7  classes/fSMTP.php
@@ -9,7 +9,8 @@
9 9
  * @package    Flourish
10 10
  * @link       http://flourishlib.com/fSMTP
11 11
  * 
12  
- * @version    1.0.0b10
  12
+ * @version    1.0.0b11
  13
+ * @changes    1.0.0b11  Enhanced the error checking for ::write() [wb, 2011-06-03]
13 14
  * @changes    1.0.0b10  Added code to work around PHP bug #42682 (http://bugs.php.net/bug.php?id=42682) where `stream_select()` doesn't work on 64bit machines from PHP 5.2.0 to 5.2.5, improved timeouts while reading data [wb, 2011-01-10]
14 15
  * @changes    1.0.0b9   Fixed a bug where lines starting with `.` and containing other content would have the `.` stripped [wb, 2010-09-11]
15 16
  * @changes    1.0.0b8   Updated the class to use fEmail::getFQDN() [wb, 2010-09-07]
@@ -592,8 +593,10 @@ private function write($data, $expect)
592 593
 		if (fCore::getDebug($this->debug)) {
593 594
 			fCore::debug("Sending:\n" . trim($data), $this->debug);
594 595
 		}
  596
+		
595 597
 		$res = fwrite($this->connection, $data);
596  
-		if ($res === FALSE) {
  598
+		
  599
+		if ($res === FALSE || $res === 0) {
597 600
 			throw new fConnectivityException('Unable to write data to SMTP server %1$s on port %2$s', $this->host, $this->port);	
598 601
 		}
599 602
 		$response = $this->read($expect);

0 notes on commit a868b44

Please sign in to comment.
Something went wrong with that request. Please try again.