You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are detecting images or videos and an image is loaded with a query string, for example in wordpress with a plugin, the lightbox can default to a video iframe if your code is augmented to run videos.
Here is a fix to keep images from turning into iframes when they have a query string url:
SlickLightbox.prototype.detectImage = function(url) {
// Remove query string
url = url.split('?')[0];
// Returns true if it finds an image file extension
return url.match(/\.(jpeg|jpg|gif|png|webp)$/i) !== null;
};
Also added support for webp.
The text was updated successfully, but these errors were encountered:
HawkenKing
changed the title
compatibility with query string images. (fix included)
compatibility with query string images for video detection upgrade. (fix included)
Oct 20, 2024
If you are detecting images or videos and an image is loaded with a query string, for example in wordpress with a plugin, the lightbox can default to a video iframe if your code is augmented to run videos.
Here is a fix to keep images from turning into iframes when they have a query string url:
Also added support for webp.
The text was updated successfully, but these errors were encountered: