Skip to content

Instantly share code, notes, and snippets.

@Un1matr1x
Created March 24, 2011 19:18
Show Gist options
  • Save Un1matr1x/885665 to your computer and use it in GitHub Desktop.
Save Un1matr1x/885665 to your computer and use it in GitHub Desktop.
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