diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2013-03-19 21:38:25 +0000 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2013-03-19 21:38:25 +0000 |
commit | 09086758e7e395b0d882551297f94a59a1856aad (patch) | |
tree | 41942f631367d2b45b7aa30813e5a4554eb21e3b /render | |
parent | 0bcbdba42481fc01a700ca1f2b4917981dbecf67 (diff) | |
download | netsurf-09086758e7e395b0d882551297f94a59a1856aad.tar.gz netsurf-09086758e7e395b0d882551297f94a59a1856aad.tar.bz2 |
Fix 3608298: only apply link hack if JS is disabled.
Diffstat (limited to 'render')
-rw-r--r-- | render/box_construct.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index e5800edf8..78d0f6742 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -3142,20 +3142,23 @@ bool box_extract_link(const char *rel, nsurl *base, nsurl **result) } s[j] = 0; - /* extract first quoted string out of "javascript:" link */ - if (strncmp(s, "javascript:", 11) == 0) { - apos0 = strchr(s, '\''); - if (apos0) - apos1 = strchr(apos0 + 1, '\''); - quot0 = strchr(s, '"'); - if (quot0) - quot1 = strchr(quot0 + 1, '"'); - if (apos0 && apos1 && (!quot0 || !quot1 || apos0 < quot0)) { - *apos1 = 0; - s1 = apos0 + 1; - } else if (quot0 && quot1) { - *quot1 = 0; - s1 = quot0 + 1; + if (nsoption_bool(enable_javascript) == false) { + /* extract first quoted string out of "javascript:" link */ + if (strncmp(s, "javascript:", 11) == 0) { + apos0 = strchr(s, '\''); + if (apos0) + apos1 = strchr(apos0 + 1, '\''); + quot0 = strchr(s, '"'); + if (quot0) + quot1 = strchr(quot0 + 1, '"'); + if (apos0 && apos1 && + (!quot0 || !quot1 || apos0 < quot0)) { + *apos1 = 0; + s1 = apos0 + 1; + } else if (quot0 && quot1) { + *quot1 = 0; + s1 = quot0 + 1; + } } } |