Page MenuHomePhabricator

Searchmenu-* messages are given $1 HTML-encoded, unable to urlencode it
Open, LowPublic

Description

“searchmenu-*” messages (e.g. searchmenu-exists) are given the searched title in $1, so that they display something like “There is a page named "[[:$1]]" on this wiki.” However SpecialSearch::showCreateLink() escapes the search query using wfEscapeWikiText.

This means e.g. quotes are escaped as HTML entities when received in searchmenu-new, and you are unable to use the original query in links (e.g. to search in other namespaces) in the message, like “[{{fullurl:Special:Search|search={{urlencode:$1}}&ns14=1&fulltext=Search&advanced=1}} Search categories]” since the urlencode leads to the HTML-encoded quote in the URL (and OTOH, omitting the urlencode would break queries containing e.g. an ampersand).

See https://commons.wikimedia.org/wiki/MediaWiki_talk:Searchmenu-new#Quotes_get_destroyed

Maybe we could have an alternate parameter $2 containing the original unencoded query?


Version: unspecified
Severity: minor

Details

Reference
bz39456

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:56 AM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz39456.
bzimport added a subscriber: Unknown Object (MLST).