diff --git a/app/View/Pages/home.ctp b/app/View/Pages/home.ctp index 468aa1f5e..029ca5494 100644 --- a/app/View/Pages/home.ctp +++ b/app/View/Pages/home.ctp @@ -37,13 +37,13 @@ endif;

=')): + if (version_compare(PHP_VERSION, '5.2.8', '>=')): echo ''; - echo __d('cake_dev', 'Your version of PHP is 5.2.6 or higher.'); + echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.6 or higher to use CakePHP.'); + echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); echo ''; endif; ?> diff --git a/lib/Cake/Console/Templates/default/views/home.ctp b/lib/Cake/Console/Templates/default/views/home.ctp index 917d84ad7..54fa0fb9a 100644 --- a/lib/Cake/Console/Templates/default/views/home.ctp +++ b/lib/Cake/Console/Templates/default/views/home.ctp @@ -13,13 +13,13 @@ endif; ?>

=')): + if (version_compare(PHP_VERSION, '5.2.8', '>=')): echo ''; - echo __d('cake_dev', 'Your version of PHP is 5.2.6 or higher.'); + echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.6 or higher to use CakePHP.'); + echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); echo ''; endif; ?> diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index cd1ff94e9..8986405f0 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1543,7 +1543,7 @@ class Model extends Object implements CakeEventListener { * @param array $validate See $options param in Model::save(). Does not respect 'fieldList' key if passed * @return boolean See Model::save() * @see Model::save() - * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-read + * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-savefield-string-fieldname-string-fieldvalue-validate-false */ public function saveField($name, $value, $validate = false) { $id = $this->id; diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index bc5b821a7..69c3982c2 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -1109,6 +1109,9 @@ class CakeEmail { $restore = mb_internal_encoding(); mb_internal_encoding($this->_appCharset); } + if (strpos($text, ',') !== false) { + $text = '"' . $text . '"'; + } $return = mb_encode_mimeheader($text, $this->headerCharset, 'B'); if ($internalEncoding) { mb_internal_encoding($restore); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index ec4c370a2..6e1075b1c 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -24,62 +24,62 @@ require_once dirname(__FILE__) . DS . 'ModelTestBase.php'; */ class ModelWriteTest extends BaseModelTest { - /** - * testInsertAnotherHabtmRecordWithSameForeignKey method - * - * @access public - * @return void - */ - public function testInsertAnotherHabtmRecordWithSameForeignKey() { - $this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC'); - $TestModel = new JoinA(); +/** + * testInsertAnotherHabtmRecordWithSameForeignKey method + * + * @access public + * @return void + */ + public function testInsertAnotherHabtmRecordWithSameForeignKey() { + $this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC'); + $TestModel = new JoinA(); - $result = $TestModel->JoinAsJoinB->findById(1); - $expected = array( - 'JoinAsJoinB' => array( - 'id' => 1, - 'join_a_id' => 1, - 'join_b_id' => 2, - 'other' => 'Data for Join A 1 Join B 2', - 'created' => '2008-01-03 10:56:33', - 'updated' => '2008-01-03 10:56:33' - )); - $this->assertEquals($expected, $result); - - $TestModel->JoinAsJoinB->create(); - $data = array( + $result = $TestModel->JoinAsJoinB->findById(1); + $expected = array( + 'JoinAsJoinB' => array( + 'id' => 1, 'join_a_id' => 1, - 'join_b_id' => 1, - 'other' => 'Data for Join A 1 Join B 1', - 'created' => '2008-01-03 10:56:44', - 'updated' => '2008-01-03 10:56:44' - ); - $result = $TestModel->JoinAsJoinB->save($data); - $lastInsertId = $TestModel->JoinAsJoinB->getLastInsertID(); - $data['id'] = $lastInsertId; - $this->assertEquals($result, array('JoinAsJoinB' => $data)); - $this->assertTrue($lastInsertId != null); + 'join_b_id' => 2, + 'other' => 'Data for Join A 1 Join B 2', + 'created' => '2008-01-03 10:56:33', + 'updated' => '2008-01-03 10:56:33' + )); + $this->assertEquals($expected, $result); - $result = $TestModel->JoinAsJoinB->findById(1); - $expected = array( - 'JoinAsJoinB' => array( - 'id' => 1, - 'join_a_id' => 1, - 'join_b_id' => 2, - 'other' => 'Data for Join A 1 Join B 2', - 'created' => '2008-01-03 10:56:33', - 'updated' => '2008-01-03 10:56:33' - )); - $this->assertEquals($expected, $result); + $TestModel->JoinAsJoinB->create(); + $data = array( + 'join_a_id' => 1, + 'join_b_id' => 1, + 'other' => 'Data for Join A 1 Join B 1', + 'created' => '2008-01-03 10:56:44', + 'updated' => '2008-01-03 10:56:44' + ); + $result = $TestModel->JoinAsJoinB->save($data); + $lastInsertId = $TestModel->JoinAsJoinB->getLastInsertID(); + $data['id'] = $lastInsertId; + $this->assertEquals($result, array('JoinAsJoinB' => $data)); + $this->assertTrue($lastInsertId != null); - $updatedValue = 'UPDATED Data for Join A 1 Join B 2'; - $TestModel->JoinAsJoinB->id = 1; - $result = $TestModel->JoinAsJoinB->saveField('other', $updatedValue, false); - $this->assertFalse(empty($result)); + $result = $TestModel->JoinAsJoinB->findById(1); + $expected = array( + 'JoinAsJoinB' => array( + 'id' => 1, + 'join_a_id' => 1, + 'join_b_id' => 2, + 'other' => 'Data for Join A 1 Join B 2', + 'created' => '2008-01-03 10:56:33', + 'updated' => '2008-01-03 10:56:33' + )); + $this->assertEquals($expected, $result); - $result = $TestModel->JoinAsJoinB->findById(1); - $this->assertEquals($result['JoinAsJoinB']['other'], $updatedValue); - } + $updatedValue = 'UPDATED Data for Join A 1 Join B 2'; + $TestModel->JoinAsJoinB->id = 1; + $result = $TestModel->JoinAsJoinB->saveField('other', $updatedValue, false); + $this->assertFalse(empty($result)); + + $result = $TestModel->JoinAsJoinB->findById(1); + $this->assertEquals($result['JoinAsJoinB']['other'], $updatedValue); + } /** * testSaveDateAsFirstEntry method @@ -611,12 +611,26 @@ class ModelWriteTest extends BaseModelTest { $this->assertEquals($expected, $result); $TestModel->recursive = -1; - $result = $TestModel->read(array('id', 'user_id', 'title', 'body'), 1); + $TestModel->read(array('id', 'user_id', 'title', 'body'), 1); $TestModel->id = 1; $result = $TestModel->saveField('title', '', true); $this->assertFalse($result); + + $TestModel->recursive = -1; + $TestModel->id = 1; + $result = $TestModel->saveField('user_id', 9999); + $this->assertTrue((bool)$result); + + $result = $TestModel->read(array('id', 'user_id'), 1); + $expected = array('Article' => array( + 'id' => '1', + 'user_id' => '9999', + )); + $this->assertEquals($expected, $result); + + $this->loadFixtures('Node', 'Dependency'); $Node = new Node(); $Node->set('id', 1); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index a3350efc2..a962bab1c 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -277,6 +277,14 @@ class CakeEmailTest extends CakeTestCase { $expected = array('CakePHP ', 'Cake '); $this->assertSame($expected, $result); + $result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last, First')); + $expected = array('"Last, First" '); + $this->assertSame($expected, $result); + + $result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last First')); + $expected = array('Last First '); + $this->assertSame($expected, $result); + $result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => 'ÄÖÜTest')); $expected = array('=?UTF-8?B?w4TDlsOcVGVzdA==?= '); $this->assertSame($expected, $result); diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 626e7cb32..83d4a1d89 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -489,7 +489,7 @@ class HtmlHelper extends AppHelper { * * Add the script file to the `$scripts_for_layout` layout var: * - * `$this->Html->script('styles.js', null, array('inline' => false));` + * `$this->Html->script('styles.js', array('inline' => false));` * * Add the script file to a custom block: * diff --git a/lib/Cake/View/ThemeView.php b/lib/Cake/View/ThemeView.php index 3b36aa078..db9a0a117 100644 --- a/lib/Cake/View/ThemeView.php +++ b/lib/Cake/View/ThemeView.php @@ -27,5 +27,5 @@ App::uses('View', 'View'); * @package Cake.View */ class ThemeView extends View { - + }