r45480 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45479‎ | r45480 | r45481 >
Date:03:05, 7 January 2009
Author:brion
Status:ok
Tags:
Comment:
Cleanup r45390:
* Use '...' rather than 'ellipsis' message to be consistent with other code in this module
* Remove stray space
* Just use the ellipsis parameter on truncate, rather than trying to duplicate it!
* Move htmlspecialchars() to outside the truncation stuff for general correctness/safety
Modified paths:
  • /trunk/extensions/CodeReview/CodeCommentsListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeCommentsListView.php
@@ -86,13 +86,7 @@
8787 return $this->mView->messageFragment( $value );
8888 case 'cc_text':
8989 # Truncate this, blah blah...
90 - $text = htmlspecialchars($value);
91 - $preview = $wgLang->truncate( $text, 300 );
92 - if( strlen($preview) < strlen($text) ) {
93 - $preview = substr( $preview, 0, strrpos($preview,' ') );
94 - $preview .= ' ' . wfMsgForContent( 'ellipsis' );
95 - }
96 - return $preview;
 90+ return htmlspecialchars( $wgLang->truncate( $value, 300, '...' ) );
9791 case 'cc_timestamp':
9892 global $wgLang;
9993 return $wgLang->timeanddate( $value, true );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45390Use new message 'ellipsis'...raymond10:47, 4 January 2009

Status & tagging log