From 150bf280cb67668e1581b232a223222f71786dcc Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Wed, 10 Jul 2013 03:39:01 +0200 Subject: [PATCH] Don't create default object from empty value in AbuseFilterHooks We shouldn't try to set the attribute of a variable which isn't actually an object as this will lead to the "Creating default object from empty value" PHP error and it will trigger a further fatal down the road. This gets triggered in Wikibase and probably other extension unit tests. Change-Id: I0f2e93657e5cfdb84ee351be371d421c11291b82 --- AbuseFilter.hooks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index 2e06ae1aa..42debad78 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -132,8 +132,9 @@ class AbuseFilterHooks { // Some edits are running through multiple hooks, but we only want to filter them once if ( isset( $title->editAlreadyFiltered ) ) { return true; + } elseif ( $title ) { + $title->editAlreadyFiltered = true; } - $title->editAlreadyFiltered = true; self::$successful_action_vars = false; self::$last_edit_page = false;