r53320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53319‎ | r53320 | r53321 >
Date:18:15, 15 July 2009
Author:dale
Status:resolved
Tags:
Comment:
added some isset() calls to avoid Notice: Undefined property errors
Modified paths:
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -48,10 +48,10 @@
4949
5050
5151 //@@todo we can move this to the parent once we update all skins
52 - if( $this->pagecss )
 52+ if( isset($this->pagecss) )
5353 $out->addInlineStyle( $this->pagecss );
5454
55 - if( $this->usercss )
 55+ if( isset($this->usercss) )
5656 $out->addInlineStyle( $this->usercss );
5757
5858 }
@@ -60,13 +60,13 @@
6161 $out->addScriptFile( 'wikibits.js' );
6262
6363 //@@todo can move to parent once we update all skins (to not include things twice
64 - if( $this->jsvarurl )
 64+ if( isset($this->jsvarurl) )
6565 $out->addScriptFile( $this->jsvarurl );
6666
67 - if( $this->userjs )
 67+ if( isset($this->userjs) )
6868 $out->addScriptFile( $this->userjs );
6969
70 - if( $this->userjsprev )
 70+ if( isset($this->userjsprev) )
7171 $out->addInlineScript( $this->userjsprev );
7272 }
7373 }
@@ -273,23 +273,23 @@
274274 <div class="pBody">
275275 <ul>
276276 <?php
277 - if($this->data['notspecialpage']) { ?>
 277+ if( isset($this->data['notspecialpage']) ) { ?>
278278 <li id="t-whatlinkshere"><a href="<?php
279279 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
280280 ?>"<?php echo $this->skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
281281 <?php
282 - if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
 282+ if( isset($this->data['nav_urls']['recentchangeslinked']) ) { ?>
283283 <li id="t-recentchangeslinked"><a href="<?php
284284 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
285285 ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
286286 <?php }
287287 }
288 - if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
 288+ if( isset($this->data['nav_urls']['trackbacklink'])) { ?>
289289 <li id="t-trackbacklink"><a href="<?php
290290 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
291291 ?>"<?php echo $this->skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li>
292292 <?php }
293 - if($this->data['feeds']) { ?>
 293+ if( isset($this->data['feeds']) ) { ?>
294294 <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
295295 ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php
296296 echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;
@@ -298,7 +298,7 @@
299299
300300 foreach( array('contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
301301
302 - if($this->data['nav_urls'][$special]) {
 302+ if( isset( $this->data['nav_urls'][$special]) ) {
303303 ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
304304 ?>"<?php echo $this->skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li>
305305 <?php }
@@ -327,7 +327,7 @@
328328
329329 /*************************************************************************************************/
330330 function languageBox() {
331 - if( $this->data['language_urls'] ) {
 331+ if( isset( $this->data['language_urls']) ) {
332332 ?>
333333 <div id="p-lang" class="portlet">
334334 <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>

Follow-up revisions

RevisionCommit summaryAuthorDate
r53325Partial revert of r53320:...mrzman19:41, 15 July 2009

Status & tagging log