Skip to content

Commit

Permalink
Merge pull request #402 from recurly/fix-verify-uri
Browse files Browse the repository at this point in the history
Fix broken _verifyUri method
  • Loading branch information
bhelx committed Mar 15, 2019
2 parents 06392f7 + 0710076 commit 28d3f15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ private function _getHeaders($headerText)
private function _verifyUri($uri) {
$host = parse_url($uri, PHP_URL_HOST);

// remove the subdomain from $host
if (count(explode('.', $host)) > 2) {
$host = substr($host, strpos($host, ".") + 1);
}

if (!in_array($host, Recurly_Client::$valid_domains))
throw new Recurly_Error("$host is not a valid Recurly domain!");
}
Expand Down

0 comments on commit 28d3f15

Please sign in to comment.