r72806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72805‎ | r72806 | r72807 >
Date:14:24, 11 September 2010
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Quickfix for Fatal error: don't die on anonymous users.
Modified paths:
  • /trunk/phase3/includes/ResourceLoaderModule.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoaderModule.php
@@ -855,6 +855,10 @@
856856 global $wgAllowUserCssPrefs;
857857 if ( $wgAllowUserCssPrefs ) {
858858 $user = User::newFromName( $context->getUser() );
 859+ if ( $user === false ) {
 860+ $user = User::newFromId( 0 );
 861+ }
 862+
859863 $rules = array();
860864 if ( ( $underline = $user->getOption( 'underline' ) ) < 2 ) {
861865 $rules[] = "a { text-decoration: " . ( $underline ? 'underline' : 'none' ) . "; }";

Comments

#Comment by Nikerabbit (talk | contribs)   14:32, 11 September 2010

Can someone review that this is the correct course of action?

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

This worked fine, but this code has been refactored to resolve other issues (exposing user options to people they don't belong to)

Status & tagging log