From 042fa41665b17e4fce19c33420ea46242482de8a Mon Sep 17 00:00:00 2001 From: Nitemare Date: Mon, 18 Nov 2019 00:47:24 -0400 Subject: [PATCH] Update Client.php Force https:// addresses as api has changed to redirect to https:// and will give 301 errors to http:// requests --- src/Moinax/TvDb/Client.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Moinax/TvDb/Client.php b/src/Moinax/TvDb/Client.php index 789cc05..caa3d25 100644 --- a/src/Moinax/TvDb/Client.php +++ b/src/Moinax/TvDb/Client.php @@ -475,15 +475,16 @@ protected function getMirrors() foreach ($mirrors->Mirror as $mirror) { $typeMask = (int)$mirror->typemask; $mirrorPath = (string)$mirror->mirrorpath; + $secure_mirrorPath = preg_replace("/http\:\/\//i", "https://", $mirrorPath); if ($typeMask & self::MIRROR_TYPE_XML) { - $this->mirrors[self::MIRROR_TYPE_XML][] = $mirrorPath; + $this->mirrors[self::MIRROR_TYPE_XML][] = $secure_mirrorPath; } if ($typeMask & self::MIRROR_TYPE_BANNER) { - $this->mirrors[self::MIRROR_TYPE_BANNER][] = $mirrorPath; + $this->mirrors[self::MIRROR_TYPE_BANNER][] = $secure_mirrorPath; } if ($typeMask & self::MIRROR_TYPE_ZIP) { - $this->mirrors[self::MIRROR_TYPE_ZIP][] = $mirrorPath; + $this->mirrors[self::MIRROR_TYPE_ZIP][] = $secure_mirrorPath; } } }