Grandt / PHPePub

PHP Classes for dynamically generating EPub files.
http://www.phpclasses.org/package/6115
241 stars 83 forks source link

Pathinfo extension undefined #37

Closed tcitworld closed 8 years ago

tcitworld commented 8 years ago

I exported two articles containing a lot of different pictures and some of them seem to not return any information through pathinfo, leading to failure. Therefore, pathinfo($internalSrc); returns undefined here. It should be tested before next conditional.

Grandt commented 8 years ago

Do you happen to have an example of a path leading to an undefined return from pathinfo? I'm adding $iSrcInfo != null && to the if statement following the call, that should protect it if pathinfo returns an undefined result.

tcitworld commented 8 years ago

The two articles were this one and this other one. There's at least two different pictures concerned.

Grandt commented 8 years ago

So the issue is not that pathinfo returns an undefined result, but that $iSrcInfo['extension'] is undefined as the link doesn't always have an extension.

I'll apply a fix for that assumption, and post 4.0.7 in a few minutes.

tcitworld commented 8 years ago

I thought so too, but I seem to recall to have _vardumped $iSrcInfo once without success.

Grandt commented 8 years ago

pathinfo shouldn't return an undefined at all. Try 4.0.7 I just posted to packagist, if that fails, I'll have to check further.

tcitworld commented 8 years ago

Works fine. :+1: