Skip to content

Commit 0af0997

Browse files
authored
Merge pull request #711 from catalyst/should-redirect-ajax
Do not redirect inside ajax or cli #710
2 parents d1c3730 + fc7ef9c commit 0af0997

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

classes/local/store/object_file_system.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,12 @@ public function presigned_url_configured() {
948948
* @throws \dml_exception
949949
*/
950950
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+
951957
// Redirect when the file size is bigger than presignedminfilesize setting
952958
// and file extension is whitelisted.
953959
return ($file->get_filesize() >= $this->externalclient->presignedminfilesize &&

0 commit comments

Comments
 (0)