fix crash when politis cover not found
This commit is contained in:
parent
20f3e94007
commit
f5fd44291e
11
epub.php
11
epub.php
|
@ -436,8 +436,15 @@
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
$doc->loadHTML($issues);
|
$doc->loadHTML($issues);
|
||||||
$finder = new DomXPath($doc);
|
$finder = new DomXPath($doc);
|
||||||
$cover = $finder->query('//img[contains(@src, "' . $issuenb . '_")]')->item(0)->getAttribute('src');
|
$cover = $finder->query('//img[contains(@src, "' . $issuenb . '_")]');
|
||||||
$epub->AddImage($cover, 'image/jpeg', true);
|
if ($cover->length)
|
||||||
|
{
|
||||||
|
$epub->AddImage($cover->item(0)->getAttribute('src'), 'image/jpeg', true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo 'warning: no cover for issue ' . $issuenb . '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
// load feeds
|
// load feeds
|
||||||
$feed = file_get_contents($feedurl);
|
$feed = file_get_contents($feedurl);
|
||||||
|
|
Loading…
Reference in New Issue