From: Brion Vibber Date: Tue, 6 Dec 2011 23:40:44 +0000 (+0000) Subject: * (bug 32617) Fix for edit summary on section 0 containing a bogus section heading X-Git-Tag: 1.31.0-rc.0~26146 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=fb81bd376a1234713820c9ceecb8334b8fd0b8f5;p=lhc%2Fweb%2Fwiklou.git * (bug 32617) Fix for edit summary on section 0 containing a bogus section heading Based on patch posted by Dan Collins: https://bugzilla.wikimedia.org/attachment.cgi?id=9552 with a tweak to avoid breaking a similar case in other sections. Follows up on function extraction & test cases added in r105379. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index f40311900a..b7deb822fd 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1720,7 +1720,7 @@ HTML * @return Mixed|string or false */ public static function extractSectionTitle( $text ) { - preg_match( "/^(=+)(.+)\\1/mi", $text, $matches ); + preg_match( "/^(=+)(.+)\\1(\n|$)/i", $text, $matches ); if ( !empty( $matches[2] ) ) { global $wgParser; return $wgParser->stripSectionName(trim($matches[2]));