From: Chad Horohoe Date: Mon, 25 Aug 2008 13:39:33 +0000 (+0000) Subject: Use wfEmptyMsg() here instead of !$tagDescription. Should make errors when a particular HTML tag doesn't exist (notably, diff-s) to go away now. Should now output the raw tag ('', again in the noticed case). Oddly, I like that more than the messages ;-) --- diff --git a/includes/HTMLDiff.php b/includes/HTMLDiff.php index 14a19ef70f..aa02b7aab2 100644 --- a/includes/HTMLDiff.php +++ b/includes/HTMLDiff.php @@ -1157,8 +1157,8 @@ class TagToString { public function getRemovedDescription(ChangeText $txt) { $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' ); - if(!$tagDescription){ - $tagDescription = $this->node->qName; + if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){ + $tagDescription = "<" . $this->node->qName . ">"; } if ($this->sem == TagToStringFactory::MOVED) { $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) ); @@ -1173,8 +1173,8 @@ class TagToString { public function getAddedDescription(ChangeText $txt) { $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' ); - if(!$tagDescription){ - $tagDescription = $this->node->qName; + if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){ + $tagDescription = "<" . $this->node->qName . ">"; } if ($this->sem == TagToStringFactory::MOVED) { $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) ); @@ -1218,7 +1218,7 @@ class TagToString { protected function translateArgument($name) { $translation = wfMsgExt('diff-' . $name, 'parseinline' ); if ( wfEmptyMsg( 'diff-' . $name, $translation ) ) { - $translation = $name; + $translation = "<" . $name . ">";; } return htmlspecialchars( $translation ); } @@ -1232,8 +1232,8 @@ class NoContentTagToString extends TagToString { public function getAddedDescription(ChangeText $txt) { $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' ); - if(!$tagDescription){ - $tagDescription = $this->node->qName; + if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){ + $tagDescription = "<" . $this->node->qName . ">"; } $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline' ) . ' ' . $tagDescription); $this->addAttributes($txt, $this->node->attributes);