From 87c096818b056ed6a6cfb9e23080366a51bcc450 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 10 Jul 2019 16:02:23 -0700 Subject: [PATCH] Html: Make linkButton() documentation less confusing The documentation for the first parameter said it was both "raw HTML" and "not escaped", but those phrases have opposite meanings. Clarify that this parameter takes plain text that will be escaped (so not raw HTML), and rename the parameter from $contents (typically used to mean HTML) to $text. Change-Id: I44d6de08a68c493935b2ceff58fac6c51bc45d12 --- includes/Html.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/Html.php b/includes/Html.php index d0f9fc64e9..c4b57af978 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -154,8 +154,7 @@ class Html { * Returns an HTML link element in a string styled as a button * (when $wgUseMediaWikiUIEverywhere is enabled). * - * @param string $contents The raw HTML contents of the element: *not* - * escaped! + * @param string $text The text of the element. Will be escaped (not raw HTML) * @param array $attrs Associative array of attributes, e.g., [ * 'href' => 'https://www.mediawiki.org/' ]. See expandAttributes() for * further documentation. @@ -163,10 +162,10 @@ class Html { * @see https://tools.wmflabs.org/styleguide/desktop/index.html for guidance on available modifiers * @return string Raw HTML */ - public static function linkButton( $contents, array $attrs, array $modifiers = [] ) { + public static function linkButton( $text, array $attrs, array $modifiers = [] ) { return self::element( 'a', self::buttonAttributes( $attrs, $modifiers ), - $contents + $text ); } -- 2.20.1