From: vincent@cubedesigners.com Date: Tue, 24 Sep 2019 15:31:47 +0000 (+0000) Subject: fix #3078 @0:05 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c68ef3bcb598f66ce56906371d013f3a8ac9f52e;p=cubeextranet.git fix #3078 @0:05 --- diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 823a2b44a..ce4e3a33f 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -378,7 +378,8 @@ class wsHTML5Compiler $this->config->seoArticles = $this->seoArticles; } - public function writeCartConfig(){ + public function writeCartConfig() + { if ($this->config->basket) { $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js'); switch ($this->config->basketManager) { @@ -401,10 +402,10 @@ class wsHTML5Compiler if (file_exists($referencesFile) || CubeIT_Util_Url::isDistant($referencesFile)) { $ext = CubeIT_Files::getExtension($referencesFile); if ($ext == 'xlsx') { - if($this->config->basketManager=="ZoomProductLink"){ - $function='excelToArrayKeyVal'; - }else{ - $function='excelToArray'; + if ($this->config->basketManager == "ZoomProductLink") { + $function = 'excelToArrayKeyVal'; + } else { + $function = 'excelToArray'; } $this->config->basketReferences = wsUtil::$function($referencesFile); if ($this->book->parametres->customLinkClass == 'AtlanticDownloadLink') { @@ -1480,19 +1481,21 @@ class wsHTML5Compiler unlink($minimized); } - if ($hasNonMin) { - $uglify = new CubeIT_CommandLine('/usr/local/bin/uglifyjs'); - $uglify->setArg('o', $minimized); - $uglify->setArg(null, $tmp); - $uglify->execute(); - $uglify->debug(); - } else { - $uglify = null; - copy($tmp, $minimized); - } + if (file_exists($tmp) && filesize($tmp) > 0) { + if ($hasNonMin) { + $uglify = new CubeIT_CommandLine('/usr/local/bin/uglifyjs'); + $uglify->setArg('o', $minimized); + $uglify->setArg(null, $tmp); + $uglify->execute(); + $uglify->debug(); + } else { + $uglify = null; + copy($tmp, $minimized); + } - if (!file_exists($minimized) || filesize($minimized) == 0) { - die('An error occured while uglifying ' . $hasNonMin . '? ' . $minimized . ': ' . ($uglify ?? $uglify->commande) . ' :: ' . ($uglify ?? $uglify->output) . '(' . implode(',', $files) . ')'); + if (!file_exists($minimized) || filesize($minimized) == 0) { + die('An error occured while uglifying ' . $hasNonMin . '? ' . $minimized . ': ' . ($uglify ?? $uglify->commande) . ' :: ' . ($uglify ?? $uglify->output) . '(' . implode(',', $files) . ')'); + } } } $dest = 'data/' . $jsfinal . '.js';