Fixed Phrase filter fails when searching for 0

Affected version
2.1.8

TickTackk

Well-known member
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;
    }
 

TickTackk

Well-known member
This also affects when using more filters menu (what's the official term for it?) and filtering by text and the templates filter system.
 

XF Bug Bot

XenForo bug fixer bot
Staff member
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