diff options
| author | Basil L. Contovounesios | 2019-09-14 16:55:24 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-09-14 16:55:24 +0200 |
| commit | c6d814345370307be3de802c65152c887a01359a (patch) | |
| tree | 85a405a869ff194025df91220b4b3e0186b48bec | |
| parent | 5a0ab88cc984e8a5e66f85cb5acfa362fc66bdb6 (diff) | |
| download | emacs-c6d814345370307be3de802c65152c887a01359a.tar.gz emacs-c6d814345370307be3de802c65152c887a01359a.zip | |
Fix fileless eww form submission
* lisp/net/eww.el (eww-submit): Ignore file inputs with no
associated file name (bug#36520).
| -rw-r--r-- | lisp/net/eww.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2013604c9e7..fb495a98582 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1447,15 +1447,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") | |||
| 1447 | (push (cons name (plist-get input :value)) | 1447 | (push (cons name (plist-get input :value)) |
| 1448 | values))) | 1448 | values))) |
| 1449 | ((equal (plist-get input :type) "file") | 1449 | ((equal (plist-get input :type) "file") |
| 1450 | (push (cons "file" | 1450 | (when-let ((file (plist-get input :filename))) |
| 1451 | (list (cons "filedata" | 1451 | (push (list "file" |
| 1452 | (with-temp-buffer | 1452 | (cons "filedata" |
| 1453 | (insert-file-contents | 1453 | (with-temp-buffer |
| 1454 | (plist-get input :filename)) | 1454 | (insert-file-contents file) |
| 1455 | (buffer-string))) | 1455 | (buffer-string))) |
| 1456 | (cons "name" (plist-get input :name)) | 1456 | (cons "name" name) |
| 1457 | (cons "filename" (plist-get input :filename)))) | 1457 | (cons "filename" file)) |
| 1458 | values)) | 1458 | values))) |
| 1459 | ((equal (plist-get input :type) "submit") | 1459 | ((equal (plist-get input :type) "submit") |
| 1460 | ;; We want the values from buttons if we hit a button if | 1460 | ;; We want the values from buttons if we hit a button if |
| 1461 | ;; we hit enter on it, or if it's the first button after | 1461 | ;; we hit enter on it, or if it's the first button after |