added unit tests for WikitextContent
[lhc/web/wiklou.git] / includes / api / ApiQueryTags.php
index 12f3eed..12cea1d 100644 (file)
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiQueryBase.php' );
-}
-
 /**
  * Query module to enumerate change tags.
  *
@@ -113,9 +108,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 ) {
@@ -179,7 +173,7 @@ class ApiQueryTags extends ApiQueryBase {
                return 'List change tags';
        }
 
-       protected function getExamples() {
+       public function getExamples() {
                return array(
                        'api.php?action=query&list=tags&tgprop=displayname|description|hitcount'
                );