Simplify BBCode::toPlaintext

- Keep white spaces after tags
This commit is contained in:
Hypolite Petovan 2019-05-27 12:02:12 -04:00
parent 596b5b0982
commit 5f9fb1f14f

View File

@ -355,7 +355,7 @@ class BBCode extends BaseObject
*/
public static function toPlaintext($text, $keep_urls = true)
{
$naked_text = preg_replace('/\[(.+?)\]\s*/','', $text);
$naked_text = preg_replace('/\[.+?\]/','', $text);
if (!$keep_urls) {
$naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text);
}