App\Libraries\BBCodeForDB::parseQuote PHP Method

parseQuote() public method

this is quite different and much more dumb than the one in phpbb
public parseQuote ( $text )
    public function parseQuote($text)
    {
        $patterns = ["/\\[(quote(?:=".+?")?)\\]/", '[/quote]'];
        $counts = [preg_match_all($patterns[0], $text), substr_count($text, $patterns[1])];
        $limit = min($counts);
        $text = preg_replace($patterns[0], "[\\1:{$this->uid}]", $text, $limit);
        $text = preg_replace('/' . preg_quote($patterns[1], '/') . '/', "[/quote:{$this->uid}]", $text, $limit);
        return $text;
    }