From: Brion Vibber Date: Mon, 24 Mar 2008 18:41:40 +0000 (+0000) Subject: * (bug 1600) Strip extra == section markup == in new-comment field X-Git-Tag: 1.31.0-rc.0~48847 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=8dacad92d3ea50db3c69826f9398c9ad87def457;p=lhc%2Fweb%2Fwiklou.git * (bug 1600) Strip extra == section markup == in new-comment field Updated patch by ^demon; previous versions by HappyDog & Alexander https://bugzilla.wikimedia.org/attachment.cgi?id=4755 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index dbb412563b..8214651bfd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -126,6 +126,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6813) Don't break HTML validator when using trackbacks * Fix for size checks on SVG images with global 'stroke-width' attribute * (bug 11874) Inline CSS with !important no longer borken +* (bug 1600) Strip extra == section markup == in new-comment field === API changes in 1.13 === diff --git a/includes/EditPage.php b/includes/EditPage.php index 33f78e0381..7faab316cd 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -542,6 +542,9 @@ class EditPage { $this->mMetaData = rtrim( $request->getText( 'metadata' ) ); # Truncate for whole multibyte characters. +5 bytes for ellipsis $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 ); + + # Remove extra headings and whitespace from summaries and new sections. + $this->summary = trim(preg_replace('/^=+(.*?)=+$/', '$1', trim($this->summary))); $this->edittime = $request->getVal( 'wpEdittime' ); $this->starttime = $request->getVal( 'wpStarttime' );