Fix overzealous prefix check in MWLBFactory
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 24 Mar 2019 03:07:56 +0000 (20:07 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 24 Mar 2019 03:08:01 +0000 (20:08 -0700)
Follow-up 9df277a4ba3

If the server array ommitted 'tablePrefix', Database will
use '' as the prefix, so if $wgDBprefix is also '', then
no error should happen.

Change-Id: Ic207c3fceae8fd45c87f7fa24678079217a60730

includes/db/MWLBFactory.php

index a930b3b..6ed693e 100644 (file)
@@ -109,7 +109,7 @@ abstract class MWLBFactory {
                                        }
 
                                        $ldTP = $mainConfig->get( 'DBprefix' ); // local domain prefix
-                                       $srvTP = $server['tablePrefix'] ?? null; // server table prefix
+                                       $srvTP = $server['tablePrefix'] ?? ''; // server table prefix
                                        if ( $srvTP !== '' && $srvTP !== $ldTP ) {
                                                self::reportMismatchedPrefixes( $srvTP, $ldTP );
                                        }