Created
May 24, 2014 13:47
-
-
Save khoin/2fe5d16eca96d901c051 to your computer and use it in GitHub Desktop.
Filter for Madlibs (backend)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Profanity Filtering | |
$profanities = array( | |
'cum','cumming','shit','fuck','ass','bitch','cunt','slut','sh!t','sh1t','fuk','b1tch','b!tch','fucking','fuking','fuckin','fukin','shitty','shitass','asshole','whore','rape','raped' | |
); | |
$schunks = array(""); | |
function expand($item) { | |
global $schunks; | |
foreach(explode(" ",$item) as $i) { | |
array_push($schunks,$i); | |
} | |
} | |
array_walk($chunks,'expand'); | |
if( count( array_intersect($profanities,$schunks) ) > 0) { | |
$return['status'] = 4; | |
echo json_encode($return); die(); | |
} | |
/** | |
Paste the code above `after` the Limiter section and before the `Madlibs Processing` section. | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment