Page MenuHomePhabricator

Use expression builder instead of raw SQL in GlobalBlocking
Closed, ResolvedPublic

Description

Now that T210206: Deprecate raw SQL conditions for IDatabase methods (select, insert, etc.) is done, this extension should migrate away from building and passing around raw SQL to expression builders.

It improves readability and security of the code and is more aligned with industry practices easing onboarding.

For more information check T210206 and T350075.

Calls to Database::addQuotes(), ::buildLike(), ::makeList() indicate that raw SQL is being built and passed around.

Event Timeline

The FixBlockerUsername.php and PopulateCentralId.php maintenance scripts make use of the BETWEEN operator.

You can turn between to a combined condition of "and". That should be rather easy.

Change #1022560 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/GlobalBlocking@master] Use expression builder to avoid some raw sql

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

Change #1022560 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Use expression builder to avoid some raw sql

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