diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 63d100e2..5cae4138 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -333,13 +333,14 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
333 | link->urlRange = capturedRange_RegExpMatch(&m, 1); | 333 | link->urlRange = capturedRange_RegExpMatch(&m, 1); |
334 | setRange_String(&link->url, link->urlRange); | 334 | setRange_String(&link->url, link->urlRange); |
335 | set_String(&link->url, canonicalUrl_String(absoluteUrl_String(&d->url, &link->url))); | 335 | set_String(&link->url, canonicalUrl_String(absoluteUrl_String(&d->url, &link->url))); |
336 | if (startsWithCase_String(&link->url, "about:command")) { | 336 | /* If invalid, disregard the link. */ |
337 | /* This is a special internal page that allows submitting UI events. */ | 337 | if (size_String(&link->url) > prefs_App()->maxUrlSize || |
338 | if (!d->enableCommandLinks) { | 338 | (startsWithCase_String(&link->url, "about:command") |
339 | delete_GmLink(link); | 339 | /* this is a special internal page that allows submitting UI events */ |
340 | *linkId = 0; | 340 | && !d->enableCommandLinks)) { |
341 | return line; | 341 | delete_GmLink(link); |
342 | } | 342 | *linkId = 0; |
343 | return line; | ||
343 | } | 344 | } |
344 | /* Check the URL. */ { | 345 | /* Check the URL. */ { |
345 | iUrl parts; | 346 | iUrl parts; |
@@ -385,7 +386,7 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
385 | iString *path = newRange_String(parts.path); | 386 | iString *path = newRange_String(parts.path); |
386 | if (endsWithCase_String(path, ".gif") || endsWithCase_String(path, ".jpg") || | 387 | if (endsWithCase_String(path, ".gif") || endsWithCase_String(path, ".jpg") || |
387 | endsWithCase_String(path, ".jpeg") || endsWithCase_String(path, ".png") || | 388 | endsWithCase_String(path, ".jpeg") || endsWithCase_String(path, ".png") || |
388 | endsWithCase_String(path, ".tga") || endsWithCase_String(path, ".psd") || | 389 | endsWithCase_String(path, ".tga") || endsWithCase_String(path, ".psd") || |
389 | #if defined (LAGRANGE_ENABLE_WEBP) | 390 | #if defined (LAGRANGE_ENABLE_WEBP) |
390 | endsWithCase_String(path, ".webp") || | 391 | endsWithCase_String(path, ".webp") || |
391 | #endif | 392 | #endif |