Fix a book reported by Mario. re #52

This commit is contained in:
Sébastien Lucas 2014-03-13 20:46:49 +01:00
rodzic 2648b9310b
commit e8cadd23d8
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -205,7 +205,14 @@ class EPub {
*/
public function componentContentType($comp) {
$comp = $this->decodeComponentName ($comp);
return $this->xpath->query("//opf:manifest/opf:item[@href='$comp']")->item(0)->getAttribute('media-type');
$item = $this->xpath->query("//opf:manifest/opf:item[@href='$comp']")->item(0);
if ($item) return $item->getAttribute('media-type');
// I had at least one book containing %20 instead of spaces in the opf file
$comp = str_replace (" ", "%20", $comp);
$item = $this->xpath->query("//opf:manifest/opf:item[@href='$comp']")->item(0);
if ($item) return $item->getAttribute('media-type');
return "application/octet-stream";
}
private function getNavPointDetail ($node) {