r32864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32863‎ | r32864 | r32865 >
Date:18:04, 6 April 2008
Author:simetrical
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -544,7 +544,7 @@
545545 $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 );
546546
547547 # Remove extra headings from summaries and new sections.
548 - $this->summary = preg_replace('/^(\s*)=+(.*?)=+(\s*)$/', '$1$2$3', $this->summary);
 548+ $this->summary = preg_replace('/^\s*=+\s*(.*?)\s*=+\s*$/', '$1$2$3', $this->summary);
549549
550550 $this->edittime = $request->getVal( 'wpEdittime' );
551551 $this->starttime = $request->getVal( 'wpStarttime' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r32971tweak to r32864 -- remove extra parameters from string replacement which were...brion18:04, 8 April 2008

Status & tagging log