Skip to content

Conversation

linniksa
Copy link
Contributor

@linniksa linniksa commented Sep 5, 2017

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

if (false !== $pos = strpos($targetUrl, '?')) {
$targetUrl = substr($targetUrl, 0, $pos);
}
if ($targetUrl !== $this->httpUtils->generateUri($request, $this->options['login_path'])) {
if (!empty($targetUrl) && $targetUrl !== $this->httpUtils->generateUri($request, $this->options['login_path'])) {
Copy link
Member

@chalasr chalasr Sep 6, 2017

Choose a reason for hiding this comment

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

I would use $targetUrl instead of !empty().

@fabpot
Copy link
Member

fabpot commented Sep 7, 2017

Thank you @linniksa.

fabpot added a commit that referenced this pull request Sep 7, 2017
…nd referer is not set or empty (linniksa)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #24101).

Discussion
----------

[Security] Fix exception when use_referer option is true and referer is not set or empty

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

a29e069 [Security] Fix exception when use_referer option is true and referer is not set or empty
@fabpot fabpot closed this Sep 7, 2017
@linniksa linniksa deleted the patch-referrer branch September 7, 2017 18:04
@fabpot fabpot mentioned this pull request Sep 11, 2017
This was referenced Oct 5, 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.

4 participants