Skip to content

Commit

Permalink
Fix bug where Chrome could not upload the same file that was selected…
Browse files Browse the repository at this point in the history
… before (#5854)

... and removed the cancel hack that is not needed anymore.
  • Loading branch information
alecpl committed Jul 14, 2017
1 parent 69795eb commit cfed954
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ CHANGELOG Roundcube Webmail
- Fix fatal error when using DMY- or MDY-based date format in PostgreSQL (#5808)
- Fix bug where errors were not printed when using bin/update.sh (#5834)
- Fix PHP 7.2 warnings on count() use (#5845)
- Fix bug where Chrome could not upload the same file that was selected before (#5854)

RELEASE 1.3.0
-------------
Expand Down
5 changes: 3 additions & 2 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,9 @@ public function upload_form($attrib, $name, $action, $input_attr = array())
unset($attrib['buttons']);
$form_attr['class'] = 'smart-upload';
$input_attr = array_merge($input_attr, array(
// Note: Chrome sometimes executes onchange event on Cancel, make sure a file was selected
'onchange' => "if ((this.files && this.files.length) || (!this.files && this.value)) $event",
// #5854: Chrome does not execute onchange when selecting the same file.
// To fix this we reset the input using null value.
'onchange' => "$event; this.value=null",
'class' => 'smart-upload',
'tabindex' => '-1',
));
Expand Down

0 comments on commit cfed954

Please sign in to comment.