http://www.mediawiki.org/wiki/Special:Code/MediaWiki/87668

Revision: 87668
Author:   dantman
Date:     2011-05-08 00:10:31 +0000 (Sun, 08 May 2011)
Log Message:
-----------
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).

Modified Paths:
--------------
    trunk/phase3/includes/Linker.php

Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php    2011-05-07 23:46:16 UTC (rev 87667)
+++ trunk/phase3/includes/Linker.php    2011-05-08 00:10:31 UTC (rev 87668)
@@ -155,19 +155,19 @@
         * @return string HTML <a> 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 "<!-- ERROR -->$text";
+                       return "<!-- ERROR -->$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 @@
                        $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__ );


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to