From 104016401ccd38f6746f6e931072c9df338ac2af Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 8 May 2011 00:10:31 +0000 Subject: [PATCH] Change $text to $html. This has been bothering me for awhile. It's stupid, counterintuitive, we call it text making people think of it as text then note (oh, this isn't text, it's html, you'd better escape it yourself or you'll screw yourself over with an XSS vector). --- includes/Linker.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 85164c6933..fd0b48ade0 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -155,19 +155,19 @@ class Linker { * @return string HTML attribute */ public static function link( - $target, $text = null, $customAttribs = array(), $query = array(), $options = array() + $target, $html = null, $customAttribs = array(), $query = array(), $options = array() ) { wfProfileIn( __METHOD__ ); if ( !$target instanceof Title ) { wfProfileOut( __METHOD__ ); - return "$text"; + return "$html"; } $options = (array)$options; $dummy = new DummyLinker; // dummy linker instance for bc on the hooks $ret = null; - if ( !wfRunHooks( 'LinkBegin', array( $dummy, $target, &$text, + if ( !wfRunHooks( 'LinkBegin', array( $dummy, $target, &$html, &$customAttribs, &$query, &$options, &$ret ) ) ) { wfProfileOut( __METHOD__ ); return $ret; @@ -203,13 +203,13 @@ class Linker { $attribs, self::linkAttribs( $target, $customAttribs, $options ) ); - if ( is_null( $text ) ) { - $text = self::linkText( $target ); + if ( is_null( $html ) ) { + $html = self::linkText( $target ); } $ret = null; - if ( wfRunHooks( 'LinkEnd', array( $dummy, $target, $options, &$text, &$attribs, &$ret ) ) ) { - $ret = Html::rawElement( 'a', $attribs, $text ); + if ( wfRunHooks( 'LinkEnd', array( $dummy, $target, $options, &$html, &$attribs, &$ret ) ) ) { + $ret = Html::rawElement( 'a', $attribs, $html ); } wfProfileOut( __METHOD__ ); -- 2.20.1