Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4684,21 +4684,11 @@ |
4685 | 4685 | * "== Header ==". |
4686 | 4686 | */ |
4687 | 4687 | public function guessSectionNameFromWikiText( $text ) { |
| 4688 | + global $wgEnforceHtmlIds; |
4688 | 4689 | # Strip out wikitext links(they break the anchor) |
4689 | 4690 | $text = $this->stripSectionName( $text ); |
4690 | | - $headline = Sanitizer::decodeCharReferences( $text ); |
4691 | | - # strip out HTML |
4692 | | - $headline = StringUtils::delimiterReplace( '<', '>', '', $headline ); |
4693 | | - $headline = trim( $headline ); |
4694 | | - $sectionanchor = '#' . urlencode( str_replace( ' ', '_', $headline ) ); |
4695 | | - $replacearray = array( |
4696 | | - '%3A' => ':', |
4697 | | - '%' => '.' |
4698 | | - ); |
4699 | | - return str_replace( |
4700 | | - array_keys( $replacearray ), |
4701 | | - array_values( $replacearray ), |
4702 | | - $sectionanchor ); |
| 4691 | + return '#' . Sanitizer::escapeId( $text, |
| 4692 | + $wgEnforceHtmlIds ? array() : 'xml' ); |
4703 | 4693 | } |
4704 | 4694 | |
4705 | 4695 | /** |