Fix epubreader when title contains ' or ". re #52

This commit is contained in:
sb domo 2014-03-20 09:12:42 +01:00
parent 604f72d860
commit aa40bb6feb

View file

@ -40,7 +40,7 @@ $book->initSpineComponent ();
<?php echo "return [" . implode (", ", array_map (function ($comp) { return "'" . $comp . "'"; }, $book->components ())) . "];"; ?> <?php echo "return [" . implode (", ", array_map (function ($comp) { return "'" . $comp . "'"; }, $book->components ())) . "];"; ?>
}, },
getContents: function () { getContents: function () {
<?php echo "return [" . implode (", ", array_map (function ($content) { return "{title: '" . $content["title"] . "', src: '". $content["src"] . "'}"; }, $book->contents ())) . "];"; ?> <?php echo "return [" . implode (", ", array_map (function ($content) { return "{title: '" . addslashes($content["title"]) . "', src: '". $content["src"] . "'}"; }, $book->contents ())) . "];"; ?>
}, },
getComponent: function (componentId) { getComponent: function (componentId) {
return { url: "epubfs.php?<?php echo $add ?>comp=" + componentId }; return { url: "epubfs.php?<?php echo $add ?>comp=" + componentId };