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

Stricter worldpay.com host check #19

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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