From fff8ae9026fc2f13d3b7ebc014a623ab81de73f9 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 25 Aug 2008 13:39:33 +0000 Subject: [PATCH] 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 ;-) --- includes/HTMLDiff.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); -- 2.20.1