r24128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24127‎ | r24128 | r24129 >
Date:19:23, 15 July 2007
Author:aaron
Status:old
Tags:
Comment:
*Use $wgLang->truncate() to avoid breaking characters for some languages. Make preview a tad smaller.
Modified paths:
  • /trunk/extensions/ConfirmAccount/ConfirmAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
@@ -586,13 +586,13 @@
587587 $r .= '<tr><td><strong>'.wfMsg('confirmaccount-email').'</strong></td><td width=\'100%\'>' .
588588 htmlspecialchars($row->acr_email) . $econf.'</td></tr>';
589589 # Truncate this, blah blah...
590 - $bio = substr( htmlspecialchars($row->acr_bio), 0, 500 );
591 - if( strlen($bio) < strlen($row->acr_bio) ) {
592 - $bio = substr( $bio, 0, strrpos($bio,' ') );
593 - $bio .= " . . .";
 590+ $bio = htmlspecialchars($row->acr_bio);
 591+ $preview = $wgLang->truncate( $bio, 400 );
 592+ if( strlen($preview) < strlen($bio) ) {
 593+ $preview = substr( $preview, 0, strrpos($preview,' ') );
 594+ $preview .= " . . .";
594595 }
595 -
596 - $r .= '<tr><td><strong>'.wfMsg('confirmaccount-bio').'</strong></td><td width=\'100%\'><i>'.$bio.'</i></td></tr>';
 596+ $r .= '<tr><td><strong>'.wfMsg('confirmaccount-bio').'</strong></td><td width=\'100%\'><i>'.$preview.'</i></td></tr>';
597597 $r .= '</table></li>';
598598
599599 return $r;

Status & tagging log