Fixed Phrase filter fails when searching for 0

TickTackk

Well-known member
Affected version
2.1.8
In file src/XF/Admin/Controller/Language.php
PHP:
        $filter = $this->filter('_xfFilter', [
            'text' => 'str',
            'prefix' => 'bool'
        ]);
        if (strlen($filter['text']))
        {
            $phrasesFinder->Phrase->searchTitle($filter['text'], $filter['prefix']);
        }
strlen is used to check the text length but inside XF:Phrase finder
PHP:
    public function searchTitle($match, $prefixMatch = false)
    {
        if ($match)
        {
            $this->where(
                $this->columnUtf8('title'),
                'LIKE',
                $this->escapeLike($match, $prefixMatch ? '?%' : '%?%')
            );
        }

        return $this;
    }
 
This also affects when using more filters menu (what's the official term for it?) and filtering by text and the templates filter system.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.9).

Change log:
Allow searches for '0' in template and phrase titles and contents
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom