EBernhardson has uploaded a new change for review.

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

Change subject: Dont throw warnings on misconfigured morelike settings message
......................................................................

Dont throw warnings on misconfigured morelike settings message

If the message is malformed and doesn't strictly adhere to "foo:bar"
formatting we can end up with quite a few warning notices in the logs.
Instead of raising all those warning's just gracefully handle a
malformed string.

It would be nice if we had some sort of way to validate the message on
save, both at translatewiki and if local admins change the message, but
I'm not sure how to accomplish that.

Change-Id: I1d22a13bae4fe32b7c08267d8c538a6c2d167c07
---
M includes/Hooks.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 933f811..1dc3b07 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -186,6 +186,9 @@
                );
 
                foreach ( $lines as $line ) {
+                       if ( false === strpos( $line, ':' ) ) {
+                               continue;
+                       }
                        list( $k, $v ) = explode( ':', $line, 2 );
                        switch( $k ) {
                        case 'min_doc_freq':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d22a13bae4fe32b7c08267d8c538a6c2d167c07
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