Slight tweak to last commit: don't preserve whitespace if it is actually a heading...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Apr 2008 18:04:38 +0000 (18:04 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Apr 2008 18:04:38 +0000 (18:04 +0000)
includes/EditPage.php

index 1468ff8..3ec0ec0 100644 (file)
@@ -544,7 +544,7 @@ class EditPage {
                        $this->summary = $wgLang->truncate( $request->getText( 'wpSummary'  ), 250 );
                        
                        # Remove extra headings from summaries and new sections.
-                       $this->summary = preg_replace('/^(\s*)=+(.*?)=+(\s*)$/', '$1$2$3', $this->summary);
+                       $this->summary = preg_replace('/^\s*=+\s*(.*?)\s*=+\s*$/', '$1$2$3', $this->summary);
 
                        $this->edittime = $request->getVal( 'wpEdittime' );
                        $this->starttime = $request->getVal( 'wpStarttime' );