From b2252a24924301759882c68926775940d33609dd Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 25 May 2020 12:23:03 +0000 Subject: [PATCH] wip #3657 @1 --- inc/ws/Util/html5/master/class.ws.html5.links.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index e640d61b9..cb80ffcdf 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -2011,14 +2011,18 @@ class slideshowLink extends normalLink // If the zip file contained a slideshow.xml file, use that for fetching images and their captions $thumbnails = true; if (file_exists($XML_path)) { - $slideshow_XML = simplexml_load_string(file_get_contents($XML_path)); $slideshowData = CubeIT_Util_Xml::toObject($slideshow_XML); - foreach ($slideshowData->image as $img) { + $images = []; + if (is_array($slideshowData->image)) { + $images = $slideshowData->image; + } else if (is_object($slideshowData->image)) { + $images = [$slideshowData->image]; + } + foreach ($images as $img) { $full_path = $this->path_absolute . '/' . $img->_name; $slides[] = ['caption' => $img->_caption, 'path' => $full_path]; } - $thumbnails = $slideshowData->_thumbnails !== 'false' && $slideshowData->_thumbnails; } else { // Or by default, just get all the images that were in the zip file... @@ -2045,7 +2049,6 @@ class slideshowLink extends normalLink if (null !== $slide['caption']) { $res .= '

' . $slide['caption'] . '

'; } - $res .= ''; // .fb-slideshow-slide } -- 2.39.5