Page MenuHomePhabricator

Pattern search feature shows snippet with wrong length
Closed, ResolvedPublic

Description

The pattern search, freshly implemented with T87455, shows on Special:AbuseFilter a column with a snippet of the searched pattern. That snippet was planned to have a character cap of 50 characters. However, I found a weird behaviour:

  1. Create a filter with a pattern like added_lines irlike 'xxxxxxxxxxxxxxxx'
  2. Perform a search (plain text, regex, whatever) for a

The snippet will show added_lines irlike 'xxxxxxx, which is 27 characters long.
This is due to a tiny math error in calculating what to show and where to cut.

Event Timeline

Change 423500 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Fix cap for pattern search

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

Huji removed a project: Patch-For-Review.

Change 423500 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Fix cap for pattern search

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