jenkins-bot has submitted this change and it was merged.
Change subject: Guard against null $title in
TranslateHooks::onAbuseFilterFilterAction
......................................................................
Guard against null $title in TranslateHooks::onAbuseFilterFilterAction
Although it's supposed to be a Title object and documented as such,
this is likely passed null sometimes. There are several places where
AbuseFilter::filterAction is called so just do this check on our side
and see whether this fixes T143073.
Added logging with backtrace for further debugging.
Bug: T143073
Change-Id: I1d011c54fc4c90fb34592b5d59d65176b8c41b88
---
M TranslateHooks.php
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/TranslateHooks.php b/TranslateHooks.php
index 5f35cd2..4fe736a 100644
--- a/TranslateHooks.php
+++ b/TranslateHooks.php
@@ -241,9 +241,14 @@
* Used for setting an AbuseFilter variable.
*
* @param AbuseFilterVariableHolder &$vars
- * @param Title $title
+ * @param Title|null $title
*/
public static function onAbuseFilterFilterAction( &$vars, $title ) {
+ if ( !$title instanceof Title ) {
+ wfDebugLog( 'T143073', 'Got non-Title in ' .
wfGetAllCallers( 5 ) );
+ return;
+ }
+
$handle = new MessageHandle( $title );
// Only set this variable if we are in a proper namespace to
avoid
--
To view, visit https://gerrit.wikimedia.org/r/304973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1d011c54fc4c90fb34592b5d59d65176b8c41b88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Glaisher <[email protected]>
Gerrit-Reviewer: Glaisher <[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