Merge "Only skip apparent null-edits when the page exists"

This commit is contained in:
jenkins-bot 2014-09-11 15:42:38 +00:00 committed by Gerrit Code Review
commit 24a0a2dd78

View file

@ -139,9 +139,7 @@ class AbuseFilterHooks {
$user = $context->getUser();
// Check for null edits.
$oldtext = '';
$oldcontent = null;
if ( ( $title instanceof Title ) && $title->canExist() && $title->exists() ) {
// Make sure we load the latest text saved in database (bug 31656)
@ -161,19 +159,19 @@ class AbuseFilterHooks {
// Cache article object so we can share a parse operation
$articleCacheKey = $title->getNamespace() . ':' . $title->getText();
AFComputedVariable::$articleCache[$articleCacheKey] = $page;
// Don't trigger for null edits.
if ( $content && isset( $oldcontent ) && $content->equals( $oldcontent ) ) {
// Compare Content objects if available
return true;
} elseif ( strcmp( $oldtext, $text ) == 0 ) {
// Otherwise, compare strings
return true;
}
} else {
$page = null;
}
// Don't trigger for null edits.
if ( $content && $oldcontent && $oldcontent->equals( $content ) ) {
// Compare Content objects if available
return true;
} else if ( strcmp( $oldtext, $text ) == 0 ) {
// Otherwise, compare strings
return true;
}
$vars->addHolders(
AbuseFilter::generateUserVars( $user ),
AbuseFilter::generateTitleVars( $title , 'ARTICLE' )