r74777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74776‎ | r74777 | r74778 >
Date:15:00, 14 October 2010
Author:jdpond
Status:ok
Tags:
Comment:
Changed to use version_compare - much better, thanks to Raymond
Modified paths:
  • /trunk/extensions/DiscussionThreading/DiscussionThreading.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DiscussionThreading/DiscussionThreading.php
@@ -41,19 +41,15 @@
4242
4343 # must use the deprecated efDiscussionLink hook if before MW Version 1.14
4444 #
45 -$xversion = explode( "." , $wgVersion );
46 -if ( $xversion[0] <= "1" && $xversion[1] < "14" ) {
 45+if (version_compare( $wgVersion , '1.14.0' ) < 0 ) {
4746 $wgHooks['EditSectionLink'][] = 'efDiscussionLink';
4847 }
49 -unset( $xversion );
50 -
5148 /**
5249 * Initial setup, add .i18n. messages from $IP/extensions/DiscussionThreading/DiscussionThreading.i18n.php
5350 */
5451 function efDiscussionThreadSetup() {
5552 global $wgVersion;
56 - $xversion = explode( ".",$wgVersion );
57 - if ( $xversion[0] <= "1" && $xversion[1] <= "11" ) {
 53+ if (version_compare( $wgVersion , '1.11.0' ) < 0 ) {
5854 global $wgMessageCache, $messages;
5955 foreach( $messages as $lang => $LangMsg )
6056 $wgMessageCache->addMessages( $LangMsg, $lang );

Status & tagging log