1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Base href was lost while setting form->action by ECMAScript. This is

attempt to fix it
This commit is contained in:
witekfl 2006-02-09 22:50:30 +01:00 committed by
parent e723ddaee6
commit 10589b04eb
2 changed files with 20 additions and 1 deletions

View File

@ -859,7 +859,17 @@ form_put(struct SEE_interpreter *interp, struct SEE_object *o,
return;
if (p == s_action) {
if (form->action) {
struct uri *uri = get_uri(form->action, URI_HTTP_REFERRER_HOST);
if (uri) {
mem_free_set(&form->action, join_urls(uri, string));
mem_free(string);
done_uri(uri);
}
} else {
mem_free_set(&form->action, string);
}
} else if (p == s_encoding) {
if (!strcasecmp(string, "application/x-www-form-urlencoded")) {
form->method = form->method == FORM_METHOD_GET ? FORM_METHOD_GET

View File

@ -735,6 +735,15 @@ form_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
switch (JSVAL_TO_INT(id)) {
case JSP_FORM_ACTION:
if (form->action) {
struct uri *uri = get_uri(form->action, URI_HTTP_REFERRER_HOST);
if (uri) {
mem_free_set(&form->action, join_urls(uri, jsval_to_string(ctx, vp)));
done_uri(uri);
break;
}
}
mem_free_set(&form->action, stracpy(jsval_to_string(ctx, vp)));
break;