CamanJS
CamanJS copied to clipboard
Url pattern problem with hyphened domain names
Hi, we got a problem on a site with a domain name containing an hyphen, images were considered as other domain ones, line 1403 of caman.full.js v4.1.2
IO.domainRegex = /(?:(?:http|https):\/\/)((?:\w+)\.(?:(?:\w|\.)+))/;
we had to replace it by
IO.domainRegex = /(?:(?:http|https):\/\/)((?:[a-zA-Z0-9_-]+)\.(?:(?:[a-zA-Z0-9_-]*|\.)+))/;
which does the trick
edit: Sorry, I put a wrong one as a fix
@n00dl3 could you submit this as a pull request, so when @meltingice finally decides to actually deal with bug reports, it's a small task for them to fix this issue?
Related pull requests:
- #199
- #151
- #152
- 1ac3fb607da642597b02e6e0e4f875e111b27324 in #163