diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2018-08-21 14:57:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2018-08-21 14:57:13 +0000 |
commit | 9171317645de4d31c61c570a9e4fa765e09ecc4d (patch) | |
tree | 4c0f0c00e634df14cc1d0e2acf92f249317b70d8 /includes/specials/SpecialSearch.php | |
parent | 0a20a21168fdb16f75e622dc6919c6538798c28b (diff) | |
parent | c6a83871b59d2bfb6a8c77160b37fbfb2ca8edd6 (diff) | |
download | mediawikicore-9171317645de4d31c61c570a9e4fa765e09ecc4d.tar.gz mediawikicore-9171317645de4d31c61c570a9e4fa765e09ecc4d.zip |
Merge "Add Special:Search sort parameter without ui"
Diffstat (limited to 'includes/specials/SpecialSearch.php')
-rw-r--r-- | includes/specials/SpecialSearch.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 513d2763c115..86dcb721f862 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -77,6 +77,11 @@ class SpecialSearch extends SpecialPage { protected $fulltext; /** + * @var string + */ + protected $sort; + + /** * @var bool */ protected $runSuggestion = true; @@ -198,6 +203,11 @@ class SpecialSearch extends SpecialPage { $this->setExtraParam( 'prefix', $this->mPrefix ); } + $this->sort = $request->getVal( 'sort', SearchEngine::DEFAULT_SORT ); + if ( $this->sort !== SearchEngine::DEFAULT_SORT ) { + $this->setExtraParam( 'sort', $this->sort ); + } + $user = $this->getUser(); # Extract manually requested namespaces @@ -301,6 +311,7 @@ class SpecialSearch extends SpecialPage { $search->setFeatureData( 'rewrite', $this->runSuggestion ); $search->setLimitOffset( $this->limit, $this->offset ); $search->setNamespaces( $this->namespaces ); + $search->setSort( $this->sort ); $search->prefix = $this->mPrefix; Hooks::run( 'SpecialSearchSetupEngine', [ $this, $this->profile, $search ] ); |