[ticket/269] Use trimmessage tool as extension and add test

B3P-269
This commit is contained in:
Marc Alexander
2014-06-27 17:39:16 +02:00
parent 87bf71684d
commit 7d0edf7403
3 changed files with 23 additions and 12 deletions

View File

@@ -412,21 +412,14 @@ function character_limit(&$title, $limit = 0)
*/
function get_sub_taged_string($message, $bbcode_uid, $length)
{
global $portal_root_path, $phpEx;
if(!class_exists('phpbb_trim_message'))
if (class_exists('\nickvergessen\trimmessage\trim_message'))
{
include($portal_root_path . 'includes/trim_message/trim_message.' . $phpEx);
$trim = new \nickvergessen\trimmessage\trim_message($message, $bbcode_uid, $length);
$message = $trim->message();
unset($trim);
}
if(!class_exists('phpbb_trim_message_bbcodes'))
{
include($portal_root_path . 'includes/trim_message/bbcodes.' . $phpEx);
}
$object = new phpbb_trim_message($message, $bbcode_uid, $length);
// Ready to get parsed:
return $object->message();
return $message;
}
function ap_validate($str)