Fix params to ParserOutputStashForEdit

$summary and $user are always guaranteed to be passed, and $user is
guaranteed to be a User object. Hence, update the hook handler to
reflect that.

Change-Id: I3a7fcb074b460b77210de5a6bad43f500aff3249
This commit is contained in:
Daimona Eaytoy 2019-09-23 23:33:51 +02:00
parent 8dbbe859e7
commit 0119108ee7

View file

@ -999,10 +999,10 @@ class AbuseFilterHooks {
* @param Content $content
* @param ParserOutput $output
* @param string $summary
* @param User|null $user
* @param User $user
*/
public static function onParserOutputStashForEdit(
WikiPage $page, Content $content, ParserOutput $output, $summary = '', $user = null
WikiPage $page, Content $content, ParserOutput $output, $summary, User $user
) {
$startTime = microtime( true );
$oldRevision = $page->getRevision();
@ -1011,7 +1011,6 @@ class AbuseFilterHooks {
}
$oldContent = $oldRevision->getContent( Revision::RAW );
$user = $user ?: RequestContext::getMain()->getUser();
$oldAfText = AbuseFilter::revisionToString( $oldRevision, $user );
// XXX: This makes the assumption that this method is only ever called for the main slot.