check whether url belongs to request domain

Hi, I found a bug where all urls are overwritten. e.g. i included the script of userreport.com and the url http://cdn.userreport.com/userreport.js is overwritten into http://cdn.mysite.com/http://cdn.userreport.com/userreport.js. To fix this, I've added a check whether a url belongs to the domain of the website. Please merge this. thanks.