Censored2

Artie S. writes:

As part of a contract with a customer, we have to maintain some of their legacy applications. I found this today in a custom controller for a very old OpenCart site and am still laughing about it and thought you guys might enjoy it. I suppose it's NSFW, but it's code, right?

I threw in some blocks ( █ ) to make things safer for work. The other symbols (!, @) are part of the original sub.


public function isClean($body)
        {
                $bad_words = array('sh█t','sh█tty','sh█ttiest','sh!t','sh!tty','sh!ttiest','f█ck','f█cking','f█cked','f█cker','cunt','piss','pissed','crap','crappy','crappier','crappiest','cr@p','cr@ppy','cr@ppier','cr@ppiest','cock','tits','titties');
                for($i=0;$i<count($bad_words);$i++)
                {
                        $pos = strpos($body, $bad_words[$i]);
                        if($pos!==false)
                        {
                                return false;
                        }
                }
                return true;
        }

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!