(bug 49694) Apply $wgSpamRegex to the new section name in action=edit&section=new
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 24 Jul 2013 07:47:50 +0000 (09:47 +0200)
committerMarius Hoch <hoo@online.de>
Fri, 26 Jul 2013 14:53:42 +0000 (16:53 +0200)
Either on $this->sectiontitle or $this->summary depending on which will be used.

bug: 49694
Change-Id: Ie35c6bfe5cc66313930b0dc4d8f9e618657b3aea

RELEASE-NOTES-1.22
includes/EditPage.php

index 64d970e..0d4bee7 100644 (file)
@@ -230,6 +230,8 @@ production.
 * (bug 51891) Fixed PHP notice on Special:PagesWithProp when no properties
   are defined.
 * (bug 52006) Corrected documentation of $wgTranscludeCacheExpiry.
+* (bug 49694) $wgSpamRegex is now also applied on the new section headline text
+  adding a new topic on a page
 
 === API changes in 1.22 ===
 * (bug 25553) The JSON output formatter now leaves forward slashes unescaped
index 36ec741..1b59430 100644 (file)
@@ -1402,6 +1402,13 @@ class EditPage {
 
                # Check for spam
                $match = self::matchSummarySpamRegex( $this->summary );
+               if ( $match === false && $this->section == 'new' ) {
+                       if ( $this->sectiontitle !== '' ) {
+                               $match = self::matchSpamRegex( $this->sectiontitle );
+                       } else {
+                               $match = self::matchSpamRegex( $this->summary );
+                       }
+               }
                if ( $match === false ) {
                        $match = self::matchSpamRegex( $this->textbox1 );
                }