From: Andreas F. <ba...@ph...> - 2009-08-21 09:45:48
|
Author: bantu Date: Fri Aug 21 10:44:55 2009 New Revision: 10039 Log: Allow "0" as censor word and replacement. Only obtain word censor list if text is not empty. Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_words.php branches/phpBB-3_0_0/phpBB/includes/functions_content.php Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_words.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_words.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_words.php Fri Aug 21 10:44:55 2009 *************** *** 23,29 **** class acp_words { var $u_action; ! function main($id, $mode) { global $db, $user, $auth, $template, $cache; --- 23,29 ---- class acp_words { var $u_action; ! function main($id, $mode) { global $db, $user, $auth, $template, $cache; *************** *** 47,54 **** switch ($action) { case 'edit': $word_id = request_var('id', 0); ! if (!$word_id) { trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); --- 47,55 ---- switch ($action) { case 'edit': + $word_id = request_var('id', 0); ! if (!$word_id) { trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); *************** *** 73,79 **** 'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); ! return; break; --- 74,80 ---- 'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); ! return; break; *************** *** 84,94 **** { trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } $word_id = request_var('id', 0); $word = utf8_normalize_nfc(request_var('word', '', true)); $replacement = utf8_normalize_nfc(request_var('replacement', '', true)); ! ! if (!$word || !$replacement) { trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } --- 85,96 ---- { trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } + $word_id = request_var('id', 0); $word = utf8_normalize_nfc(request_var('word', '', true)); $replacement = utf8_normalize_nfc(request_var('replacement', '', true)); ! ! if ($word === '' || $replacement === '') { trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } Modified: branches/phpBB-3_0_0/phpBB/includes/functions_content.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_content.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_content.php Fri Aug 21 10:44:55 2009 *************** *** 685,690 **** --- 685,696 ---- { static $censors; + // 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)) { |