From: vincent@cubedesigners.com Date: Tue, 13 Mar 2018 15:04:00 +0000 (+0000) Subject: wip #819 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=071870db41c05d7022bd99ffd184fba5c11d4de5;p=cubeextranet.git wip #819 @0.5 --- diff --git a/inc/ws/Util/class.ws.tools.php b/inc/ws/Util/class.ws.tools.php index 498a4dd73..03cd916cc 100644 --- a/inc/ws/Util/class.ws.tools.php +++ b/inc/ws/Util/class.ws.tools.php @@ -121,8 +121,8 @@ class wsTools { $batik = new cubeCommandLine('inkscape'); $batik->setArg('z'); $batik->setArg('e', $png); - $batik->setArg('w', $w * $scale); - $batik->setArg('h', $h * $scale); + $batik->setArg('w', floatval($w) * $scale); + $batik->setArg('h', floatval($h) * $scale); $batik->setManualArg($svgColorized); $batik->execute(); } 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 faa1dd462..76a486e94 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -615,7 +615,11 @@ class wsHTML5Compiler { } $vars = array('titre', 'credits', 'statsfooter', 'ga', 'style', 'script', 'pagesContents', 'description', 'print', 'hiddenContents', 'splash', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard'); foreach ($vars as $v) { - $html = str_replace('', $$v, $html); + if (isset($$v)) { + $html = str_replace('', $$v, $html); + } else { + $html = str_replace('', '', $html); + } } $scripts = array(); @@ -1372,7 +1376,7 @@ class wsHTML5Compiler { $lessVariables['z'] = $this->z; $lessVariables['book-page-width'] = $w; $lessVariables['book-page-height'] = $h; - $lessVariables['book-page-ratio'] = $w / $h; + $lessVariables['book-page-ratio'] = floatval($w) / floatval($h); $lessVariables['shadow-opacity'] = wsHTML5::colorToArray($this->theme->parametres->bookShadeColor)['opacity'] * 1.2; $lessVariables['edges-display'] = $this->_lessBoolean($this->theme->parametres->usePageEdges); @@ -1404,7 +1408,7 @@ class wsHTML5Compiler { $texts .= 'height:' . ($hm / $this->cssSVGScale) . 'px; max-height:' . ($hm / $this->cssSVGScale) . 'px;'; $texts .= '}'; } else { - $texts = '.texts{width:' . floor($w + 4) . 'px;height:' . floor($h + 4) . 'px;}'; + $texts = '.texts{width:' . floor(floatval($w) + 4) . 'px;height:' . floor(floatval($h) + 4) . 'px;}'; } $res[] = $texts; 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 5585ecbd5..b55761156 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -205,7 +205,7 @@ class wsHTML5Link { public function getHTMLContainerClass() { $res = trim('link ' . $this->class); - if ($this->page % 2 == 1) { + if (intval($this->page) % 2 == 1) { $res .= ' odd'; } return $res; @@ -249,7 +249,7 @@ class wsHTML5Link { } public function getCSSContainer() { - if (!($this instanceof contentLink) && $this->page % 2 == 1) { + if (!($this instanceof contentLink) && intval($this->page) % 2 == 1) { $this->page--; $this->left += $this->compiler->width; } diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php index 65327c563..5e40df2bc 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php @@ -61,7 +61,6 @@ class wsPackagerWinEXEHTML extends wsPackager { $cl->execute(); $this->compileShortcut(); - } function compileShortcut() {