Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/300843
Change subject: Only run filters once for direct uploads (without stash)
......................................................................
Only run filters once for direct uploads (without stash)
Bug: T140522
Depends-On: I01c8f1271398574073b61c38387ca2e8d96d2871
Change-Id: Ic7c2dbc54c6ad300d26172796ee21027a8c372ee
---
M AbuseFilter.hooks.php
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter
refs/changes/43/300843/1
diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index b16139a..ffd4df4 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -718,11 +718,17 @@
* @param UploadBase $upload
* @param string $mime
* @param array|ApiMessage &$error
+ * @param bool $forImmediatePublishing
* @return bool
*/
- public static function onUploadVerifyFile( $upload, $mime, &$error ) {
+ public static function onUploadVerifyFile( $upload, $mime, &$error,
$forImmediatePublishing = false ) {
global $wgUser, $wgVersion;
+ if ( $forImmediatePublishing ) {
+ // This means that UploadVerifyUpload will run later,
we'll do action='upload' checks there
+ return true;
+ }
+
// On MW 1.27 and older, this is the only hook we can use, even
though it's deficient.
// On MW 1.28 and newer, we use UploadVerifyUpload to check
file uploads, and this one only
// to check file uploads to stash. If a filter doesn't need to
check the page contents or
--
To view, visit https://gerrit.wikimedia.org/r/300843
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7c2dbc54c6ad300d26172796ee21027a8c372ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits