dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve comments on fields and fix opening_text - needs no highlights."
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiParse.php
diff --git
a/includes/api/ApiParse.php
b/includes/api/ApiParse.php
index
f96acf3
..
3e66cad
100644
(file)
--- a/
includes/api/ApiParse.php
+++ b/
includes/api/ApiParse.php
@@
-346,22
+346,27
@@
class ApiParse extends ApiBase {
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
- $context =
$this->getContext(
);
+ $context =
new DerivativeContext( $this->getContext()
);
$context->setTitle( $titleObj );
$context->setTitle( $titleObj );
- $context->getOutput()->addParserOutputMetadata( $p_result );
+ $context->setWikiPage( $pageObj );
+
+ // We need an OutputPage tied to $context, not to the
+ // RequestContext at the root of the stack.
+ $output = new OutputPage( $context );
+ $output->addParserOutputMetadata( $p_result );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
- $css = $this->formatCss( $
context->getOutput()
->buildCssLinksArray() );
+ $css = $this->formatCss( $
output
->buildCssLinksArray() );
- $scripts = [ $
context->getOutput()
->getHeadScripts() ];
+ $scripts = [ $
output
->getHeadScripts() ];
$result_array['headitems'] = array_merge( $headItems, $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
$result_array['headitems'] = array_merge( $headItems, $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
- $result_array['headhtml'] = $
context->getOutput()
->headElement( $context->getSkin() );
+ $result_array['headhtml'] = $
output
->headElement( $context->getSkin() );
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'headhtml';
}
}
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'headhtml';
}
}