mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Last code optimization before release.
This commit is contained in:
@@ -26,6 +26,7 @@ use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Log;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class PwndVerifierV2.
|
||||
@@ -64,7 +65,12 @@ class PwndVerifierV2 implements Verifier
|
||||
if (404 === $res->getStatusCode()) {
|
||||
return true;
|
||||
}
|
||||
$strpos = stripos($res->getBody()->getContents(), $rest);
|
||||
try {
|
||||
$strpos = stripos($res->getBody()->getContents(), $rest);
|
||||
} catch (RunTimeException $e) {
|
||||
Log::error(sprintf('Could not get body from Pwnd result: %s', $e->getMessage()));
|
||||
$strpos = false;
|
||||
}
|
||||
if (false === $strpos) {
|
||||
Log::debug(sprintf('%s was not found in result body. Return true.', $rest));
|
||||
|
||||
|
Reference in New Issue
Block a user