diff --git a/src/Passbook/PassFactory.php b/src/Passbook/PassFactory.php index fed3153..9c789c7 100644 --- a/src/Passbook/PassFactory.php +++ b/src/Passbook/PassFactory.php @@ -479,7 +479,7 @@ private function preparePassDirectory(PassInterface $pass) /** * @param PassInterface $pass - * @param $passDir + * @param string $passDir */ private function prepareImages(PassInterface $pass, $passDir) { @@ -491,14 +491,16 @@ private function prepareImages(PassInterface $pass, $passDir) } else if ($image->getDensity() === 3) { $fileName .= '@3x'; } - $fileName .= '.' . $image->getExtension(); + + // Image pathname can be URL not only local file location + $fileName .= '.' . pathinfo(parse_url($image->getPathname(), PHP_URL_PATH), PATHINFO_EXTENSION); copy($image->getPathname(), $fileName); } } /** * @param PassInterface $pass - * @param $passDir + * @param string $passDir */ private function prepareLocalizations(PassInterface $pass, $passDir) { @@ -524,6 +526,4 @@ private function prepareLocalizations(PassInterface $pass, $passDir) } } } - - }