$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();
}
}
$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 . ' -->', $$v, $html);
+ if (isset($$v)) {
+ $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
+ } else {
+ $html = str_replace('<!-- $' . $v . ' -->', '', $html);
+ }
}
$scripts = array();
$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);
$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;
public function getHTMLContainerClass() {
$res = trim('link ' . $this->class);
- if ($this->page % 2 == 1) {
+ if (intval($this->page) % 2 == 1) {
$res .= ' odd';
}
return $res;
}
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;
}