diff --git a/README.md b/README.md index 5ebba74..5827e7e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Usage: use Moinax\TvDb\Client; $apiKey = 'YOURAPIKEY'; -$tvdb = new Client("http://thetvdb.com", $apiKey); +$tvdb = new Client("https://thetvdb.com", $apiKey); $tvdb->getSerie(75710); ``` @@ -42,7 +42,7 @@ $apiKey = 'YOURAPIKEY'; $cache = new FilesystemCache(__DIR__ . '/cache'); $httpClient = new CacheClient($cache, $ttl); -$tvdb = new Client("http://thetvdb.com", $apiKey); +$tvdb = new Client("https://thetvdb.com", $apiKey); $tvdb->setHttpClient($httpClient); $tvdb->getSerie(75710); //This request will fetch the resource online. diff --git a/examples/settings.php.dist b/examples/settings.php.dist index b46d35d..89ae364 100644 --- a/examples/settings.php.dist +++ b/examples/settings.php.dist @@ -3,5 +3,5 @@ * Constants defined here outside of class because class constants can't be * the result of any operation (concatenation) */ -define('TVDB_URL', 'http://thetvdb.com'); +define('TVDB_URL', 'https://thetvdb.com'); define('TVDB_API_KEY', ''); diff --git a/src/Moinax/TvDb/Client.php b/src/Moinax/TvDb/Client.php index 789cc05..442d824 100644 --- a/src/Moinax/TvDb/Client.php +++ b/src/Moinax/TvDb/Client.php @@ -445,7 +445,7 @@ protected function getXml($data) } $simpleXml = simplexml_load_string($data); - if (!$simpleXml) { + if ($simpleXml === FALSE) { if (extension_loaded('libxml')) { $xmlErrors = libxml_get_errors(); $errors = array(); @@ -500,7 +500,7 @@ public function getMirror($typeMask = self::MIRROR_TYPE_XML) if (empty($this->mirrors)) { $this->getMirrors(); } - return $this->mirrors[$typeMask][array_rand($this->mirrors[$typeMask], 1)]; + return $this->baseUrl; }