Commit graph

6989 commits

Author SHA1 Message Date
mark_story
c14d1ffe93 Add tests for #7428 2015-09-21 21:39:51 -04:00
Mark Story
9208a0857e Merge pull request #7428 from burriko/fix-dbo-connection-issues
Fix use of $_connection in DboSource in 2.x
2015-09-21 21:38:20 -04:00
Graeme Tait
dc856b8508 Switch out is_null() 2015-09-21 17:00:20 +01:00
Graeme Tait
1b33efaad3 Check $_connection is not null before trying to use it
Stops a fatal error if calling isConnected() after disconnect().
2015-09-21 14:08:07 +01:00
Graeme Tait
8fae10a971 Set DboSource::$_connection to null on disconnect 2015-09-21 14:05:56 +01:00
Mark Scherer
97b6f8674c Fix CS 2015-09-21 13:45:18 +02:00
Mark S.
c87de2a069 Fix CS 2015-09-17 11:33:59 +02:00
mark
e7d6319d59 Skip test for versions of < MySQL5.6. 2015-09-17 10:43:43 +02:00
mark
d8a55ad065 Allow CURRENT_TIMESTAMP for datetime columns - MySQL5.6+. 2015-09-16 14:16:58 +02:00
Mark Scherer
450a544eb4 Backport 3.x limit of fixture data generation. 2015-09-13 13:12:53 +02:00
Sander Visser
5a7507df4f Fix issue "Debugger class not found"
App::uses('Debugger') not needed because it's allready defined in top of file
2015-09-12 15:28:30 -04:00
mark_story
9eafde13d2 Set the key variable in the SessionHelper.
This fixes cross template compatibility between the Flash and Session
helpers.

Refs #7365
2015-09-09 22:08:49 -04:00
mark_story
e4cce7a441 Fix errors in PHP <5.4 2015-09-06 22:14:04 -04:00
mark_story
60d7bbaa10 Always update updated/modified columns when a fieldList is used.
When a fieldList is used, and updated is not in the fieldList, the
column should continue to be updated even if the column has a value from
the user. Because the field is not in the fieldList, we must assume that
the intent is for the field to update automatically, as it would have if
the updated column was not present in the save data.

Refs #7076
2015-09-05 22:01:33 -04:00
mark_story
0dbabce792 Update version number to 2.7.3 2015-08-23 22:22:27 -04:00
mark_story
143c34bdc1 Handle case where a visible input shares a name with an invisible one.
If a visible input is created *after* a hidden input was created, the
form would always blackhole unless the visible input had the same value
as the hidden input.

Refs #7274
2015-08-22 23:10:44 -04:00
Mark Scherer
f154a8f4d7 Fix MediaView extension handling as documented and expected. 2015-08-21 12:35:49 +02:00
mark_story
0df0f1a559 Don't use short tags.
They are not broadly supported before PHP 5.4 and we should escape all
the content the core templates output.
2015-08-20 22:36:09 -04:00
Mark Story
d05727b6df Merge pull request #7265 from mattmemmesheimer/issue-7048
Issue 7048
2015-08-20 22:32:39 -04:00
mattmemmesheimer
70feb52f73 Changing the default layout to use FlashComponent::render instead of the deprecated SessionComponent::flash. Changing the flash elements to retain the id attribute that was previously present. Also fixing file permissions on the template files I added. 2015-08-20 20:19:22 -05:00
mattmemmesheimer
7d5e6e3a3e Reverting accidental chmod. 2015-08-19 17:50:47 -05:00
ndm2
8fe953548c Fix path traversal check for Windows based systems
On Windows based systems, both, backward as well as forward
slashes are supported as path separators, thus checking for `DS`
only, would allow to slip in `../` fragments.

refs #5905, cad57dcc28
2015-08-19 16:47:53 +02:00
mattmemmesheimer
d4467f9acf Fixing unit tests. 2015-08-18 22:14:10 -05:00
James Tancock
5b92c900e6 Missing test fix ModelIntegration 2015-08-18 13:32:16 +01:00
James Tancock
fdb41e01bb Alter Model::exists() to return false with no table 2015-08-18 13:07:30 +01:00
James Tancock
2f7cc052d2 Typo in tests docblock 2015-08-17 13:15:35 +01:00
James Tancock
fd198ce0fa Edits to tests to cover the changes to Model::exists 2015-08-17 12:19:02 +01:00
mattmemmesheimer
d3cf879195 Updating deprecated SessionComponent::setFlash calls to FlashComponent magic calls. 2015-08-16 18:01:23 -05:00
mattmemmesheimer
604cb0e48b Including the FlashComponent by default in the controller when baking. 2015-08-16 17:58:41 -05:00
mattmemmesheimer
0df7bcd26d Adding Flash element template files. 2015-08-16 17:55:03 -05:00
James Tancock
90a77f6ce5 Alter model exists to consider useTable 2015-08-16 19:06:12 +01:00
Marc Würth
f3e590acfb Annotate test coverage 2015-08-11 16:36:09 +02:00
paolo
a7b5f8c3af DboSource now check the actual status of connection by executing a dumb query on DB
This change makes it possible for developer to build reconnection logic
on MySQL connections which frequently time out in long running CLI
processes.

Cherry picked onto 2.7 from #7190.
2015-08-07 21:59:28 -04:00
mark_story
f959b76013 Update version number to 2.7.2 2015-08-06 21:43:53 -04:00
mark_story
07c2047984 Merge branch '2.7' of github.com:cakephp/cakephp into 2.7 2015-08-06 21:43:40 -04:00
mark_story
b7c9ac913d Backport fixes for comparison() and range() to 2.x
These fixes were released as a security update for 3.x, they also belong
in 2.x
2015-08-06 21:36:39 -04:00
mark_story
056f24a774 Forbid direct prefix access with mixed casing.
Changing the casing up should not allow prefix method access.
2015-08-05 23:05:30 -04:00
mark_story
9f20330d17 Fix fatal error on null subject.
Refs #7176
2015-08-05 22:20:39 -04:00
Mark Scherer
3f15c8a199 fix templates 2015-08-05 11:45:27 +02:00
Mark Story
58bede76d1 Merge pull request #7103 from ravage84/2.7-fixture-import-record-aware
Make fixture import from table aware of records found
2015-08-03 16:01:35 -04:00
José Lorenzo Rodríguez
b89ac18e55 Merge pull request #7147 from cakephp/issue-7118
Fix incorrectly parsed mo file context.
2015-08-02 11:30:46 +02:00
Marc Würth
27c88a872b Use tabs and single spaces in all .htaccess files 2015-08-01 00:39:10 +02:00
mark_story
a73fc25657 Fix incorrectly parsed mo file context.
The context from mo files should be parsed correctly.

Refs #7118
2015-07-30 22:28:55 -04:00
mark_story
26ab829d5a Bootstrap Configure after the mb_* shims have been defined.
By bootstrapping after the shims have been defined allows the shims to
be used by Inflector which is often involved with bootstrapping.

Refs #7135
2015-07-29 22:01:27 -04:00
José Lorenzo Rodríguez
355eb1859c Merge pull request #7106 from cakephp/issue-7098
Consistently remove plugin names in object collections.
2015-07-28 15:58:41 +02:00
mark_story
58ea40e32c Don't stop reading when only a '0' has been read.
Make tests simpler by using onConsecutiveCalls() instead of trying to
maintain mock method indexes.

Refs #7121
2015-07-27 22:40:27 -04:00
Mark Story
97be4f893a Merge pull request #7117 from Tijme/2.7
Disable SNI in HttpSocket
2015-07-27 16:57:53 -04:00
t.gommers
b16d627b36 Disable SNI in HttpSocket 2015-07-27 13:03:21 +02:00
Mark Scherer
a239324a0d use constant PHP_SAPI 2015-07-26 15:35:03 +02:00
Mark Story
de4b44a37b Merge pull request #7077 from dereuromark/2.7-static
Replacing self with static due to PHP5.3+. Following #7040.
2015-07-23 22:27:37 -04:00
mark_story
b3a192add0 Add warning for irregular method.
Refs #7096
2015-07-23 21:49:22 -04:00
mark_story
418dcfd7f8 Consistently remove plugin names in object collections.
We were sometimes removing plugin prefixes (set, and some subclass
methods). But many other methods were missing the pluginSplit() feature.
This change makes all of the methods in ObjectCollection strip plugin
prefixes, which increases consistency across the framework.

Refs #7098
2015-07-23 21:46:21 -04:00
mark_story
45877df3eb Update version number to 2.7.1 2015-07-23 21:08:54 -04:00
Marc Würth
b412b405f9 Make fixture import from table aware of records found 2015-07-23 18:03:42 +02:00
Marc Würth
71e4ed91af Slightly improve the bake templates 2015-07-23 17:29:47 +02:00
antograssiot
94b2ea29a6 enable colors for windows ConEmu user
backport of #7090
2015-07-23 05:49:15 +02:00
Mark Story
e19f621314 Merge pull request #7086 from cakephp/issue-7069
Fix issues saveMany & saveAssociated with boolean values.
2015-07-22 22:01:39 -04:00
Yoshiyuki Kinjo
00919c5f01 Fix FormHelper::input ignoring value option.
Signed-off-by: mark_story <mark@mark-story.com>

Backport fixes from #7082 to 2.7
2015-07-22 22:00:20 -04:00
Yoshiyuki Kinjo
e25be3a47e Add failing test for FormHelper::input
FormHelper::input does not respect 'value' option when form is of date/time type.

Signed-off-by: mark_story <mark@mark-story.com>

Backport fixes from #7082 to 2.7
2015-07-22 21:59:44 -04:00
mark_story
c6e5026767 Fix issues saveMany & saveAssociated with boolean values.
For non-atomic, save operations that include models with boolean fields.
The first false value would cause the save to abort. This regression was
introduced in #6947. Instead of checking the data from save() we should
be boolean casting save() to capture the success/failure.

Refs #7069
2015-07-22 00:41:10 -04:00
mark_story
e4b2428735 Fix PHPCS errors. 2015-07-21 16:28:17 -04:00
Mark Scherer
52e79987a2 Replacing self with static due to PHP5.3+. Following #7040. 2015-07-21 10:22:53 +02:00
mark_story
bd23fdeebf Simplify code and reduce test redundancy.
We don't need the additional parameter, and some of the tests weren't
covering unique scenarios.

Refs #7040
2015-07-20 22:16:50 -04:00
Chris Valliere
64f0ca0028 Fix Hash::maxDimensions
The current Hash::maxDimensions function calls Hash::dimensions to try
to get the maximum depth of the passed in array.  However, this ends up
only getting the depth of the first element of each 1st dimension
element in the array passed to maxDimensions.  The function needs to be
called recursively in order to get the depth of ALL of the elements in
all of the dimensions of the passed in array.

I made the maxDimensions function more closely resemble the deprecated
Set::countDim function in order to restore the correct functionality.
2015-07-20 22:07:58 -04:00
Chris Valliere
7b2d7ad748 Test Case for Hash::maxDimensions
Added test case for Hash::maxDimensions using the example array in pull request #7040.
2015-07-20 22:07:58 -04:00
David Yell
4af2e5489b Update deprecated method in docblocks
So that the docblock doesn't point you to another deprecated method which then points you to the actual method.
2015-07-17 16:14:06 +02:00
mark_story
9b313f86e4 Add tests for #7034
These tests ensure that redirect() is never called which ensures the
Location header is never set. Ajax requests when no loginElement is
defined should get an empty response with a 403 status code.
2015-07-16 23:00:20 -04:00
adam1010
1922a18d07 Ajax requests not properly returning 403
When an AJAX request is made to a page that's not authorized, an infinite redirect loop to  /status:403/exit:1  is triggered. This bug has existed at least since CakePHP v2.3.0. The main use case is when a user's session has expired and they try to use an authenticated feature as a logged-out user.
2015-07-16 22:47:13 -04:00
Mark Scherer
d98e7d8d27 Fix tests. 2015-07-13 08:37:11 +02:00
Mark Scherer
2eea245491 Backport utf fix for CakeText::tokenize(). 2015-07-13 08:23:05 +02:00
mark_story
e07b64f4e3 Update version number to 2.7.0 2015-07-11 21:34:20 -04:00
mark_story
47378427e3 Merge branch '2.6' into 2.7 2015-07-11 21:25:26 -04:00
mark_story
65c1745349 Add missing parameter to rawQuery()
Previously bound parameters were put in the incorrect position.

Refs #6992
2015-07-10 12:56:49 -04:00
Marc Würth
4a131bdcbf Capitalize Windows, the OS 2015-07-09 15:54:03 +02:00
Anne
b4b10e75ac Added return types in PHP documenation in basics.php, since it raises warning in ie. PHPStorm, like:
- Method _toString is not implemented for translated
2015-07-08 09:35:06 -04:00
Anne
64951a3e7e Added return types in PHP documenation in basics.php, since it raises warning in ie. PHPStorm, like:
- Method _toString is not implemented for translated
2015-07-08 11:23:29 +02:00
Mark Story
97656d8edb Merge pull request #6965 from dy-dx/backport-csv-mapping
Don't map text/plain to csv. Backport from 3.0. Refs #1696
2015-07-07 22:07:02 -04:00
mark_story
7613e720e7 Fix PHPCS errors. 2015-07-07 22:06:47 -04:00
mark_story
59a18e7709 Merge branch '2.6' into 2.7 2015-07-07 22:05:56 -04:00
Chris Kim
94fbc6e5f2 Don't map text/plain to csv. Backport from 3.0. Refs #1696
Jquery sets accepts header similar to "text/plain, */*; q=0.01" by
default for xhr requests. Due to this RequestHandler used to set
extension to csv thereby causing View class to look for views under
non-existent csv folders.
2015-07-07 15:19:45 -04:00
mark_story
4102961cb5 Add tests for #6879
I wasn't able to reproduce the issue the reporter had, but we have more
robust tests now.
2015-07-06 22:43:52 -04:00
hiromi2424
deb62c8887 #6935 Fix deep saving for hasMany could not handle validation errors correctly 2015-07-04 06:10:58 +00:00
mark_story
c037e04ace Update version number to 2.6.8 2015-06-29 22:35:55 -04:00
mark_story
cbd45f702d Make FlashComponent/FlashHelper more backwards compatible.
Merge branch 'issue-6874' into 2.7.

Make AuthComponent use FlashComponent, and make FlashHelper more
compatible with SessionHelper::setFlash().
2015-06-26 22:05:32 -04:00
mark_story
97c5463387 Fix failing tests.
FlashHelper uses `Message` not flash now. This is more backwards
compatible with 2.x

Refs #6874
2015-06-26 22:04:00 -04:00
mark_story
e651d15df5 Add tests for less greedy field parsing in SQLite.
Refs #6887
2015-06-25 22:21:38 -04:00
Lawrence Barsanti
0b28c2e839 Added negative lookahead
It is possible to have multiple occurrences of 'as' in a field name.
Use the last occurrence of 'as' when extracting field name.

Tested with following examples:
"WeldCheck"."weld_id"
count(*) as WeldCheck__num_measurements
count(case decision when 2 then 1 else null end) as
WeldCheck__num_failures
avg(cast (WeldMeasurement.surface_indentation as bigint)) as
WeldCheck__avg_indentation
avg(cast (WeldMeasurement.circle_diameter as bigint)) as
WeldCheck__avg_diameter
2015-06-25 22:21:38 -04:00
mark_story
ae2ea1ea6c Merge branch '2.6' into 2.7 2015-06-25 21:50:47 -04:00
Highstrike
a9d77d26f0 fix failing tests
fixing...
2015-06-25 13:40:50 +03:00
mark_story
2f616a9e0c Fix greedy regex operators in Postgres driver.
`*` is greedy in regex, and needs to be escaped so that SQL operators
don't cause invalid SQL conditions to be created.

Refs #6877
2015-06-24 23:39:26 -04:00
Mark Scherer
1c56c723f5 Backport param() access. 2015-06-25 00:52:33 +02:00
Highstrike
8257100f54 How about this? 2015-06-24 15:46:48 +03:00
Highstrike
ef1fc7dfef PHPCS 2015-06-24 15:18:57 +03:00
Highstrike
833c747b41 Test append PR to Issue
This commit fixes #6874
2015-06-24 14:18:14 +03:00
Highstrike
7cdf19363d Tab instead of space
IDE preference
2015-06-24 14:09:32 +03:00
Highstrike
58983f717a 2.7.0-RC Auth doesn't use the new Flash component
Changed 'Flash.' to 'Message.' and also provided backwards compatibility
in FlashHelper->render
2015-06-24 14:06:35 +03:00
Mark Story
0841c04351 Merge pull request #6853 from cakephp/2.6-template
Cleanup method calls.
2015-06-22 10:53:32 -04:00
Mark Scherer
fc57e43a5b Adjust tests. 2015-06-21 12:13:09 +02:00
Humberto Pereira
77150eb6f6 fixed tests cases to print html 2015-06-20 22:19:08 -04:00
Humberto Pereira
26630991a6 CakeShells should not print html in case of a error 2015-06-20 22:19:07 -04:00
Mark Scherer
6e5381a4e3 Cleanup method calls. 2015-06-20 23:27:32 +02:00
mark_story
26b3713bd6 Merge branch '2.7' of github.com:cakephp/cakephp into 2.7 2015-06-20 10:03:24 -04:00
mark_story
664ba53c89 Merge branch '2.6' into 2.7 2015-06-20 10:03:14 -04:00
Mark Scherer
1d03d5bd59 Consolidate template whitespace 2015-06-20 05:10:35 +02:00
mark_story
705f44e30a Fix regression where attributes were created with no whitespace. 2015-06-19 22:00:27 -04:00
Mark Scherer
4025f2fb22 add cast for clarification and to allow int 0. 2015-06-17 12:38:06 +02:00
Mark Scherer
1b81323462 Use strict check 2015-06-17 12:06:56 +02:00
Mark Scherer
7dedf7f86d Refactor cleanly. 2015-06-17 11:38:42 +02:00
Mark Scherer
2d7487d33c img tag needs manual space 2015-06-17 11:34:03 +02:00
Mark Scherer
51d75bc2be Remove overhead whitespace in templates. 2015-06-17 11:04:04 +02:00
Mark Scherer
ccac3b3e06 Allow deep options for radio() just as for select(). 2015-06-16 13:23:51 +02:00
Mark Story
65b64e0348 Merge pull request #6816 from cakephp/2.6-fix-validation-multiple
Fix Validation::multiple() regarding 0 value.
2015-06-15 12:20:13 -04:00
mark_story
97be9b9696 Fix PHPCS errors. 2015-06-15 12:19:20 -04:00
Mark Scherer
86c358f3f9 Fix Validation::multiple() regarding 0 value. 2015-06-15 16:35:27 +02:00
Mark Story
32fe09835b Merge pull request #6809 from ravage84/2.7-code-coverage
Explicit definition of the code coverage
2015-06-15 10:13:12 -04:00
mark_story
c3080873b9 Update version number to 2.7.0-RC 2015-06-14 22:50:05 -04:00
mark_story
947262e754 Fix PHPCS errors. 2015-06-14 21:56:48 -04:00
mark_story
ebb01f0fac Merge branch '2.6' into 2.7 2015-06-14 21:52:53 -04:00
Marc Würth
f3099fefdf Define code coverage explicitly 2015-06-15 00:56:09 +02:00
mark_story
56143c663e Update doc blocks for CakePlugin::load().
Refs #5665
2015-06-11 22:17:18 -04:00
mark_story
c47196fe08 Merge branch '2.6' into 2.7 2015-06-07 15:45:26 -04:00
mark_story
6d60e6a4db Backport 7eec48268ebb6a17656df4a059f9e7b43991472f to 2.x
Backport fixes to base path generation that prevent issue when a URL
contains // it can circumvent the base path generation, which results in
unwanted user data in the base/webroot paths. This creates an
opportunity for CSS manipulation in old versions of IE, and newer ones
via iframe inheritance.
2015-06-07 15:45:16 -04:00
mark_story
0e6fcc02b8 Add/correct some tests for humanize.
The arguments for assertEquals() were backwards. While there are many
more flipped assertions I will change the others separately.
2015-06-05 10:31:29 -04:00
mark_story
239c83938f Fix regression in camelize().
The input should not be lowercased before camelizing, as this can cause
inputs that were previously camelized to create incorrect results.

Refs #6735
2015-06-05 10:20:51 -04:00
mark_story
df0f2295c3 Fix issue with overlapping irregular inflections.
When irregular inflections overlap we should choose the longest match,
not the shortest.

Refs #6659
2015-06-02 23:09:29 -04:00
Mark Scherer
0524eb95ae Documentation update 2015-06-01 16:14:15 +02:00
Mark Scherer
4ad001b9ca Use options array. 2015-06-01 16:12:45 +02:00
Mark Scherer
670d93b6f6 Extract formatTreeList() from generateTreeList(). 2015-06-01 12:36:20 +02:00
Mark Scherer
2a5cbb8037 Add missing static keyword. 2015-05-31 13:40:22 +02:00
mark_story
d7d8b90986 Merge branch '2.6' into 2.7 2015-05-28 19:34:59 -04:00
mark_story
523597df43 Update version number to 2.6.7 2015-05-28 19:30:33 -04:00
mark_story
65691836be Fix syntax errors in PHP <5.4 2015-05-28 17:39:52 -04:00
mark_story
b66c1ce53c Update version number to 2.6.6 2015-05-28 09:50:27 -04:00
mark_story
995d8d22c6 Disable reading XML files and URLs when handling user data.
Allowing users to load arbitrary files/URLs with Xml is not desirable
when handing user input.
2015-05-27 09:45:53 -04:00
mark_story
dddc504f87 Merge branch 'issue-6635' into 2.6
Fixes FormHelper generating invalid ID attributes when multibyte values
are used.
2015-05-26 22:51:13 -04:00
mark_story
733ddc7ff4 Use mb* functions in Inflector humanize/underscore.
Use the mbstring shims we already provide to make Inflector more robust
than it currently is. This solves the invalid ID attribute generation in
a way that never varies between environments.

Refs #6635
2015-05-26 22:51:00 -04:00
Igor Padovan da Silva
bf550d13ce preventing error on trying to delete unexiting buffer 2015-05-26 17:46:08 -04:00
nojimage
c6e4208bda refs #6635 Inflector::underscore, humanize support multibyte string inputs 2015-05-26 13:29:05 +09:00
nojimage
8ebc9cdd87 refs #6635 FormHelper::radio() return collect id attributes with multibyte 2015-05-25 22:10:50 +09:00
mark_story
15f88533e8 Update version number to 2.6.5 2015-05-24 21:01:09 -04:00
mark_story
9626f0e726 Exclude deprecated validators from bake.
Don't include deprecated validators in bake.

Refs #6581
2015-05-22 22:03:32 -04:00
mark_story
4a3b2e2a03 Fix failing test in SQLite.
SQLite does not handle subqueries in virtual fields well. However, the
original issue was that the generated query was invalid which
find(first) will still catch.
2015-05-21 21:58:12 -04:00
mark_story
52a0d642ec Fix incorrectly quoted table aliases in virtual fields.
DboSource::_quoteFields() is already a bit of a mess, and while I'm not
happy about having to add more regex replacement, it seems to be the
only reasonable solution given that the code is already 'parsing' SQL
to apply identifier quoting.

Fixes #6602
2015-05-20 22:40:47 -04:00
Marc Würth
508b9d1443 Rename test methods after notBlank change
Was a left-over from #6579
2015-05-19 15:13:28 +02:00
Mark Scherer
29747995dc Add missing minimizable HTML attributes 2015-05-18 18:10:02 +02:00
Mark Scherer
f742fa51fe Dont include deprecated options for bake 2015-05-17 23:24:23 +02:00
Mark Scherer
4f3602ad5f Adjust bake, docblocks and tests for notBlank. 2015-05-17 22:27:16 +02:00
Mark Scherer
866242643f Deprecate notEmpty in favor of notBlank. 2015-05-17 22:13:04 +02:00
mark_story
6ffc9670d2 Document missing option in loadAll(). 2015-05-13 22:37:52 -04:00
ndm2
323e8d8d76 Add underscore support for multi word irregulars.
Underscore separated words were not catched by the irregular regex,
tests however didn't fail as the default rules matched the tested words
too. The added test should ensure that this won't happen again.

Fixes the gap left by the previous #6538 fix.
2015-05-12 14:33:15 +02:00