r73987 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73986‎ | r73987 | r73988 >
Date:21:42, 29 September 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Moved wgDBName out of $wgUseAjax / $wgEnableMWSuggest conditional - this needs to be done in deployment as well.
Modified paths:
  • /trunk/phase3/includes/ResourceLoaderModule.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoaderModule.php
@@ -1031,13 +1031,13 @@
10321032 'wgNamespaceIds' => $wgContLang->getNamespaceIds(),
10331033 'wgSiteName' => $wgSitename,
10341034 'wgFileExtensions' => $wgFileExtensions,
 1035+ 'wgDBname' => $wgDBname,
10351036 );
10361037 if ( $wgContLang->hasVariants() ) {
10371038 $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
10381039 }
10391040 if ( $wgUseAjax && $wgEnableMWSuggest ) {
10401041 $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate();
1041 - $vars['wgDBname'] = $wgDBname;
10421042 }
10431043
10441044 return $vars;

Comments

#Comment by Kaldari (talk | contribs)   22:04, 29 September 2010

This was needed so CentralNotice could use wgDBname as well. Since most users have $wgUseAjax and $wgEnableMWSuggest as true, this shouldn't actually affect a large percentage of users.

#Comment by 😂 (talk | contribs)   15:43, 30 September 2010
#Comment by Trevor Parscal (WMF) (talk | contribs)   16:46, 30 September 2010

Yeah, the dbname should probably be exported as the wiki ID as Brion mentions, but right now central notice banners are depending on the dbname, and people who are logged in and have mwsuggest turned off are having problems. That's why this is being done.

#Comment by 😂 (talk | contribs)   16:48, 30 September 2010

$wgEnableMWSuggest is the user preference? I don't see any variance on user prefs here.

#Comment by Trevor Parscal (WMF) (talk | contribs)   16:57, 30 September 2010

In the deployment branch there is. This was just a back-port of what is being put into production.

#Comment by Kaldari (talk | contribs)   17:20, 30 September 2010

Technically, all that CentralNotice needs is a unique non-localized identifier for the site, so wiki ID would work for our purposes. We're not actually using it to make a db connection. I suppose I could also use wgContentLanguage + wgNoticeProject. I didn't realize that exposing wgDBname universally would be controversial. If it needs to be reverted, I'm OK with that.

#Comment by Trevor Parscal (WMF) (talk | contribs)   17:23, 30 September 2010

Me too - but the concern is primarily about other people's wikis afaik, we've been exposing these dbnames for years.

Status & tagging log