We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1c3730 commit fc7ef9cCopy full SHA for fc7ef9c
classes/local/store/object_file_system.php
@@ -948,6 +948,12 @@ public function presigned_url_configured() {
948
* @throws \dml_exception
949
*/
950
public function presigned_url_should_redirect_file($file) {
951
+
952
+ // Core will throw an exception is we try to redirect inside cli or ajax.
953
+ if (CLI_SCRIPT || AJAX_SCRIPT) {
954
+ return false;
955
+ }
956
957
// Redirect when the file size is bigger than presignedminfilesize setting
958
// and file extension is whitelisted.
959
return ($file->get_filesize() >= $this->externalclient->presignedminfilesize &&
0 commit comments