- Affected version
- 2.2.8 Patch 1
If "exact match" is selected, with no email, then on navigating to page 2 of the search results an error is thrown.
This is the line that is triggering it, but the issue is "exact match" is being added into the filter options when it isn't valid. A similar error likely exists for the username field.
I think the fix should be
Code:
ErrorException: [E_WARNING] Undefined array key "address" src/XF/Searcher/User.php:134
#0 src/XF/Searcher/User.php(134): XF::handlePhpError(2, '[E_WARNING] Und...', '/var/www/sites/...', 134)
#1 src/XF/Searcher/AbstractSearcher.php(409): XF\Searcher\User->applySpecialCriteriaValue(Object(XF\Finder\User), 'email', Array, Array, 'like', NULL)
#2 src/XF/Searcher/AbstractSearcher.php(402): XF\Searcher\AbstractSearcher->applyCriteriaValue(Object(XF\Finder\User), 'email', Array, Array, 'like', NULL)
#3 src/XF/Searcher/AbstractSearcher.php(365): XF\Searcher\AbstractSearcher->applyCriteria(Object(XF\Finder\User), Array)
#4 src/XF/Admin/Controller/User.php(62): XF\Searcher\AbstractSearcher->getFinder()
#5 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\User->actionList(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:User', 'List', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\User), NULL)
#7 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\User), NULL)
#8 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#10 src/XF.php(512): XF\App->run()
#11 admin.php(13): XF::runApp('XF\\Admin\\App')
#12 {main}
SQL:
if ($key == 'email')
{
if (is_array($value))
{
$email = $value['address'];
I think the fix should be
$email = $value['address'] ?? ''
as this allows for finding users without an email address. This is possible on the first page, but fails on the second page.