Browse Source

Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

Jose Lorenzo Rodriguez 14 years ago
parent
commit
5a181d8705

+ 1 - 1
app/Config/email.php.default

@@ -48,7 +48,7 @@ class EmailConfig {
 
 	public $smtp = array(
 		'transport' => 'Smtp',
-		'from' => array('My Site', 'site@localhost'),
+		'from' => array('site@localhost' => 'My Site'),
 		'host' => 'localhost',
 		'port' => 25,
 		'timeout' => 30,

+ 1 - 1
lib/Cake/Console/Templates/skel/Config/email.php.default

@@ -48,7 +48,7 @@ class EmailConfig {
 
 	public $smtp = array(
 		'transport' => 'Smtp',
-		'from' => array('My Site', 'site@localhost'),
+		'from' => array('site@localhost' => 'My Site'),
 		'host' => 'localhost',
 		'port' => 25,
 		'timeout' => 30,

+ 1 - 1
lib/Cake/I18n/I18n.php

@@ -354,7 +354,7 @@ class I18n {
 /**
  * Loads the binary .mo file for translation and sets the values for this translation in the var I18n::_domains
  *
- * @param resource $file Binary .mo file to load
+ * @param string $file Binary .mo file to load
  * @param string $domain Domain where to load file in
  * @return void
  */

+ 1 - 1
lib/Cake/Model/Datasource/DboSource.php

@@ -2443,7 +2443,7 @@ class DboSource extends DataSource {
 				break;
 			}
 			$value = "({$value})";
-		} elseif ($null) {
+		} elseif ($null || $value === 'NULL') {
 			switch ($operator) {
 				case '=':
 					$operator = 'IS';

+ 1 - 2
lib/Cake/Network/Email/MailTransport.php

@@ -44,8 +44,7 @@ class MailTransport extends AbstractTransport {
 			if (!@mail($to, $email->subject(), $message, $headers)) {
 				throw new SocketException(__d('cake', 'Could not send email.'));
 			}
-		}
-		if(!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
+		} elseif (!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
 			throw new SocketException(__d('cake', 'Could not send email.'));
 		}
 		return array('headers' => $headers, 'message' => $message);

+ 6 - 1
lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php

@@ -2219,10 +2219,15 @@ class MysqlTest extends CakeTestCase {
 		$expected = " WHERE `Book`.`id` = 0";
 		$this->assertEqual($expected, $result);
 
-		$result = $this->Dbo->conditions(array("Book.id" => NULL));
+		$result = $this->Dbo->conditions(array("Book.id" => null));
 		$expected = " WHERE `Book`.`id` IS NULL";
 		$this->assertEqual($expected, $result);
 
+		$conditions = array('MysqlModel.id' => '');
+		$result = $this->Dbo->conditions($conditions, true, true, $this->model);
+		$expected = " WHERE `MysqlModel`.`id` IS NULL";
+		$this->assertEqual($result, $expected);
+
 		$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
 		$expected = " WHERE `Listing`.`beds` >= 0";
 		$this->assertEqual($expected, $result);