mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-15977 create_file_from_storedfile should accept an original file object
This commit is contained in:
parent
26a9dc726b
commit
8eb1e0a15c
@ -353,10 +353,15 @@ class file_storage {
|
||||
public function create_file_from_storedfile($file_record, $fid) {
|
||||
global $DB;
|
||||
|
||||
if ($fid instanceof stored_file) {
|
||||
$fid = $fid->get_id();
|
||||
}
|
||||
|
||||
$file_record = (array)$file_record; // we support arrays too
|
||||
unset($file_record['id']);
|
||||
unset($file_record['filesize']);
|
||||
unset($file_record['contenthash']);
|
||||
unset($file_record['pathnamehash']);
|
||||
|
||||
$now = time();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user