MediaWiki r37893 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r37892‎ | r37893 (on ViewVC)‎ | r37894 >
Date:21:51, 21 July 2008
Author:demon
Status:old
Tags:
Comment:
Allow $wgCookiePrefix to be set by the user. Default is false which keeps current behavior in Setup. Fixes bug 14843.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Setup.php
===================================================================
--- trunk/phase3/includes/Setup.php	(revision 37892)
+++ trunk/phase3/includes/Setup.php	(revision 37893)
@@ -204,14 +204,16 @@
 # Set default shared prefix
 if( $wgSharedPrefix === false ) $wgSharedPrefix = $wgDBprefix;
 
-if ( in_array('user', $wgSharedTables) && $wgSharedDB && $wgSharedPrefix ) {
-	$wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
-} elseif ( in_array('user', $wgSharedTables) && $wgSharedDB ) {
-	$wgCookiePrefix = $wgSharedDB;
-} elseif ( $wgDBprefix ) {
-	$wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
-} else {
-	$wgCookiePrefix = $wgDBname;
+if( !$wgCookiePrefix ) {
+	if ( in_array('user', $wgSharedTables) && $wgSharedDB && $wgSharedPrefix ) {
+		$wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
+	} elseif ( in_array('user', $wgSharedTables) && $wgSharedDB ) {
+		$wgCookiePrefix = $wgSharedDB;
+	} elseif ( $wgDBprefix ) {
+		$wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
+	} else {
+		$wgCookiePrefix = $wgDBname;
+	}
 }
 $wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
 
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 37892)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 37893)
@@ -1528,6 +1528,12 @@
 $wgDisableCookieCheck = false;
 
 /**
+ * Set $wgCookiePrefix to use a custom one. Setting to false sets the default of
+ * using the database name.
+ */
+$wgCookiePrefix = false;
+
+/**
  * Set authentication cookies to HttpOnly to prevent access by JavaScript,
  * in browsers that support this feature. This can mitigates some classes of
  * XSS attack.
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 37892)
+++ trunk/phase3/RELEASE-NOTES	(revision 37893)
@@ -68,6 +68,8 @@
   with MimeMagic.
 * Added $wgDirectoryMode, which allows for setting the default CHMOD value when
   creating new directories.
+* (bug 14843) $wgCookiePrefix can be set by LocalSettings now, false defaults 
+  current behavior.
 
 === New features in 1.13 ===
 

Follow-up revisions

Rev.Commit summaryAuthorDate
r44454(bug 14843) IRC should flag redirects with "R" like it does with bots, etc.demon17:42, 11 December 2008
r44456Reverting r44454 "(bug 14843) IRC should flag redirects with "R" like it does...brion18:44, 11 December 2008

Status & tagging log

  • 15:29, 12 September 2011 Meno25 (Talk | contribs) changed the status of r37893 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox