Merge "Fix a few minor mistakes in PHPDoc tags"
[lhc/web/wiklou.git] / includes / api / ApiFormatBase.php
index eb23bd6..06eaa19 100644 (file)
@@ -132,6 +132,7 @@ abstract class ApiFormatBase extends ApiBase {
 
        /**
         * Overridden to honor $this->forceDefaultParams(), if applicable
+        * @inheritDoc
         * @since 1.26
         */
        protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) {
@@ -219,7 +220,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 );
                                }