From 9ccd299446538575019ad27f78cd1583cc7af337 Mon Sep 17 00:00:00 2001 From: Anagh Padmanabhan Date: Thu, 30 Mar 2017 18:41:33 +0530 Subject: [PATCH] Check if host was split --- src/Quintype/Seo/Base.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Quintype/Seo/Base.php b/src/Quintype/Seo/Base.php index f2b5462..67ca1cd 100644 --- a/src/Quintype/Seo/Base.php +++ b/src/Quintype/Seo/Base.php @@ -112,7 +112,10 @@ protected function getCanonicalUrl(){ protected function getAlternateUrl(){ if(isset($this->config['android-package']) && $this->config['android-package'] !== ''){ $split_host_and_protocol = explode("://", $this->config['sketches-host']); - return $this->config['android-package']. "/" . $split_host_and_protocol[0] . "/" . $split_host_and_protocol[1] . "/" . $this->story['slug']; + if(sizeof($split_host_and_protocol) >= 2){ + return $this->config['android-package']. "/" . $split_host_and_protocol[0] . "/" . $split_host_and_protocol[1] . "/" . $this->story['slug']; + } + return $this->config['sketches-host'] . "/". $this->story['slug']; } return $this->config['sketches-host'] . "/". $this->story['slug']; }