Bug 985 Fix auto-summary for section edits
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 5 Dec 2004 23:16:35 +0000 (23:16 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 5 Dec 2004 23:16:35 +0000 (23:16 +0000)
includes/EditPage.php

index e7ccb34..17c2bbf 100644 (file)
@@ -292,11 +292,11 @@ class EditPage {
                                        $s = wfMsg('editingsection', $this->mTitle->getPrefixedText() );
                                }
                                if(!$this->preview) {
-                                       $sectitle=preg_match("/^=+(.*?)=+/mi",
-                                       $this->textbox1,
-                                       $matches);
-                                       if( !empty( $matches[1] ) ) {
-                                               $this->summary = "/* ". trim($matches[1])." */ ";
+                                       preg_match( "/^(=+)(.+)\\1/mi",
+                                               $this->textbox1,
+                                               $matches );
+                                       if( !empty( $matches[2] ) ) {
+                                               $this->summary = "/* ". trim($matches[2])." */ ";
                                        }
                                }
                        } else {