r62588 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62587‎ | r62588 | r62589 >
Date:19:48, 16 February 2010
Author:aaron
Status:ok
Tags:
Comment:
Follow up r62488, r62538: consistency fix for $maxLen=0 case; no display text means truncateHtml() returns ''.
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeCommentLinker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeCommentLinker.php
@@ -26,7 +26,7 @@
2727 * Note: tries to fix broken HTML with MWTidy
2828 * @TODO: cleanup and move to language.php
2929 * @param string $text
30 - * @param int $maxLen
 30+ * @param int $maxLen (zero/positive)
3131 * @param string $ellipsis
3232 * @returns string
3333 */
@@ -97,6 +97,9 @@
9898 }
9999 }
100100 }
 101+ if( $displayLen == 0 ) {
 102+ return ''; // no text shown, nothing to format
 103+ }
101104 self::onEndBracket( $tag, $lastCh, $tagType, $openTags ); // for bad HTML
102105 while ( count( $openTags ) > 0 ) {
103106 $ret .= '</' . array_pop($openTags) . '>'; // close open tags

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62488* Fixed bug 22326: "Truncated urls in summaries lead to different places"...aaron03:07, 15 February 2010
r62538truncateHtml() edge case and doc tweaksaaron20:15, 15 February 2010

Status & tagging log