Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/90289


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

Make it possible for EditPage::getCopyrightWarning to return HTML

Adds a boolean $html option to let it return HTML 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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/90289/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 12cd4b3..30015a7 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2859,7 +2859,14 @@
                return self::getCopyrightWarning( $this->mTitle );
        }
 
-       public static function getCopyrightWarning( $title ) {
+       /**
+        * Get the copyright warning, by default returns wikitext
+        *
+        * @param Title $title
+        * @param bool $html whether to return parsed HTML
+        * @return string
+        */
+       public static function getCopyrightWarning( $title, $html = false ) {
                global $wgRightsText;
                if ( $wgRightsText ) {
                        $copywarnMsg = array( 'copyrightwarning',
@@ -2872,8 +2879,9 @@
                // Allow for site and per-namespace customization of 
contribution/copyright notice.
                wfRunHooks( 'EditPageCopyrightWarning', array( $title, 
&$copywarnMsg ) );
 
+               $format = $html ? 'parse' : 'plain';
                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: newchange
Gerrit-Change-Id: Ie4ff9738773399f9f00994c6cc587703ce99a681
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to