diff --git a/php/Modules/Album.php b/php/Modules/Album.php index 4460a5c..253d224 100644 --- a/php/Modules/Album.php +++ b/php/Modules/Album.php @@ -278,7 +278,7 @@ final class Album { if (!@is_readable($photo->url)) continue; // Get extension of image - $extension = getExtension($photo->url); + $extension = getExtension($photo->url, true); // Set title for photo $zipFileName = $zipTitle . '/' . $photo->title . $extension; diff --git a/php/Modules/Import.php b/php/Modules/Import.php index 3bf0df1..76adf19 100644 --- a/php/Modules/Import.php +++ b/php/Modules/Import.php @@ -50,7 +50,7 @@ final class Import { // This prevents us from downloading invalid photos. // Verify extension - $extension = getExtension($url); + $extension = getExtension($url, true); if (!in_array(strtolower($extension), Photo::$validExtensions, true)) { $error = true; Log::error(Database::get(), __METHOD__, __LINE__, 'Photo format not supported (' . $url . ')'); diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 55fe91f..50f6dfc 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -124,7 +124,7 @@ final class Photo { } // Verify extension - $extension = getExtension($file['name']); + $extension = getExtension($file['name'], false); if (!in_array(strtolower($extension), self::$validExtensions, true)) { Log::error(Database::get(), __METHOD__, __LINE__, 'Photo format not supported'); if ($returnOnError===true) return false; @@ -845,8 +845,8 @@ final class Photo { } // Get extension - $extension = getExtension($photo->url); - if ($extension===false) { + $extension = getExtension($photo->url, true); + if (empty($extension)) { Log::error(Database::get(), __METHOD__, __LINE__, 'Invalid photo extension'); return false; } diff --git a/php/helpers/getExtension.php b/php/helpers/getExtension.php index 21089c0..d8df170 100644 --- a/php/helpers/getExtension.php +++ b/php/helpers/getExtension.php @@ -1,13 +1,18 @@ \ No newline at end of file