Fixed Advanced search is broken for guests

Xon

Well-known member
Affected version
2.3.0 Beta 1
Accessing https://xenforo.com/community/search/?type=conversation_message as a guest throws an internal server error.

Accessing https://xenforo.com/community/search/search returns "Please specify a search query or the name of a member.".


The internal server error is caused by:
PHP:
    /**
     * @return array<string, mixed>
     */
    public function getSearchFormTab(): array
    {
        if (!\XF::visitor()->user_id)
        {
            return null;
        }

        return [
            'title' => \XF::phrase('search_direct_messages'),
            'order' => 1100,
        ];
    }

This should have the return type ?array not array.
 
This was also sorted for Beta 2 while our bug bot was misbehaving.
He have been working hard for years, let them have a day vacation.
Robot Reaction GIF by GEICO
 
Top Bottom