r43072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43071‎ | r43072 | r43073 >
Date:12:25, 2 November 2008
Author:siebrand
Status:old
Tags:
Comment:
Resolve four notices when creating a page with "No layout"
Modified paths:
  • /trunk/extensions/uniwiki/Layouts/Layouts.php (modified) (history)

Diff [purge]

Index: trunk/extensions/uniwiki/Layouts/Layouts.php
@@ -76,9 +76,9 @@
7777 /* don't hijack the request if we are
7878 * in the middle of switching modes,
7979 * previewing, or showing changes */
80 - if ( $wgRequest->data['switch-mode']
81 - || $wgRequest->data['wpTextbox1']
82 - || $wgRequest->data['section-0'] )
 80+ if ( isset( $wgRequest->data['switch-mode'] )
 81+ || isset( $wgRequest->data['wpTextbox1'] )
 82+ || isset( $wgRequest->data['section-0'] ) )
8383 return true;
8484
8585 /* if this page is new,
@@ -86,7 +86,7 @@
8787 * and the page is in a namespace that is using the extension
8888 * and we are not submitting the form (either saving OR preview)
8989 * and we're NOT editing an old revision */
90 - if ( $article->fetchContent( $wgRequest->data['oldid'] ) === false
 90+ if ( ( !isset( $wgRequest->data['oldid'] ) || $article->fetchContent( $wgRequest->data['oldid'] ) === false )
9191 && ( $wgRequest->getVal ( "layout" ) === NULL )
9292 && in_array ( $article->mTitle->getNamespace(), $wgLayoutWhiteList )
9393 && ( $wgRequest->getVal( "action" ) != "submit" ) )

Status & tagging log