[ticket/12426] Rework of user search

Small code revisions requested in audit

PHPBB3-12426