Index: trunk/phase3/includes/Linker.php |
— | — | @@ -302,10 +302,7 @@ |
303 | 303 | * @param $query String: link target |
304 | 304 | * @param $trail String: text after link |
305 | 305 | * @param $prefix String: text before link text |
306 | | - * @param $aprops Mixed: extra attributes to the a-element. If a string, |
307 | | - * inserted literally into the HTML, with a space prepended. It can also |
308 | | - * be an associative array. In this case the keys are attributes, and |
309 | | - * values are *unescaped* attribute values. |
| 306 | + * @param $aprops String: extra attributes to the a-element |
310 | 307 | * @param $style String: style to apply - if empty, use getInternalLinkAttributesObj instead |
311 | 308 | * @return the a-element |
312 | 309 | */ |
— | — | @@ -331,16 +328,7 @@ |
332 | 329 | $style = $this->getInternalLinkAttributesObj( $nt, $text ); |
333 | 330 | } |
334 | 331 | |
335 | | - if( is_string( $aprops ) && $aprops != '' ) { |
336 | | - $aprops = " $aprops"; |
337 | | - } elseif( is_array( $aprops ) ) { |
338 | | - $attributes = $aprops; |
339 | | - $aprops = ''; |
340 | | - foreach( $attributes as $key => $value ) { |
341 | | - $value = htmlspecialchars( $value ); |
342 | | - $aprops .= " $key=\"$value\""; |
343 | | - } |
344 | | - } |
| 332 | + if ( $aprops !== '' ) $aprops = " $aprops"; |
345 | 333 | |
346 | 334 | list( $inside, $trail ) = Linker::splitTrail( $trail ); |
347 | 335 | $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}"; |
— | — | @@ -1298,22 +1286,23 @@ |
1299 | 1287 | * @return string HTML to use for edit link |
1300 | 1288 | */ |
1301 | 1289 | public function doEditSectionLink( Title $nt, $section, $tooltip='' ) { |
| 1290 | + $attribs = ''; |
| 1291 | + if( $tooltip ) { |
| 1292 | + $attribs = wfMsgHtml( 'editsectionhint', htmlspecialchar |
| 1293 | +s( $tooltip ) ); |
| 1294 | + $attribs = " title=\"$attribs\""; |
| 1295 | + } |
| 1296 | + |
1302 | 1297 | $url = $this->makeKnownLinkObj( |
1303 | 1298 | $nt, |
1304 | 1299 | htmlspecialchars(wfMsg('editsection')), |
1305 | 1300 | "action=edit§ion=$section", |
1306 | | - '', '', '', |
1307 | | - array( 'title' => wfMsg( 'editsectionhint', $tooltip ) ) |
| 1301 | + '', '', '', $attribs |
1308 | 1302 | ); |
1309 | 1303 | |
1310 | | - # Run the old hook. This takes up most of the function . . . hopefully |
| 1304 | + # Run the old hook. This takes up half of the function . . . hopefully |
1311 | 1305 | # we can rid of it someday. |
1312 | 1306 | $result = null; |
1313 | | - $attribs = ''; |
1314 | | - if( $tooltip ) { |
1315 | | - $attribs = wfMsgHtml( 'editsectionhint', htmlspecialchars( $tooltip ) ); |
1316 | | - $attribs = " title=\"$attribs\""; |
1317 | | - } |
1318 | 1307 | wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $attribs, $url, &$result ) ); |
1319 | 1308 | if( !is_null( $result ) ) { |
1320 | 1309 | # For reverse compatibility, add the brackets *after* the hook is |