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 "Fix documentation of mw.loader.getState"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiFormatBase.php
diff --git
a/includes/api/ApiFormatBase.php
b/includes/api/ApiFormatBase.php
index
f0037bb
..
7bbd968
100644
(file)
--- a/
includes/api/ApiFormatBase.php
+++ b/
includes/api/ApiFormatBase.php
@@
-164,20
+164,23
@@
abstract class ApiFormatBase extends ApiBase {
$out->setPageTitle( $context->msg( 'api-format-title' ) );
$header = $context->msg( 'api-format-prettyprint-header' )
$out->setPageTitle( $context->msg( 'api-format-title' ) );
$header = $context->msg( 'api-format-prettyprint-header' )
- ->params( $format, strtolower( $format ) )
- ->parseAsBlock();
+
->params( $format, strtolower( $format ) )
+
->parseAsBlock();
$out->addHTML(
Html::rawElement( 'div', array( 'class' => 'api-pretty-header' ),
ApiHelp::fixHelpLinks( $header )
)
);
$out->addHTML(
Html::rawElement( 'div', array( 'class' => 'api-pretty-header' ),
ApiHelp::fixHelpLinks( $header )
)
);
- if (
wfRunHooks
( 'ApiFormatHighlight', array( $context, $result, $mime, $format ) ) ) {
+ if (
Hooks::run
( 'ApiFormatHighlight', array( $context, $result, $mime, $format ) ) ) {
$out->addHTML(
Html::element( 'pre', array( 'class' => 'api-pretty-content' ), $result )
);
}
$out->addHTML(
Html::element( 'pre', array( 'class' => 'api-pretty-content' ), $result )
);
}
+ // API handles its own clickjacking protection.
+ // Note, that $wgBreakFrames will still override $wgApiFrameOptions for format mode.
+ $out->allowClickJacking();
$out->output();
} else {
// For non-HTML output, clear all errors that might have been
$out->output();
} else {
// For non-HTML output, clear all errors that might have been
@@
-204,7
+207,7
@@
abstract class ApiFormatBase extends ApiBase {
return $this->mBuffer;
}
return $this->mBuffer;
}
- p
ublic
function getExamplesMessages() {
+ p
rotected
function getExamplesMessages() {
return array(
'action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName()
=> array( 'apihelp-format-example-generic', $this->getFormat() )
return array(
'action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName()
=> array( 'apihelp-format-example-generic', $this->getFormat() )