Gerrit Patch Uploader has uploaded a new change for review.

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

Change subject: Add autocomplete for Special:Redirect subpages
......................................................................

Add autocomplete for Special:Redirect subpages

Implements prefixSearchSubpages()

Change-Id: I23142450d6eb0b78761fb4e2286d66e81374b413
---
M includes/specials/SpecialRedirect.php
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/175388/1

diff --git a/includes/specials/SpecialRedirect.php 
b/includes/specials/SpecialRedirect.php
index 2022d74..464f71a 100644
--- a/includes/specials/SpecialRedirect.php
+++ b/includes/specials/SpecialRedirect.php
@@ -263,6 +263,26 @@
                $form->setMethod( 'get' );
        }
 
+       /**
+        * Return an array of subpages beginning with $search that this special 
page will accept.
+        *
+        * @param string $search Prefix to search for
+        * @param int $limit Maximum number of results to return
+        * @return string[] Matching subpages
+        */
+       public function prefixSearchSubpages( $search, $limit = 10 ) {
+               return self::prefixSearchArray(
+                       $search,
+                       $limit,
+                       array(
+                               "file",
+                               "page",
+                               "revision",
+                               "user",
+                       )
+               );
+       }
+
        protected function getGroupName() {
                return 'redirects';
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/175388
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23142450d6eb0b78761fb4e2286d66e81374b413
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to