From: Alexandre Emsenhuber Date: Wed, 24 Jul 2013 07:47:50 +0000 (+0200) Subject: (bug 49694) Apply $wgSpamRegex to the new section name in action=edit§ion=new X-Git-Tag: 1.31.0-rc.0~19112 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=6e838747487661faf0f404911f062f75ccf950a4;p=lhc%2Fweb%2Fwiklou.git (bug 49694) Apply $wgSpamRegex to the new section name in action=edit§ion=new Either on $this->sectiontitle or $this->summary depending on which will be used. bug: 49694 Change-Id: Ie35c6bfe5cc66313930b0dc4d8f9e618657b3aea --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 64d970eee0..0d4bee79e8 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -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 diff --git a/includes/EditPage.php b/includes/EditPage.php index 36ec7410fd..1b59430a76 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ); }