Commit graph

5916 commits

Author SHA1 Message Date
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
Mark Story
00be120e7a Merge pull request #3381 from planardothum/shell-requires-cli
Add check to abort if $argv is undefined.
2014-04-24 12:32:54 -04:00
Harold Putman
d62e5e1b00 Prevent infinite loop caused when argv not set.
If shell is invoked with the wrong PHP executable (not CLI) and argv is not an array,  array_search on null causes infinite number of error messages.
2014-04-24 11:48:19 -04:00
mark_story
9d19801cfa Clear data and validationErrors *after* calling clearCache().
Having both properties cleaned after clearCache() means that you can use
the model data in specialized clearCache() implementations.

Fixes #3386
2014-04-24 09:19:00 -04:00
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
mark_story
2333c3d535 Update docs for file().
Mention that relative paths will be prepended with APP.

Refs #3370
2014-04-23 22:15:10 -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
Carl Sutton
5ac60288fd Fix closing non resource
I get a load of these errors when running tests in the shell, this check stops the errors from happening

Warning: 2 :: fclose() expects parameter 1 to be resource, integer given on line 298 of CORE\Cake\Console\ConsoleOutput.php
Trace:
fclose - [internal], line ??
ConsoleOutput::__destruct() - CORE\Cake\Console\ConsoleOutput.php, line 298
ToolbarComponent::_saveState() - APP\Plugin\DebugKit\Controller\Component\ToolbarComponent.php, line 307
ToolbarComponent::beforeRedirect() - APP\Plugin\DebugKit\Controller\Component\ToolbarComponent.php, line 307
ObjectCollection::trigger() - CORE\Cake\Utility\ObjectCollection.php, line 132
call_user_func - [internal], line ??
CakeEventManager::dispatch() - CORE\Cake\Event\CakeEventManager.php, line 247
Controller::redirect() - CORE\Cake\Controller\Controller.php, line 765
AuthComponent::_unauthenticated() - CORE\Cake\Controller\Component\AuthComponent.php, line 364
AuthComponent::startup() - CORE\Cake\Controller\Component\AuthComponent.php, line 304
ObjectCollection::trigger() - CORE\Cake\Utility\ObjectCollection.php, line 132
call_user_func - [internal], line ??
CakeEventManager::dispatch() - CORE\Cake\Event\CakeEventManager.php, line 247
Controller::startupProcess() - CORE\Cake\Controller\Controller.php, line 675
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 182
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 160
2014-04-14 14:15:46 +01:00
Bryan Crowe
1a73906a50 Fix failing NoActions comparison test 2014-04-13 23:28:13 -04:00
Bryan Crowe
f7cc0c1802 Add newline after actions in controller template 2014-04-13 21:56:27 -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
mark_story
d4ae2b0b88 Correct types for Validation::range().
Refs #3304
2014-04-13 06:16:24 -04:00
euromark
4f3578ebda Fix CakeHtmlReporter output for HTML 2014-04-12 13:37:36 +02:00
Mark Story
d2fa1b444f Merge pull request #3301 from ubermaniac/Sqlserver-trim
Trim $sql before checking for SELECT
2014-04-11 18:48:41 -04:00
Joseph Woodruff
9aeea2fcc3 Trim $sql before checking for SELECT 2014-04-11 15:25:07 -06: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
6122869d89 Update version number to 2.5.0-RC1 2014-04-10 20:54:20 -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
Guillaume Lafarge
db450a96e9 Fix Hash type casting
When using comparison with a boolean, as the filter is a string, we have to convert the data boolean to "boolean string" to avoid type-casting troubles.

## Example
```php
$users = [
    [
        'id' => 2,
        'username' => 'johndoe',
        'active' => true
    ],
    [   'id' => 5,
        'username' => 'kevin',
        'active' => true
    ],
    [
        'id' => 9,
        'username' => 'samantha',
        'active' => false
    ],
];
$unactiveUsers = Hash::extract($users, '{n}[active=false]');
print_r($unactiveUsers);
```

This example returns the two unwanted active users because `"false"` is `true` but not `false` :)

I think this pull request will fix this issue by converting true/false boolean to string (to match with our filter).
2014-04-10 20:19:32 +02:00
euromark
8e0f15b3d6 Revert the removal of a BC relevant part. 2014-04-10 20:11:58 +02:00
Mark Story
f9a6c1905b Merge pull request #3210 from ubermaniac/Sqlserver-schema-prefix
Sqlserver schema prefix #3208
2014-04-09 14:31:09 -04:00
euromark
c321ee5fec correct doc block 2014-04-09 03:07:19 +02:00
euromark
4679a30b37 move cast up 2014-04-08 12:22:29 +02:00
euromark
e948598277 update doc block 2014-04-08 12:19:29 +02:00
euromark
9058f0f6f1 Make CakePlugin::loadAll behave correctly regarding merging of settings. 2014-04-08 12:18:17 +02:00
mark_story
debdc6bccc Merge branch '2.5' of github.com:cakephp/cakephp into 2.5 2014-04-07 21:46:11 -04:00
mark_story
ac66c2c03a Merge branch 'master' into 2.5 2014-04-07 21:45:57 -04:00
Mark Story
bb7b450404 Merge pull request #3260 from dereuromark/2.5-count-dim
Without any params this method does not make sense
2014-04-07 21:45:31 -04: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
euromark
fdc42a24ca Without any params this method does not make sense 2014-04-08 03:27:45 +02:00
mark_story
513f7bfe86 Cleanup file header. 2014-04-07 21:26:35 -04:00
mark_story
7eb569c439 Add test case for #2750 2014-04-07 21:26:11 -04:00
euromark
a7744e6ff4 a few more corrections 2014-04-08 01:49:33 +02:00