Page MenuHomePhabricator

Sidebar search form should not use Special:Search view URL as target
Closed, ResolvedPublic

Description

The mini search form in the sitebar uses a view URL for Special:Search as the form submission target/action.

This tends to produce a final URL like this:

http://en.wikipedia.org/wiki/Special:Search?search=fooey&go=Go

While pretty, it has the distinct disadvantage that it frequently collides with "pretty URL" configurations whose rewrite rules don't pass on the original query string...

So for instance the incoming URL fragment:

/wiki/Special:Search?search=fooey&go=Go

might get rewritten into:

/index.php?title=Special:Search

and our actual search parameters are gone. We then get bug reports, mails, or IRC visitors asking why search doesn't work on their wiki.

The sidebar form should instead use the script target, the way Special:Search's form does:

<form id="search" method="get" action="/w/index.php"><input name="title" type="hidden" value="Special:Search" />

this produces a URL which will work on any configuration, and will reduce the incidence of surprises.

AFAIK we don't explicitly create any other URLs where we append parameters to a view URL in this way, and we should be avoiding it here too.


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/Special:Search?search=fooey&go=Go

Details

Reference
bz16823

Related Objects