Commit Graph

3717 Commits

Author SHA1 Message Date
Alexander M. Turek
07c4773d98 CS: Apply ternary_to_null_coalescing fixer 2020-12-27 00:49:32 +01:00
Nicolas Grekas
cda81ccccd [HttpFoundation] keep turning dots to underscores when using Request::create() 2020-12-18 11:00:10 +01:00
Fabien Potencier
9e87661911 Merge branch '5.1' into 5.2
* 5.1:
  Remove :void in test function signatures
2020-12-18 09:03:05 +01:00
Fabien Potencier
090b4256f0 Merge branch '4.4' into 5.1
* 4.4:
  Remove :void in test function signatures
2020-12-18 09:02:46 +01:00
Fabien Potencier
47fcf4ad5a Remove :void in test function signatures 2020-12-18 08:41:31 +01:00
Jérémy Derussé
25a8a0a81b
Fix CS in Changelogs in 5.2 2020-12-10 21:03:43 +01:00
Nicolas Grekas
555697df61 Merge branch '5.1' into 5.2
* 5.1:
  Update .php_cs.dist
  Apply "visibility_required" CS rule to constants
2020-12-08 18:03:37 +01:00
Nicolas Grekas
a8b992f8a2 Merge branch '4.4' into 5.1
* 4.4:
  Update .php_cs.dist
  Apply "visibility_required" CS rule to constants
2020-12-08 18:02:38 +01:00
Nicolas Grekas
ff22d30cb0 Apply "visibility_required" CS rule to constants
php-cs-fixer fix --rules='{"visibility_required": ["property", "method", "const"]}'
2020-12-08 17:59:59 +01:00
Nicolas Grekas
f37f56c1bb Merge branch '5.1' into 5.2
* 5.1:
  minor cs fix
  [Config][TwigBundle] Fixed syntax error in config
  [DI] Fix Xdebug 3.0 detection
  Use php8 stable
  [Notifier] Streamline changelogs of notifier bridges
  [Cache] fix checking for redis_sentinel support
  [Messenger] Fixed wording in php doc
  [Intl] Update the ICU data to 68.1
  [FrameworkBundle] acces public-deprecated services via the private container to remove false-positive deprecations
  Remove unused @throws tags and handling of never thrown exceptions
  [PhpUnitBridge] Fix disabling DeprecationErrorHandler from phpunit configuration file
2020-12-08 17:43:38 +01:00
Nicolas Grekas
a2f073472f Merge branch '4.4' into 5.1
* 4.4:
  minor cs fix
  [Config][TwigBundle] Fixed syntax error in config
  [DI] Fix Xdebug 3.0 detection
  Use php8 stable
  [Cache] fix checking for redis_sentinel support
  [Intl] Update the ICU data to 68.1
  Remove unused @throws tags and handling of never thrown exceptions
  [PhpUnitBridge] Fix disabling DeprecationErrorHandler from phpunit configuration file
2020-12-08 17:43:25 +01:00
Nicolas Grekas
1ea5a8c3ce minor #39246 [HttpFoundation] Throws cleanup (kick-the-bucket)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Throws cleanup

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

The actual throw statements have been removed years ago, but the annotations stayed.
Such annotations fool static analysis tools to trigger false positives for unhandled exceptions.

Commits
-------

8b9b62048c Remove unused @throws tags and handling of never thrown exceptions
2020-12-08 12:12:36 +01:00
Nicolas Grekas
5f08c617cd bug #39298 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0 (wickex)
This PR was merged into the 5.2 branch.

Discussion
----------

[Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39280
| License       | MIT

Currently, deleting cache keys is broken for users using PhpRedis with Redis-server < 4.0.0. The current implementation expects PhpRedis to throw an exception if the 'unlink'-function is used but unavailable, after which it's supposed to switch to using the 'del'-function. Using the 'unlink'-function on lower Redis-server versions seems to not throw an exception, but instead it appears to silently fail.

This pull request changes this behavior and checks the Redis-server version instead. If the version is 4.0 or higher, it uses the unlink function. If not, it uses the del-function.

Also see https://redis.io/commands/unlink > "Available since 4.0.0".

(Footnote: this is one of my first times contributing to an open-source project and my first time contributing to Symfony. I've tried following the guidelines, but please let me know if I missed anything. I'm unsure how I would go about unit testing this specific bugfix due to it being dependent on the Redis version, so I omitted it. Please let me know if a unit test is indeed required for this and if so, let me know if you have any suggestions on how to go about that.)

Commits
-------

9363f3b973 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0
2020-12-08 12:05:08 +01:00
Wickex
9363f3b973 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0 2020-12-08 12:04:54 +01:00
Fabien Potencier
fd34c9c22f bug #39358 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery() (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39307
| License       | MIT
| Doc PR        | -

Same as #39357 for 5.2

Commits
-------

8682bdc521 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery()
2020-12-08 08:08:22 +01:00
Alexander M. Turek
cd3993ee88 Merge branch '5.1' into 5.2
* 5.1:
  [HttpFoundation] Removed obsolete test.
  [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
  [Security][Validator] Add missing Portuguese translations
  Add Croatian (hr) translations
2020-12-07 23:32:31 +01:00
Alexander M. Turek
2807a7950d [HttpFoundation] Removed obsolete test. 2020-12-07 23:31:01 +01:00
Alexander M. Turek
f8b9ee9333 Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
  [Security][Validator] Add missing Portuguese translations
  Add Croatian (hr) translations
2020-12-07 23:18:25 +01:00
Alexander M. Turek
306914a96d bug #39271 [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given (sidz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This PR fixes the type error when user set `null` as data in the `new JsonResponse(null, 200, [], true)` and true in the fourth argument to mark that value is json.
```
TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\JsonResponse::setJson() must be of the type string, object given, called in /home/projects/symfony/src/Symfony/Component/HttpFoundation/JsonResponse.php on line 52
```

Commits
-------

7fcba9611d [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
2020-12-07 23:02:04 +01:00
Oleg Zhulnev
7fcba9611d [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given 2020-12-07 23:01:57 +01:00
Nicolas Grekas
8682bdc521 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery() 2020-12-07 13:06:47 +01:00
Alexander M. Turek
72abcc3051 Merge branch '5.1' into 5.2
* 5.1:
  [HttpFoundation] Make test pass without Xdebug.
  [Mime] Leverage PHP 8's detection of CSV files.
  [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests.
  [FrameworkBundle] TextDescriptor::formatControllerLink checked method…
  Fix CS
  [HttpClient] throw clearer error when no scheme is provided
  Fix github pr template and include 5.2 for bugfixes
  [HttpFoundation] Ignore stack trace printed by Xdebug 3.
  fix lexing backslashes in single quoted strings
2020-12-05 11:51:53 +01:00
Alexander M. Turek
2cf0686f72 Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] Make test pass without Xdebug.
  [Mime] Leverage PHP 8's detection of CSV files.
  [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests.
  [FrameworkBundle] TextDescriptor::formatControllerLink checked method…
  Fix CS
  [HttpClient] throw clearer error when no scheme is provided
  Fix github pr template and include 5.2 for bugfixes
  [HttpFoundation] Ignore stack trace printed by Xdebug 3.
  fix lexing backslashes in single quoted strings
2020-12-05 11:32:07 +01:00
Alexander M. Turek
cf94f2a591 [HttpFoundation] Make test pass without Xdebug. 2020-12-05 09:52:36 +01:00
Alexander M. Turek
9208c69b21 [HttpFoundation] Make sure we reuse the current PHP binary for the webserver process in functional tests. 2020-12-05 09:17:15 +01:00
Fabien Potencier
07781474bc Fix @experimental annotations 2020-12-05 07:51:44 +01:00
Alexander M. Turek
b67baa4e7f [HttpFoundation] Ignore stack trace printed by Xdebug 3. 2020-12-04 13:53:59 +01:00
kick-the-bucket
8b9b62048c Remove unused @throws tags and handling of never thrown exceptions 2020-12-02 16:16:03 +01:00
Fabien Potencier
7378b0b836 feature #39128 [HttpFoundation] Deprecate BinaryFileResponse::create() (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[HttpFoundation] Deprecate BinaryFileResponse::create()

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Follows #34771. We've deprecated the static `::create()` methods on all response classes but `BinaryFileResponse`. This PR proposes to fix this inconsistency.

Commits
-------

9ce2e86207 [HttpFoundation] Deprecate BinaryFileResponse::create().
2020-11-27 07:13:25 +01:00
Anderson Müller
4c6f4c7b9c
[HttpFoundation] Typo on deprecation package name 2020-11-20 18:25:36 +01:00
Alexander M. Turek
9ce2e86207 [HttpFoundation] Deprecate BinaryFileResponse::create(). 2020-11-20 16:47:02 +01:00
Alexander M. Turek
5a9a7be6e5 Merge branch '5.1' into 5.2
* 5.1:
  remove unreachable code
  Update ExceptionEvent.php
  fix firebase transport factory DI tag type
  [HttpFoundation] Fix for virtualhosts based on URL path
2020-11-16 00:02:13 +01:00
Alexander M. Turek
a71bce881a Merge branch '4.4' into 5.1 2020-11-15 23:55:04 +01:00
Michael Voříšek
75ff86811f [HttpFoundation] Fix for virtualhosts based on URL path 2020-11-03 12:58:18 +01:00
Jérémy Derussé
7cf4dd6917
Deprecate HEADER_X_FORWARDED_ALL constant 2020-11-02 17:16:33 +01:00
Alexander M. Turek
8bac7a0b5e Merge branch '5.1' into 5.x 2020-11-01 17:14:45 +01:00
Alexander M. Turek
fd4cdba551 Merge branch '4.4' into 5.1 2020-11-01 16:43:26 +01:00
Alexander M. Turek
43ce6dfe44 Set constant visibility in tests to private where possible. 2020-10-31 23:44:29 +01:00
Alexander M. Turek
176f52d630 feature #38859 [HttpFoundation] Deprecate not passing a Closure together with FILTER_CALLBACK to ParameterBag::filter() (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Deprecate not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()`

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

Using `filter_var()` with a configurable flag is risky, because of the `FILTER_CALLBACK` flag.
Restricting the type of callable that is accepted here mitigates the risk.
We did the same in Twig: https://github.com/twigphp/Twig/pull/3308

Commits
-------

d6aea288e7 [HttpFoundation] Deprecate not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()`
2020-10-30 18:01:43 +01:00
Nicolas Grekas
d6aea288e7 [HttpFoundation] Deprecate not passing a Closure together with FILTER_CALLBACK to ParameterBag::filter() 2020-10-30 17:07:47 +01:00
Alexander M. Turek
6b1b12f40e Merge branch '5.1' into 5.x 2020-10-30 16:18:47 +01:00
Alexander M. Turek
41311a9b4a Merge branch '4.4' into 5.1 2020-10-30 16:09:42 +01:00
Alexander M. Turek
b9ca866bdd Remove Symfony 3 compatibility code. 2020-10-30 15:21:36 +01:00
Alexander M. Turek
0fee41a617 Merge branch '5.1' into 5.x 2020-10-28 22:46:03 +01:00
Alexander M. Turek
294cffea25 Merge branch '4.4' into 5.1 2020-10-28 22:31:18 +01:00
Alexander M. Turek
659decf594 Use short array deconstruction syntax. 2020-10-28 21:42:29 +01:00
Fabien Potencier
fc615e9845 feature #38664 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace (Nyholm)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[RateLimiter] Moved classes implementing LimiterInterface to a new namespace

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no?
| Tickets       |
| License       | MIT
| Doc PR        |

Before we release the RateLimit component.
I think it would be a good idea to put the 7 classes that belongs to a specific strategy in their own "Policy" namespace. It is very likely that it will be more strategies in the future and the `Symfony\Component\RateLimiter` namespace is crowed as it is.

I decided not to put the `CompoundLimiter` in this namespace as it is not a strategy.

Commits
-------

1e6cea56e4 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace
2020-10-25 09:35:39 +01:00
Nyholm
1e6cea56e4 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace 2020-10-25 09:35:33 +01:00
Nicolas Grekas
605a5674a8 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  fix merge
  Remove branch-version (keep them for contracts only)
  [HttpClient] relax auth bearer format requirements
  [PHPUnitBridge] Silence errors from mkdir()
  [DependencyInjection] Preload classes with union types correctly.
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  [TwigBridge] Remove "transchoice" from the code base
  Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
  Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
  [String] fix before/after[Last]() returning the empty string instead of the original one on non-match
  Add missing exporter function for PHPUnit 7
  [Validator] Add missing romanian translations
  [String] fix slicing in UnicodeString
  [Cache] Use correct expiry in ChainAdapter
  do not translate null placeholders or titles
2020-10-24 14:08:07 +02:00
Nicolas Grekas
65f2620bc4 Merge branch '4.4' into 5.1
* 4.4:
  fix merge
  Remove branch-version (keep them for contracts only)
  [HttpClient] relax auth bearer format requirements
  [PHPUnitBridge] Silence errors from mkdir()
  [DependencyInjection] Preload classes with union types correctly.
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
  Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
  Add missing exporter function for PHPUnit 7
  [Validator] Add missing romanian translations
  [Cache] Use correct expiry in ChainAdapter
  do not translate null placeholders or titles
2020-10-24 14:01:57 +02:00
Nicolas Grekas
77aa17401d Merge branch '3.4' into 4.4
* 3.4:
  Remove branch-version (keep them for contracts only)
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  [Validator] Add missing romanian translations
  do not translate null placeholders or titles
2020-10-24 13:50:19 +02:00
Nicolas Grekas
f8fe4bf9f5 Remove branch-version (keep them for contracts only) 2020-10-24 12:57:07 +02:00
Alexander M. Turek
e6417384d2 Merge branch '5.1' into 5.x 2020-10-20 22:28:53 +02:00
Alexander M. Turek
1c6380f333 Merge branch '4.4' into 5.1 2020-10-20 22:28:16 +02:00
Nicolas Grekas
c8c227f43f Merge branch '3.4' into 4.4
* 3.4:
  [Form] Sync translations
  Added dutch translations for new invalid messages
  Don't skip Doctrine tests on php 8.
  Bump APCu to 5.1.19 on Travis.
  [WebProfilerBundle] Hide debug toolbar in print view
  indexBy does not refer to attributes, but to column names
  Fix Reflection file name with eval()\'d code
  [HttpFoundation] Fix Range Requests
2020-10-20 13:58:22 +02:00
Kevin Bond
c5361cfc58 [RateLimiter] rename Limit to RateLimit and add RateLimit::getLimit() 2020-10-20 08:15:14 +02:00
Kevin Bond
a246894a00
fix RequestRateLimiterInterface::reset() 2020-10-18 18:14:51 -04:00
Fabien Potencier
89dddd1770 bug #38516 [HttpFoundation] Fix Range Requests (BattleRattle)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Fix Range Requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #38295
| License       | MIT
| Doc PR        |

This PR fixes some deviations from [RFC 7233](https://tools.ietf.org/html/rfc7233) for handling range requests, mentioned in #38295.

- overlapping ranges are now satisfiable (e.g. when requested range end is larger than the file size)
- range units other than `bytes` will get ignored
- range requests for methods other than `GET` will be ignored

I did not manage yet to implement the support for multiple ranges, but also don't know, if that's needed here.

Commits
-------

681804ba1a [HttpFoundation] Fix Range Requests
2020-10-14 19:31:51 +02:00
Nicolas Grekas
ffbb9883bd Merge branch '5.1' into 5.x
* 5.1:
  [Contracts] add branch-aliases for dev-main
  [Cache] Make Redis initializers static
  [Messenger] Fixed typos in Connection
  [CI] Fixed build on AppVeyor
  Fix tests typo
  [Lock] Reset Key lifetime time before we acquire it
  [CI] Silence errors when remove file/dir on test tearDown()
  Fix tests
  Remove content-type check on toArray methods
2020-10-14 19:08:19 +02:00
Norman Soetbeer
681804ba1a [HttpFoundation] Fix Range Requests 2020-10-14 18:38:26 +02:00
Nyholm
0c08432a3d [CI] Fixed build on AppVeyor 2020-10-14 11:34:34 +02:00
Fabien Potencier
9982713327 Merge branch '3.4' into 4.4
* 3.4:
  [CI] Silence errors when remove file/dir on test tearDown()
2020-10-14 11:30:35 +02:00
Nyholm
efef41faa1
[CI] Silence errors when remove file/dir on test tearDown() 2020-10-14 09:00:24 +02:00
Nicolas Grekas
01b064d97a Merge branch '5.1' into 5.x
* 5.1:
  Fix branch-version
2020-10-13 15:22:54 +02:00
Nicolas Grekas
1a0ea4d2f7 Merge branch '4.4' into 5.1
* 4.4:
  Fix branch-version
2020-10-13 15:21:37 +02:00
Nicolas Grekas
58f803f356 Merge branch '3.4' into 4.4
* 3.4:
  Fix branch-version
2020-10-13 15:20:53 +02:00
Nicolas Grekas
44a7e3e920 Fix branch-version 2020-10-13 15:20:16 +02:00
Nicolas Grekas
7f0015ee35 Merge branch '5.1' into 5.x
* 5.1:
  Remove "version" from composer.json files, use "branch-version" instead
  [String] fix "is too large" ValueError on PHP 8
2020-10-13 14:43:06 +02:00
Nicolas Grekas
23ab908213 Merge branch '4.4' into 5.1
* 4.4:
  Remove "version" from composer.json files, use "branch-version" instead
2020-10-13 14:35:38 +02:00
Nicolas Grekas
e953dd3e0d Merge branch '3.4' into 4.4
* 3.4:
  Remove "version" from composer.json files, use "branch-version" instead
2020-10-13 14:30:56 +02:00
Nicolas Grekas
f9ed6940fd Remove "version" from composer.json files, use "branch-version" instead 2020-10-13 14:21:16 +02:00
Nicolas Grekas
6066462be2 Merge branch '5.1' into 5.x
* 5.1:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:53:16 +02:00
Nicolas Grekas
3e492d6e5d Merge branch '4.4' into 5.1
* 4.4:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:50:31 +02:00
Nicolas Grekas
55396f90a3 Merge branch '3.4' into 4.4
* 3.4:
  Update versions in composer.json
2020-10-06 17:45:41 +02:00
Nicolas Grekas
8f714a2fd6 Update versions in composer.json 2020-10-06 17:25:25 +02:00
Nicolas Grekas
11c4f28137 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 14:00:29 +02:00
Nicolas Grekas
097c8c6f27 Merge branch '4.4' into 5.1
* 4.4:
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 13:49:34 +02:00
Nicolas Grekas
e553f424d0 Merge branch '3.4' into 4.4
* 3.4:
  Remove "branch-alias", populate "version"
2020-10-06 13:41:17 +02:00
Nicolas Grekas
9d40c796c4 Remove "branch-alias", populate "version" 2020-10-06 13:22:52 +02:00
Fabien Potencier
5e808b59ec Merge branch '4.4' into 5.1
* 4.4:
  Change test
2020-10-04 18:35:53 +02:00
Fabien Potencier
20969e604b Merge branch '3.4' into 4.4
* 3.4:
  Change test
2020-10-04 18:35:43 +02:00
Fabien Potencier
bfcf65f61c Change test 2020-10-04 18:34:28 +02:00
Fabien Potencier
dfcde5b409 feature #38369 [HttpFoundation] Expired cookies string representation consistency & tests (iquito)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Expired cookies string representation consistency & tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

These changes add consistent behavior when converting expired cookies back and forth from string representation into `Symfony\Component\HttpFoundation\Cookie` instances in `Cookie::fromString`:

- When `Max-Age` is zero and `expires` is in the past, the `expires` date is kept as is (previous behavior: `expires` is overwritten with current timestamp because it is reset to current timestamp + `Max-Age`)
- When `Max-Age` is zero and `expires` is in the future, expires is reset to current timestamp, as `Max-Age` is the preferred "source of truth" (same as previous behavior)
- Add tests for how the Cookie class handles `Max-Age` in a cookie string and how `expires` and `Max-Age` interact
- Extract helper function `expiresTimestamp` so converting to a unix timestamp can be reused in `Cookie::fromString`

This is more a new feature than a bug fix in my mind, therefore I would include it in 5.1+.

Commits
-------

4f5d5eceb0 [HttpFoundation] Expired cookies string representation consistency & tests
2020-10-04 10:45:41 +02:00
Andreas
4f5d5eceb0 [HttpFoundation] Expired cookies string representation consistency & tests 2020-10-04 10:45:35 +02:00
Fabien Potencier
89adb2133b [Mime] Prefer .jpg instead of .jpeg 2020-10-04 10:36:21 +02:00
Graham Campbell
8b291a49a6
Remove array return type from Request::toArray() 2020-10-03 23:39:59 +01:00
Nyholm
83c1a2666d [HttpFoundation] Add Request::toArray() for JSON content 2020-10-03 08:13:56 +02:00
Wouter de Jong
5d03afea99 Added request rate limiters and improved login throttling
This allows limiting on different elements of a request. This is usefull to
e.g. prevent breadth-first attacks, by allowing to enforce a limit on both IP
and IP+username.
2020-09-30 21:18:40 +02:00
Nicolas Grekas
6349a1b2fc Merge branch '5.1'
* 5.1:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:15:50 +02:00
Nicolas Grekas
66758ad5dc Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:14:57 +02:00
Nicolas Grekas
cbb0b1d54b Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:14:06 +02:00
Nicolas Grekas
feaa9a6b2a [HttpFoundation] skip tests when the IANA server is throttling the list of status codes 2020-09-27 16:13:16 +02:00
Jonas Hünig
91a44524ff [HttpFoundation][Cache][Messenger] Replace redis "DEL" commands with "UNLINK" 2020-09-27 12:41:29 +02:00
Fabien Potencier
3b1ab7bfac Merge branch '5.1'
* 5.1:
  Internal classes are not legacy.
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:01:37 +02:00
Fabien Potencier
9fae49fb20 Merge branch '4.4' into 5.1
* 4.4:
  Internal classes are not legacy.
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:01:27 +02:00
Fabien Potencier
f2e7158bc0 Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:00:26 +02:00
Alexander M. Turek
d6d9b2927d [HttpFoundation] Skip the cookie_max_age fixture on PHP 8. 2020-09-12 22:41:00 +02:00
Zmey
0412e91060 [SecurityBundle] Comma separated ips for security.access_control 2020-09-12 07:06:09 +02:00
Christian Flothmann
1bdae34365 Merge branch '5.1' into master
* 5.1:
  [Intl] promote warnings to value errors on PHP 8
  Fix CS
  DateTime validator support for trailing data
  Remove some leftover for HHVM support
  Simplify code
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 14:41:49 +02:00
Christian Flothmann
41cb27beb0 Merge branch '4.4' into 5.1
* 4.4:
  [Intl] promote warnings to value errors on PHP 8
  Fix CS
  DateTime validator support for trailing data
  Remove some leftover for HHVM support
  Simplify code
  Fix tests on 5.6
  [Debug] Skip a test that was meant for HHVM.
  [Console] Silence warnings on sapi_windows_cp_set() call
  guard $argv + $token against null, preventing unnecessary exceptions
2020-09-09 10:28:14 +02:00