Skip to content

Commit

Permalink
Merge pull request #127 from Payum/token-factory-fix-absolute-url-han…
Browse files Browse the repository at this point in the history
…dling

[security] GenericTokenFactory did not handle afterPath correctly, when ...
  • Loading branch information
makasim committed Apr 10, 2014
2 parents 6f55f10 + 0f4ebc7 commit 6ba94e7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Security/AbstractGenericTokenFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ public function createToken($paymentName, $model, $targetPath, array $targetPara
$token->setTargetUrl($this->generateUrl($targetPath, $targetParameters));
}

if ($afterPath) {
if ($afterPath && 0 === strpos($afterPath, 'http')) {
if (false !== strpos($afterPath, '?')) {
$afterPath .= '&'.http_build_query($afterParameters);
} else {
$afterPath .= '?'.http_build_query($afterParameters);
}

$token->setAfterUrl($afterPath);
} elseif ($afterPath) {
$token->setAfterUrl($this->generateUrl($afterPath, $afterParameters));
}

Expand Down

0 comments on commit 6ba94e7

Please sign in to comment.