From: Aryeh Gregor Date: Sun, 6 Apr 2008 18:04:38 +0000 (+0000) Subject: Slight tweak to last commit: don't preserve whitespace if it is actually a heading... X-Git-Tag: 1.31.0-rc.0~48573 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=23008e367f0848e782814e861413afc687684b77;p=lhc%2Fweb%2Fwiklou.git Slight tweak to last commit: don't preserve whitespace if it is actually a heading.\nI'm not actually clear on why we want to introduce this voodoo =-stripping behavior, actually? Do people really enter stuff like "== Section name ==" for their edit summary, and *not* mean it to be saved that way? Why is the expected result to strip the equals signs? And would it make more sense to do the normalization on save as well or also on previews, as we do now? The former is what we do for things like subst. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 1468ff86db..3ec0ec009e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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' );