From: Daniel Friesen Date: Sun, 8 May 2011 00:10:31 +0000 (+0000) Subject: Change $text to $html. This has been bothering me for awhile. It's stupid, counterint... X-Git-Tag: 1.31.0-rc.0~30330 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=104016401ccd38f6746f6e931072c9df338ac2af;p=lhc%2Fweb%2Fwiklou.git 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). --- 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__ );