From 5655514978bce047af959b5f9d64f5a23052ae8a Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Wed, 16 Oct 2013 22:34:07 -0700 Subject: [PATCH] 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 --- includes/EditPage.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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"; } /** -- 2.20.1