Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -701,7 +701,7 @@ |
702 | 702 | } |
703 | 703 | $attributes = array(); |
704 | 704 | if ( $displayTitle ) { |
705 | | - $attributes["title"] = $key; |
| 705 | + $attributes["title"] = Sanitizer::escapeId( $key ); |
706 | 706 | } |
707 | 707 | $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n"; |
708 | 708 | } |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.preferences.js |
— | — | @@ -17,14 +17,15 @@ |
18 | 18 | if ( i === 0 ) { |
19 | 19 | $(legend).parent().show(); |
20 | 20 | } |
| 21 | + var ident = $(legend).parent().attr( 'title' ); |
21 | 22 | $( '#preftoc' ).append( |
22 | 23 | $( '<li></li>' ) |
23 | 24 | .addClass( i === 0 ? 'selected' : null ) |
24 | 25 | .append( |
25 | 26 | $( '<a></a>') |
26 | 27 | .text( $(legend).text() ) |
27 | | - .attr( 'id', 'preftab-' + i + '-tab' ) |
28 | | - .attr( 'href', '#preftab-' + i ) // Use #preftab-N instead of #prefsection-N to avoid jumping on click |
| 28 | + .attr( 'id', 'preftab-' + ident + '-tab' ) |
| 29 | + .attr( 'href', '#preftab-' + ident ) // Use #preftab-N instead of #prefsection-N to avoid jumping on click |
29 | 30 | .click( function() { |
30 | 31 | $(this).parent().parent().find( 'li' ).removeClass( 'selected' ); |
31 | 32 | $(this).parent().addClass( 'selected' ); |
— | — | @@ -41,7 +42,7 @@ |
42 | 43 | // On document ready: |
43 | 44 | $( function() { |
44 | 45 | var hash = window.location.hash; |
45 | | - if( hash.match( /^#preftab-[\d]+$/ ) ) { |
| 46 | + if( hash.match( /^#preftab-/ ) ) { |
46 | 47 | var $tab = $( hash + '-tab' ); |
47 | 48 | $tab.click(); |
48 | 49 | } |