Add $wgWikiId to override default wfWikiId() output. Solves bug 21086 (security issue...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 29 Nov 2009 16:13:40 +0000 (16:13 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 29 Nov 2009 16:13:40 +0000 (16:13 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/GlobalFunctions.php

index a87e6a0..42af146 100644 (file)
@@ -98,6 +98,7 @@ Hopefully we will remove this configuration var soon)
   CIDR ranges for blocking
 * $wgUseInstantCommons added for quick and easy enabling of Commons as a remote
   file repository
+* $wgWikiId added to override default output of wfWikiId()
 
 === New features in 1.16 ===
 
index a0644c6..5253829 100644 (file)
@@ -713,6 +713,12 @@ $wgDBservers               = false;
  */
 $wgLBFactoryConf    = array( 'class' => 'LBFactory_Simple' );
 
+/** 
+ * Unique identifier if you're paranoid and don't want $wgDBname as part of 
+ * wfWikiId(). See bug 21086
+ */
+$wgWikiId = false;
+
 /** How long to wait for a slave to catch up to the master */
 $wgMasterWaitTimeout = 10;
 
index 645bb4d..53e0b87 100644 (file)
@@ -2896,7 +2896,9 @@ function wfForeignMemcKey( $db, $prefix /*, ... */ ) {
  * This is used as a prefix in memcached keys
  */
 function wfWikiID() {
-       global $wgDBprefix, $wgDBname;
+       global $wgDBprefix, $wgDBname, $wgWikiId;
+       if( $wgWikiId )
+               return $wgWikiId;
        if ( $wgDBprefix ) {
                return "$wgDBname-$wgDBprefix";
        } else {