Last modified: 2012-07-01 20:46:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28766, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26766 - Page navigates to the 'Main page' for the search with the character "#'
Page navigates to the 'Main page' for the search with the character "#'
Status: RESOLVED DUPLICATE of bug 17006
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-17 10:13 UTC by Nadeesha
Modified: 2012-07-01 20:46 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nadeesha 2011-01-17 10:13:07 UTC
Steps to reproduce:
1. Input the '#' as the search string.
2. Click on the 'Go' button.

Actual Results:
Main page displayed.

Expected Results:
'There were no results matching the query.' message button should display.
Comment 1 Mark A. Hershberger 2011-01-22 05:46:15 UTC
It could take you to "Number sign" in the same way that @ takes you to "At sign" but AFAICT, "Go" simply puts the text in the URL.  Thus, @ takes you to "At sign" because @ redirects there.  Given that the # in the URL is, essentially, invisible to MW, I'm not sure there is much to do about it.
Comment 2 MZMcBride 2011-01-22 05:57:09 UTC
It should be possible to catch this gracefully, in theory at least.

All searches go through "Special:Search", even searches using the "Go" button. In Monobook, this was done using a &go=Go parameter, e.g. <http://en.wikipedia.org/w/index.php?title=Special:Search&search=|&go=Go>. Vector seems to do this a little bit differently (omitting the &go=Go parameter), but the general idea is still the same.

"#" is an illegal character in MediaWiki page titles. "|" is also an illegal character in MediaWiki page titles, but it can be caught gracefully. Other sites, such as Google, can gracefully catch "#", e.g. <http://www.google.com/search?q=%23>.

I don't know of any technical reason "#" can't be caught gracefully when it's input into the search field directly. It may require special-casing in includes/specials/SpecialSearch.php, but there isn't anything impossibile here (that I'm aware of) that requires a "wontfix" resolution.

Re-opening this for now.
Comment 3 Brion Vibber 2011-11-30 16:12:24 UTC
*** Bug 32728 has been marked as a duplicate of this bug. ***
Comment 4 Brion Vibber 2011-11-30 16:12:42 UTC
*** Bug 23799 has been marked as a duplicate of this bug. ***
Comment 5 Brion Vibber 2011-11-30 16:14:08 UTC
The # is definitely not invisible to MediaWiki -- it'd be encoded as part of the query string, not a literal # on the form submission.

It's only doing this because it's shoving things through title parsing to check for matches.
Comment 6 Liangent 2011-11-30 16:18:40 UTC
Seems FIXED (maybe accidentally?)

Searching for '#' on enwiki sends me to the main page.
Comment 7 Brion Vibber 2011-11-30 16:19:43 UTC
That would be an instance of the bug, not a fixed bug.
Comment 8 Liangent 2011-11-30 16:21:01 UTC
(In reply to comment #7)
> That would be an instance of the bug, not a fixed bug.

Sorry I misread the bug as "users should be sent to the main page".
Comment 9 Daniel Friesen 2011-12-01 23:28:05 UTC
Wait, why is what sounds like Title::newFromText( '#' ) being detected as the Main Page? That shouldn't default to anything like the main page. And it shouldn't be a title that can exist. Even if it could, we shouldn't be sending anyone anywhere when getText returns ''.
Comment 10 Platonides 2011-12-02 21:22:18 UTC
Because Title::newFromText( 'Foo#Bar' ) sends you to page Foo (section bar), so Title::newFromText( '#' ) sends you to section '' of page ''. And the default page if given '' is the main page. You can view how searching #Foo, sends you to Main_Page#Foo.
Comment 11 Liangent 2011-12-12 16:42:42 UTC
This also happens on search for ':' (a colon).
Comment 12 Platonides 2012-02-20 15:43:28 UTC
*** Bug 34545 has been marked as a duplicate of this bug. ***
Comment 13 Krinkle 2012-05-11 17:19:26 UTC
As @Platonides already touched, this is not limited to search.

The following also results in a link to the Main Page: [[#|foo]]

See also bug 17006
Comment 14 Krinkle 2012-07-01 20:46:28 UTC

*** This bug has been marked as a duplicate of bug 17006 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links