From 48aa3b74e7c4a8573fb1808f53bce0c4d460a0cd Mon Sep 17 00:00:00 2001 From: Alexander Sigachov Date: Sat, 8 Oct 2005 22:33:46 +0000 Subject: [PATCH] truncate summary for multibyte chars --- includes/EditPage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index d64bb14602..b6b1a772d8 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -295,6 +295,7 @@ class EditPage { * @todo document */ function importFormData( &$request ) { + global $wgLang ; $fname = 'EditPage::importFormData'; wfProfileIn( $fname ); @@ -305,7 +306,8 @@ class EditPage { $this->textbox1 = $this->safeUnicodeInput( $request, 'wpTextbox1' ); $this->textbox2 = $this->safeUnicodeInput( $request, 'wpTextbox2' ); $this->mMetaData = rtrim( $request->getText( 'metadata' ) ); - $this->summary = $request->getText( 'wpSummary' ); + # Truncate for whole multibyte characters. +5 bytes for ellipsis + $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 ); $this->edittime = $request->getVal( 'wpEdittime' ); $this->starttime = $request->getVal( 'wpStarttime' ); -- 2.20.1