From 773b2af73ca3d3ee2bd2830048a720a8b808947c Mon Sep 17 00:00:00 2001 From: Ahmad Abdo Date: Sun, 13 Jan 2019 21:29:03 -0800 Subject: [PATCH 1/4] fixes video sitemap title --- src/Item/Video/VideoItemValidator.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Item/Video/VideoItemValidator.php b/src/Item/Video/VideoItemValidator.php index fbc2f1f..7498fed 100644 --- a/src/Item/Video/VideoItemValidator.php +++ b/src/Item/Video/VideoItemValidator.php @@ -65,11 +65,16 @@ public function validateThumbnailLoc($loc) /** * @param $title * - * @return bool + * @return string|false */ public function validateTitle($title) { - return self::validateString($title) && \strlen($title) < 97; + $length = \mb_strlen($title, 'UTF-8'); + if ($length > 0 && $length < 97) { + return self::validateString($title); + } + + return false; } /** From ac1477a557e9b5ae1e07c9bccf9f1b5f576fe646 Mon Sep 17 00:00:00 2001 From: Ahmad Abdo Date: Thu, 7 Feb 2019 15:07:26 -0800 Subject: [PATCH 2/4] makes player_loc optional --- src/Item/Video/VideoItem.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Item/Video/VideoItem.php b/src/Item/Video/VideoItem.php index 55bd9e3..f3112be 100644 --- a/src/Item/Video/VideoItem.php +++ b/src/Item/Video/VideoItem.php @@ -131,12 +131,14 @@ protected function setContentLoc($loc) */ protected function setPlayerLoc($loc, $playerEmbedded, $playerAutoPlay) { - self::$xml['player_loc'] = VideoItemPlayerTags::setPlayerLoc( - $this->validator, - $loc, - $playerEmbedded, - $playerAutoPlay - ); + if ($loc) { + self::$xml['player_loc'] = VideoItemPlayerTags::setPlayerLoc( + $this->validator, + $loc, + $playerEmbedded, + $playerAutoPlay + ); + } return $this; } From 933c40fd8393eecf3c5b78d08b1fdb96cbce91c3 Mon Sep 17 00:00:00 2001 From: Ahmad Abdo Date: Thu, 7 Feb 2019 16:34:58 -0800 Subject: [PATCH 3/4] remove whitespaces --- src/Item/Video/VideoItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Item/Video/VideoItem.php b/src/Item/Video/VideoItem.php index f3112be..6ebd792 100644 --- a/src/Item/Video/VideoItem.php +++ b/src/Item/Video/VideoItem.php @@ -137,7 +137,7 @@ protected function setPlayerLoc($loc, $playerEmbedded, $playerAutoPlay) $loc, $playerEmbedded, $playerAutoPlay - ); + ); } return $this; From 66fb106b5469099751ba65bd796d55f3479c1985 Mon Sep 17 00:00:00 2001 From: Ahmad Abdo Date: Thu, 24 Oct 2019 18:12:28 -0700 Subject: [PATCH 4/4] make contentloc optional --- src/Item/Video/VideoItem.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Item/Video/VideoItem.php b/src/Item/Video/VideoItem.php index 6ebd792..7b03c17 100644 --- a/src/Item/Video/VideoItem.php +++ b/src/Item/Video/VideoItem.php @@ -106,16 +106,18 @@ protected function setTitle($title) */ protected function setContentLoc($loc) { - self::writeFullTag( - $loc, - 'content_loc', - true, - 'video:content_loc', - $this->validator, - 'validateContentLoc', - $this->exception, - 'Provided content URL is not a valid.' - ); + if ($loc) { + self::writeFullTag( + $loc, + 'content_loc', + true, + 'video:content_loc', + $this->validator, + 'validateContentLoc', + $this->exception, + 'Provided content URL is not a valid.' + ); + } return $this; }