Merge branch 'MDL-80157_storedfileproblem' of https://github.com/leonstr/moodle

This commit is contained in:
Ilya Tregubov 2023-11-23 09:46:31 +08:00
commit ae15c3de69
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1

View File

@ -1247,7 +1247,7 @@ class file_storage {
$tmpfile = tempnam($this->tempdir, 'newfromurl');
$content = download_file_content($url, $headers, $postdata, $fullresponse, $timeout, $connecttimeout, $skipcertverify, $tmpfile, $calctimeout);
if ($content === false) {
throw new file_exception('storedfileproblem', 'Can not fetch file form URL');
throw new file_exception('storedfileproblem', 'Cannot fetch file from URL');
}
try {
$newfile = $this->create_file_from_pathname($filerecord, $tmpfile);
@ -1261,7 +1261,7 @@ class file_storage {
} else {
$content = download_file_content($url, $headers, $postdata, $fullresponse, $timeout, $connecttimeout, $skipcertverify, NULL, $calctimeout);
if ($content === false) {
throw new file_exception('storedfileproblem', 'Can not fetch file form URL');
throw new file_exception('storedfileproblem', 'Cannot fetch file from URL');
}
return $this->create_file_from_string($filerecord, $content);
}