From 03ce11a5d52d57a9a469c5f90d6eb147cc185a93 Mon Sep 17 00:00:00 2001 From: Fran Dieguez Date: Tue, 14 Aug 2018 18:04:10 +0200 Subject: [PATCH] Fix error when the url is invalid --- src/Panorama/Video.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Panorama/Video.php b/src/Panorama/Video.php index 8c8bead..6d4fb2a 100644 --- a/src/Panorama/Video.php +++ b/src/Panorama/Video.php @@ -193,7 +193,11 @@ public function camelize($lowerCaseAndUnderscoredWord) */ public static function getDomain($url = '') { - $host = parse_url($url); + $host = parse_url($url); + + if (!array_key_exists('host', $host)) { + throw new \Exception('Video service or Url not supported'); + } $domainParts = preg_split("@\.@", $host['host']); /*