Skip to content
Snippets Groups Projects
Commit fa36ccb0 authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Watch for bad language on homepage and filter it out.

parent fd3935ea
No related branches found
No related tags found
No related merge requests found
<?php
/* here is a nice little function we can use to check for dirty words. It's very intolerant and may filter content that
doesn't need to be filtered, but it's for use on the home page where we don't want to chance anything.
from: http://blog.otaku-anime.com/2008/04/29/filtro-de-palabras-en-php/
*/
function filtrado($texto, $reemplazo = false) {
$filtradas = 'fu?ck,shit,\Wass,damn,piss,cunt,cocksuc?ker,tits,^ass,fag,bitch,bastard,boner,dick,ass*hole,douche,nigger,nig+a,penis,pussy,pric?k,queer,skank,slut';
$f = explode(',', $filtradas);
$f = array_map('trim', $f);
$filtro = implode('|', $f);
return ($reemplazo) ? preg_replace("#$filtro#i", $reemplazo, $texto) : preg_match("#$filtro#i", $texto) ;
}
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment