From 09f343c9e0da804e051953088664c8c56e0e9135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Grandt?= Date: Wed, 16 Mar 2016 16:30:38 +0100 Subject: [PATCH] #37 fixing an error when image link has no extension. --- src/PHPePub/Core/EPub.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PHPePub/Core/EPub.php b/src/PHPePub/Core/EPub.php index 98cb6d4..bbc6fe0 100644 --- a/src/PHPePub/Core/EPub.php +++ b/src/PHPePub/Core/EPub.php @@ -599,7 +599,8 @@ protected function resolveImage($source, &$internalPath, &$internalSrc, &$isSour } if ($imageData !== false) { $iSrcInfo = pathinfo($internalSrc); - if (!empty($imageData['ext']) && $imageData['ext'] != $iSrcInfo['extension']) { + + if (!empty($imageData['ext']) && (!isset($iSrcInfo['extension']) || $imageData['ext'] != $iSrcInfo['extension'])) { $internalSrc = $iSrcInfo['filename'] . "." . $imageData['ext']; } $internalPath = RelativePath::getRelativePath("images/" . $internalPath . "/" . $internalSrc);