allow other content-types
[lhc/web/wiklou.git] / includes / WebRequest.php
index 985697a..865c1b7 100644 (file)
@@ -38,7 +38,7 @@ class WebRequest {
        function WebRequest() {
                $this->checkMagicQuotes();
                global $wgUsePathInfo;
-               if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) {
+               if( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) {
                        # Stuff it!
                        $_GET['title'] = $_REQUEST['title'] =
                                substr( $_SERVER['PATH_INFO'], 1 );
@@ -100,6 +100,7 @@ class WebRequest {
        
        /**
         * Fetch a value from the given array or return $default if it's not set.
+        *
         * @param array &$arr
         * @param string $name
         * @param mixed $default
@@ -108,7 +109,7 @@ class WebRequest {
         */
        function getGPCVal( &$arr, $name, $default ) {
                if( isset( $arr[$name] ) ) {
-                       global $wgUseLatin1, $wgServer, $wgContLang;
+                       global $wgServer, $wgContLang;
                        $data = $arr[$name];
                        if( isset( $_GET[$name] ) &&
                                !is_array( $data ) &&
@@ -120,10 +121,8 @@ class WebRequest {
                                        $data = $wgContLang->checkTitleEncoding( $data );
                                }
                        }
-                       if( !$wgUseLatin1 ) {
-                               require_once( 'normal/UtfNormal.php' );
-                               $data = $this->normalizeUnicode( $data );
-                       }
+                       require_once( 'normal/UtfNormal.php' );
+                       $data = $this->normalizeUnicode( $data );
                        return $data;
                } else {
                        return $default;
@@ -381,15 +380,8 @@ class WebRequest {
                
                # Safari sends filenames in HTML-encoded Unicode form D...
                # Horrid and evil! Let's try to make some kind of sense of it.
-               global $wgUseLatin1;
-               if( $wgUseLatin1 ) {
-                       $name = utf8_encode( $name );
-               }
                $name = wfMungeToUtf8( $name );
                $name = UtfNormal::cleanUp( $name );
-               if( $wgUseLatin1 ) {
-                       $name = utf8_decode( $name );
-               }
                wfDebug( "WebRequest::getFileName() '" . $_FILES[$key]['name'] . "' normalized to '$name'\n" );
                return $name;
        }