https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112830

Revision: 112830
Author:   emsmith
Date:     2012-03-01 19:42:07 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
bug 34090 - follow up to r111474 - use truncate for chopping

Modified Paths:
--------------
    trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php

Modified: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php
===================================================================
--- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php        
2012-03-01 19:26:21 UTC (rev 112829)
+++ trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php        
2012-03-01 19:42:07 UTC (rev 112830)
@@ -235,9 +235,10 @@
                $permalink = SpecialPage::getTitleFor( 'ArticleFeedbackv5', 
"$page_name/$itemId" );
 
                // Make sure our notes are not too long - we won't error, just 
hard substr it
-               global $wgArticleFeedbackv5MaxActivityNoteLength;
-               $notes = substr($notes, 0, 
$wgArticleFeedbackv5MaxActivityNoteLength);
+               global $wgArticleFeedbackv5MaxActivityNoteLength, $wgLang;
 
+               $notes = $wgLang->truncate( $note, 
$wgArticleFeedbackv5MaxActivityNoteLength );
+
                // if this is an automatic action, we create our special 
extension doer and send
                if ($auto) {
                        $doer = User::newFromName( 'Article Feedback V5' );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to