]> _ Git - cubeextranet.git/commitdiff
wip #3657 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 25 May 2020 12:23:03 +0000 (12:23 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 25 May 2020 12:23:03 +0000 (12:23 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index e640d61b9a2563f5f864755bf4214b48f337cd51..cb80ffcdf6fb52c04630b79e617025986faac776 100644 (file)
@@ -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 .= '<p class="fb-slideshow-slide-caption">' . $slide['caption'] . '</p>';
             }
-
             $res .= '</div>'; // .fb-slideshow-slide
         }