From b6b5e421540cc3a7b059a913ee9ab112ae25662b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 14 Jul 2017 08:44:49 +0200 Subject: [PATCH] Fix bug where Chrome could not upload the same file that was selected before (#5854) ... and removed the cancel hack that is not needed anymore. --- CHANGELOG | 1 + program/include/rcmail.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cd0c1e94d..30f88d4be 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,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 ------------- diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 208d1560e..62d73696f 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -2164,8 +2164,9 @@ class rcmail extends rcube 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', ));