Created
March 24, 2011 19:18
-
-
Save Un1matr1x/885665 to your computer and use it in GitHub Desktop.
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
| function censor_text($text) | |
| { | |
| static $censors; | |
| // Begin OGame-Mod | |
| global $config, $phpbb_root_path, $phpEx; | |
| if (isset($config['ogm_version'])) | |
| { | |
| include($phpbb_root_path . 'includes/functions_ogame.' . $phpEx); | |
| } | |
| // End OGame-Mod | |
| // Nothing to do? | |
| if ($text === '') | |
| { | |
| return ''; | |
| } | |
| // We moved the word censor checks in here because we call this function quite often - and then only need to do the check once | |
| if (!isset($censors) || !is_array($censors)) | |
| { | |
| global $config, $user, $auth, $cache; | |
| // We check here if the user is having viewing censors disabled (and also allowed to do so). | |
| if (!$user->optionget('viewcensors') && $config['allow_nocensors'] && $auth->acl_get('u_chgcensors')) | |
| { | |
| $censors = array(); | |
| } | |
| else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment