Commit graph

3225 commits

Author SHA1 Message Date
David Steinsland
6e777a54a3 Mocking _sendHeader instead of send() 2014-07-22 15:05:06 +02:00
David Steinsland
d98abc58d1 Added test case for CakeResponse::send() and ajaxLogin 2014-07-22 14:45:18 +02:00
Denys Kyselov
79dc624062 Add removeSubcommand in ConsoleOptionParser 2014-07-21 23:55:42 -04:00
mark_story
0d14bf7cc8 Update doc blocks.
There were a few trailing comments in #3706 that have now been
addressed.
2014-07-20 22:00:07 -04:00
Mark Story
7ef7ce2dbb Merge pull request #3706 from MelvinRoss/httpsocketheader
Add support for specifying protocol in Cakesocket/HttpSocket.  Add HEAD function to HttpSocket
2014-07-20 21:58:37 -04:00
mark_story
0dfce1abf3 Add . to the list of allowed characters.
This was missed when the email validation rules were relaxed in
dc34d80f6f.

Fixes #4027
2014-07-19 19:57:33 -04:00
Mark Story
dbe7329e54 Merge pull request #3703 from MMS-Projects/i18n-context-2.6
Basic support for I18n contexts as requested by #2063
2014-07-18 21:48:19 -04:00
ndm2
f03bf8067c Add some more exception message checks 2014-07-18 14:56:10 +02:00
ndm2
bf7d01ac66 Make SMTP auth reply code checks work properly. 2014-07-18 14:53:22 +02:00
Mark Story
d62d6061b2 Merge pull request #3906 from ravage84/hash-nest-exception
Hash::nest() should throw an exception instead of returning an empty arr...
2014-07-17 09:27:38 -04:00
Marlin Cremers
b47f91c47c Add context support to the I18n class which resolves cakephp/cakephp#2063
This change adds Gettext context support to the I18n class. This
allows custom translations for verbs and nouns and more.
2014-07-17 11:01:11 +02:00
mark_story
051d78c1a5 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/Model/Model.php
2014-07-16 23:11:58 -04:00
Melvin Ross
09a7020119 Fix spacing to conform to coding standards 2014-07-14 14:54:26 -05:00
Melvin Ross
0eaf650d9f Test for new HEAD function inside HttpSocket 2014-07-14 14:34:27 -05:00
chinpei215
ca93bbcd15 Fix CS 2014-07-14 01:21:09 +09:00
chinpei215
ace30fdd8a Fix a race condition problem
Prevents Model::save() from generating a query with WHERE 1 = 1 on race condition.

Refs #3857
2014-07-12 23:27:39 +09:00
mark_story
03c2a8b722 Unify datetime column default values between MySQL and Postgres.
Datetime columns should have 'default' => null, in both Postgres and
MySQL.

Fixes #3837
2014-07-11 23:10:16 -04:00
mark_story
9fd1a51a52 Merge branch 'master' into 2.6 2014-07-10 14:39:32 -04:00
mark_story
a098d96c94 Remove flaky test that was of questionable value. 2014-07-10 14:39:20 -04:00
euromark
ac0053d660 Added a shorthand stackTrace() method 2014-07-10 01:49:28 +02:00
mark_story
3a70d9c033 Merge branch 'master' into 2.6 2014-07-09 10:17:05 -04:00
chinpei215
0c1fc36b14 Fix an infinite recursion caused by missing plugin
When a MissingPluginException has caught when rendering an exception,
we should disable the plugin as needed to prevent an infinite recursion.
2014-07-09 15:55:41 +09:00
Marc Würth
c321a8fa93 Hash::nest() should throw an exception instead of returning an empty array
Refs: https://github.com/cakephp/cakephp/pull/3498#issuecomment-48316204
2014-07-08 13:01:02 +02:00
Schlaefer
1e961a8aac increases time window in CSRF token expiry tests to 2 seconds
travis-cs failed with 1 second margin
2014-07-06 13:54:24 +02:00
Schlaefer
9fa7afa354 fixes #3887 CSRF reusable token expires 2014-07-06 10:39:00 +02:00
José Lorenzo Rodríguez
396725dc8c Merge pull request #3880 from markstory/incorrect-validation
Fix issues with Validation::inList() and SecurityComponent
2014-07-05 14:41:15 +02:00
ADmad
1eccec02e4 Merge pull request #3872 from CostaC/response-sharable-fix
Fix for CakeResponse::sharable() header to include private caches
2014-07-04 10:32:51 +05:30
mark_story
3936cce4b8 Disallow hexadecimal input with inList.
Instead of turning on/off strict mode based on the user supplied input,
cast everything to strings and always use a strict check. This avoids
the potential issue of a bad user using hexadecimal when they should not
be allowed to do so. Thanks to 'Kurita Takashi' for pointing this out.
2014-07-03 22:10:49 -04:00
Costa Caruso
4f559f5cc9 Fixed failing test for CakeResponse::sharable + spacing 2014-07-03 15:03:48 -04:00
ADmad
e410501791 Fix CS errors. 2014-07-03 23:13:55 +05:30
mark_story
2bcd817367 Merge branch 'master' into 2.6 2014-07-03 11:13:06 -04:00
euromark
974ca851c2 Correct doc blocks according to cs guidelines.
Remove superfluous empty lines.
2014-07-03 15:36:42 +02:00
mark_story
b1610c145e Merge branch 'master' into 2.6 2014-07-02 23:39:16 -04:00
mark_story
adcf9ab723 Fix failing test.
CakeEmail now has a default validation pattern.

Refs #3742
2014-06-30 13:29:39 -04:00
mark_story
dc34d80f6f Relax email validation rules even more.
While filter_var() allows a number of email addresses that
Validation::email() does not, it misses out of email address that
contain IDN host names, and unicode mailboxes. Both of these are
generally deliverable, and should be permitted. filter_var() also fails
on local mailboxes like `root@localhost` which is useful in the context
of cron jobs.

Fixes #3742
2014-06-30 10:42:37 -04:00
mark_story
30952f2b64 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-06-29 22:57:59 -04:00
Derek Perkins
b1a3ab9e64 Added unit test for CakeRequest::setInput
Don't use mocks as the tests weren't really testing anything when mocks
were involved.

Refs #3764
2014-06-29 22:55:38 -04:00
ADmad
607200fa7b Add pluralization rule for "stadia".
Refs #3830
2014-06-29 14:51:23 +05:30
Mark Story
187272c06a Merge pull request #3824 from NickBeeuwsaert/element_events
Added view type getter and ensured element render events would get the proper type
2014-06-28 06:21:46 -04:00
Nick Beeuwsaert
733a610bf7 More coding standard fixes 2014-06-27 18:03:29 +00:00
Nick Beeuwsaert
6623a8a7f4 Adhering to CakePHP coding standards 2014-06-27 17:28:43 +00:00
Nick Beeuwsaert
f9aa954562 Changed Event names back, added view type getter
Changed `Element.beforeRender` and `Element.afterRender` back to
`View.beforeRender` and `View.afterRender` Also added a getter for
`View::_currentType`.
Added more tests to make sure that things were getting reset right
And also that View::render and View::element events were working
As expected

Changed Event names back, added view type getter

Changed `Element.beforeRender` and `Element.afterRender` back to
`View.beforeRender` and `View.afterRender` Also added a getter and
setter for `View::_currentType`.
Added more tests to make sure that things were getting reset right
And also that View::render and View::element events were working
As expected
2014-06-27 15:40:12 +00:00
Bryan Crowe
a1ae31e554 Fix identifier typos 2014-06-26 23:06:08 -04:00
Renan Gonçalves
1a89a3cb9d Exiting with 1 when Exception::getCode() returns non-integer values.
From php.net/exception.getcode
> Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
2014-06-26 13:26:20 +02:00
Nick Beeuwsaert
7cef19fe96 Changed View::element() to have an appropriately named event
And also made it so when the event fires the subjects type is
`View::TYPE_ELEMENT`. Wrote some tests which I hope are done right I
don't really know the bes way to write a test for a event listener
2014-06-25 22:08:59 -05:00
mark_story
a2673d8bf0 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/Core/App.php
2014-06-25 09:22:10 -04:00
mark_story
a40fa5cae9 Add test for #3754 2014-06-25 09:19:24 -04:00
José Lorenzo Rodríguez
3df972faa2 Merge pull request #3782 from cakephp/issue-3779
Whitelist more URL-y characters in digest parsing.
2014-06-24 21:56:40 +02:00
euromark
26fe1265ab Mark App::pluginPath as deprecated and don't use it anymore. 2014-06-24 11:52:29 +02:00
mark_story
b4bcd74e60 Whitelist more URL-y characters in digest parsing.
Android clients include a full URL instead of just the URI. Also handle
situations where URLencoded bytes and document fragments are used.

Refs #3779
2014-06-23 14:39:35 -04:00
ADmad
9a1a965b1c Update isAbsolute() to recognize stream wrapper paths.
This has the benefit that the realpath() method is not applied to a
registered stream wrapper in the constructor of the Folder class.
Using the realpath() method will break the stream.

Thank "davalb" for the original patch.
2014-06-22 13:43:14 +05:30
mark_story
497ecd3f80 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-06-19 21:41:02 -04:00
mark_story
9136f63874 Fix autoLinkEmail() not working when emails are adjacent to HTML.
When an email address is adjacent to HTML it should be autolinked
correctly.

Refs #3656
2014-06-16 21:48:30 -04:00
mark_story
74d8e9ea40 Convert test to use a dataprovider instead of multiple calls.
Dataproviders are generally a bit easier to work with in the future.
2014-06-16 21:46:34 -04:00
mark_story
fa19c34580 Fix Hash::extract() not matching 1/0 to true/false.
Historically [prop=1] has matched prop=true as well. This restores that
and also fixes [prop=0] not finding falsey values.

This makes the typing less strict in Hash::extract() but I don't think
it is unreasonable given PHP's type juggling.

Refs #3288
2014-06-12 11:30:48 -04:00
Melvin Ross
ad4dbdcee5 Fix HttpSocket test to actually reset protocols for correct test. Modify HttpSocket so that Https with non-passed in protocol doesn't set it to tcp and fail test. 2014-06-12 09:37:03 -05:00
Melvin Ross
86923e3593 Modify CakeSocket and HttpSocket so that the "protocol" parameter can be used to specify which protocol to use for creating sockets. These are protcols in the php "[a-z]://" wrapper sense. I also modified the test for these two files respectively to accomodate these new changes.
Unrelated to this bug, I added a "head" function inside of HttpSocket to go along with the GET/POST/PUT/DELETE/PATCH combination that's already present. Came in handy for me for deciding if I wanted to hit a resource with HttpSocket or not.
2014-06-11 19:04:58 -05:00
José Lorenzo Rodríguez
91224b0ec1 Merge pull request #3653 from markstory/2.6-html-css
Add once option to css().
2014-06-06 09:55:06 +02:00
José Lorenzo Rodríguez
932bf47481 Merge pull request #3604 from Haititi/2.6-save-atomic
2.6 add 'atomic' option to "save()" API - delivery
2014-06-05 13:55:52 +02:00
mark_story
758599e6f4 Add once option to css().
The default value is false for backwards compatibility. In 3.0, the
default will be made consistent with script().

Refs #1973
Refs #3628
2014-06-04 22:15:56 -04:00
Haithem BEN GHORBAL
31615ce415 add 'atomic' option to "save()" API
This commit adds a transaction context to 'save()' API in order to rollback
possible modifications done in some 'Model.beforeSave' listener callback.
This will allow cakephp 2.x to behave like 3.0 .
It uses try/catch to better handle transaction.
Previous save() API is renamed to protected _doSave() method.
A new save() method is created for transaction handling.
'atomic' option is disabled for internal 'save()' call.
2014-06-03 09:37:17 +02:00
mark_story
92eeef8ae0 Merge branch 'master' into 2.6 2014-06-02 22:57:25 -04:00
mark_story
55672b6df3 Merge branch 'router-stars' from Hikkijp
Refs #3582, #3581
2014-06-02 22:38:27 -04:00
mark_story
4362f7bf8b Add tests for CakeRoute::match() and trailing * routes.
Add tests for /pages/** routes, and fix coding standards errors.

Refs #3581
2014-06-02 22:37:37 -04:00
mark_story
975e4c3af0 Allow username of 0 in basic authentication.
Refs #3624
2014-06-02 22:02:28 -04:00
mark_story
d1e4dfac47 Add tests for #3624
The username of '0' should be accepted by FormAuthenticate.

Refs #3624
2014-06-02 21:58:50 -04:00
Stefan Dickmann
91907b5c6c correct docblock
invalid certificate domain
2014-06-01 13:23:47 +02:00
mark_story
15f63e9c81 Removing peer verification failure test.
Since we are not running a domain with an invalid certificate relying on
someone else to do that is quite unreliable.
2014-05-31 21:51:03 -04:00
ADmad
543066f34a Set default sort direction to 'asc'. 2014-05-30 19:43:09 +05:30
Mark Story
136f026f77 Merge pull request #3548 from dogmatic69/patch-3
Allow getting params the same way data() works
2014-05-29 21:49:09 -04:00
dogmatic69
59fe581912 adding doc block for tests related to CakeRequest::param() 2014-05-28 22:28:44 +01:00
Haithem BEN GHORBAL
a8e410ee20 fix save with habtm returning false 2014-05-28 18:17:16 +02:00
mark_story
2546b79c62 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-05-27 20:55:16 -04:00
mark_story
0c8406c034 Merge branch 'master' into 2.6 2014-05-27 20:55:06 -04:00
José Lorenzo Rodríguez
05d92ddc0a Merge pull request #3560 from cakephp/2.6-memcached-options
2.6 memcached options
2014-05-26 21:47:45 +02:00
dogmatic69
bcdc530391 adding support to write values to param like can be done with data(), method returns $this as does ->data() when writing 2014-05-25 00:52:30 +01:00
dogmatic69
9dca564519 make the default return false so it matches previous use, improve tests for new method 2014-05-25 00:46:40 +01:00
Mark Story
9c9d45596f Merge pull request #3478 from Schlaefer/#3303-lengthBetween
closes #3303 RFC: Rename Validator::between() into Validator::length()
2014-05-24 16:48:05 -04:00
mark_story
86c7d1ff5e Add addtional options array for memcached.
Memcached supports a number of options that we should afford in our
memcached adapter.

Fixes #3477
2014-05-23 22:29:03 -04:00
mark_story
db86b0c050 Don't disable the entire select when disabled is array(1)
When the disabled attribute is just array(1), then the attribute should
be filtered out of select element attributes. This is kind of a hacky
workaround but changing the underlying attribute handling is going to be
pretty tricky and far more dangerous.

Fixes #3546
2014-05-23 13:26:11 -04:00
mark_story
587f2da09e Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-05-22 14:29:43 -04:00
mark_story
cd68002246 Add additional test case for named parameters.
Refs #3525
2014-05-22 14:14:35 -04:00
akiyan
781430c4af Removed unnecessary conditional branch, fixed test and comment. 2014-05-22 14:08:18 -04:00
akiyan
67f256297d Fixed secure form hash for special url.
No htmlspecialchars encode and without fragment identifer.
2014-05-22 14:08:11 -04:00
mark_story
270e8774e4 Fix incorrect status line parsing in HttpSocketResponse.
Allow for multi-word status reasons.

Closes #3545
2014-05-21 21:53:18 -04:00
mark_story
2e4d6eb009 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-05-16 21:26:30 -04:00
euromark
143e8e4c56 Make sure invalid arrays return empty array instead of throwing notices. 2014-05-14 23:53:58 +02:00
mark_story
20ef10aca2 Fix inline attachments being broken when only sending an HTML text body.
The rel boundary was closed too early causing inline images to be
incorrectly included in the email message.

Refs #3474
2014-05-14 09:42:25 -04:00
Schlaefer
6b80ae35b1 fixes model task test-cases for 'between' validation rule alias 2014-05-14 10:55:24 +02:00
Schlaefer
bf0edd1112 fixes failing test cases in ModelTaskTest if not run in test-suite
Tests 'testSkipTablesAndAll' and 'testExecuteIntoAll' didn't took fixture
table 'core.number_tree' into account.
2014-05-14 10:34:09 +02:00
mark_story
66e733f8b1 Fix test I forgot to fix in b8fa7ce134 2014-05-13 22:12:39 -04:00
mark_story
b8fa7ce134 Fix issues where emails would have multipart/mixed when they should not.
When sending multi-part emails with no attachments we shouldn't include
the outer multipart/mixed header as it confuses Outlook and causes it to
show the email as having attachments even though there are none.

A bunch of tests need to be adjusted as the empty multipart/mixed
container has been removed.

Fixes #3474
2014-05-13 22:03:06 -04:00
mark_story
e9ecfe0936 Remove x bit on files.
PHP files should not have executable permission set.
2014-05-13 12:30:14 -04:00
Schlaefer
3ac731273e adds backwards compatible 'between' alias for 'lengthBetween' validation rule 2014-05-13 17:36:23 +02:00
Schlaefer
e10e8fcb15 fixes failing test case ValidationTest::testDecimalLocaleSet() on OS X
thousand separator isn't set in de_DE but in da_DK
2014-05-13 13:25:53 +02:00
Schlaefer
021d765620 fixes falling test case for 'lengthBetween' validator 2014-05-13 10:46:50 +02:00
Schlaefer
815838f150 replaces validator 'between' with 'lengthBetween' 2014-05-13 10:46:25 +02:00
Schlaefer
4848b63189 closes #3303 RFC: Rename Validator::between() into Validator::length() 2014-05-13 09:31:03 +02:00
mark_story
a34d5f733d Fix PaginatorComponent tests.
Because count() queries don't happen in many cases now, the lastQueries
index needs to shift up by one because a query isn't happening anymore.

Refs #3333
2014-05-12 22:10:27 -04:00
mark_story
89cd114e6f Merge branch 'master' into 2.5 2014-05-12 14:30:02 -04:00
mark_story
d0b995ad79 Merge branch '2.5' into 2.6 2014-05-11 21:47:42 -04:00
José Lorenzo Rodríguez
751d2d8f2d Merge pull request #3448 from dereuromark/master-controller
Controller::referer() and local URL
2014-05-07 22:42:28 +02:00
mark_story
5469840c80 Fix incorrectly generated URL path.
Refs #3442
2014-05-07 08:52:42 -04:00
mark_story
1103ca7816 Ensure that only the path and query are used to make the hash.
While including the entire protocol, host, port, path and query would be
even better in theory, it gets complicated when proxies and load
balancers are involved.

Fixes #3442
2014-05-06 23:00:11 -04:00
mark_story
559d9d39e7 Make test names match the rest of the tests. 2014-05-06 22:13:44 -04:00
Renan Gonçalves
87683b10f1 Allowing same Authenticate object to be setup with different settings. 2014-05-06 22:10:41 +02:00
ADmad
aa7f18840c Merge branch '2.5' into 2.6 2014-05-04 14:40:39 +05:30
ADmad
d466e00644 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Datasource/DboSource.php
	lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
	lib/Cake/Utility/Folder.php
	lib/Cake/VERSION.txt
2014-05-04 14:35:36 +05:30
euromark
fecf321cce This is a hotfix for TextHelper which seems to have gone wrong in a merge. tail() is missing completly and the docs for truncate() are the ones for tail(). This fixes it. 2014-05-02 13:33:57 +02:00
mark_story
e1057e3e6b Fix FormHelper::postLink() not working when SecurityComponent is enabled.
The action attribute value was not being included in the generated hash,
so postLink() forms never worked properly.

Fixes #3418
2014-04-29 11:23:52 -04:00
euromark
7a287a6942 More coding standard corrections. 2014-04-29 14:19:33 +02:00
mark_story
1d1a2f859c Fix coding standards error. 2014-04-28 20:56:06 -04:00
euromark
06aa747b21 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6-overwrite 2014-04-29 02:35:20 +02:00
euromark
5e5a776de8 Backporting overwrite() from 3.0 to 2.6. 2014-04-29 02:18:27 +02:00
euromark
8679c5cd18 Fix test 2014-04-28 17:33:56 +02:00
mark_story
cf96e9f54f Merge branch 'master' into 2.5 2014-04-26 22:04:19 -04:00
mark_story
a28158d614 Add additional test for f23d811ff5
I neglected to put a negative test to ensure validatePost fails when the
URL differs.
2014-04-26 10:23:27 -04:00
Mark Story
5b46eb71ec Merge pull request #3397 from steinkel/fix-formhelper-with-model-mock
fixed FormHelper to allow create() on Mock Models without errors
2014-04-26 08:53:43 -04:00
ADmad
68572d8046 Cannot use php 5.4+ array syntax for 2.x. 2014-04-26 17:30:31 +05:30
Jorge González
5cf2ce723c fixed FormHelper to allow create() on Mock Models without errors 2014-04-26 10:33:58 +01:00
mark_story
de0062de77 Merge branch 'master' into 2.5 2014-04-25 22:10:02 -04:00
mark_story
f23d811ff5 Use the form action URL in generated form hashes.
By including the URL in generated hash for secured forms we prevent
a class of abuse where a user uses one secured form to post into a
controller action the form was not originally intended for. These cross
action requests could potentially violate developer's mental model of
how SecurityComponent works and produce unexpected/undesirable outcomes.

Thanks to Kurita Takashi for pointing this issue out, and suggesting
a fix.
2014-04-25 22:05:58 -04:00
ADmad
27699d1f12 Fix auto linking urls with subdomain with underscore.
Closes #3392
2014-04-25 22:28:34 +05:30
Stefan Dickmann
f90f718e11 change parameter order 2014-04-24 12:54:45 +02:00
ADmad
971a845eb1 Merge pull request #3379 from dereuromark/2.5-inflector
2.5 inflector
2014-04-24 13:13:59 +05:30
mark_story
04edb547f3 Merge branch 'master' into 2.5 2014-04-23 22:21:57 -04:00
mark_story
6f68049bf5 Reject file paths containing ...
Paths containing `..` are generally up to no good. Throw an exception,
as developers can use realpath() if they really need to get relative
paths.

Fixes #3370
2014-04-23 22:20:14 -04:00
euromark
0c036f6370 Remove unncessary language support. 2014-04-23 18:07:08 +02:00
euromark
7e6bc48ef2 Complete Inflector transliterations. 2014-04-23 16:43:44 +02:00
ADmad
ead494eec1 Allow setting only default layout without specifying template in email config.
Closes #3336
2014-04-22 20:02:36 +05:30
ADmad
6bdfdfd436 Optimize view paths caching for plugins.
Closes #2047
2014-04-20 02:02:07 +05:30
mark_story
d54fbe6f60 Merge branch 'master' into 2.5 2014-04-18 22:13:56 -04:00
mark_story
f1b57d14ab Revert changed added in #2750.
While the had the potential to make 404s going through AssetDispatcher
much faster, they broke plugins + extension routing. While explicit
extensions could be fixed, routing all extensions could not. Because we
are trying to keep 2.x as API compatible as possible it makes sense to
revert the previous changes.
2014-04-13 20:00:34 -04:00
mark_story
749f2b99d9 Don't 404 extensions that could be handled by routing.
Fixes an error in #2750 where routed extensions would always return
404's for plugin requests. When a file extenion could be handled by
router, AssetDispatcher cannot 404 the request.

Refs #3305
2014-04-13 06:48:51 -04:00
Stephen Young
b55fa98a2d Updated documentation
* Removed references to nonexistent `AclBase` class
* Added references to `AclInterface` requirements
2014-04-11 15:10:56 -04:00
mark_story
bf9c3029cb Merge branch 'master' into 2.5 2014-04-10 20:51:49 -04:00
mark_story
c6173a0054 Add tests for #3288 and remove nested ternaries.
Nested ternaries are complicated to maintain and hard to read. Break
down the nested ternary into two conditionals.
2014-04-10 20:37:08 -04:00
euromark
8e0f15b3d6 Revert the removal of a BC relevant part. 2014-04-10 20:11:58 +02:00
euromark
9058f0f6f1 Make CakePlugin::loadAll behave correctly regarding merging of settings. 2014-04-08 12:18:17 +02:00
Mark Story
caf0217fe0 Merge pull request #3259 from dereuromark/2.5-array-merge
microptimize options and default merge and other string key array merges
2014-04-07 21:44:38 -04:00
mark_story
b05ab740d6 Merge branch '2.5-AssetDispatcher-404' into 2.5
Return a 404 much earlier when handling missing theme/plugin assets.

Fixes #2750
2014-04-07 21:43:37 -04:00
mark_story
7eb569c439 Add test case for #2750 2014-04-07 21:26:11 -04:00
euromark
0ece694a75 microptimize options and default merge and other string key array merges 2014-04-08 01:25:14 +02:00
Jose Lorenzo Rodriguez
343d3279b9 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Test/Case/Utility/FileTest.php
	lib/Cake/VERSION.txt
2014-04-06 21:50:41 +02:00
mark_story
4ec81542db Fix email rendering when using 2 different plugins.
When an email template and layout are in different plugins the incorrect
plugin would be used for the layout.

Fixes #3062
2014-04-04 21:45:04 -04:00
euromark
b150e33472 correct missed cs errors 2014-04-02 03:16:03 +02:00
euromark
e544340d67 fix indentation 2014-04-02 03:12:22 +02:00
euromark
0d09a54033 more missing doc block tags added 2014-04-02 03:02:37 +02:00
euromark
44952b06a4 cs 2014-04-02 02:23:43 +02:00
Bryan Crowe
b93f373f16 Fix yoda condition in File test 2014-03-31 17:40:35 -04:00
ADmad
10f294d6bb Remove $reponse param of Dispatcher::_invoke().
Use controller's $response property by default.
2014-03-30 19:29:07 +05:30
mark_story
ff73229ab8 Fix failing tests.
Not everyone uses the same database names as me.
2014-03-24 10:04:19 -04:00
mark_story
2fe8c4050b Insert manual joins *after* generated joins.
Re-order query joins to make manually added joins be performed after
generated joins. This removes the need to workaround the current join
order, or redefine all association joins when you want to add an
additional join on a leaf table.

Refs #2179
Refs #2346
2014-03-23 21:09:08 -04:00
func0der
06f47ee01f Introduced I18n category constants (#1894)
Replaced all hard coded category values
2014-03-23 17:00:17 +01:00
Mark Story
dea6709d89 Merge pull request #3014 from ndm2/smtp-extensibility-response-access
SMTP transport - Extensibility and response access
2014-03-23 09:24:21 -04:00
mark_story
8acb75425d Merge branch 'master' into 2.5
Conflicts:
	CONTRIBUTING.md
	lib/Cake/Model/Datasource/DboSource.php
2014-03-21 22:55:28 -04:00
mark_story
f12b272758 Fix a few flaky/bad attribute matchers. 2014-03-21 22:52:52 -04:00
mark_story
af68f61e7a Make assertTags() run much faster.
Generating the various permutations a priori is incredibly expensive
with sets of attributes. Using nested loops that look for matches is
more efficient.

Add replacments for `.*` and `.+` in preg:/ prefixed attribute matchers
so they do not greedily eat all content. This also requires that preg:/
based attribute matchers *must* be quoted.

Fixes #3072
2014-03-21 22:52:52 -04:00
wbkostan
fea60bfe51 Update InflectorTest.php
Added test cases for changes to inflector which affected words ending -aves. Author acknowledges the homonym conflict with 'leaves' and 'leaves', but preferences the word whose singular avoids an exception to the inflection rule.
2014-03-19 19:17:52 -04:00
mark_story
afc8587949 Merge branch 'master' into 2.5 2014-03-18 22:12:14 -04:00
mark_story
ee895a8bb1 Add form attribute to hidden inputs when present.
If inputs are placed outside of the form elements the form attribute
needs to be set on the hidden inputs. Without this attribute the empty
state does not submit correctly.

Fixes #3053
2014-03-18 22:11:57 -04:00
Hadrien
d55a167830 Themed CakeEmail should load view helpers with the theme set 2014-03-18 14:22:24 +01:00
mark_story
9888209e9a Add tests and fix issues with multiple trailing whitespaces.
Closes #3016
2014-03-17 13:08:46 -04:00
ADmad
abacf0d14b Remove setting of Controller::$ext by RequestHandler.
Closes #3022
2014-03-16 20:09:08 +05:30
ndm2
0ae225615c Match SP as per rfc2821 2014-03-15 11:47:13 +01:00
ndm2
c1824071c9 Expose last SMTP response. 2014-03-13 16:28:54 +01:00
mark_story
c5b6dda82f Merge branch 'master' into 2.5 2014-03-11 21:02:27 -04:00
mark_story
c0ac61117e Only sort the keys once per request instead of on each match.
Sorting the keys property by value sorts keys with the same prefix for
free. This does change the order of the keys, but I don't think that is
actually a large issue as it is just a list.

Refs #2991
2014-03-10 21:42:26 -04:00
Mike Gibson
1202658396 Added a test case 2014-03-10 12:03:04 +00:00
Rachman Chavik
aa0f1c1862 Fix: Stray [] syntax in php 5.3 codebase 2014-03-07 09:23:06 +07:00
Rachman Chavik
e71d650ade Fix: Regression with format specifiers in i18n methods
Refs: #2589
2014-03-07 09:22:56 +07:00
mark_story
6c3bc48ce0 Merge branch 'master' into 2.5 2014-03-06 17:45:00 -05:00
Mark
3ca338fe26 Merge pull request #2781 from davidsteinsland/2.5
Fixed HTTP Status code when ajaxLogin is set
2014-03-06 12:37:51 +01:00
mark_story
5544fcc4c2 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2014-03-03 21:20:58 -05:00
ndm2
1015b38a27 Use convenience methods to create a (case-insensitive) negation matcher 2014-03-02 17:56:35 +01:00
ndm2
70a1b87db6 Fix wrong test model association class name 2014-03-01 23:01:33 +01:00
ndm2
01e1b5ca61 Fix failing tests caused by already existing classes 2014-03-01 20:24:32 +01:00
ndm2
008ad3237c Fix verification of expected invocations #2919 2014-03-01 19:06:17 +01:00
ADmad
a707709e1d Added test for FormHelper::radio().
Tests generating radio input for field with model other than one used
in create(). Refs #2911.
2014-02-28 02:34:16 +05:30
mark_story
25f94f9b71 Add test to prove the fix made in pull/2899
Ensure that event listeners are not lost when merging the global and
local listeners.

Fixes #2897
Fixes #2899
2014-02-26 21:06:32 -05:00
mark_story
0f584c0e8b Merge branch 'master' into 2.5 2014-02-24 21:19:17 -05:00
mark_story
0776b87214 Fix postLink() & postButton() with nested data.
Flatten deeply nested array data before generating hidden inputs.
This solves 'Array to string conversion' errors.

Closes #2894
2014-02-24 21:17:31 -05:00
jalbertocr
35f152b333 Make sure a datetime instance is valid to avoid fatal errors. 2014-02-19 20:50:30 -03:00
AD7six
4e0627232c account for localized floats more robustly.
Normalize floats, strings too, so that they are validated as

    dddddddddd.dd

ref #2853
2014-02-19 15:04:25 +00:00
mark_story
b8c94fa5d4 Merge branch 'master' into 2.5 2014-02-18 22:19:12 -05:00
mark_story
0a51458ffd Fix Validation::decimal() not working with localized floats.
Use similar workarounds as DboSource::value() for accepting localized
floats.

Fixes #2853
2014-02-18 22:18:56 -05:00
mark_story
3433f4a1f0 Clean up changes code standards and tests.
Refs #2582
2014-02-17 11:03:49 -05:00
Jonas
b32deed4aa changed FormHelper::secure() and FormHelper::end() to support attributes in the hidden CSRF-protection tags that are being generated for SecurityComponent to allow specification of additional html attributes like HTML5s "form" attribute. This allows separation of Form instantiation/controls and form data - for instance within html tables
improved tests for testing against additional attributes for Form::secure()

improved tests for testing against additional attributes for Form::end()

removed array cast, fixed test

fixed docblock format

format

Fixed a bug, this won't work as some forms are just empty
2014-02-17 10:54:02 -05:00
Mark Story
c325a93998 Merge pull request #2741 from ADmad/2.5-mimetype
Added regex support to Validation::mimeType().
2014-02-17 10:10:48 -05:00
ADmad
9ae7f11a2a Made mimetype check case insensitive. 2014-02-17 11:48:00 +05:30
mark_story
cde93ca7b9 2.x needs to be compatible with PHP<5.4 2014-02-16 21:37:28 -05:00
mark_story
3919f93149 Use simpler assertions. 2014-02-16 14:37:29 -05:00
mark_story
7a4cabe5d3 Add depth to log().
Much like dump() it is handy to be able to control the depth variables
are dumped out when logged.

Refs #2834
2014-02-16 14:35:32 -05:00
mark_story
2c5d96e916 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Datasource/DboSource.php
2014-02-16 14:24:19 -05:00
AD7six
5334fe04c3 handle loose % signs in __() function
While it's passed to sprintf and translation markers may contain
variable placeholders (%s, %d) that doesn't mean translators need to be
aware of all relevant rules. A % sign in a translation message shouldn't
cause a warning (and no return) it should be handled as a literal
percent sign.
2014-02-13 15:30:16 +00:00
euromark
1725386c16 Fix uploadError validation rule to work with OS Win. Here the error is string, not integer. 2014-02-12 21:52:18 +01:00
mark_story
827dc77a11 Fix incorrect assertion. 2014-02-11 22:00:24 -05:00
mark_story
96a37d5917 Fix temporary associations that replace fields not being restored.
When binding temporary associations, fields should be restored
in the afterFind as the association will have become unbound.

Fixes #2816
2014-02-11 21:56:05 -05:00
mark_story
a5d50da040 Remove dead and unused code. 2014-02-11 16:38:24 -05:00
ADmad
9de3418079 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Permission.php
2014-02-11 18:17:59 +05:30
ADmad
bea30e62cb Renamed CakeRequest::onlyAllow() to CakeRequest::allowMethod().
Existing name is unintuitive and it's not easily apparent what
the method does. Closes #2803
2014-02-10 17:38:55 +05:30
mark_story
91349c306e Remove trailing whitespace.
Refs #2799
2014-02-09 16:03:37 -05:00
Sam
f3cd0fc808 Test added for previous fix in CakeRoute.php. Refs #2797. 2014-02-10 02:20:00 +11:00
ADmad
d9489257d3 Don't return true from view classes' render() method.
It cause's Controller:render() to set the response body as `true`.

Refs #2780
2014-02-06 03:06:00 +05:30
David Steinsland
f2b9aa5ca4 Fixed HTTP Status code when ajaxLogin is set 2014-02-05 16:05:02 +01:00
mark_story
be8ebfc005 Merge branch 'master' into 2.5 2014-02-05 09:22:46 -05:00
AD7six
adc0bf3ded BC fix for checkbox ids
Revert to previous behavior for id generation of checkboxes, This commit
can be reverted for 2.5+ is desired

Fixes #2733
2014-02-03 17:57:26 +00:00
José Lorenzo Rodríguez
e36c954da7 Merge pull request #2693 from ADmad/2.5-session-start
Don't start a session if it's known to be empty.
2014-02-01 04:08:48 -08:00
Mark Story
a6459a6c2f Merge pull request #2740 from rchavik/2.5-event-manager-regression
RFC Fix: CakeEventManager regression
2014-01-31 07:10:46 -08:00
Mark Story
405f3a1cb9 Merge pull request #2752 from rchavik/2.4-postgres-alterschema
Fix: Changing boolean to integer for Postgres
2014-01-31 06:46:52 -08:00
Rachman Chavik
35c22a291e Add test to prove Event Manager regression 2014-01-31 16:52:26 +07:00
Rachman Chavik
59549b7ebe Fix: Changing boolean to integer for Postgres
Closes #2751, CakeDC/migrations#149
2014-01-31 15:14:20 +07:00
mark_story
4d57d3ce5b Fix plugin path filtering when directories do not exist.
When paths do not exist we should correctly remove them from the output
paths.

Fixes #2748
2014-01-30 21:40:08 -05:00
mark_story
605351d0c9 Allow empty values in checkboxes.
Allow the checkbox value attribute to be empty. This is required to make
checkboxes with a value of 0.

Fixes #2717
2014-01-30 21:12:06 -05:00
Walter Nasich
43604f64d5 Rendering a proper value for html5 attribute 'step' 2014-01-30 17:17:50 -03:00
ADmad
2d10707d18 Added regex support to Validation::mimeType(). 2014-01-30 21:05:04 +05:30
mark_story
c1ab6fa9d1 Merge branch 'master' into 2.5 2014-01-30 10:13:37 -05:00
Mark Story
6eb5a38f22 Merge pull request #2692 from jrbasso/2.5-cors
Added support to cross origin requests
2014-01-29 06:45:11 -08:00
Mark Story
8db034cbf1 Merge pull request #2731 from joostdekeijzer/console-extract-not-handling-validation-quotes
Console Extract task doesn't handle validation messages with qoutes correctly
2014-01-29 06:43:23 -08:00
Mark Story
5629dfdcc3 Merge pull request #2728 from joostdekeijzer/2721-fix-in-translatebehavior
Fix Model::field() and  TranslateBehavior::beforeFind() not working together.

Fixes #2721
2014-01-29 06:40:27 -08:00
joostdekeijzer
42daa25340 Fix Console "extract i18n from sources" to handle quotes in Model::validate parameters correctly 2014-01-29 14:53:52 +01:00
joostdekeijzer
987187ef8c Fix #2721 in TranslateBehavior::beforeFind() supporting both Model::field('fieldname') and Model::read('fieldname') 2014-01-29 13:37:47 +01:00
joostdekeijzer
827c815cf1 correct property comment 2014-01-29 12:25:09 +01:00
Rachman Chavik
b83b59a9d7 Log errors instead of calling trigger_error() 2014-01-29 17:51:07 +07:00
ADmad
c093804b35 Merge branch 'master' into 2.5 2014-01-26 17:39:50 +05:30
José Lorenzo Rodríguez
ddf046a246 Merge pull request #2694 from bar/patch-3
Correctly remove routing url from query string.
2014-01-22 05:15:03 -08:00
mark_story
61dd1c3f9d Fix trailing whitespace. 2014-01-21 20:23:12 -05:00
Juan Basso
dae756c84a Added option to allowed headers 2014-01-21 15:31:05 -05:00
Ber Clausen
5b4121f643 Update tests. 2014-01-21 16:56:37 -03:00
ADmad
84932fcc4a Don't start a session if it's known to be empty.
If an app only reads/checks the session there's no need to start a
session to know that the read/checked session value is empty.

Fixes #1981
2014-01-22 01:17:16 +05:30
Juan Basso
5af3da7fe6 Changed tests to support PHP 5.2 :( 2014-01-21 10:44:00 -05:00
Juan Basso
ec7196013c Added support to cross origin requests 2014-01-21 09:44:49 -05:00
mark_story
55e1619c59 Fix issue with find(count) and TranslateBehavior.
Fixes #2667
2014-01-18 21:54:09 -05:00
Rob McVey
7a27650297 Test case that demonstrates issue with count and Translate 2014-01-18 21:49:07 -05:00
mark_story
75dd2ff1fb Merge branch 'master' into 2.5 2014-01-16 15:20:40 -05:00
mark_story
f25e84f4fb Don't select year 0 when there are all 0's.
Year 0 is almost never a 'good' selection value and causes odd behavior
when paired with MySQL.

Fixes #2658
2014-01-15 10:23:45 -05:00
Matthew Ouyang
84eb46dbdc allow additional status codes through constructor
through $options['statusCodes']
2014-01-14 11:18:57 -05:00
euromark
690f54ad9d more corrections in order 2014-01-10 00:33:27 +01:00
euromark
3ff23c732f unify and correct assert order 2014-01-10 00:18:08 +01:00
José Lorenzo Rodríguez
606362d519 Merge pull request #2636 from dereuromark/2.5-title-for-layout
Follow the deprecation note in the doc block of View class
2014-01-09 15:13:07 -08:00
euromark
97e43e5806 unify to expected 2014-01-09 16:52:21 +01:00
euromark
738b34c2d0 Correct assert param order 2014-01-09 16:50:27 +01:00
euromark
29e15386b2 Follow the deprecation note of 2.1 migration guide and switch to fetch(title)
correct assert order for test
2014-01-09 16:45:49 +01:00
mark_story
b20ca3f4e0 Fix errors with postgres tests. 2014-01-08 09:42:13 -05:00
mark_story
312b2c3cd1 Merge branch 'translate-patch' 2014-01-06 21:21:25 -05:00
mark_story
3763350667 Add test for issue #2595
Fold conditions that did the same thing and add a test case.

Closes #2595
2014-01-06 21:21:13 -05:00
euromark
ecfd64c082 adding test 2014-01-06 21:07:00 +01:00
mark_story
3cee3b0e99 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2013-12-30 21:28:22 -05:00
Rachman Chavik
c48afae2dc Add test to prove issue when saving invalid tree data 2013-12-27 12:35:28 +07:00
mark_story
1daa27c0d7 Add tests for uncovered case of :0 replacements.
There were previously no tests for the :0, :1 style replacement markers
in DboSource. In fact I didn't even know it was a 'feature'.
2013-12-24 13:13:05 -05:00