meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

Url pattern problem with hyphened domain names #158

Open n00dl3 opened 9 years ago

n00dl3 commented 9 years ago

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

MarkTraceur commented 8 years ago

@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?

prtksxna commented 8 years ago

Related pull requests: