terrymun / Fluidbox

Replicating and improving the lightbox module seen on Medium with fluid transitions.
http://terrymun.github.io/Fluidbox/
Other
2.15k stars 167 forks source link

Image URLs containing a plus sign cause an "opening halted" warning #200

Open SeinopSys opened 5 years ago

SeinopSys commented 5 years ago

The following URL fails to open with Fluidbox: http://placehold.it/1024x768&text=Your+text, and this is logged to the console:

Fluidbox: Fluidbox opening is halted because it has detected characters in your URL string that need to be properly encoded/escaped. Whitespace(s) have to be escaped manually. See RFC3986 documentation.

I believe this is caused by /[\s+]/g being used instead of /\s+/g here:

https://github.com/terrymun/Fluidbox/blob/eda36eebad235a1f372a209eaf5f24477afcf77c/src/js/jquery.fluidbox.js#L202