mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-15 02:53:52 +00:00
Unhardcode the limit "find no more than 250 results" in doSearchQuery()
Here we add $wgReplaceTextResultsLimit variable (default: 250) to allow administrator to change this limit. Change-Id: Iee9d958db8ddd245a98ec6a3d5b5cf8ef1d80370
This commit is contained in:
parent
efb62c28a2
commit
b7cf9f4b09
|
@ -78,6 +78,7 @@
|
|||
]
|
||||
},
|
||||
"config": {
|
||||
"ReplaceTextResultsLimit": 250,
|
||||
"ReplaceTextUser": null
|
||||
},
|
||||
"manifest_version": 1
|
||||
|
|
|
@ -34,6 +34,8 @@ class ReplaceTextSearch {
|
|||
public static function doSearchQuery(
|
||||
$search, $namespaces, $category, $prefix, $use_regex = false
|
||||
) {
|
||||
global $wgReplaceTextResultsLimit;
|
||||
|
||||
$dbr = wfGetDB( DB_REPLICA );
|
||||
$tables = [ 'page', 'revision', 'text', 'slots', 'content' ];
|
||||
$vars = [ 'page_id', 'page_namespace', 'page_title', 'old_text' ];
|
||||
|
@ -56,9 +58,7 @@ class ReplaceTextSearch {
|
|||
self::prefixCondition( $prefix, $conds );
|
||||
$options = [
|
||||
'ORDER BY' => 'page_namespace, page_title',
|
||||
// 250 seems like a reasonable limit for one screen.
|
||||
// @TODO - should probably be a setting.
|
||||
'LIMIT' => 250
|
||||
'LIMIT' => $wgReplaceTextResultsLimit
|
||||
];
|
||||
|
||||
return $dbr->select( $tables, $vars, $conds, __METHOD__, $options );
|
||||
|
|
Loading…
Reference in a new issue