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

onsubmit: Reverted commit fa93d05b7e.

I don't remember why I cleared "returns", but it doesn't work
with www.hypermedia.pl/altkom/ and probably with many more sites.

[ From commit e887efc611 on the witekfl
  branch.  --KON ]
This commit is contained in:
Witold Filipczyk 2007-05-19 18:47:20 +02:00 committed by Kalle Olavi Niemitalo
parent ac3608bda0
commit 7988a6ce2f

View File

@ -916,17 +916,12 @@ call_onsubmit_and_submit(struct session *ses, struct document_view *doc_view,
if (init_string(&code)) {
struct view_state *vs = doc_view->vs;
struct ecmascript_interpreter *interpreter;
unsigned char *ret = fc->form->onsubmit;
int res;
if (vs->ecmascript_fragile)
ecmascript_reset_state(vs);
interpreter = vs->ecmascript;
assert(interpreter);
/* SEE and SpiderMonkey do not like return outside
* functions. */
while ((ret = strstr(ret, "return ")))
while (*ret != ' ') *ret++ = ' ';
add_to_string(&code, fc->form->onsubmit);
res = ecmascript_eval_boolback(interpreter, &code);