r39943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39942‎ | r39943 | r39944 >
Date:13:39, 25 August 2008
Author:demon
Status:old
Tags:
Comment:
Use wfEmptyMsg() here instead of !$tagDescription. Should make <non-existent-message> errors when a particular HTML tag doesn't exist (notably, diff-s) to go away now. Should now output the raw tag ('<s>', again in the noticed case). Oddly, I like that more than the messages ;-)
Modified paths:
  • /trunk/phase3/includes/HTMLDiff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLDiff.php
@@ -1157,8 +1157,8 @@
11581158
11591159 public function getRemovedDescription(ChangeText $txt) {
11601160 $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' );
1161 - if(!$tagDescription){
1162 - $tagDescription = $this->node->qName;
 1161+ if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
 1162+ $tagDescription = "&lt;" . $this->node->qName . "&gt;";
11631163 }
11641164 if ($this->sem == TagToStringFactory::MOVED) {
11651165 $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) );
@@ -1173,8 +1173,8 @@
11741174
11751175 public function getAddedDescription(ChangeText $txt) {
11761176 $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' );
1177 - if(!$tagDescription){
1178 - $tagDescription = $this->node->qName;
 1177+ if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
 1178+ $tagDescription = "&lt;" . $this->node->qName . "&gt;";
11791179 }
11801180 if ($this->sem == TagToStringFactory::MOVED) {
11811181 $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) );
@@ -1218,7 +1218,7 @@
12191219 protected function translateArgument($name) {
12201220 $translation = wfMsgExt('diff-' . $name, 'parseinline' );
12211221 if ( wfEmptyMsg( 'diff-' . $name, $translation ) ) {
1222 - $translation = $name;
 1222+ $translation = "&lt;" . $name . "&gt;";;
12231223 }
12241224 return htmlspecialchars( $translation );
12251225 }
@@ -1232,8 +1232,8 @@
12331233
12341234 public function getAddedDescription(ChangeText $txt) {
12351235 $tagDescription = wfMsgExt('diff-' . $this->node->qName, 'parseinline' );
1236 - if(!$tagDescription){
1237 - $tagDescription = $this->node->qName;
 1236+ if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
 1237+ $tagDescription = "&lt;" . $this->node->qName . "&gt;";
12381238 }
12391239 $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline' ) . ' ' . $tagDescription);
12401240 $this->addAttributes($txt, $this->node->attributes);

Status & tagging log