elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  mejorar script anti Hoygan
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: mejorar script anti Hoygan  (Leído 2,009 veces)
hardjesjlc

Desconectado Desconectado

Mensajes: 40


http://ldelac.wordpress.com/


Ver Perfil WWW
mejorar script anti Hoygan
« en: 31 Marzo 2008, 11:28 am »

Hola me he encontrado este script anti-hoygan en www.nopuedocreer.com
Lo que hace este programa, es que al escribir un comentario de un post. El programa lo analiza y si no cumple una serie de requisitos (tiene demasiadas mayusculas, contiene palabras del diccionario...) salta un mensaje de error.
Citar
// antiHOYGAN
// Script URI: http://www.nopuedocreer.com/quelohayaninventado/?page_id=203
// Description: "Filtro antiHOYGAN"
// Author: Dani "Troy" Gonzalez
// Version: 1.0
// Author URI: http://www.hevistocosas.com

function filterHOYGAN (texto)
{
   swHOYGAN=false;
   msgError="";

   numLetras=texto.length;
   numMayusculas=0;
   for (i=0;i<numLetras;i++)
      if (texto.charAt(i)>='A' && texto.charAt(i)<='Z')
         numMayusculas++;
    if (numLetras>4 && numMayusculas>numLetras/4)         
    {
      swHOYGAN=true;
      msgError="Shift overload";
   }
   else
   {
      textoLower=texto.toLowerCase();
      textoLower=" "+textoLower;
      HOYGANseed = new Array("hoygan","hoigan","wenas","wapo","wapa","weno","favor","quiero","plis ","pliss","plisss","gracias","antebraso"," que "," k "," q "," d ","pq","xq","aaaa","eeee","iiii","oooo","uuuu","jajaja","hahaha","jejeje","!!!","???","dddd","fff","ggg","jjj","lll","mmmm","nnnn","rrrr","xxxx","zzzz","dddd","ssss");
      for (i=0;i<HOYGANseed.length;i++)
      {
         if (textoLower.indexOf(HOYGANseed)!=-1)
         {
            swHOYGAN=true;
            msgError=HOYGANseed;
            break;
         }   
      }
   }
   if (swHOYGAN)
   {   
      alert ("ALERT: AntiHOYGAN Filter FAILED!\n\n>>Offending Command: \""+msgError+"\"\n\nRevise su mensaje y vuelva a intentarlo, por favor.\n\nSi el problema persiste, puede solucionarlo accediendo a:\nwww.RAE.es\nfrikipedia.es/friki/Hoygan");
      return false;
    }
    return true;
}


Me gustaria mejorarlo, para en vez de que lea de un array, poder leer de un collection , un Set o un map para asi poder mejorar la velocidad y aumentar el diccionario.
Que seria mejor (set, collection, map)??
Me dais alguna idea mas para mejorarlo?
Gracias
un saludo!!


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Script anti- inyesiones XSS
Scripting
sommer 0 1,528 Último mensaje 18 Diciembre 2016, 03:37 am
por sommer
¿Script anti pop-up? ¿es posible?
Desarrollo Web
hckcrck 4 3,103 Último mensaje 3 Febrero 2017, 20:05 pm
por ThinkByYourself
Mejorar un script?
Scripting
Macoiikari 0 1,593 Último mensaje 18 Marzo 2017, 15:52 pm
por Macoiikari
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines