Moved the PATH_INFO check from index.php into WebRequest; it now just shoves the param into $_REQUEST['title'].
*
*/
+require_once( 'normal/UtfNormal.php' );
+
/**
*
*/
wfProfileOut( $fname );
return false;
}
+
+ global $wgUseLatin1;
+ if( !$wgUseLatin1 && false !== strpos( $t, UTF8_REPLACEMENT, $t ) ) {
+ # Contained illegal UTF-8 sequences or forbidden Unicode chars.
+ wfProfileOut( $fname );
+ return false;
+ }
$this->mDbkeyform = $t;
$done = false;
class WebRequest {
function WebRequest() {
$this->checkMagicQuotes();
+ global $wgUsePathInfo;
+ if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) {
+ # Stuff it!
+ $_REQUEST['title'] = substr( $_SERVER['PATH_INFO'], 1 );
+ }
global $wgUseLatin1;
if( !$wgUseLatin1 ) {
require_once( 'normal/UtfNormal.php' );
if( is_array( $val ) ) {
$this->normalizeUnicode( $arr[$key ] );
} else {
- $arr[$key] = UtfNormal::toNFC( $val );
+ $arr[$key] = UtfNormal::cleanUp( $val );
}
}
}
# Query string fields
$action = $wgRequest->getVal( "action", "view" );
-
-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" );
-}
+$title = $wgRequest->getVal( "title" );
# Placeholders in case of DB error
$wgTitle = Title::newFromText( wfMsg( "badtitle" ) );