EditPage: Use content language to truncate for database
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 12 Oct 2012 19:52:16 +0000 (21:52 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 12 Oct 2012 19:52:16 +0000 (21:52 +0200)
Change-Id: I53e5b2304f8b8a8787b30d9c4717f39bfe96a127

includes/EditPage.php

index f2bab7d..2f21270 100644 (file)
@@ -588,7 +588,7 @@ class EditPage {
         * @param $request WebRequest
         */
        function importFormData( &$request ) {
-               global $wgLang, $wgUser;
+               global $wgContLang, $wgUser;
 
                wfProfileIn( __METHOD__ );
 
@@ -612,7 +612,7 @@ class EditPage {
                        }
 
                        # Truncate for whole multibyte characters
-                       $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 255 );
+                       $this->summary = $wgContLang->truncate( $request->getText( 'wpSummary' ), 255 );
 
                        # If the summary consists of a heading, e.g. '==Foobar==', extract the title from the
                        # header syntax, e.g. 'Foobar'. This is mainly an issue when we are using wpSummary for
@@ -624,7 +624,7 @@ class EditPage {
                        # currently doing double duty as both edit summary and section title. Right now this
                        # is just to allow API edits to work around this limitation, but this should be
                        # incorporated into the actual edit form when EditPage is rewritten (Bugs 18654, 26312).
-                       $this->sectiontitle = $wgLang->truncate( $request->getText( 'wpSectionTitle' ), 255 );
+                       $this->sectiontitle = $wgContLang->truncate( $request->getText( 'wpSectionTitle' ), 255 );
                        $this->sectiontitle = preg_replace( '/^\s*=+\s*(.*?)\s*=+\s*$/', '$1', $this->sectiontitle );
 
                        $this->edittime = $request->getVal( 'wpEdittime' );