From fb81bd376a1234713820c9ceecb8334b8fd0b8f5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 6 Dec 2011 23:40:44 +0000 Subject: [PATCH] * (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. --- includes/EditPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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])); -- 2.20.1