Index: trunk/phase3/includes/Xml.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | * Return null if no attributes given. |
43 | 43 | * @param $attribs Array of attributes for an XML element |
44 | 44 | */ |
45 | | - private static function expandAttributes( $attribs ) { |
| 45 | + public static function expandAttributes( $attribs ) { |
46 | 46 | $out = ''; |
47 | 47 | if( is_null( $attribs ) ) { |
48 | 48 | return null; |
— | — | @@ -682,4 +682,4 @@ |
683 | 683 | return Xml::tags( 'select', $this->attributes, implode( "\n", $this->options ) ); |
684 | 684 | } |
685 | 685 | |
686 | | -} |
\ No newline at end of file |
| 686 | +} |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -205,8 +205,24 @@ |
206 | 206 | $text = $this->linkText( $target ); |
207 | 207 | } |
208 | 208 | |
| 209 | + # Compat cruft :( |
| 210 | + if( in_array( 'broken', $options ) ) { |
| 211 | + $hookQuery = wfArrayToCGI( $query ); |
| 212 | + $hookUrl = $attribs['href']; |
| 213 | + $hookAttribs = $attribs; |
| 214 | + unset( $hookAttribs['href'] ); |
| 215 | + $hookAttribs = Xml::expandAttributes( $hookAttribs ); |
| 216 | + $hookPrefix = $hookInside = $hookTrail = ''; |
| 217 | + wfRunHooks( 'BrokenLink', array( $this, $target, $hookQuery, |
| 218 | + &$hookUrl, &$hookAttribs, &$hookPrefix, &$text, &$hookInside, |
| 219 | + &$hookTrail ) ); |
| 220 | + $attribs = Sanitizer::decodeTagAttributes( $hookAttribs ); |
| 221 | + $attribs['href'] = $hookUrl; |
| 222 | + $text = "$hookPrefix$text$hookInside"; |
| 223 | + } |
| 224 | + |
209 | 225 | $ret = Xml::openElement( 'a', $attribs ) |
210 | | - . $text |
| 226 | + . $text . ( isset( $hookTrail ) ? $hookTrail : '' ) |
211 | 227 | . Xml::closeElement( 'a' ); |
212 | 228 | |
213 | 229 | wfProfileOut( __METHOD__ ); |