From c30da5b0e968d95afb6f2c09dcb169467931d50a Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 14 Jul 2014 08:42:59 -0700 Subject: [PATCH] PrefixSearch: Avoid notice when no subpage exists Change-Id: I9e09b1c082e099f3b79716da5ab16239e256e4b2 --- includes/PrefixSearch.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php index 13696ad5e1..f794b2aad4 100644 --- a/includes/PrefixSearch.php +++ b/includes/PrefixSearch.php @@ -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 ) { -- 2.20.1