1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Bug 765: Bypass checks on base tab's view state when copying to a new tab

In setup_session, use copy_location, add_to_history, and
render_document_frames instead of goto_uri and copy_vs to copy the base
tab's view state.  By avoiding goto_uri, setup_session now bypasses MIME
checks, form post confirmations, malicious URL checks, and so on when
copying the base tab's current location and view state to the new tab,
so the new tab should get exactly what was loaded in the base tab.

This fixes bug 765: Opening a new tab can ask about the document of the
previous tab.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-06-11 10:32:02 +00:00
parent 9e1e94bee0
commit 5c96d430c9

View File

@ -21,6 +21,7 @@
#include "document/document.h"
#include "document/html/frames.h"
#include "document/refresh.h"
#include "document/renderer.h"
#include "document/view.h"
#include "globhist/globhist.h"
#include "intl/gettext/libintl.h"
@ -823,15 +824,13 @@ static void
setup_session(struct session *ses, struct uri *uri, struct session *base)
{
if (base && have_location(base)) {
goto_uri(ses, cur_loc(base)->vs.uri);
if (ses->doc_view && ses->doc_view->vs
&& base->doc_view && base->doc_view->vs) {
struct view_state *vs = ses->doc_view->vs;
struct location *loc = mem_calloc(1, sizeof(*loc));
destroy_vs(vs, 1);
copy_vs(vs, base->doc_view->vs);
ses->doc_view->vs = vs;
if (loc) {
loc->download.state = S_OK;
copy_location(loc, cur_loc(base));
add_to_history(&ses->history, loc);
render_document_frames(ses, 0);
}
}