Commit graph

3031 commits

Author SHA1 Message Date
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
mark_story
c1b2b560bb Fix typo. 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
1da79080ac Updated bake templates to use CakeRequest::allowMethod() 2014-02-10 17:56:57 +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
euromark
a02ab67521 unify exception and error handling. 2014-01-03 12:42:52 +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
Mark Story
1cb7e4f0ff Merge pull request #1635 from dereuromark/master-dom-ids
Fix duplicate ID generation of for multiple checkboxes.
2013-12-24 07:02:38 -08:00
euromark
b392254c92 fix cs 2013-12-24 15:20:32 +01:00
mark_story
99e4dbd827 Merge branch 'master' into 2.5 2013-12-23 11:58:07 -05:00
mark_story
70530135d6 Don't use FORWARDED_HOST when getting referer values.
HTTP_X_FORWARDED_HOST is supposed to be used by proxies to indicate the
original HTTP_HOST value. It has nothing to do with referer values.

Since the HTTP_X_FORWARDED_HOST is intended to replace the HOST header
in proxied setups, add a trustProxy parameter to host() and default it
to false. This maintains existing behavior and allows people to access
the proxied value.

Fixes #2537
2013-12-23 11:32:14 -05:00
mark_story
62e89734ab Throw exceptions from Hash::combine()
When the key + value counts do not match Hash should throw an exception.
Silently doing the wrong thing is generally not a good idea. While this
change could break existing applications, those applications were
probably behaving incorrectly anyways.

Fixes #2470
2013-12-21 17:46:05 -05:00
José Lorenzo Rodríguez
60d2ece035 Merge pull request #2506 from dereuromark/2.5-string
Correct tokenize for empty strings.
2013-12-21 10:31:52 -08:00
mark_story
7e5c0f7185 Merge branch 'master' into 2.5 2013-12-20 14:15:35 -05:00
mark_story
5bddc477a3 Fix incorrectly handled time values around 12:00:00
When using 12 hour formats & intervals, values around 12:00 were
incorrecly converted to midnight.

Fixes #2507
2013-12-19 17:36:27 -05:00
euromark
3ecce19732 Correct tokenize for empty strings. 2013-12-19 15:58:08 +01:00
Saleh Souzanchi
bbbf3076ab undo remove end line break 2013-12-19 00:36:20 +03:30
OKINAKA Kenshin
3433e10fbd Fix Postgres for bigint primary key. 2013-12-18 14:58:18 +09:00
Saleh Souzanchi
4639d3597c add DispatcherFilter Settings 2013-12-18 06:54:27 +03:30
ADmad
49a9d24ca7 By default use filter_var() to valid email addresses in CakeEmail.
Refs #2477
2013-12-18 01:07:40 +05:30
mark_story
30e139412d Fix input type inference when type=>checkbox
FormHelper should not infer types when the explicit type is checkbox.
Instead the provided type should be used.

Fixes #2491
2013-12-16 23:26:20 -05:00
ADmad
27979286b2 Revert change done in 11f543f1f2.
The change is unneeded now as Security::encrypt() no longer throws exception
for falsey values.
2013-12-15 20:29:41 +05:30
ADmad
8a666fb37e Don't throw exception when trying to encrypt falsey value. 2013-12-15 19:28:56 +05:30
mark_story
e15d1652ed Relax the 'my' and 'ym' date validation formats.
All other formats that include 'y' allow 2006 or 06. These formats are
now conformant with the other formats available.

Closes #2436
2013-12-14 23:02:12 -05:00
Mark Story
bf96ea36d9 Merge pull request #2482 from zoghal/2.5-cookie-fix2
fix CookieComponent - when write null or empty string
2013-12-14 16:21:58 -08:00
mark_story
c2b8778ce8 Merge branch 'master' into 2.5 2013-12-14 17:45:49 -05:00
Saleh Souzanchi
11f543f1f2 fix CookieComponent - when write null or empty string 2013-12-15 02:15:36 +03:30
Mark Story
384c3a815d Merge pull request #2350 from tuffz/formatting_app_uses_blocks
formatting app::uses blocks
2013-12-14 12:37:02 -08:00
mark_story
79701af501 Make Hash::numeric() accept more numeric things.
Negative numbers and other stringy forms of numbers should be accepted.
The name Hash::numeric implies is_numeric which it now uses.

Fixes #2478
2013-12-12 17:41:38 -05:00
Jose Lorenzo Rodriguez
fc6edf4d9c Fixed small coding standard error 2013-12-12 09:07:00 +01:00
mark_story
3b867a048e Add test for saveMany + validate=false.
Closes #2468
2013-12-11 12:43:18 -05:00
Mark Story
a2f043d2a3 Merge pull request #2445 from young-steveo/2.5
CakeFixtureManager::load now calls CakeTestFixture::truncate
2013-12-09 09:23:02 -08:00
mark_story
2a58e529b7 Merge branch 'glorand-master'
Fix Hash::extract() operating on non-array data.

Closes #2433
2013-12-09 12:17:36 -05:00
mark_story
edcfe2d3a8 Add tests for #2433 2013-12-09 12:17:25 -05:00
José Lorenzo Rodríguez
6358741944 Merge pull request #2449 from cakephp/fix-session-cyclic-error
Fixed error in CakeSession that would call start() in an infinite loop
2013-12-09 02:18:21 -08:00
mark_story
48d2618c62 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Routing/Router.php
2013-12-08 21:25:59 -05:00
mark_story
abf4af14a8 Change quotes to keep postgres happy. 2013-12-08 11:58:26 -05:00
mark_story
530c95725f Attempt to fix errors with postgres tests. 2013-12-08 11:46:17 -05:00
Jose Lorenzo Rodriguez
3a2c497206 Fixed failing test 2013-12-08 14:08:57 +01:00
Rachman Chavik
98e645a1ea Add test to prove issues with deleteAll with $order set 2013-12-08 16:39:56 +07:00
Jose Lorenzo Rodriguez
848a0ce217 Fiexed error in CakeSession that would call start() in an infinite loop
when the session is marked as invalid
2013-12-07 22:25:33 +01:00
Stephen Young
8645e05ab1 Removed leading underscores from ReflectionProperty variables in test case 2013-12-07 12:10:03 -05:00
Stephen Young
f0036b3ebc CakeFixtureManager::load now calls CakeTestFixture::truncate 2013-12-07 09:47:06 -05:00
ADmad
738d0e2277 Fixed edge case which allowed login with empty password.
Ensure skipping call to FormAuthenticate::_checkFields() does not allow
logging in with empty password. Closes #2441.
2013-12-07 18:40:08 +05:30
Brian Porter
bfdc41e8bb Baked test methods are marked incomplete.
Previously empty (and "passing") test methods now include PHPunit's `markTestIncomplete()` to better reflect the truth of the resulting file: The test methods are stubbed out, but are not yet complete and passing.

It is much easier when _running_ tests to locate incomplete test methods.

Fixes 2437.
2013-12-05 22:54:26 -06:00
mark_story
85a9132c9b Append / to the start/end of the mapResources prefix.
This makes the method easier to use and less error prone.

Fixes #2431
2013-12-04 21:46:59 -05:00
euromark
8ebf004450 Also make DOM ids for radio element values unique. 2013-12-04 02:14:08 +01:00
euromark
587a04ab84 prevent possible XSS attack via form helper selects and unescaped output. 2013-12-04 01:51:39 +01:00
euromark
aae0f762dd Collision free approach to resolve the DOM ID issue in a clean way. Fix to generation of ids for multiple checkboxes. Resolves ticket 4064. 2013-12-04 01:30:57 +01:00
ADmad
f3900e89fd Fixed bug where deleteAll tried to delete same id multiple times.
Ensure find done in deleteAll only returns distinct ids. A wacky
combination of association and conditions can sometimes generate
multiple rows per id.
2013-12-03 22:18:17 +05:30
mark_story
8578708e76 Merge branch 'master' into 2.5 2013-12-01 21:37:37 -05:00
ADmad
c72def4840 Moved exception throwing to after paging info it set for request.
This fixes the regression caused in 2096d3f632. When catching exception
thrown by PaginatorComponent::paginate() in controller, developer again
has access to paging info in request object.

Closes #2402
2013-11-30 19:00:08 +05:30
mark_story
a9ca1bdc58 Add tests and fix other cases where autoLinkEmail would fail.
Refs #2403
2013-11-29 22:57:43 -05:00
mark_story
bbe4c659aa Add tests for TextHelper::autoLink()
Add tests for email addresses embedded in urls.

Refs #2403
2013-11-29 21:57:08 -05:00
mark_story
97ab2c0e9b Merge branch 'imsamurai-2.5' into 2.5
Add unsigned integer support to MySQL. Unsigned integers have not been
added to other databases as they either do not support them (postgres,
sqlserver) or they are 'faked' and don't do anything (sqlite).

Fixes #2321
2013-11-27 20:12:28 -05:00