From 767da0cb6125d36fef5d2c30e5e73812f3f1c622 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 7 Jan 2011 00:17:52 +0000 Subject: [PATCH] Comment in code says - truncate to 250 bytes, then add ellipse. but we don't add the ellipse, so change it to add the ellipse. The comment and code should be the same, and since we have the room might as well add the ellipse. This normally wouldn't affect much, since users with JS on will be prevented from adding that long a summary on the client side --- RELEASE-NOTES | 1 + includes/EditPage.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 93b61e908d..fb6bcaf24a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -61,6 +61,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 26574) Added 'upload' to $wgRestrictionTypes, allowing upload protected pages to be queried via the API and Special:ProtectedPages, and allowing disabling upload protection by removing it from $wgRestrictionTypes. +* If an edit summary exceeds 250 bytes and is truncated, add an ellipse === API changes in 1.18 === * (bug 26339) Throw warning when truncating an overlarge API result diff --git a/includes/EditPage.php b/includes/EditPage.php index f1b599899f..30e01e752c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -557,7 +557,7 @@ class EditPage { } # Truncate for whole multibyte characters. +5 bytes for ellipsis - $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250, '' ); + $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 ); # Remove extra headings from summaries and new sections. $this->summary = preg_replace('/^\s*=+\s*(.*?)\s*=+\s*$/', '$1', $this->summary); -- 2.20.1