r84241 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84240‎ | r84241 | r84242 >
Date:13:54, 18 March 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix really daft way of checking version
Modified paths:
  • /trunk/extensions/HeaderTabs/HeaderTabs_body.yui.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HeaderTabs/HeaderTabs_body.yui.php
@@ -43,8 +43,7 @@
4444
4545 $tabs = array();
4646
47 - $v = explode( '.', $wgVersion );
48 - if ( $v[0] > 1 || ( $v[0] == 1 && $v[1] >= 16 ) ) {
 47+ if ( version_compare( $wgVersion, '1.16', '>=' ) ) {
4948 $parts = preg_split( '/(<h1.*?class="mw-headline".*?<\/h1>)/', $aboveandbelow[0], - 1, PREG_SPLIT_DELIM_CAPTURE );
5049 array_shift( $parts ); // don't need above part anyway
5150
@@ -90,7 +89,6 @@
9190 $tabhtml .= '</ul>';
9291
9392 $tabhtml .= '<div class="yui-content">';
94 - $firsttab = true;
9593 foreach ( $tabs as $tab ) {
9694 $tabhtml .= '<div id="' . $tab['tabid'] . '"><p>' . $tab['tabcontent'] . '</p></div>';
9795 }

Comments

#Comment by Reach Out to the Truth (talk | contribs)   14:28, 18 March 2011

Was the removal of $firsttab = true; intentional?

#Comment by Reedy (talk | contribs)   14:29, 18 March 2011

Yup, unused

Status & tagging log