CBPTaskResult::ConvertBBCode: Bitrix method

      
<?php 
//  CBPTaskResult :: ConvertBBCode()
//  /dist/bitrix/modules/bizproc/classes/general/taskservice.php:770

    
function ConvertBBCode($text)
    {
        
$text preg_replace(
            
"'(?<=^|[\s.,;:!?\#\-\*\|\[\(\)\{\}]|\s)((http|https|news|ftp|aim|mailto)://[\.\-\_\:a-z0-9\@]([^\"\s\'\[\]\{\}])*)'is",
            
"[url]\\1[/url]",
            
$text
        
);

        
$text preg_replace_callback("#\[img\](.+?)\[/img\]#i", array($this"ConvertBCodeImageTag"), $text);

        
$text preg_replace_callback(
            
"/\[url\]([^\]]+?)\[\/url\]/i".BX_UTF_PCRE_MODIFIER,
            array(
$this"ConvertBCodeAnchorTag"),
            
$text
        
);
        
$text preg_replace_callback(
            
"/\[url\s*=\s*([^\]]+?)\s*\](.*?)\[\/url\]/i".BX_UTF_PCRE_MODIFIER,
            array(
$this"ConvertBCodeAnchorTag"),
            
$text
        
);

        
$text preg_replace(
            array(
                
"/\[b\](.+?)\[\/b\]/is".BX_UTF_PCRE_MODIFIER,
                
"/\[i\](.+?)\[\/i\]/is".BX_UTF_PCRE_MODIFIER,
                
"/\[s\](.+?)\[\/s\]/is".BX_UTF_PCRE_MODIFIER,
                
"/\[u\](.+?)\[\/u\]/is".BX_UTF_PCRE_MODIFIER
            
),
            array(
                
"<b>\\1</b>",
                
"<i>\\1</i>",
                
"<s>\\1</s>",
                
"<u>\\1</u>"
            
),
            
$text
        
);

        return 
$text;
    }