From 5a6ff4865b840840276f9f2541af1ed69de79f26 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 17 Feb 2013 14:39:04 +0100 Subject: [PATCH] [Regression] Do not trim spaces on edit preview or show changes Since Ic05e5898 spaces are also trimmed on preview/show changes, which is bad, because the autosummary "/* Header */ " gets trimmed and the user text is direct written behind the slash. That is confusing and was not so, before this change. Force the trim on summary preview to have the right preview, because the spaces are trimmed on save. Change-Id: I0058ce31197f3ea8ffc5520f3f0f9e1bf6105066 --- includes/EditPage.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 4e3ea493b4..5434dabd4f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -624,11 +624,8 @@ class EditPage { wfProfileOut( get_class( $this ) . "::importContentFormData" ); } - # Trim spaces on user supplied text - $summary = trim( $request->getText( 'wpSummary' ) ); - # Truncate for whole multibyte characters - $this->summary = $wgContLang->truncate( $summary, 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 @@ -2453,6 +2450,8 @@ class EditPage { * @return String */ protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) { + // avoid spaces in preview, gets always trimmed on save + $summary = trim( $summary ); if ( !$summary || ( !$this->preview && !$this->diff ) ) { return ""; } -- 2.20.1