r37893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37892‎ | r37893 | 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:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -204,14 +204,16 @@
205205 # Set default shared prefix
206206 if( $wgSharedPrefix === false ) $wgSharedPrefix = $wgDBprefix;
207207
208 -if ( in_array('user', $wgSharedTables) && $wgSharedDB && $wgSharedPrefix ) {
209 - $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
210 -} elseif ( in_array('user', $wgSharedTables) && $wgSharedDB ) {
211 - $wgCookiePrefix = $wgSharedDB;
212 -} elseif ( $wgDBprefix ) {
213 - $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
214 -} else {
215 - $wgCookiePrefix = $wgDBname;
 208+if( !$wgCookiePrefix ) {
 209+ if ( in_array('user', $wgSharedTables) && $wgSharedDB && $wgSharedPrefix ) {
 210+ $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
 211+ } elseif ( in_array('user', $wgSharedTables) && $wgSharedDB ) {
 212+ $wgCookiePrefix = $wgSharedDB;
 213+ } elseif ( $wgDBprefix ) {
 214+ $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
 215+ } else {
 216+ $wgCookiePrefix = $wgDBname;
 217+ }
216218 }
217219 $wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
218220
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1528,6 +1528,12 @@
15291529 $wgDisableCookieCheck = false;
15301530
15311531 /**
 1532+ * Set $wgCookiePrefix to use a custom one. Setting to false sets the default of
 1533+ * using the database name.
 1534+ */
 1535+$wgCookiePrefix = false;
 1536+
 1537+/**
15321538 * Set authentication cookies to HttpOnly to prevent access by JavaScript,
15331539 * in browsers that support this feature. This can mitigates some classes of
15341540 * XSS attack.
Index: trunk/phase3/RELEASE-NOTES
@@ -68,6 +68,8 @@
6969 with MimeMagic.
7070 * Added $wgDirectoryMode, which allows for setting the default CHMOD value when
7171 creating new directories.
 72+* (bug 14843) $wgCookiePrefix can be set by LocalSettings now, false defaults
 73+ current behavior.
7274
7375 === New features in 1.13 ===
7476

Follow-up revisions

RevisionCommit 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