r43272 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43271‎ | r43272 | r43273 >
Date:22:43, 6 November 2008
Author:siebrand
Status:old
Tags:
Comment:
Partial revert of r43269 for HTMLDiff.php. In file addHtml() is a method. Thanks to demon for spotting this.
Modified paths:
  • /trunk/phase3/includes/diff/HTMLDiff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/HTMLDiff.php
@@ -634,7 +634,7 @@
635635 $txt = new ChangeText;
636636 $rootlistopened = false;
637637 if (count($differences) > 1) {
638 - $txt->addHTML('<ul class="changelist">');
 638+ $txt->addHtml('<ul class="changelist">');
639639 $rootlistopened = true;
640640 }
641641 $nbDifferences = count($differences);
@@ -642,44 +642,44 @@
643643 $d = $differences[$j];
644644 $lvl1listopened = false;
645645 if ($rootlistopened) {
646 - $txt->addHTML('<li>');
 646+ $txt->addHtml('<li>');
647647 }
648648 if ($d->leftlength + $d->rightlength > 1) {
649 - $txt->addHTML('<ul class="changelist">');
 649+ $txt->addHtml('<ul class="changelist">');
650650 $lvl1listopened = true;
651651 }
652652 // left are the old ones
653653 for ($i = $d->leftstart; $i < $d->leftend; ++$i) {
654654 if ($lvl1listopened){
655 - $txt->addHTML('<li>');
 655+ $txt->addHtml('<li>');
656656 }
657657 // add a bullet for a old tag
658658 $this->addTagOld($txt, $this->other->ancestors[$i]);
659659 if ($lvl1listopened){
660 - $txt->addHTML('</li>');
 660+ $txt->addHtml('</li>');
661661 }
662662 }
663663 // right are the new ones
664664 for ($i = $d->rightstart; $i < $d->rightend; ++$i) {
665665 if ($lvl1listopened){
666 - $txt->addHTML('<li>');
 666+ $txt->addHtml('<li>');
667667 }
668668 // add a bullet for a new tag
669669 $this->addTagNew($txt, $this->ancestorComparator->ancestors[$i]);
670670
671671 if ($lvl1listopened){
672 - $txt->addHTML('</li>');
 672+ $txt->addHtml('</li>');
673673 }
674674 }
675675 if ($lvl1listopened) {
676 - $txt->addHTML('</ul>');
 676+ $txt->addHtml('</ul>');
677677 }
678678 if ($rootlistopened) {
679 - $txt->addHTML('</li>');
 679+ $txt->addHtml('</li>');
680680 }
681681 }
682682 if ($rootlistopened) {
683 - $txt->addHTML('</ul>');
 683+ $txt->addHtml('</ul>');
684684 }
685685 return $txt;
686686 }
@@ -697,7 +697,7 @@
698698
699699 private $txt = "";
700700
701 - public function addHTML($s) {
 701+ public function addHtml($s) {
702702 $this->txt .= $s;
703703 }
704704
@@ -759,14 +759,14 @@
760760 $tagDescription = "&lt;" . $this->node->qName . "&gt;";
761761 }
762762 if ($this->sem == TagToStringFactory::MOVED) {
763 - $txt->addHTML( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) );
 763+ $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) );
764764 } else if ($this->sem == TagToStringFactory::STYLE) {
765 - $txt->addHTML( wfMsgExt( 'diff-styleremoved' , 'parseinline', $tagDescription ) );
 765+ $txt->addHtml( wfMsgExt( 'diff-styleremoved' , 'parseinline', $tagDescription ) );
766766 } else {
767 - $txt->addHTML( wfMsgExt( 'diff-removed' , 'parseinline', $tagDescription ) );
 767+ $txt->addHtml( wfMsgExt( 'diff-removed' , 'parseinline', $tagDescription ) );
768768 }
769769 $this->addAttributes($txt, $this->node->attributes);
770 - $txt->addHTML('.');
 770+ $txt->addHtml('.');
771771 }
772772
773773 public function getAddedDescription(ChangeText $txt) {
@@ -775,14 +775,14 @@
776776 $tagDescription = "&lt;" . $this->node->qName . "&gt;";
777777 }
778778 if ($this->sem == TagToStringFactory::MOVED) {
779 - $txt->addHTML( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) );
 779+ $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) );
780780 } else if ($this->sem == TagToStringFactory::STYLE) {
781 - $txt->addHTML( wfMsgExt( 'diff-styleadded', 'parseinline', $tagDescription ) );
 781+ $txt->addHtml( wfMsgExt( 'diff-styleadded', 'parseinline', $tagDescription ) );
782782 } else {
783 - $txt->addHTML( wfMsgExt( 'diff-added', 'parseinline', $tagDescription ) );
 783+ $txt->addHtml( wfMsgExt( 'diff-added', 'parseinline', $tagDescription ) );
784784 }
785785 $this->addAttributes($txt, $this->node->attributes);
786 - $txt->addHTML('.');
 786+ $txt->addHtml('.');
787787 }
788788
789789 protected function addAttributes(ChangeText $txt, array $attributes) {
@@ -797,17 +797,17 @@
798798 $attr = $attributes[$key];
799799 if($firstOne) {
800800 $firstOne = false;
801 - $txt->addHTML( wfMsgExt('diff-with', 'escapenoentities', $this->translateArgument($key), htmlspecialchars($attr) ) );
 801+ $txt->addHtml( wfMsgExt('diff-with', 'escapenoentities', $this->translateArgument($key), htmlspecialchars($attr) ) );
802802 continue;
803803 }
804 - $txt->addHTML( wfMsgExt( 'comma-separator', 'escapenoentities' ) .
 804+ $txt->addHtml( wfMsgExt( 'comma-separator', 'escapenoentities' ) .
805805 wfMsgExt( 'diff-with-additional', 'escapenoentities',
806806 $this->translateArgument( $key ), htmlspecialchars( $attr ) )
807807 );
808808 }
809809
810810 if ($nbAttributes_min_1 > 0) {
811 - $txt->addHTML( wfMsgExt( 'diff-with-final', 'escapenoentities',
 811+ $txt->addHtml( wfMsgExt( 'diff-with-final', 'escapenoentities',
812812 $this->translateArgument($keys[$nbAttributes_min_1]),
813813 htmlspecialchars($attributes[$keys[$nbAttributes_min_1]]) ) );
814814 }
@@ -833,15 +833,15 @@
834834 if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
835835 $tagDescription = "&lt;" . $this->node->qName . "&gt;";
836836 }
837 - $txt->addHTML( wfMsgExt('diff-changedto', 'parseinline', $tagDescription ) );
 837+ $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline', $tagDescription ) );
838838 $this->addAttributes($txt, $this->node->attributes);
839 - $txt->addHTML('.');
 839+ $txt->addHtml('.');
840840 }
841841
842842 public function getRemovedDescription(ChangeText $txt) {
843 - $txt->addHTML( wfMsgExt('diff-changedfrom', 'parseinline', $tagDescription ) );
 843+ $txt->addHtml( wfMsgExt('diff-changedfrom', 'parseinline', $tagDescription ) );
844844 $this->addAttributes($txt, $this->node->attributes);
845 - $txt->addHTML('.');
 845+ $txt->addHtml('.');
846846 }
847847 }
848848
@@ -853,7 +853,7 @@
854854
855855 protected function addAttributes(ChangeText $txt, array $attributes) {
856856 if (array_key_exists('href', $attributes)) {
857 - $txt->addHTML(' ' . wfMsgExt( 'diff-withdestination', 'parseinline', htmlspecialchars($attributes['href']) ) );
 857+ $txt->addHtml(' ' . wfMsgExt( 'diff-withdestination', 'parseinline', htmlspecialchars($attributes['href']) ) );
858858 unset($attributes['href']);
859859 }
860860 parent::addAttributes($txt, $attributes);
@@ -988,18 +988,18 @@
989989 }
990990
991991 function startElement($qname, /*array*/ $arguments) {
992 - $this->delegate->addHTML(Xml::openElement($qname, $arguments));
 992+ $this->delegate->addHtml(Xml::openElement($qname, $arguments));
993993 }
994994
995995 function endElement($qname){
996 - $this->delegate->addHTML(Xml::closeElement($qname));
 996+ $this->delegate->addHtml(Xml::closeElement($qname));
997997 }
998998
999999 function characters($chars){
1000 - $this->delegate->addHTML(htmlspecialchars($chars));
 1000+ $this->delegate->addHtml(htmlspecialchars($chars));
10011001 }
10021002
10031003 function html($html){
1004 - $this->delegate->addHTML($html);
 1004+ $this->delegate->addHtml($html);
10051005 }
10061006 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43269Consistent casing for addHTML()siebrand22:20, 6 November 2008

Status & tagging log