use Cubist\Util\Files\Files;
use Cubist\Util\Graphics\Image;
use Cubist\Util\Xml;
+use Illuminate\Support\Facades\Log;
class SlideshowLink extends NormalLink {
return 'view slideshow';
}
+ /**
+ * @throws \Exception
+ */
public function generateSlideshow($context) {
$this->compiler->addSlideshowLibrary($context === 'inline');
$slides_options = [];
// If the zip file contained a slideshow.xml file, use that for fetching images and their captions
- if (file_exists($XML_path) && $slideshow_XML = simplexml_load_string(file_get_contents($XML_path))) {
+ if (file_exists($XML_path)) {
+ try {
+ $slideshow_XML = simplexml_load_file($XML_path);
+ } catch (\Exception $e) {
+ throw new \Exception('Error while decoding xml file of slideshow ' . $this->to . ' on page ' . $this->page . ' : ' . $e->getMessage());
+ }
$slideshowData = Xml::toObject($slideshow_XML);
$thumbnails = isset($slideshowData->_thumbnails) && $slideshowData->_thumbnails !== 'false';