Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix rate limit check method not working if whois result has trailing …

…spaces
  • Loading branch information...
commit 70272572bdec56952c10997d26ca2edc44c27e09 1 parent e705c30
@lboynton authored
View
2  library/Lboy/Whois/Result/Pir.php
@@ -41,6 +41,6 @@ public function gotWhois()
public function isRateLimitExceeded()
{
- return $this->whois == 'WHOIS LIMIT EXCEEDED';
+ return trim($this->whois) == 'WHOIS LIMIT EXCEEDED';
}
}
View
5 tests/library/Lboy/Whois/Result/PirTest.php
@@ -70,5 +70,10 @@ public function testIsRateLimitExceeded()
$whois = 'WHOIS LIMIT EXCEEDED';
$result = new Lboy_Whois_Result_Pir($whois);
$this->assertTrue($result->isRateLimitExceeded());
+
+ // check it works with spaces
+ $whois = ' WHOIS LIMIT EXCEEDED ';
+ $result = new Lboy_Whois_Result_Pir($whois);
+ $this->assertTrue($result->isRateLimitExceeded());
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.