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
This commit is contained in:
Marius Hoch 2013-07-10 03:39:01 +02:00 committed by Hashar
parent 2fcb9e51df
commit 150bf280cb

View file

@ -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;