Jump to content


Photo

Protetor De Link


  • Faça o login para participar
Nenhuma resposta neste tópico

#1 STHELT

STHELT

    12 Horas

  • Usuários
  • 270 posts
  • Sexo:Masculino
  • Interesses:Ruby on Rails

Posted 22/02/2010, 19:25

eu achei um script protetor de link mas quando eu uso algum link com "&" ele corta o link no meio...
o script:

link.js

function cuc(){var linkuc=document.getElementsByTagName("A");try{var locuc=(""+top.location.href).replace("http://","").replace("https://","").replace("www.","");}catch(e){var locuc=(""+document.location.href).replace("http://","").replace("https://","").replace("www.","");}for(i=0;i<linkuc.length;i++){domain_urluc=(""+linkuc[i].href).replace(/^\s+/g,"").replace(/\s+$/g,"").replace("http://","").replace("https://","");if(duc(linkuc[i].href)&&(((" "+linkuc[i].href).indexOf(locuc)<=0||(" "+linkuc[i].href).indexOf("http")<=0)||(" "+linkuc[i].href).lastIndexOf("http:")>3)&&(" "+linkuc[i].href).indexOf("script:")<=0&&(" "+linkuc[i].href).indexOf("#")!=1&&(" "+linkuc[i].href).indexOf("mailto:")<=0&&(" "+linkuc[i].href).indexOf("file:")<=0&&(" "+linkuc[i].href).indexOf("#exit")<=0&&!(!isNaN(parseInt(domain_urluc.substr(0,1)))&&(!isNaN(parseInt(domain_urluc.substr(0,2)))||domain_urluc.substr(0,2)=="."))){linkuc[i].target="_blank";linkuc[i].href=urluc+linkuc[i]+"";}}}function duc(urluc){if(""+domainuc!="undefined"&&domainuc!=""&&domainuc.replace(/\s/g,"")!=""&&urluc!=""){if((" "+domainuc).indexOf(",")>0){params_to_skip=domainuc.split(",");}else{params_to_skip=new Array(domainuc);}for(s=0;s<params_to_skip.length;s++){if((" "+urluc.toLowerCase()).indexOf(params_to_skip[s].toLowerCase())>0){if(""+domainsuc!="undefined"&&domainsuc!=""&&domainsuc.replace(/\s/g,"")!=""&&urluc!=""){if((" "+domainsuc).indexOf(",")>0){params_to_skip=domainsuc.split(",");}else{params_to_skip=new Array(domainsuc);}for(s=0;s<params_to_skip.length;s++){if((" "+urluc.toLowerCase()).indexOf(params_to_skip[s].toLowerCase())>0){return false;break;};}return true;}else{return true;}};}return false;}else{return false;}}if(""+window.onload==""||""+window.onload=="null"){window.onload=cuc;}else{var tout=window.setTimeout("cuc(); clearTimeout(tout)",1000);};



protetor.js

var urluc='http://MINHAURL.com/link/?url='+"";
var domainsuc='';
function cuc(){var linkuc=document.getElementsByTagName("A");try{var locuc=(""+top.location.href).replace("http://","").replace("https://","").replace("www.","");}catch(e){var locuc=(""+document.location.href).replace("http://","").replace("https://","").replace("www.","");}for(i=0;i<linkuc.length;i++){domain_urluc=(""+linkuc[i].href).replace(/^\s+/g,"").replace(/\s+$/g,"").replace("http://","").replace("https://","");if(duc(linkuc[i].href)&&(((" "+linkuc[i].href).indexOf(locuc)<=0||(" "+linkuc[i].href).indexOf("http")<=0)||(" "+linkuc[i].href).lastIndexOf("http:")>3)&&(" "+linkuc[i].href).indexOf("script:")<=0&&(" "+linkuc[i].href).indexOf("#")!=1&&(" "+linkuc[i].href).indexOf("mailto:")<=0&&(" "+linkuc[i].href).indexOf("file:")<=0&&(" "+linkuc[i].href).indexOf("#exit")<=0&&!(!isNaN(parseInt(domain_urluc.substr(0,1)))&&(!isNaN(parseInt(domain_urluc.substr(0,2)))||domain_urluc.substr(0,2)=="."))){linkuc[i].target="_blank";linkuc[i].href=urluc+linkuc[i]+"";}}}function duc(urluc){if(""+domainuc!="undefined"&&domainuc!=""&&domainuc.replace(/\s/g,"")!=""&&urluc!=""){if((" "+domainuc).indexOf(",")>0){params_to_skip=domainuc.split(",");}else{params_to_skip=new Array(domainuc);}for(s=0;s<params_to_skip.length;s++){if((" "+urluc.toLowerCase()).indexOf(params_to_skip[s].toLowerCase())>0){if(""+domainsuc!="undefined"&&domainsuc!=""&&domainsuc.replace(/\s/g,"")!=""&&urluc!=""){if((" "+domainsuc).indexOf(",")>0){params_to_skip=domainsuc.split(",");}else{params_to_skip=new Array(domainsuc);}for(s=0;s<params_to_skip.length;s++){if((" "+urluc.toLowerCase()).indexOf(params_to_skip[s].toLowerCase())>0){return false;break;};}return true;}else{return true;}};}return false;}else{return false;}}if(""+window.onload==""||""+window.onload=="null"){window.onload=cuc;}else{var tout=window.setTimeout("cuc(); clearTimeout(tout)",1000);};


na pagina do protetor, o link <a href="<?=$_GET['url']?>"><font face="Tahoma"><b>
Continuar &gt;&gt;&gt;</b></font></a>

A URL fica assim: http://MINHAURL.com/...rl=URLPROTEGIDA
quando uso assim:http://MINHAURL.com/link/?url=URLPROTEGIDA&alguma coisa&blblbl

o link fika http://MINHAURL.com/...rl=URLPROTEGIDA
<HTML>
<HEAD>
<BODY>

<NAME> Caio </NAME>

</HTML>
</HEAD>
</BODY>




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq