Simplify checks by using wfMessage() instead of wfEmptyMsg()
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 21 Jun 2011 20:05:00 +0000 (20:05 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 21 Jun 2011 20:05:00 +0000 (20:05 +0000)
includes/api/ApiQueryTags.php

index 12f3eed..4ab0c3d 100644 (file)
@@ -113,9 +113,8 @@ class ApiQueryTags extends ApiQueryBase {
                }
 
                if ( $this->fld_description ) {
-                       $msg = wfMsg( "tag-$tagName-description" );
-                       $msg = wfEmptyMsg( "tag-$tagName-description" ) ? '' : $msg;
-                       $tag['description'] = $msg;
+                       $msg = wfMessage( "tag-$tagName-description" );
+                       $tag['description'] = $msg->exists() ? $msg->text() : '';
                }
 
                if ( $this->fld_hitcount ) {