Conditions | 8 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | protected function determineTargetUrl(Request $request) |
||
37 | { |
||
38 | if ($this->options['always_use_default_target_path']) { |
||
39 | return $this->options['default_target_path']; |
||
40 | } |
||
41 | |||
42 | if ($targetUrl = ParameterBagUtils::getRequestParameterValue($request, $this->options['target_path_parameter'])) { |
||
43 | return $targetUrl; |
||
44 | } |
||
45 | |||
46 | if (null !== $this->providerKey && $targetUrl = $this->getTargetPath($request->getSession(), $this->providerKey)) { |
||
|
|||
47 | $this->removeTargetPath($request->getSession(), $this->providerKey); |
||
48 | |||
49 | return $targetUrl; |
||
50 | } |
||
51 | |||
52 | if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && parse_url($targetUrl, PHP_URL_PATH) !== parse_url($this->httpUtils->generateUri($request, $this->options['login_path']), PHP_URL_PATH)) { |
||
53 | return $targetUrl; |
||
54 | } |
||
55 | |||
56 | return $this->options['default_target_path']; |
||
57 | } |
||
58 | } |
||
59 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: