PrefixSearch: Avoid notice when no subpage exists
authorChad Horohoe <chadh@wikimedia.org>
Mon, 14 Jul 2014 15:42:59 +0000 (08:42 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Mon, 14 Jul 2014 15:42:59 +0000 (08:42 -0700)
Change-Id: I9e09b1c082e099f3b79716da5ab16239e256e4b2

includes/PrefixSearch.php

index 13696ad..f794b2a 100644 (file)
@@ -166,7 +166,9 @@ abstract class PrefixSearch {
        protected function specialSearch( $search, $limit ) {
                global $wgContLang;
 
-               list( $searchKey, $subpageSearch ) = explode( '/', $search, 2 );
+               $searchParts = explode( '/', $search, 2 );
+               $searchKey = $searchParts[0];
+               $subpageSearch = isset( $searchParts[1] ) ? $searchParts[1] : null;
 
                // Handle subpage search separately.
                if ( $subpageSearch !== null ) {