applies patch from bug 19934
authorMichael Dale <dale@users.mediawiki.org>
Mon, 27 Jul 2009 00:42:26 +0000 (00:42 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Mon, 27 Jul 2009 00:42:26 +0000 (00:42 +0000)
includes/HttpFunctions.php

index e4c90dc..a87e6f6 100644 (file)
@@ -195,11 +195,17 @@ class Http {
                // if status okay process upload using fauxReq to api:
                if( $status->isOK() ){
                        // setup the FauxRequest
-                       $fauxReqData = $sd['mParams'];
+                       $fauxReqData = $sd['mParams'];          
+                               
+                       // Fix boolean parameters
+                       foreach( $fauxReqData as $k => $v ) {
+                               if( $v === false )
+                                       unset( $fauxReqData[$k] );
+                       }
+                       
                        $fauxReqData['action'] = 'upload';
                        $fauxReqData['format'] = 'json';
-                       $fauxReqData['internalhttpsession'] = $upload_session_key;
-
+                       $fauxReqData['internalhttpsession'] = $upload_session_key;                      
                        // evil but no other clean way about it:
                        $faxReq = new FauxRequest( $fauxReqData, true );
                        $processor = new ApiMain( $faxReq, $wgEnableWriteAPI );