function stripBBCode($txt, $len=0) { if (!$txt) return; $bbcode = KunenaBbcode::getInstance(); $bbcode->SetLimit($len); $bbcode->SetPlainMode(true); $bbcode->SetDetectURLs(true); $bbcode->SetURLPattern('<a href="{$url/h}" target="_blank" rel="nofollow">{$text/h}</a>'); $bbcode->SetURLTarget('_blank'); $txt = strip_tags($bbcode->Parse($txt)); $txt = self::prepareContent ( $txt ); return $txt; }
/** * @param $txt * @param int $len * @param bool $html * * @return string|void */ public static function stripBBCode($txt, $len = 0, $html = true) { if (!$txt) { return; } $bbcode = KunenaBbcode::getInstance(self::$relative); $bbcode->SetLimit($len); $bbcode->SetPlainMode(true); $bbcode->SetAllowAmpersand($html); $txt = $bbcode->Parse($txt); $txt = self::prepareContent($txt); $txt = strip_tags($txt); if (!$html) { $txt = $bbcode->UnHTMLEncode($txt); } return $txt; }