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

Daimona created this task.Apr 2 2018, 5:48 PM
Restricted Application added subscribers: Scoopfinder, Aklapper. · View Herald TranscriptApr 2 2018, 5:48 PM

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 closed this task as Resolved.Apr 4 2018, 2:08 AM
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