r71625 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71624‎ | r71625 | r71626 >
Date:13:38, 25 August 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Make sure the constants are defined.

It's a bit ugly, but I see no better way of doing this while keeping BC
Modified paths:
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -403,6 +403,11 @@
404404 # Startup code
405405
406406 function efTranslateNamespaces( &$list ) {
 407+ global $wgPageTranslationNamespace;
 408+ if ( !defined( 'NS_TRANSLATIONS' ) ) {
 409+ define( 'NS_TRANSLATIONS', $wgPageTranslationNamespace );
 410+ define( 'NS_TRANSLATIONS_TALK', $wgPageTranslationNamespace + 1 );
 411+ }
407412 $list[NS_TRANSLATIONS] = 'Translations';
408413 $list[NS_TRANSLATIONS_TALK] = 'Translations_talk';
409414 return true;
@@ -472,8 +477,10 @@
473478 global $wgTranslateMessageNamespaces, $wgVersion;
474479
475480 // Define constants for more readable core
476 - define ( 'NS_TRANSLATIONS', $wgPageTranslationNamespace );
477 - define ( 'NS_TRANSLATIONS_TALK', $wgPageTranslationNamespace + 1 );
 481+ if ( !defined( 'NS_TRANSLATIONS' ) ) {
 482+ define( 'NS_TRANSLATIONS', $wgPageTranslationNamespace );
 483+ define( 'NS_TRANSLATIONS_TALK', $wgPageTranslationNamespace + 1 );
 484+ }
478485
479486 if ( version_compare( $wgVersion, '1.17alpha', '<' ) ) {
480487 efTranslateNamespaces( &$wgExtraNamespaces );

Status & tagging log