Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php |
— | — | @@ -24,10 +24,13 @@ |
25 | 25 | * @return bool |
26 | 26 | */ |
27 | 27 | public function beforePageDisplayHTML( &$out, &$text ) { |
28 | | - global $wgRequest, $wgConf, $wgDBname, $wgEnableZeroRatedMobileAccessTesting; |
| 28 | + global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting; |
29 | 29 | wfProfileIn( __METHOD__ ); |
30 | 30 | |
31 | | - list( $site, $lang ) = $wgConf->siteFromDB( $wgDBname ); |
| 31 | + $dB = wfGetDB( DB_MASTER ); |
| 32 | + $dBname = $dB->getDBname(); |
| 33 | + |
| 34 | + list( $site, $lang ) = $wgConf->siteFromDB( $dBname ); |
32 | 35 | if ( $site == 'wikipedia' || $wgEnableZeroRatedMobileAccessTesting ) { |
33 | 36 | |
34 | 37 | $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : ''; |