emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c6d8143: Fix fileless eww form submission


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master c6d8143: Fix fileless eww form submission
Date: Sat, 14 Sep 2019 10:55:33 -0400 (EDT)

branch: master
commit c6d814345370307be3de802c65152c887a01359a
Author: Basil L. Contovounesios <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix fileless eww form submission
    
    * lisp/net/eww.el (eww-submit): Ignore file inputs with no
    associated file name (bug#36520).
---
 lisp/net/eww.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 2013604..fb495a9 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'.")
              (push (cons name (plist-get input :value))
                    values)))
           ((equal (plist-get input :type) "file")
-           (push (cons "file"
-                       (list (cons "filedata"
-                                   (with-temp-buffer
-                                     (insert-file-contents
-                                      (plist-get input :filename))
-                                     (buffer-string)))
-                             (cons "name" (plist-get input :name))
-                             (cons "filename" (plist-get input :filename))))
-                 values))
+            (when-let ((file (plist-get input :filename)))
+              (push (list "file"
+                          (cons "filedata"
+                                (with-temp-buffer
+                                  (insert-file-contents file)
+                                  (buffer-string)))
+                          (cons "name" name)
+                          (cons "filename" file))
+                    values)))
           ((equal (plist-get input :type) "submit")
            ;; We want the values from buttons if we hit a button if
            ;; we hit enter on it, or if it's the first button after



reply via email to

[Prev in Thread] Current Thread [Next in Thread]