public static function basedOnBlacklist($word)
	{
		$words[] = (string)$word;
		$words[] = strtolower($word);
		$words[] = strtolower(strrev($word));

		$len = strlen($word);
		$word2 = '';

		// @FIXME: badly inefficient
		for ($i = 0; $i < $len; $i++)
		{
			if (preg_match('/[a-zA-Z]/', $word[$i]))
			{
				$word2 .= $word[$i];
			}
		}

		$words[] = strtolower($word2);
		$words[] = strtolower(strrev($word2));
		$words[] = self::toL33t($word);
		$words[] = strrev(self::toL33t($word));
		$words[] = self::toSimpleL33t($word);
		$words[] = strrev(self::toSimpleL33t($word));

		$total = self::all()
			->whereIn('word', $words)
			->total();

		return ($total > 1); // returns true if char belongs to class
	}
public static function basedOnBlacklist($word)
	{
		$words[] = (string)$word;
		$words[] = strtolower($word);
		$words[] = strtolower(strrev($word));

		$len = strlen($word);
		$word2 = '';

		// @FIXME: badly inefficient
		for ($i = 0; $i < $len; $i++)
		{
			if (preg_match('/[a-zA-Z]/', $word[$i]))
			{
				$word2 .= $word[$i];
			}
		}

		$words[] = strtolower($word2);
		$words[] = strtolower(strrev($word2));
		$words[] = self::toL33t($word);
		$words[] = strrev(self::toL33t($word));
		$words[] = self::toSimpleL33t($word);
		$words[] = strrev(self::toSimpleL33t($word));

		$total = self::all()
			->whereIn('word', $words)
			->total();

		return ($total > 1); // returns true if char belongs to class
	}
public static function basedOnBlacklist ( $ word ) { $ words [ ] = ( string ) $ word ; $ words [ ] = strtolower ( $ word ) ; $ words [ ] = strtolower ( strrev ( $ word ) ) ; $ len = strlen ( $ word ) ; $ word2 = '' ; // @FIXME: badly inefficient for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { if ( preg_match ( '/[a-zA-Z]/' , $ word [ $ i ] ) ) { $ word2 .= $ word [ $ i ] ; } } $ words [ ] = strtolower ( $ word2 ) ; $ words [ ] = strtolower ( strrev ( $ word2 ) ) ; $ words [ ] = self :: toL33t ( $ word ) ; $ words [ ] = strrev ( self :: toL33t ( $ word ) ) ; $ words [ ] = self :: toSimpleL33t ( $ word ) ; $ words [ ] = strrev ( self :: toSimpleL33t ( $ word ) ) ; $ total = self :: all ( ) -> whereIn ( 'word' , $ words ) -> total ( ) ; return ( $ total > 1 ) ; // returns true if char belongs to class }
Check if a word is based on a blacklisted word

@param   string  $word
@return  bool
Check if a word is based on a blacklisted word