mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Bug 620: Reset form fields to default values on reload
Do not retain changed values in form fields when the user reloads. Doing so can be confusing or even cause data-loss when new default values are specified in the updated document. For example, when editing an article on Wikipedia, one loads the edit page for the article, makes and submits changes, goes back to the edit page to make further modifications, and reloads to get the new article text. Before this change, reloading the edit page would not update the textarea on the page with the new article source, which can lead one (and has led me) to make changes to the original version of the article by accident. This fixes bug 620.
This commit is contained in:
parent
696496e831
commit
9e1e94bee0
@ -36,6 +36,7 @@
|
||||
#include "util/error.h"
|
||||
#include "util/memory.h"
|
||||
#include "util/string.h"
|
||||
#include "viewer/text/form.h"
|
||||
#include "viewer/text/view.h"
|
||||
#include "viewer/text/vs.h"
|
||||
|
||||
@ -335,6 +336,11 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
if (!document) return;
|
||||
doc_view->document = document;
|
||||
|
||||
if (doc_view->session
|
||||
&& doc_view->session->reloadlevel > CACHE_MODE_NORMAL)
|
||||
while (vs->form_info_len)
|
||||
mem_free_if(vs->form_info[--vs->form_info_len].value);
|
||||
|
||||
shrink_memory(0);
|
||||
|
||||
render_encoded_document(cached, document);
|
||||
|
Loading…
x
Reference in New Issue
Block a user