Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpFoundation] add back support for legacy constant values #23074

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 5, 2017

Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Due to the data type change of the Request::HEADER_ constants in Symfony 3.3 #23067 introduced a small BC break if someone used the old constant values statically instead of referring to the constants themselves.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 6, 2017

I'm not sure we should go that far in BC, especially since this is non serializable data (since we're talking about consts used in static props only.)
I'd suggest to wait for an actual bug report before adding this, if any.

@xabbuh
Copy link
Member Author

xabbuh commented Jun 6, 2017

The thing is we even advised to use these strings in the previous docblocks of getClientIp(), getPort(), isSecure() and getHost().

@@ -672,7 +672,17 @@ public static function setTrustedHeaderName($key, $value)
{
@trigger_error(sprintf('The "%s()" method is deprecated since version 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED);

if (!array_key_exists($key, self::$trustedHeaders)) {
if ('forwared' === $key) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forwarded ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed

@@ -672,7 +672,17 @@ public static function setTrustedHeaderName($key, $value)
{
@trigger_error(sprintf('The "%s()" method is deprecated since version 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED);

if (!array_key_exists($key, self::$trustedHeaders)) {
if ('forwared' === $key) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed

@fabpot
Copy link
Member

fabpot commented Jun 14, 2017

Thank you @xabbuh.

@fabpot fabpot merged commit fddd754 into symfony:3.3 Jun 14, 2017
fabpot added a commit that referenced this pull request Jun 14, 2017
…es (xabbuh)

This PR was merged into the 3.3 branch.

Discussion
----------

[HttpFoundation] add back support for legacy constant values

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Due to the data type change of the `Request::HEADER_` constants in Symfony 3.3 #23067 introduced a small BC break if someone used the old constant values statically instead of referring to the constants themselves.

Commits
-------

fddd754 add back support for legacy constant values
@xabbuh xabbuh deleted the pr-23067 branch June 14, 2017 20:59
@fabpot fabpot mentioned this pull request Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants