HomePhabricator

Prevent uncaught warnings/exception on Special:AbuseFilter

This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Prevent uncaught warnings/exception on Special:AbuseFilter

This patch addresses two issues observed in WMF production:

  • Specifying a search mode without a search pattern would result in a call to mb_stripos (in AbuseFilterPager) with an empty delimiter, which triggers a PHP warning. Avoid this by checking that the search pattern is not the empty string, and unset the search mode if that's the case.
  • Trying to use an invalid search mode would result in an unhandled LogicException. We have some code in place to check the validity of the URL parameter, but the relevant code didn't reset the search mode to null, hence AbuseFilterPager would throw before we can show a pretty error to the user.

Bug: T265994
Change-Id: Ib19d36d6265981097bbb551783fdac8bdaa98854
(cherry picked from commit 215f16a17700337e3fcedd5bfbe40bbbd09be967)

Details

Provenance
DaimonaAuthored on Oct 20 2020, 11:56 AM
UrbanecmCommitted on Oct 20 2020, 1:38 PM
Parents
rEABF51ce0bacf681: Merge "Delegate some switch cases to the parent in GlobalAFPager"
Branches
Unknown
Tags
Unknown
ChangeId
Ib19d36d6265981097bbb551783fdac8bdaa98854