mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Pass a user to WikiPage::prepareContentForEdit()"
This commit is contained in:
commit
2deac909ad
|
@ -189,7 +189,11 @@ class LazyVariableComputer {
|
|||
|
||||
$new_text = $getVarCB( $textVar )->toString();
|
||||
$content = ContentHandler::makeContent( $new_text, $article->getTitle() );
|
||||
$editInfo = $article->prepareContentForEdit( $content );
|
||||
$editInfo = $article->prepareContentForEdit(
|
||||
$content,
|
||||
null,
|
||||
$parameters['contextUser']
|
||||
);
|
||||
$result = array_keys( $editInfo->output->getExternalLinks() );
|
||||
self::$profilingExtraTime += ( microtime( true ) - $startTime );
|
||||
break;
|
||||
|
@ -253,7 +257,11 @@ class LazyVariableComputer {
|
|||
|
||||
$new_text = $getVarCB( $textVar )->toString();
|
||||
$content = ContentHandler::makeContent( $new_text, $article->getTitle() );
|
||||
$editInfo = $article->prepareContentForEdit( $content );
|
||||
$editInfo = $article->prepareContentForEdit(
|
||||
$content,
|
||||
null,
|
||||
$parameters['contextUser']
|
||||
);
|
||||
if ( isset( $parameters['pst'] ) && $parameters['pst'] ) {
|
||||
$result = $editInfo->pstContent->serialize( $editInfo->format );
|
||||
} else {
|
||||
|
|
|
@ -46,7 +46,7 @@ class LazyVariableComputerDBTest extends MediaWikiIntegrationTestCase {
|
|||
] );
|
||||
|
||||
$generator = AbuseFilterServices::getVariableGeneratorFactory()->newGenerator( $baseVars );
|
||||
$actualHolder = $generator->addEditVars( $page, $this->createMock( User::class ) )
|
||||
$actualHolder = $generator->addEditVars( $page, $this->getTestUser()->getUser() )
|
||||
->getVariableHolder();
|
||||
$actual = AbuseFilterServices::getVariablesManager()->exportAllVars( $actualHolder );
|
||||
|
||||
|
|
Loading…
Reference in a new issue