MyBB Community Forums

Full Version: FancyZoom (needlessly) trying to open every link with graphic file extension +fix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
We encountered this minior bug when some user posted link like this:

https://picload.org/view/ririogow/img_20...4.jpg.html

FancyZoom tried to open it like any other image. It wasn't possible, so we could just admire endlessly loading circle instead. Smile

To overcome this bug, we propose little fix, so links like those gonna be shown in new tab (just like any other regular links).

jscripts/fancyzoom/FancyZoom.js line 85:

if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi) != -1) { 

need to be changed to:

if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)$/gi) != -1) { 
(2017-05-19, 10:04 PM)BlankAvatar Wrote: [ -> ]We encountered this minior bug when some user posted link like this:

https://picload.org/view/ririogow/img_20...4.jpg.html

FancyZoom tried to open it like any other image. It wasn't possible, so we could just admire endlessly loading circle instead. Smile

To overcome this bug, we propose little fix, so links like those gonna be shown in new tab (just like any other regular links).

jscripts/fancyzoom/FancyZoom.js line 85:

if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi) != -1) { 

need to be changed to:

if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)$/gi) != -1) { 

Thanks indeed for providing the bug report and fix....., your solution has been added in

"Build #3"  https://community.mybb.com/mods.php?acti...3&bid=2629

Change Log

* small edit for fix suggested by: BlankAvatar at: https://community.mybb.com/thread-210525...pid1274139
thx! Smile