(bug 33471) compare detectProtocol to 'https'
[lhc/web/wiklou.git] / includes / OutputPage.php
index e9e2b6f..b69069b 100644 (file)
@@ -56,9 +56,9 @@ class OutputPage extends ContextSource {
        /**
         * Holds the debug lines that will be output as comments in page source if
         * $wgDebugComments is enabled. See also $wgShowDebug.
-        * TODO: make a getter method for this
+        * @deprecated since 1.20; use MWDebug class instead.
         */
-       public $mDebugtext = ''; // TODO: we might want to replace it by wfDebug() wfDebugLog()
+       public $mDebugtext = '';
 
        /// Should be private. Stores contents of "<title>" tag
        var $mHTMLtitle = '';
@@ -851,11 +851,10 @@ class OutputPage extends ContextSource {
                $this->getContext()->setTitle( $t );
        }
 
-
        /**
         * Replace the subtile with $str
         *
-        * @param $str String|Message: new value of the subtitle
+        * @param $str String|Message: new value of the subtitle. String should be safe HTML.
         */
        public function setSubtitle( $str ) {
                $this->clearSubtitle();
@@ -875,7 +874,7 @@ class OutputPage extends ContextSource {
        /**
         * Add $str to the subtitle
         *
-        * @param $str String|Message to add to the subtitle
+        * @param $str String|Message to add to the subtitle. String should be safe HTML.
         */
        public function addSubtitle( $str ) {
                if ( $str instanceof Message ) {
@@ -1314,15 +1313,6 @@ class OutputPage extends ContextSource {
                return $this->mBodytext;
        }
 
-       /**
-        * Add $text to the debug output
-        *
-        * @param $text String: debug text
-        */
-       public function debug( $text ) {
-               $this->mDebugtext .= $text;
-       }
-
        /**
         * Get/set the ParserOptions object to use for wikitext parsing
         *
@@ -1999,6 +1989,9 @@ class OutputPage extends ContextSource {
                        wfProfileOut( 'Output-skin' );
                }
 
+               // This hook allows last minute changes to final overall output by modifying output buffer
+               wfRunHooks( 'AfterFinalPageOutput', array( $this ) );
+
                $this->sendCacheControl();
                ob_end_flush();
                wfProfileOut( __METHOD__ );
@@ -2032,10 +2025,6 @@ class OutputPage extends ContextSource {
         *                   based on $pageTitle
         */
        public function prepareErrorPage( $pageTitle, $htmlTitle = false ) {
-               if ( $this->getTitle() ) {
-                       $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
-               }
-
                $this->setPageTitle( $pageTitle );
                if ( $htmlTitle !== false ) {
                        $this->setHTMLTitle( $htmlTitle );
@@ -3550,9 +3539,6 @@ $templates
         * message names, or arrays, in which case the first element is the message name,
         * and subsequent elements are the parameters to that message.
         *
-        * The special named parameter 'options' in a message specification array is passed
-        * through to the $options parameter of wfMsgExt().
-        *
         * Don't use this for messages that are not in users interface language.
         *
         * For example:
@@ -3561,7 +3547,7 @@ $templates
         *
         * Is equivalent to:
         *
-        *    $wgOut->addWikiText( "<div class='error'>\n" . wfMsgNoTrans( 'some-error' ) . "\n</div>" );
+        *    $wgOut->addWikiText( "<div class='error'>\n" . wfMessage( 'some-error' )->plain() . "\n</div>" );
         *
         * The newline after opening div is needed in some wikitext. See bug 19226.
         *
@@ -3578,14 +3564,17 @@ $templates
                                $args = $spec;
                                $name = array_shift( $args );
                                if ( isset( $args['options'] ) ) {
-                                       $options = $args['options'];
                                        unset( $args['options'] );
+                                       wfDeprecated(
+                                               'Adding "options" to ' . __METHOD__ . ' is no longer supported',
+                                               '1.20'
+                                       );
                                }
                        }  else {
                                $args = array();
                                $name = $spec;
                        }
-                       $s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s );
+                       $s = str_replace( '$' . ( $n + 1 ), $this->msg( $name, $args )->plain(), $s );
                }
                $this->addWikiText( $s );
        }