]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16907, force binary mode write in smb plugin for repository module"
authordongsheng <dongsheng>
Tue, 21 Oct 2008 06:43:18 +0000 (06:43 +0000)
committerdongsheng <dongsheng>
Tue, 21 Oct 2008 06:43:18 +0000 (06:43 +0000)
repository/smb/repository.class.php

index fe8592e67953d645c1d89f95376163ffd093048f..76e010bc6e2fa92ce76ed437030e8906e2717686 100755 (executable)
@@ -32,13 +32,12 @@ class repository_smb extends repository {
             $file = uniqid('m').$file;
         }
 
-        $fp = fopen($dir.$file, 'w');
         $content = '';
         $fp = fopen($url, 'r');
         while (!feof($fp)) {
             $content .= fread($fp, 1024*8);
         }
-        $fp = fopen($dir.$file, 'w');
+        $fp = fopen($dir.$file, 'wb');
         fwrite($fp, $content);
         return $dir.$file;
     }