From b3fac92fdc785a2a5966fecc7c3bdad150b4fdb8 Mon Sep 17 00:00:00 2001
From: dongsheng <dongsheng>
Date: Tue, 22 Jul 2008 07:24:32 +0000
Subject: [PATCH] MDL-15350, use penny's patch to apply default value in
 uploadfile function

---
 repository/boxnet/boxlibphp5.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/repository/boxnet/boxlibphp5.php b/repository/boxnet/boxlibphp5.php
index d543f6b009..01fb2b480b 100755
--- a/repository/boxnet/boxlibphp5.php
+++ b/repository/boxnet/boxlibphp5.php
@@ -190,8 +190,15 @@ class boxclient {
         $params['auth_token'] = $this->auth_token;
         // this param should be the full path of the file
         $params['new_file1']  = '@'.$params['file'];
-        $params['folder_id']  = 0; //Set to '0' by default. Change to create within sub-folder.
-        $params['share']      = 1; //Set to '1' by default. Set to '0' to make folder private.
+        $defaults = array(
+            'folder_id' => 0, //Set to '0' by default. Change to create within sub-folder.
+            'share'     => 1, //Set to '1' by default. Set to '0' to make folder private.
+        );
+        foreach ($defaults as $key => $value) {
+            if (!array_key_exists($key, $params)) {
+                $params[$key] = $value;
+            }
+        }
         $ret_array = array();
         $entry_count = 0;
         $data = $this->makeRequest('upload', $params);
-- 
2.39.5