Check comic archive contents for files without extensions to prevent parsing error
This commit is contained in:
parent
5af639b931
commit
4577aa5e16
|
@ -45,6 +45,7 @@ if ( $ext == "cbz" ) {
|
|||
for ( $i=0; $i<$zip->numFiles; $i++ ) {
|
||||
$imgname = basename($zip->getNameIndex($i));
|
||||
//$myext = substr($imgname, -3);
|
||||
if ( ! isset(pathinfo($imgname)['extension']) ) continue;
|
||||
$myext = strtolower(pathinfo($imgname)['extension']);
|
||||
if ( ($myext == "jpg") || ($myext == "png") || ($myext == "webp") ) {
|
||||
$imgname = str_replace("#", "", $imgname);
|
||||
|
@ -60,6 +61,7 @@ if ( $ext == "cbz" ) {
|
|||
$myfile = $comicoutputfull . $file;
|
||||
$mynewfile = $comicoutputfull . str_replace("#", "", $file);
|
||||
//$myext = strtolower(substr($file, -3));
|
||||
if ( ! isset(pathinfo($myfile)['extension']) ) continue;
|
||||
$myext = strtolower(pathinfo($myfile)['extension']);
|
||||
if ( ($myext == "jpg") || ($myext == "png") || ($myext == "webp") ) {
|
||||
rename($myfile, $mynewfile);
|
||||
|
|
Loading…
Reference in New Issue
Block a user