r58407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58406‎ | r58407 | r58408 >
Date:21:34, 1 November 2009
Author:siebrand
Status:deferred (Comments)
Tags:
Comment:
Fix PHP Notice: Undefined index: lqtnotifytalk in extensions/LiquidThreads/classes/NewMessagesController.php on line 144. Needs review.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/NewMessagesController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/NewMessagesController.php
@@ -141,7 +141,7 @@
142142 if ( $oldPrefCompat ) {
143143 $decodedOptions = self::decodeUserOptions( $row->user_options );
144144
145 - $wantsTalkNotification = ( is_null( $decodedOptions['lqtnotifytalk'] ) &&
 145+ $wantsTalkNotification = ( ( !isset( $decodedOptions['lqtnotifytalk'] ) || is_null( $decodedOptions['lqtnotifytalk'] ) ) &&
146146 User::getDefaultOption( 'lqtnotifytalk' ) ) || $row->up_value;
147147 } else {
148148 $wantsTalkNotification =

Follow-up revisions

RevisionCommit summaryAuthorDate
r66078update r58407 to make it clearer.mah00:14, 9 May 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   00:12, 9 May 2010

!isset() is enough in these circumstances.

The following all return the same no matter what $a is.

var_dump( !isset( $a['a'] ) );
@var_dump( is_null( $a['a'] ) );
var_dump( !isset( $a['a'] ) || is_null( $a['a'] ) );

Status & tagging log