* Pass a title object, not a title string
*/
function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
- global $wgOut, $wgUser, $wgInputEncoding;
+ global $wgOut, $wgUser;
$fname = 'Linker::makeLinkObj';
wfProfileIn( $fname );
$parts = explode( '#', $u, 2 );
if ( count( $parts ) == 2 ) {
- $anchor = urlencode( do_html_entity_decode( str_replace(' ', '_', $parts[1] ),
- ENT_COMPAT,
- $wgInputEncoding ) );
+ $anchor = urlencode( Sanitizer::decodeCharReferences( str_replace(' ', '_', $parts[1] ) ) );
$replacearray = array(
'%3A' => ':',
'%' => '.'
* Pass a title object, not a title string
*/
function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' ) {
- global $wgOut, $wgTitle, $wgInputEncoding;
+ global $wgOut, $wgTitle;
$fname = 'Linker::makeKnownLinkObj';
wfProfileIn( $fname );
$text = htmlspecialchars( $nt->getFragment() );
}
}
- $anchor = urlencode( do_html_entity_decode( str_replace(' ', '_', $nt->getFragment()), ENT_COMPAT, $wgInputEncoding ) );
+ $anchor = urlencode( Sanitizer::decodeCharReferences( str_replace( ' ', '_', $nt->getFragment() ) ) );
$replacearray = array(
'%3A' => ':',
'%' => '.'