]> _ Git - cubeextranet.git/commitdiff
wait #5650 @0.75
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 15 Dec 2022 16:12:06 +0000 (16:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 15 Dec 2022 16:12:06 +0000 (16:12 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 6c911d8e57087ad2a051b00ef8705598d632bf97..a5a6b3d725d5afb109e3b088b484e91198e3e9e5 100644 (file)
@@ -1156,6 +1156,7 @@ class wsHTML5Compiler
         if ($this->book->parametres->scorm_enable) {
             $this->book->parametres->seoVersion = false;
         }
+
         if ($this->book->parametres->embedAllLibraries) {
             $this->addVideoJs();
             $this->addSlideshowLibrary(false);
@@ -1718,19 +1719,23 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             if ($this->theme->parametres->favicon != '') {
 
                 $pngFile = $this->checkThemeImage($this->theme->parametres->favicon);
-                $icoFile = $this->checkThemeImage('favicon.ico');
+                $icoFile = $this->checkThemeImage('favicon.ico', false);
 
                 if (!file_exists($icoFile) || filemtime($icoFile) < filemtime($pngFile) || filemtime(__FILE__) > filemtime($icoFile)) {
                     $tmp = CubeIT_Files::tempnam() . '.png';
                     $convert = "convert $pngFile -resize 64x64^ -gravity center $tmp";
                     `$convert`;
 
-                    $icotool = new cubeCommandLine('icotool');
+                    $icotool = new CubeIT_CommandLine('icotool');
                     $icotool->setArg('c');
                     $icotool->setArg('o', $icoFile);
                     $icotool->setArg(null, $tmp);
                     $icotool->execute();
 
+                    if (!file_exists($icoFile)) {
+                        die('error while generating ico ' . $icoFile);
+                    }
+
                     unlink($tmp);
                 }
 
@@ -3255,7 +3260,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->log('Write CSS');
     }
 
-    protected function checkThemeImage($path)
+    protected function checkThemeImage($path, $checkExists = true)
     {
         $path = trim($path);
         $path = trim($path, '/');
@@ -3263,7 +3268,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             return false;
         }
         $p = $this->themeRoot . '/' . $path;
-        if (file_exists($p)) {
+        if (!$checkExists || file_exists($p)) {
             return $p;
         }
         $po = str_replace('.svg', '.o.svg', $p);