EBernhardson has uploaded a new change for review.

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

Change subject: Don't pass null to constructor that requires array
......................................................................

Don't pass null to constructor that requires array

The namespaces variable is nullable, set by SearchEngine::replacePrefixes().
Icd762939 introduced type hints to CirrusSearch\Searcher::__construct which
does not accept this nullable value and causes exceptions.  CirrusSearch
doesn't care about the distinction between null and array so just convert
those into a blank array.

Bug: T98082
Change-Id: Ic0d6adcde305d9ed4ccd1edb0406080f616a393e
---
M includes/CirrusSearch.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/27/208827/1

diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 58ac7f6..5900ae4 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -72,7 +72,7 @@
 
                $context = RequestContext::getMain();
                $user = $context->getUser();
-               $searcher = new Searcher( $this->offset, $this->limit, 
$this->namespaces, $user );
+               $searcher = new Searcher( $this->offset, $this->limit, 
$this->namespaces ?: array(), $user );
 
                // Ignore leading ~ because it is used to force displaying 
search results but not to effect them
                if ( substr( $term, 0, 1 ) === '~' )  {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0d6adcde305d9ed4ccd1edb0406080f616a393e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

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

Reply via email to