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->loadHTML($issues);
|
||||
$finder = new DomXPath($doc);
|
||||
$cover = $finder->query('//img[contains(@src, "' . $issuenb . '_")]')->item(0)->getAttribute('src');
|
||||
$epub->AddImage($cover, 'image/jpeg', true);
|
||||
$cover = $finder->query('//img[contains(@src, "' . $issuenb . '_")]');
|
||||
if ($cover->length)
|
||||
{
|
||||
$epub->AddImage($cover->item(0)->getAttribute('src'), 'image/jpeg', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'warning: no cover for issue ' . $issuenb . '<br>';
|
||||
}
|
||||
|
||||
// load feeds
|
||||
$feed = file_get_contents($feedurl);
|
||||
|
|
Loading…
Reference in New Issue