Increase length of edit summary by 5 bytes
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 13 Jul 2012 18:07:34 +0000 (20:07 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 13 Jul 2012 18:07:34 +0000 (20:07 +0200)
Language::truncate subtracts the length of ellipses from the whole
length since 1.18, that means, there is no need for a buffer for the
ellipses.

Change-Id: I5c39a6c4160f16156c8928dd954f065f9e3c7a5c

includes/EditPage.php
includes/WikiPage.php
resources/mediawiki.action/mediawiki.action.edit.js

index 5ce703e..f034153 100644 (file)
@@ -591,8 +591,8 @@ class EditPage {
                                wfProfileOut( get_class( $this ) . "::importContentFormData" );
                        }
 
-                       # Truncate for whole multibyte characters. +5 bytes for ellipsis
-                       $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 );
+                       # Truncate for whole multibyte characters
+                       $this->summary = $wgLang->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
@@ -604,7 +604,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' ), 250 );
+                       $this->sectiontitle = $wgLang->truncate( $request->getText( 'wpSectionTitle' ), 255 );
                        $this->sectiontitle = preg_replace( '/^\s*=+\s*(.*?)\s*=+\s*$/', '$1', $this->sectiontitle );
 
                        $this->edittime = $request->getVal( 'wpEdittime' );
@@ -2109,7 +2109,7 @@ class EditPage {
         * @return array An array in the format array( $label, $input )
         */
        function getSummaryInput( $summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null ) {
-               // Note: the maxlength is overriden in JS to 250 and to make it use UTF-8 bytes, not characters.
+               // Note: the maxlength is overriden in JS to 255 and to make it use UTF-8 bytes, not characters.
                $inputAttrs = ( is_array( $inputAttrs ) ? $inputAttrs : array() ) + array(
                        'id' => 'wpSummary',
                        'maxlength' => '200',
index 8995f3f..6d9170a 100644 (file)
@@ -2606,7 +2606,7 @@ class WikiPage extends Page {
                if ( is_object( $rt ) && ( !is_object( $ot ) || !$rt->equals( $ot ) || $ot->getFragment() != $rt->getFragment() ) ) {
                        $truncatedtext = $wgContLang->truncate(
                                str_replace( "\n", ' ', $newtext ),
-                               max( 0, 250
+                               max( 0, 255
                                        - strlen( wfMsgForContent( 'autoredircomment' ) )
                                        - strlen( $rt->getFullText() )
                                ) );
index e685ca9..14b845d 100644 (file)
@@ -92,7 +92,7 @@
                isReady = true;
 
                // Make sure edit summary does not exceed byte limit
-               $( '#wpSummary' ).byteLimit( 250 );
+               $( '#wpSummary' ).byteLimit( 255 );
 
                /**
                 * Restore the edit box scroll state following a preview operation,