OutputPage::showErrorPage raises a notice if arguments are incoherent
authorDereckson <dereckson@espace-win.org>
Wed, 29 Jan 2014 15:31:03 +0000 (16:31 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 29 Jan 2014 16:06:01 +0000 (17:06 +0100)
The method has the following signature:
OutputPage::showErrorPage( $title, $msg, $params = array() )

$msg can be a string or a Message object.

If it's a string, a Message object is built, with $params as parameters.
If it's a Message object, $params is ignored.

The core now triggers a notice in the case a call is made with $msg an instance
of Message object, and a (non-empty array) $params argument is given.

Change-Id: I227a416f088fc1acd6a04345ed0e24d06f967ecc

RELEASE-NOTES-1.23
includes/OutputPage.php

index 10caf6f..57080b7 100644 (file)
@@ -201,6 +201,7 @@ changes to languages because of Bugzilla reports.
 * (bug 52813) Preference "Show table of contents (for pages with more than
   3 headings)" was removed.
 * (bug 52810) Preference "Justify paragraphs" was removed.
+* OutputPage::showErrorPage raises a notice if arguments are incoherent.
 
 ==== Removed classes ====
 * FakeMemCachedClient (deprecated in 1.18)
index 04792cf..6d06693 100644 (file)
@@ -2147,6 +2147,9 @@ class OutputPage extends ContextSource {
                $this->prepareErrorPage( $title );
 
                if ( $msg instanceof Message ) {
+                       if ( $params !== array() ) {
+                               trigger_error( 'Argument ignored: $params. The message parameters argument is discarded when the $msg argument is a Message object instead of a string.', E_USER_NOTICE );
+                       }
                        $this->addHTML( $msg->parseAsBlock() );
                } else {
                        $this->addWikiMsgArray( $msg, $params );