1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-31 01:32:00 -07:00

Fix eww-submit for forms with no action (bug#80918)

* lisp/net/eww.el (eww-submit): If a form does not specify an action
the assumed action is the current URL. If the current URL has an
existing query part, that part must be replaced by the form values,
rather than appended to.

Copyright-paperwork-exempt: yes
This commit is contained in:
Aidan Coyle 2026-04-29 11:17:44 -05:00 committed by Philip Kaludercic
parent 0e7a24d931
commit 09dc864b0b
No known key found for this signature in database

View file

@ -2246,11 +2246,12 @@ Interactively, EVENT is the value of `last-nonmenu-event'."
(plist-get eww-data :url)))))))
(eww-browse-url
(concat
(if (cdr (assq :action form))
(shr-expand-url (cdr (assq :action form)) (plist-get eww-data :url))
(plist-get eww-data :url))
"?"
(mm-url-encode-www-form-urlencoded values))))))
(shr-expand-url
(or (cdr (assq :action form))
(car (url-path-and-query (url-generic-parse-url (plist-get eww-data :url)))))
(plist-get eww-data :url))
"?"
(mm-url-encode-www-form-urlencoded values))))))
(defun eww-browse-with-external-browser (&optional url)
"Browse the current URL with an external browser.