Check comic archive contents for files without extensions to prevent parsing error

This commit is contained in:
Junior 2024-10-11 12:08:44 -04:00
parent 5af639b931
commit 4577aa5e16

View File

@ -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);