From 09086758e7e395b0d882551297f94a59a1856aad Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Tue, 19 Mar 2013 21:38:25 +0000 Subject: Fix 3608298: only apply link hack if JS is disabled. --- render/box_construct.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'render') 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; + } } } -- cgit v1.2.3