Partial revert of r32376: don't strip whitespace from summaries. If you do, that...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Apr 2008 17:58:21 +0000 (17:58 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Apr 2008 17:58:21 +0000 (17:58 +0000)
includes/EditPage.php

index 99f1f76..1468ff8 100644 (file)
@@ -543,8 +543,8 @@ class EditPage {
                        # 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)));
+                       # Remove extra headings from summaries and new sections.
+                       $this->summary = preg_replace('/^(\s*)=+(.*?)=+(\s*)$/', '$1$2$3', $this->summary);
 
                        $this->edittime = $request->getVal( 'wpEdittime' );
                        $this->starttime = $request->getVal( 'wpStarttime' );