http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84675
Revision: 84675
Author: aaron
Date: 2011-03-24 13:32:58 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
Fixed hacky "ellipsis already there" check
Modified Paths:
--------------
trunk/extensions/CodeReview/ui/CodeView.php
Modified: trunk/extensions/CodeReview/ui/CodeView.php
===================================================================
--- trunk/extensions/CodeReview/ui/CodeView.php 2011-03-24 13:15:54 UTC (rev
84674)
+++ trunk/extensions/CodeReview/ui/CodeView.php 2011-03-24 13:32:58 UTC (rev
84675)
@@ -58,11 +58,10 @@
$truncated = $wgLang->truncateHtml( $html, 80 );
if ( count( $lines ) > 1 ) { // If multiline, we might want to
add an ellipse
- $ellipse = wfMsgExt( 'ellipsis', array() );
-
- $len = strlen( $truncated );
- if ( substr( $truncated, $len ) !== $ellipse ) { //
Don't add if the end is already an ellipse
- $truncated .= $ellipse;
+ $ellipsis = wfMsgExt( 'ellipsis', array() );
+ // Hack: don't add if the end is already an ellipse
+ if ( substr( $truncated, -strlen( $ellipsis ) ) !==
$ellipsis ) {
+ $truncated .= $ellipsis;
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs