aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Category/CategoryViewer.php
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2023-10-30 20:10:26 +0100
committerJames D. Forrester <jforrester@wikimedia.org>2023-10-30 17:56:35 -0400
commit17589adcc48d1bb19e5f097da6c1724e41a35a84 (patch)
tree6ba86e381a42db787e1c55097cab01fa29789979 /includes/Category/CategoryViewer.php
parent9d3eae6684f1570653c6632d122d61dbc8289e9a (diff)
downloadmediawikicore-17589adcc48d1bb19e5f097da6c1724e41a35a84.tar.gz
mediawikicore-17589adcc48d1bb19e5f097da6c1724e41a35a84.zip
Migrate another batch to use $db->expr instead of raw SQL
Bug: T210206 Change-Id: I327517fef250c24392565a26bbe7b296dc19508a
Diffstat (limited to 'includes/Category/CategoryViewer.php')
-rw-r--r--includes/Category/CategoryViewer.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/includes/Category/CategoryViewer.php b/includes/Category/CategoryViewer.php
index f0d4f18a843f..61fdae4fbfda 100644
--- a/includes/Category/CategoryViewer.php
+++ b/includes/Category/CategoryViewer.php
@@ -388,11 +388,17 @@ class CategoryViewer extends ContextSource {
# set in $wgCategoryCollation, pagination might go totally haywire.
$extraConds = [ 'cl_type' => $type ];
if ( isset( $this->from[$type] ) ) {
- $extraConds[] = 'cl_sortkey >= '
- . $dbr->addQuotes( $this->collation->getSortKey( $this->from[$type] ) );
+ $extraConds[] = $dbr->expr(
+ 'cl_sortkey',
+ '>=',
+ $this->collation->getSortKey( $this->from[$type] )
+ );
} elseif ( isset( $this->until[$type] ) ) {
- $extraConds[] = 'cl_sortkey < '
- . $dbr->addQuotes( $this->collation->getSortKey( $this->until[$type] ) );
+ $extraConds[] = $dbr->expr(
+ 'cl_sortkey',
+ '<',
+ $this->collation->getSortKey( $this->until[$type] )
+ );
$this->flip[$type] = true;
}