diff --git a/Cmfcmf/OpenWeatherMap.php b/Cmfcmf/OpenWeatherMap.php index bc61686..b0ef85c 100644 --- a/Cmfcmf/OpenWeatherMap.php +++ b/Cmfcmf/OpenWeatherMap.php @@ -584,7 +584,7 @@ private function cacheOrFetchResult($url) $response = $this->httpClient->sendRequest($this->httpRequestFactory->createRequest("GET", $url)); $result = $response->getBody()->getContents(); if ($response->getStatusCode() !== 200) { - if ($result === "{\"message\":\"not found\"}\n" && $response->getStatusCode() === 404) { + if (false !== strpos($result, 'not found') && $response->getStatusCode() === 404) { throw new OWMNotFoundException(); } throw new OWMException('OpenWeatherMap returned a response with status code ' . $response->getStatusCode() . ' and the following content `'. $result . '`');