r30129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30128‎ | r30129 | r30130 >
Date:20:14, 24 January 2008
Author:simetrical
Status:old
Tags:
Comment:
Avoid relying on isset(). This can cause problems with PHP's (thankfully now uncommon) register_globals setting. Instead, just give the variable a default value in the code.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -1620,6 +1620,7 @@
16211621
16221622 $bar = array();
16231623 $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
 1624+ $heading = '';
16241625 foreach ($lines as $line) {
16251626 if (strpos($line, '*') !== 0)
16261627 continue;
@@ -1649,7 +1650,6 @@
16501651 }
16511652 }
16521653
1653 - if( !isset($heading) ) $heading='';
16541654 $bar[$heading][] = array(
16551655 'text' => $text,
16561656 'href' => $href,

Status & tagging log