Page MenuHomePhabricator

insource and intitle regular expression search doesn't allow final escaped slash
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:
Submit the query insource:/\// or intitle:/\// in CirrusSearch.

Practical example link with narrowed search domain: Search results for “: slash insource:/\//” (English Wikipedia).

Actual Results:
Error message: An error has occurred while searching: Regular expression syntax error at unknown: unknown. Apparently there is some kind of parsing error.

Expected Results:
Should search for pages containing / or titles in the given namespaces containing /. The query also fails if more valid regular expression characters are added before \/: insource:/word\// or intitle:/word\//.

Search succeeds when \/ is not the last thing in the regex: insource:/\/./ or intitle:/\/./.

Again, example link for English Wikipedia: Search results for “: slash insource:/\/./”


This is probably a separate issue, but insource:// and intitle://, and insource:/// and insource:////, etc., have an odd error: An error has occurred while searching: We could not complete your search due to a temporary problem. Please try again later. I would've expected something like "You can't search for an empty regular expression" and "Invalid syntax: / found after insource:// syntax, expected space character or end of query".

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
TJones triaged this task as Medium priority.Aug 27 2020, 8:56 PM

Change 813830 had a related patch set uploaded (by EJoseph; author: EJoseph):

[mediawiki/extensions/CirrusSearch@master] Trim only first occurence of slash on Insource and Intitle regex value

https://gerrit.wikimedia.org/r/813830

Change 813830 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Trim only first occurence of slash on Insource and Intitle regex value

https://gerrit.wikimedia.org/r/813830