From: Kunal Mehta Date: Thu, 17 Oct 2013 05:34:07 +0000 (-0700) Subject: Make it possible for EditPage::getCopyrightWarning to return HTML X-Git-Tag: 1.31.0-rc.0~18454^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=5655514978bce047af959b5f9d64f5a23052ae8a;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 12cd4b3d83..7471589adb 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2859,7 +2859,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', @@ -2873,7 +2881,7 @@ HTML wfRunHooks( 'EditPageCopyrightWarning', array( $title, &$copywarnMsg ) ); return "
\n" . - call_user_func_array( 'wfMessage', $copywarnMsg )->plain() . "\n
"; + call_user_func_array( 'wfMessage', $copywarnMsg )->$format() . "\n"; } /**