Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/170594
Change subject: Fix undefined offset in updateOneSearchIndexConfig
......................................................................
Fix undefined offset in updateOneSearchIndexConfig
isset( $wgCirrusSearchReplicas[ $this->indexType ] ) returns true
if $wgCirrusSearchReplicas is a string, so we need to also
check type of $wgCirrusSearchReplicas.
Bug: 72888
Change-Id: I1d8c13cbc2dd5a34b0e5b877a046d314fdefc236
---
M maintenance/updateOneSearchIndexConfig.php
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/94/170594/1
diff --git a/maintenance/updateOneSearchIndexConfig.php
b/maintenance/updateOneSearchIndexConfig.php
index f348dd9..6c22cbb 100644
--- a/maintenance/updateOneSearchIndexConfig.php
+++ b/maintenance/updateOneSearchIndexConfig.php
@@ -1021,13 +1021,16 @@
private function getReplicaCount() {
global $wgCirrusSearchReplicas;
+
// If $wgCirrusSearchReplicas is an array of index type to
number of replicas then respect that
- if ( isset( $wgCirrusSearchReplicas[ $this->indexType ] ) ) {
- return $wgCirrusSearchReplicas[ $this->indexType ];
- }
if ( is_array( $wgCirrusSearchReplicas ) ) {
- $this->error( 'If wgCirrusSearchReplicas is an array it
must contain all index types.', 1 );
+ if ( isset( $wgCirrusSearchReplicas[ $this->indexType ]
) ) {
+ return $wgCirrusSearchReplicas[
$this->indexType ];
+ } else {
+ $this->error( 'If wgCirrusSearchReplicas is an
array it must contain all index types.', 1 );
+ }
}
+
// Otherwise its just a raw scalar so we should respect that too
return $wgCirrusSearchReplicas;
}
--
To view, visit https://gerrit.wikimedia.org/r/170594
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d8c13cbc2dd5a34b0e5b877a046d314fdefc236
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits