jenkins-bot has submitted this change and it was merged.

Change subject: Exclude short sections from validations
......................................................................


Exclude short sections from validations

Validating sections with a few words - may be while translation is
starting - will trigger false alarms. Since the section will be
evaluated as an article.

150 characters are choosen as threshold to do validation. It is based
on https://en.wikipedia.org/wiki/Special:AbuseFilter/98. Since the rules
are different in different wikis, we may still get false alarms, but less.

Bug: T128455
Change-Id: I1e2bec7b8b0209520904b33b40b7c9d1b620145a
---
M includes/AbuseFilterCheck.php
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Nikerabbit: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/AbuseFilterCheck.php b/includes/AbuseFilterCheck.php
index 82d3dc5..3f1be38 100644
--- a/includes/AbuseFilterCheck.php
+++ b/includes/AbuseFilterCheck.php
@@ -78,6 +78,12 @@
                        return array();
                }
 
+               if ( $text === null || mb_strlen( $text ) < 150 ) {
+                       // Don't validate sections that are too short. The 
validations
+                       // happen while editing is going on.
+                       return array();
+               }
+
                $vars = new \AbuseFilterVariableHolder();
                // Add AbuseFilter variables. Note that we are adding the title
                // here. That will cause filters about titles executed for 
every sections.

-- 
To view, visit https://gerrit.wikimedia.org/r/274353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e2bec7b8b0209520904b33b40b7c9d1b620145a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to