XF 2.2 Article Constraints

I completely overlooked that $htmlMaxLength is set to -1 by default so it's not really going to work :P because -1 * 60 will return -60 which wouldn't really do anything good as XF does this check:
PHP:
        if ($htmlMaxLength < 0)
        {

Try:
PHP:
    public function convertToBbCode($html, $htmlMaxLength = -1)
    {
        if ($htmlMaxLength < 0)
        {
            $htmlMaxLength = 60 * $this->options()->messageMaxLength;
        }
      
        return parent::convertToBbCode($html, $htmlMaxLength);
    }
 
I have some running around to do shortly, so not much time to contribute here. It's too bad that $extras wasn't added to public function convertToBbCode($html, $htmlMaxLength = -1), it would make passing a forum type here really easy. But there is no $extras so you may need to get creative to detect if indeed the $html belongs to an Article or not.

Edit: I didn't put that extra ICODE in this message, and can't find it when editing this... hmmmm
 
Top Bottom