jenkins-bot has submitted this change and it was merged.

Change subject: Make it possible for EditPage::getCopyrightWarning to return 
HTML
......................................................................


Make it possible for EditPage::getCopyrightWarning to return HTML

Adds a $format option to let it return various output formats
so code that needs HTML doesn't have to do hacky stuff.

Change-Id: Ie4ff9738773399f9f00994c6cc587703ce99a681
---
M includes/EditPage.php
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Parent5446: Looks good to me, approved
  Bartosz Dziewoński: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 12cd4b3..7471589 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2859,7 +2859,15 @@
                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',
@@ -2873,7 +2881,7 @@
                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>";
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/90289
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4ff9738773399f9f00994c6cc587703ce99a681
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to