Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from comicrelief/stricter-host-check
Browse files Browse the repository at this point in the history
Stricter worldpay.com host check
  • Loading branch information
NoelLH authored Mar 15, 2018
2 parents 99dab4f + e278729 commit 2c3ed1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Omnipay/WorldpayCGHosted/Message/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ private function originIsValid()
return false;
}

$expectedEnd = 'worldpay.com'; // todo fix me
$expectedEnd = '.worldpay.com';
$expectedPosition = strlen($hostname) - strlen($expectedEnd);

if (strpos($hostname, $expectedEnd) === $expectedPosition) {
if (strpos($hostname, $expectedEnd) === $expectedPosition || $hostname === 'worldpay.com') {
return true;
}

Expand Down

0 comments on commit 2c3ed1f

Please sign in to comment.