* (bug 7064) Replace hard-coded empty message checks with wfEmptyMsg calls
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 11 Sep 2006 12:22:35 +0000 (12:22 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 11 Sep 2006 12:22:35 +0000 (12:22 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php
includes/RawPage.php
includes/SkinTemplate.php
includes/SpecialAllmessages.php
includes/SpecialUserlogin.php
includes/User.php

index 5699aca..4007b7d 100644 (file)
@@ -192,6 +192,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 7252) Use dvipng support in texvc math rastrization. dvipng is required if texvc is rebuilt.
 * (bug 7279) Use wfBaseName in place of basename() in more places
 * Clear newtalk marker on diff links with explicit current revision number
+* (bug 7064) Replace hard-coded empty message checks with wfEmptyMsg calls
 
 
 == Languages updated ==
index 0de411a..fcbe817 100644 (file)
@@ -430,12 +430,12 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform =
 function wfMsgWeirdKey ( $key ) {
        $subsource = str_replace ( ' ' , '_' , $key ) ;
        $source = wfMsgForContentNoTrans( $subsource ) ;
-       if ( $source == "&lt;{$subsource}&gt;" ) {
+       if ( wfEmptyMsg( $subsource, $source) ) {
                # Try again with first char lower case
                $subsource = strtolower ( substr ( $subsource , 0 , 1 ) ) . substr ( $subsource , 1 ) ;
                $source = wfMsgForContentNoTrans( $subsource ) ;
        }
-       if ( $source == "&lt;{$subsource}&gt;" ) {
+       if ( wfEmptyMsg( $subsource, $source ) ) {
                # Didn't work either, return blank text
                $source = "" ;
        }
@@ -1423,7 +1423,7 @@ function wfGetCachedNotice( $name ) {
        
        $needParse = false;
        $notice = wfMsgForContent( $name );
-       if( $notice == '&lt;'. $name . ';&gt' || $notice == '-' ) {
+       if( wfEmptyMsg( $name, $notice ) || $notice == '-' ) {
                wfProfileOut( $fname );
                return( false );
        }
index f5e74e7..480c032 100644 (file)
@@ -157,7 +157,7 @@ class RawPage {
                                $key = $this->mTitle->getDBkey();
                                $text = wfMsgForContentNoTrans( $key );
                                # If the message doesn't exist, return a blank
-                               if( $text == '&lt;' . $key . '&gt;' )
+                               if( wfEmptyMsg( $key, $text ) )
                                        $text = '';
                                $found = true;
                        } else {
index eddcc02..5a02b77 100644 (file)
@@ -571,7 +571,7 @@ class SkinTemplate extends Skin {
                }
 
                $text = wfMsg( $message );
-               if ( $text == "&lt;$message&gt;" ) {
+               if ( wfEmptyMsg( $message, $text ) ) {
                        global $wgContLang;
                        $text = $wgContLang->getFormattedNsText( Namespace::getSubject( $title->getNamespace() ) );
                }
@@ -1014,7 +1014,7 @@ class SkinTemplate extends Skin {
                // by checking for default message content
                $msgKey = ucfirst($this->skinname).'.js';
                $userJS = wfMsgForContent($msgKey);
-               if ('&lt;'.$msgKey.'&gt;' != $userJS) {
+               if ( !wfEmptyMsg( $msgKey, $userJS ) ) {
                        $s .= $userJS;
                }
 
index 994adc6..f5e16cf 100644 (file)
@@ -80,7 +80,7 @@ function makePhp($messages) {
                        //      $comment = '';
                        //}
                        continue;
-               } elseif ($m['msg'] == '&lt;'.$key.'&gt;'){
+               } elseif ( wfEmptyMsg( $key, $m['msg'] ) ) {
                        $m['msg'] = '';
                        $comment = ' #empty';
                } else {
index 53fc94c..65b66e3 100644 (file)
@@ -686,7 +686,7 @@ class LoginForm {
         */
        function makeLanguageSelector() {
                $msg = wfMsgForContent( 'loginlanguagelinks' );
-               if( $msg != '' && $msg != '&lt;loginlanguagelinks&gt;' ) {
+               if( $msg != '' && !wfEmptyMsg( 'loginlanguagelinks', $msg ) ) {
                        $langs = explode( "\n", $msg );
                        $links = array();
                        foreach( $langs as $lang ) {
index 05380d4..5757ff6 100644 (file)
@@ -2021,7 +2021,7 @@ class User {
        static function getGroupName( $group ) {
                $key = "group-$group";
                $name = wfMsg( $key );
-               if( $name == '' || $name == "&lt;$key&gt;" ) {
+               if( $name == '' || wfEmptyMsg( $key, $name ) ) {
                        return $group;
                } else {
                        return $name;
@@ -2036,7 +2036,7 @@ class User {
        static function getGroupMember( $group ) {
                $key = "group-$group-member";
                $name = wfMsg( $key );
-               if( $name == '' || $name == "&lt;$key&gt;" ) {
+               if( $name == '' || wfEmptyMsg( $key, $name ) ) {
                        return $group;
                } else {
                        return $name;