diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b05c2754..1697844de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,6 +68,6 @@ for the sniff and phpcs. * [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html) * [Bug tracker](https://cakephp.lighthouseapp.com/projects/42648-cakephp) -* [General GitHub documentation](http://help.github.com/) -* [GitHub pull request documentation](http://help.github.com/send-pull-requests/) +* [General GitHub documentation](https://help.github.com/) +* [GitHub pull request documentation](https://help.github.com/send-pull-requests/) * #cakephp IRC channel on freenode.org diff --git a/README.md b/README.md index 413ef4f8d..703508eb4 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ Some Handy Links Get Support! ------------ -[Our Google Group](http://groups.google.com/group/cake-php) - community mailing list and forum +[Our Google Group](https://groups.google.com/group/cake-php) - community mailing list and forum [#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake. [Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome -[Lighthouse](http://cakephp.lighthouseapp.com/) - Got issues? Please tell us! +[Lighthouse](https://cakephp.lighthouseapp.com/) - Got issues? Please tell us! [![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=2.4)](http://travis-ci.org/cakephp/cakephp) diff --git a/app/View/Pages/home.ctp b/app/View/Pages/home.ctp index 2e1cb69b1..4aa772bcd 100644 --- a/app/View/Pages/home.ctp +++ b/app/View/Pages/home.ctp @@ -216,12 +216,12 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
  • -
  • +
  • irc.freenode.net #cakephp
  • -
  • +
  • -
  • +
  • diff --git a/build.xml b/build.xml index e98fb5324..01d6e25e6 100644 --- a/build.xml +++ b/build.xml @@ -133,7 +133,7 @@ MIT License - http://github.com/cakephp/cakephp/blob/master/README + https://github.com/cakephp/cakephp/blob/master/README @@ -164,6 +164,17 @@ + + + + + + + + + @@ -182,7 +193,7 @@ - + diff --git a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp index ae3f8fdc3..e6990b3a3 100644 --- a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp +++ b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp @@ -208,12 +208,12 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
  • -
  • +
  • irc.freenode.net #cakephp
  • -
  • +
  • -
  • +
  • diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 78a975fb9..bae565565 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -707,8 +707,8 @@ class AuthComponent extends Component { * If no parameter is passed, gets the authentication redirect URL. The URL * returned is as per following rules: * - * - Returns the session Auth.redirect value if it is present and for the same - * domain the current app is running on. + * - Returns the normalized URL from session Auth.redirect value if it is + * present and for the same domain the current app is running on. * - If there is no session value and there is a $loginRedirect, the $loginRedirect * value is returned. * - If there is no session and no $loginRedirect, / is returned. @@ -722,6 +722,7 @@ class AuthComponent extends Component { $this->Session->write('Auth.redirect', $redir); } elseif ($this->Session->check('Auth.redirect')) { $redir = $this->Session->read('Auth.redirect'); + $redir = is_string($redir) ? ltrim($redir, '/') : $redir; $this->Session->delete('Auth.redirect'); if (Router::normalize($redir) == Router::normalize($this->loginAction)) { diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index d1a8bfa95..9d091599e 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -21,6 +21,9 @@ /** * DataSource base class * + * DataSources are the link between models and the source of data that models represent. + * + * @link http://book.cakephp.org/2.0/en/models/datasources.html#basic-api-for-datasources * @package Cake.Model.Datasource */ class DataSource extends Object { diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 14cb037c9..7bc3a048b 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -280,7 +280,7 @@ class DboSource extends DataSource { /** * Disconnects from database. * - * @return boolean True if the database could be disconnected, else false + * @return boolean Always true */ public function disconnect() { if ($this->_result instanceof PDOStatement) { diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 7ed94c746..201262254 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -1288,6 +1288,23 @@ class AuthComponentTest extends CakeTestCase { $this->assertFalse($this->Auth->Session->check('Auth.redirect')); } +/** + * test redirectUrl with duplicate base. + * + * @return void + */ + public function testRedirectSessionReadDuplicateBase() { + $this->Auth->request->webroot = '/waves/'; + $this->Auth->request->base = '/waves'; + + Router::setRequestInfo($this->Auth->request); + + $this->Auth->Session->write('Auth.redirect', '/waves/add'); + + $result = $this->Auth->redirectUrl(); + $this->assertEquals('/waves/add', $result); + } + /** * test that redirect does not return loginAction if that is what's stored in Auth.redirect. * instead loginRedirect should be used. diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 769effe05..10144ef31 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -822,7 +822,7 @@ class RequestHandlerComponentTest extends CakeTestCase { * array URLs into their correct string ones, and adds base => false so * the correct URLs are generated. * - * @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 + * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 * @return void */ public function testBeforeRedirectCallbackWithArrayUrl() { diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index 26ebd7f07..05f60fc40 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -1092,7 +1092,7 @@ class SecurityComponentTest extends CakeTestCase { * the params. * * @return void - * @see http://cakephp.lighthouseapp.com/projects/42648/tickets/68 + * @see https://cakephp.lighthouseapp.com/projects/42648/tickets/68 */ public function testSettingTokenForRequestAction() { $this->Controller->Security->startup($this->Controller); @@ -1109,7 +1109,7 @@ class SecurityComponentTest extends CakeTestCase { * test that blackhole doesn't delete the _Token session key so repeat data submissions * stay blackholed. * - * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/214 + * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/214 * @return void */ public function testBlackHoleNotDeletingSessionInformation() { diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index f9d14ac1a..30c1b7901 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -597,7 +597,7 @@ class AppTest extends CakeTestCase { * test that building helper paths actually works. * * @return void - * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/410 + * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/410 */ public function testImportingHelpersFromAlternatePaths() { $this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.'); diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 3320c1765..bedc1d258 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -569,7 +569,7 @@ class DboSourceTest extends CakeTestCase { } /** - * testReconnect method + * Tests if the connection can be re-established and that the new (optional) config is set. * * @return void */ diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 59d0a4c41..c35b1a893 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -4824,7 +4824,7 @@ class ModelWriteTest extends BaseModelTest { /** * test that saveAll behaves like plain save() when supplied empty data * - * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data + * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data * @return void */ public function testSaveAllEmptyData() { @@ -6212,7 +6212,7 @@ class ModelWriteTest extends BaseModelTest { /** * test that saveMany behaves like plain save() when suplied empty data * - * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data + * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data * @return void */ public function testSaveManyEmptyData() { @@ -6231,7 +6231,7 @@ class ModelWriteTest extends BaseModelTest { /** * test that saveAssociated behaves like plain save() when supplied empty data * - * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data + * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data * @return void */ public function testSaveAssociatedEmptyData() { diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 1e9f7c71a..07804d824 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -700,6 +700,25 @@ class CakeRequestTest extends CakeTestCase { $this->assertSame($result, 'cakephp.org'); } +/** + * Test referer() with a base path that duplicates the + * first segment. + * + * @return void + */ + public function testRefererBasePath() { + $request = new CakeRequest('some/path'); + $request->url = 'users/login'; + $request->webroot = '/waves/'; + $request->base = '/waves'; + $request->here = '/waves/users/login'; + + $_SERVER['HTTP_REFERER'] = FULL_BASE_URL . '/waves/waves/add'; + + $result = $request->referer(true); + $this->assertSame($result, '/waves/add'); + } + /** * test the simple uses of is() * diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index fa0163d6d..0c99842e5 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -536,7 +536,7 @@ class ControllerTestCaseTest extends CakeTestCase { * will always have a fresh reference to those object available * * @return void - * @see http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2705-requesthandler-weird-behavior + * @see https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2705-requesthandler-weird-behavior */ public function testComponentsSameRequestAndResponse() { $this->Case->generate('TestsApps'); diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 856518363..7d22d235c 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -6674,6 +6674,70 @@ class FormHelperTest extends CakeTestCase { $this->assertEquals($result, $expected); } +/** + * testInputDate method + * + * Test various inputs with type date and different dateFormat values. + * Failing to provide a dateFormat key should not error. + * It should simply not pre-select any value then. + * + * @return void + */ + public function testInputDate() { + $this->Form->request->data = array( + 'User' => array( + 'month_year' => array('month' => date('m')), + 'just_year' => array('month' => date('m')), + 'just_month' => array('year' => date('Y')), + 'just_day' => array('month' => date('m')), + ) + ); + $this->Form->create('User'); + $result = $this->Form->input('month_year', + array( + 'label' => false, + 'div' => false, + 'type' => 'date', + 'dateFormat' => 'MY', + 'minYear' => 2006, + 'maxYear' => 2008 + ) + ); + $this->assertContains('value="' . date('m') . '" selected="selected"', $result); + $this->assertNotContains('value="2008" selected="selected"', $result); + + $result = $this->Form->input('just_year', + array( + 'type' => 'date', + 'label' => false, + 'dateFormat' => 'Y', + 'minYear' => date('Y'), + 'maxYear' => date('Y', strtotime('+20 years')) + ) + ); + $this->assertNotContains('value="' . date('Y') . '" selected="selected"', $result); + + $result = $this->Form->input('just_month', + array( + 'type' => 'date', + 'label' => false, + 'dateFormat' => 'M', + 'empty' => false, + ) + ); + $this->assertNotContains('value="' . date('m') . '" selected="selected"', $result); + + $result = $this->Form->input('just_day', + array( + 'type' => 'date', + 'label' => false, + 'dateFormat' => 'D', + 'empty' => false, + ) + ); + $this->assertNotContains('value="' . date('d') . '" selected="selected"', $result); + } + /** * testInputDateMaxYear method * diff --git a/lib/Cake/Test/test_app/View/Pages/home.ctp b/lib/Cake/Test/test_app/View/Pages/home.ctp index 5326a29d1..6090d03ec 100644 --- a/lib/Cake/Test/test_app/View/Pages/home.ctp +++ b/lib/Cake/Test/test_app/View/Pages/home.ctp @@ -134,9 +134,9 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
  • irc.freenode.net #cakephp
  • -
  • +
  • -
  • +
  • diff --git a/lib/Cake/TestSuite/templates/phpunit.php b/lib/Cake/TestSuite/templates/phpunit.php index 30db0cb93..cb3796c03 100644 --- a/lib/Cake/TestSuite/templates/phpunit.php +++ b/lib/Cake/TestSuite/templates/phpunit.php @@ -31,7 +31,7 @@

    Once PHPUnit is installed make sure its located on PHP's include_path by checking your php.ini

    For full instructions on how to install PHPUnit, see the PHPUnit installation guide.

    -

    Download PHPUnit

    +

    Download PHPUnit

    true, 'value' => null); if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) { if (is_array($value)) { + $year = null; extract($value); $attributes['value'] = $year; } else { @@ -2313,6 +2314,7 @@ class FormHelper extends AppHelper { $attributes += array('empty' => true, 'value' => null); if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) { if (is_array($value)) { + $meridian = null; extract($value); $attributes['value'] = $meridian; } else { diff --git a/lib/Cake/View/ScaffoldView.php b/lib/Cake/View/ScaffoldView.php index 247cf6d13..bfaa87fec 100644 --- a/lib/Cake/View/ScaffoldView.php +++ b/lib/Cake/View/ScaffoldView.php @@ -20,14 +20,14 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -App::uses('ThemeView', 'View'); +App::uses('View', 'View'); /** * ScaffoldView provides specific view file loading features for scaffolded views. * * @package Cake.View */ -class ScaffoldView extends ThemeView { +class ScaffoldView extends View { /** * Override _getViewFileName Appends special scaffolding views in. diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp index 2c68928eb..74b9726f0 100644 --- a/lib/Cake/View/Scaffolds/view.ctp +++ b/lib/Cake/View/Scaffolds/view.ctp @@ -56,7 +56,7 @@ foreach ($scaffoldFields as $_field) { echo " \n"; echo "\t\t
  • "; - echo $this->Form->postLink(__d('cake', 'Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __d('cake', 'Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'); + echo $this->Form->postLink(__d('cake', 'Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __d('cake', 'Are you sure you want to delete # %s?', ${$singularVar}[$modelClass][$primaryKey])); echo "
  • \n"; echo "\t\t
  • ";