App\Libraries\BBCodeForDB::parseList PHP Method

parseList() public method

with phpBB original implementation.
public parseList ( $text )
    public function parseList($text)
    {
        $patterns = ["/\\[(list(?:=.+?)?)\\]/", '[/list]'];
        $counts = [preg_match_all($patterns[0], $text), substr_count($text, $patterns[1])];
        $limit = min($counts);
        $text = str_replace('[*]', "[*:{$this->uid}]", $text);
        $text = str_replace('[/*]', '', $text);
        $text = preg_replace($patterns[0], "[\\1:{$this->uid}]", $text, $limit);
        $text = preg_replace('/' . preg_quote($patterns[1], '/') . '/', "[/list:o:{$this->uid}]", $text, $limit);
        return $text;
    }