diff --git a/lightbox-photoswipe.php b/lightbox-photoswipe.php index 34d8ad5..3e3bdbc 100644 --- a/lightbox-photoswipe.php +++ b/lightbox-photoswipe.php @@ -3,7 +3,7 @@ Plugin Name: Lightbox with PhotoSwipe Plugin URI: https://wordpress.org/plugins/lightbox-photoswipe/ Description: Lightbox with PhotoSwipe -Version: 5.1.5 +Version: 5.1.6 Author: Arno Welzel Author URI: http://arnowelzel.de Text Domain: lightbox-photoswipe diff --git a/readme.txt b/readme.txt index d117d25..6d4e381 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: awelzel Tags: attachments, images, gallery, lightbox, fancybox, photoswipe Requires at least: 5.3 Tested up to: 6.4 -Stable tag: 5.1.5 +Stable tag: 5.1.6 Donate link: https://paypal.me/ArnoWelzel License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -219,6 +219,11 @@ If you change any of the stylesheets or frontend scripts in `src/js` or `src/lib == Changelog == += 5.1.6 = + +* Make sure, that displaying SVG images in the lightbox is supported even if WordPress does not report it as allowed + file type for upload (for example when not logged in as administrator). + = 5.1.5 = * Fixed handling of tabindex attribute in image links with Bricks image slider: if image links contain a tabindex diff --git a/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php b/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php index ecb4913..b4f3469 100644 --- a/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php +++ b/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php @@ -11,7 +11,7 @@ */ class LightboxPhotoSwipe { - const VERSION = '5.1.5'; + const VERSION = '5.1.6'; const SLUG = 'lightbox-photoswipe'; const META_VERSION = '14'; const CACHE_EXPIRE_IMG_DETAILS = 86400; @@ -316,7 +316,11 @@ public function callbackProperties(array $matches) $file = $this->getHomeUrl() . $file; } - $type = wp_check_filetype($file); + $mimeTypes = get_allowed_mime_types(); + if (!in_array('svg', $mimeTypes)) { + $mimeTypes['svg'] = 'image/svg+xml'; + } + $type = wp_check_filetype($file, $mimeTypes); $extension = strtolower($type['ext']); $captionCaption = ''; $captionDescription = '';