mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '2.0' into 2.1
Conflicts: lib/Cake/View/ThemeView.php
This commit is contained in:
commit
7eda0affe3
8 changed files with 86 additions and 61 deletions
|
@ -37,13 +37,13 @@ endif;
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if (version_compare(PHP_VERSION, '5.2.6', '>=')):
|
if (version_compare(PHP_VERSION, '5.2.8', '>=')):
|
||||||
echo '<span class="notice success">';
|
echo '<span class="notice success">';
|
||||||
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 '</span>';
|
echo '</span>';
|
||||||
else:
|
else:
|
||||||
echo '<span class="notice">';
|
echo '<span class="notice">';
|
||||||
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 '</span>';
|
echo '</span>';
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -13,13 +13,13 @@ endif;
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if (version_compare(PHP_VERSION, '5.2.6', '>=')):
|
if (version_compare(PHP_VERSION, '5.2.8', '>=')):
|
||||||
echo '<span class=\"notice success\">';
|
echo '<span class=\"notice success\">';
|
||||||
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 '</span>';
|
echo '</span>';
|
||||||
else:
|
else:
|
||||||
echo '<span class=\"notice\">';
|
echo '<span class=\"notice\">';
|
||||||
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 '</span>';
|
echo '</span>';
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -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
|
* @param array $validate See $options param in Model::save(). Does not respect 'fieldList' key if passed
|
||||||
* @return boolean See Model::save()
|
* @return boolean See Model::save()
|
||||||
* @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) {
|
public function saveField($name, $value, $validate = false) {
|
||||||
$id = $this->id;
|
$id = $this->id;
|
||||||
|
|
|
@ -1109,6 +1109,9 @@ class CakeEmail {
|
||||||
$restore = mb_internal_encoding();
|
$restore = mb_internal_encoding();
|
||||||
mb_internal_encoding($this->_appCharset);
|
mb_internal_encoding($this->_appCharset);
|
||||||
}
|
}
|
||||||
|
if (strpos($text, ',') !== false) {
|
||||||
|
$text = '"' . $text . '"';
|
||||||
|
}
|
||||||
$return = mb_encode_mimeheader($text, $this->headerCharset, 'B');
|
$return = mb_encode_mimeheader($text, $this->headerCharset, 'B');
|
||||||
if ($internalEncoding) {
|
if ($internalEncoding) {
|
||||||
mb_internal_encoding($restore);
|
mb_internal_encoding($restore);
|
||||||
|
|
|
@ -611,12 +611,26 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$TestModel->recursive = -1;
|
$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;
|
$TestModel->id = 1;
|
||||||
$result = $TestModel->saveField('title', '', true);
|
$result = $TestModel->saveField('title', '', true);
|
||||||
$this->assertFalse($result);
|
$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');
|
$this->loadFixtures('Node', 'Dependency');
|
||||||
$Node = new Node();
|
$Node = new Node();
|
||||||
$Node->set('id', 1);
|
$Node->set('id', 1);
|
||||||
|
|
|
@ -277,6 +277,14 @@ class CakeEmailTest extends CakeTestCase {
|
||||||
$expected = array('CakePHP <cake@cakephp.org>', 'Cake <php@cakephp.org>');
|
$expected = array('CakePHP <cake@cakephp.org>', 'Cake <php@cakephp.org>');
|
||||||
$this->assertSame($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
|
$result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last, First'));
|
||||||
|
$expected = array('"Last, First" <me@example.com>');
|
||||||
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
|
$result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last First'));
|
||||||
|
$expected = array('Last First <me@example.com>');
|
||||||
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => 'ÄÖÜTest'));
|
$result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => 'ÄÖÜTest'));
|
||||||
$expected = array('=?UTF-8?B?w4TDlsOcVGVzdA==?= <cake@cakephp.org>');
|
$expected = array('=?UTF-8?B?w4TDlsOcVGVzdA==?= <cake@cakephp.org>');
|
||||||
$this->assertSame($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
|
@ -489,7 +489,7 @@ class HtmlHelper extends AppHelper {
|
||||||
*
|
*
|
||||||
* Add the script file to the `$scripts_for_layout` layout var:
|
* 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:
|
* Add the script file to a custom block:
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue