function stripBBCode($txt, $len = 0) { if (!$txt) { return; } if (!self::$emoticons) { self::$emoticons = smile::getEmoticons(0); } $txt = smile::purify($txt); if ($len && JString::strlen($txt) > $len) { $txt = JString::substr($txt, 0, $len) . '...'; } $txt = self::escape($txt); $txt = self::prepareContent($txt); return $txt; }