Merge "Make it possible for EditPage::getCopyrightWarning to return HTML"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 21 Oct 2013 01:19:27 +0000 (01:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 21 Oct 2013 01:19:27 +0000 (01:19 +0000)
includes/EditPage.php

index 718fe91..d7b2b5e 100644 (file)
@@ -2858,7 +2858,15 @@ HTML
                return self::getCopyrightWarning( $this->mTitle );
        }
 
-       public static function getCopyrightWarning( $title ) {
+       /**
+        * Get the copyright warning, by default returns wikitext
+        *
+        * @param Title $title
+        * @param string $format output format, valid values are any function of
+        *                       a Message object
+        * @return string
+        */
+       public static function getCopyrightWarning( $title, $format = 'plain' ) {
                global $wgRightsText;
                if ( $wgRightsText ) {
                        $copywarnMsg = array( 'copyrightwarning',
@@ -2872,7 +2880,7 @@ HTML
                wfRunHooks( 'EditPageCopyrightWarning', array( $title, &$copywarnMsg ) );
 
                return "<div id=\"editpage-copywarn\">\n" .
-                       call_user_func_array( 'wfMessage', $copywarnMsg )->plain() . "\n</div>";
+                       call_user_func_array( 'wfMessage', $copywarnMsg )->$format() . "\n</div>";
        }
 
        /**