X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatBase.php;h=36247dd981ac5912a52d936ed807f019b58efa7d;hb=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;hp=eb23bd63ace7c914fe642b443aaca6b1c4db3bc4;hpb=55043101b2a89ea1e811b6d35e415f57ed0bf41d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index eb23bd63ac..36247dd981 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -219,7 +219,14 @@ abstract class ApiFormatBase extends ApiBase { if ( !$this->getIsWrappedHtml() ) { // When the format without suffix 'fm' is defined, there is a non-html version if ( $this->getMain()->getModuleManager()->isDefined( $lcformat, 'format' ) ) { - $msg = $context->msg( 'api-format-prettyprint-header' )->params( $format, $lcformat ); + if ( !$this->getRequest()->wasPosted() ) { + $nonHtmlUrl = strtok( $this->getRequest()->getFullRequestURL(), '?' ) + . '?' . $this->getRequest()->appendQueryValue( 'format', $lcformat ); + $msg = $context->msg( 'api-format-prettyprint-header-hyperlinked' ) + ->params( $format, $lcformat, $nonHtmlUrl ); + } else { + $msg = $context->msg( 'api-format-prettyprint-header' )->params( $format, $lcformat ); + } } else { $msg = $context->msg( 'api-format-prettyprint-header-only-html' )->params( $format ); }