|
From: FlorinCB <ory...@us...> - 2008-09-27 18:56:02
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3982 Modified Files: mx_functions.php mx_functions_tools.php Log Message: not commited? Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** mx_functions_tools.php 17 Sep 2008 03:40:30 -0000 1.42 --- mx_functions_tools.php 27 Sep 2008 18:55:26 -0000 1.43 *************** *** 3138,3143 **** $current_time = ($current_time == 0) ? time() : $current_time; $subject = addslashes(trim($subject)); ! $username = addslashes(unprepare_message(trim($user_name))); $username = phpBB2::phpbb_clean_username( $username ); --- 3138,3146 ---- $current_time = ($current_time == 0) ? time() : $current_time; + //phpBB2 topic_title can have max 60 chars $subject = addslashes(trim($subject)); ! $subject = substr($subject, 0, 60); ! $subject = mx_censor_text($subject); ! $username = addslashes(unprepare_message(trim($user_name))); $username = phpBB2::phpbb_clean_username( $username ); Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** mx_functions.php 28 Aug 2008 05:05:20 -0000 1.92 --- mx_functions.php 27 Sep 2008 18:55:23 -0000 1.93 *************** *** 1046,1049 **** --- 1046,1071 ---- /** + * Censoring + */ + function mx_censor_text($text) + { + static $censors; + global $mx_cache; + + if (!isset($censors) || !is_array($censors)) + { + // obtain_word_list is taking care of the users censor option and the board-wide option + $censors = $mx_cache->obtain_word_list(); + } + + if (sizeof($censors)) + { + return preg_replace($censors['match'], $censors['replace'], $text); + } + + return $text; + } + + /** * For display of custom parsed text on user-facing pages * Expects $text to be the value directly from the database (stored value) *************** *** 1058,1062 **** } ! $text = phpbb3::censor_text($text); // Parse bbcode if bbcode uid stored and bbcode enabled --- 1080,1084 ---- } ! $text = mx_censor_text($text); // Parse bbcode if bbcode uid stored and bbcode enabled |