Edit API: Run OutputPageBeforeHTML hook on output

The output is assumed to be the same as you would get if you
fetched the page again, so this output-modifying hook needs to run.

Bug: T258980
Change-Id: I015ac183a0c25dafb9b95c577edd4ef59c112d43
This commit is contained in:
Ed Sanders 2020-07-07 12:20:01 +01:00 committed by Bartosz Dziewoński
parent eb98439453
commit a63133776a

View file

@ -423,9 +423,12 @@ class ApiVisualEditorEdit extends ApiBase {
$context = new RequestContext;
$context->setTitle( $title );
$context->setRequest( new FauxRequest( [ 'action' => 'view' ] ) );
$tempOut = new OutputPage( $context );
$tempOut->setArticleFlag( true );
Hooks::run( 'OutputPageBeforeHTML', [ $tempOut, &$result['content'] ] );
$subpagestr = $this->getSkin()->subPageSubtitle( $tempOut );
if ( $subpagestr !== '' ) {
$subpagestr = '<span class="subpages">' . $subpagestr . '</span>';