Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
6926df75
Commit
6926df75
authored
Dec 15, 2009
by
Dongsheng Cai
Browse files
"MDL-21102, fixed fatal php error in file picker"
parent
75b1018c
Changes
2
Hide whitespace changes
Inline
Side-by-side
repository/local/repository.class.php
View file @
6926df75
...
...
@@ -158,12 +158,13 @@ class repository_local extends repository {
$filename
=
$params
[
'filename'
];
$fileitemid
=
$params
[
'itemid'
];
$context
=
get_context_instance_by_id
(
$contextid
);
$file_info
=
$browser
->
get_file_info
(
$context
,
$filearea
,
$fileitemid
,
$filepath
,
$filename
);
$file_info
=
$browser
->
get_file_info
(
$context
,
$filearea
,
$fileitemid
,
$filepath
,
$filename
);
$file_info
->
copy_to_storage
(
$user_context
->
id
,
'user_draft'
,
$itemid
,
$save_path
,
$title
);
$ret
[
'itemid'
]
=
$itemid
;
$ret
[
'title'
]
=
$title
;
$ret
[
'contextid'
]
=
$user_context
->
id
;
$ret
[
'filesize'
]
=
$file_info
->
get_filesize
();
return
$ret
;
}
...
...
repository/repository_ajax.php
View file @
6926df75
...
...
@@ -237,7 +237,7 @@ EOD;
$info
[
'file'
]
=
$fileinfo
[
'title'
];
$info
[
'id'
]
=
$itemid
;
$info
[
'url'
]
=
$CFG
->
httpswwwroot
.
'/draftfile.php/'
.
$fileinfo
[
'contextid'
]
.
'/user_draft/'
.
$itemid
.
'/'
.
$fileinfo
[
'title'
];
$filesize
=
$fileinfo
->
get_
filesize
()
;
$filesize
=
$fileinfo
[
'
filesize
'
]
;
if
((
$maxbytes
!==-
1
)
&&
(
$filesize
>
$maxbytes
))
{
$fileinfo
->
delete
();
throw
new
file_exception
(
'maxbytes'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment