$this->checkMagicQuotes();
global $wgUseLatin1;
if( !$wgUseLatin1 ) {
- $this->normalizeUnicode();
+ require_once( 'normal/UtfNormal.php' );
+ wfProfileIn( 'WebRequest:normalizeUnicode-fix' );
+ $this->normalizeUnicode( $_REQUEST );
+ wfProfileOut( 'WebRequest:normalizeUnicode-fix' );
}
}
}
}
- function normalizeUnicode() {
- wfProfileIn( 'WebRequest:normalizeUnicode-include' );
- require_once( 'normal/UtfNormal.php' );
- wfProfileOut( 'WebRequest:normalizeUnicode-include' );
- wfProfileIn( 'WebRequest:normalizeUnicode-fix' );
- foreach( $_REQUEST as $key => $val ) {
- $_REQUEST[$key] = UtfNormal::toNFC( $val );
+ function normalizeUnicode( &$arr ) {
+ foreach( $arr as $key => $val ) {
+ if( is_array( $val ) ) {
+ $this->normalizeUnicode( $arr[$key ] );
+ } else {
+ $arr[$key] = UtfNormal::toNFC( $val );
+ }
}
- wfProfileOut( 'WebRequest:normalizeUnicode-fix' );
}
function getGPCVal( &$arr, $name, $default ) {
if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) {
$title = substr( $_SERVER['PATH_INFO'], 1 );
+ if( !$wgUseLatin1 ) {
+ require_once( 'includes/normal/UtfNormal.php' );
+ $title = UtfNormal::toNFC( $title );
+ }
} else {
$title = $wgRequest->getVal( "title" );
}