Skip to content

Commit

Permalink
use type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaraGunkel committed May 4, 2021
1 parent 121332a commit a955d12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/chunkupload_form_element.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function validatesubmitvalue($value) {
if ($path == null || !file_exists($path)) {
return get_string('nofile', 'error');
}
if ($this->_options['maxbytes'] != -1 && filesize($path) > $this->_options['maxbytes']) {
if ($this->_options['maxbytes'] !== -1 && filesize($path) > $this->_options['maxbytes']) {
unlink($path);
$DB->delete_records('local_chunkupload_files', ['id' => $value]);
return get_string('errorfiletoobig', 'moodle', $this->_options['maxbytes']);
Expand Down

1 comment on commit a955d12

@t-schroeder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made the size check fail again for us since block_opencast passes maxbytes as a string ("-1"). I've created a pull request to cast maxsize into an int there. For other form elements like filepicker maxbytes is also of type int.

Please sign in to comment.