From c6d870c38f5bee39e8fc4d2379d2a0a2c86a7a26 Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Sat, 20 Dec 2014 18:48:24 -0300 Subject: Fix: Abort redirections and META-refresh for URLs marke "local". --- src/cache.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/cache.c') diff --git a/src/cache.c b/src/cache.c index 04c8d356..14e862b5 100644 --- a/src/cache.c +++ b/src/cache.c @@ -953,14 +953,20 @@ static int Cache_redirect(CacheEntry_t *entry, int Flags, BrowserWindow *bw) _MSG(" Cache_redirect: redirect_level = %d\n", bw->redirect_level); + /* Don't allow redirection for SpamSafe/local URLs */ + if (URL_FLAGS(entry->Url) & URL_SpamSafe) { + a_UIcmd_set_msg(bw, "WARNING: local URL with redirection. Aborting."); + return 0; + } + /* if there's a redirect loop, stop now */ if (bw->redirect_level >= 5) entry->Flags |= CA_RedirectLoop; if (entry->Flags & CA_RedirectLoop) { - a_UIcmd_set_msg(bw, "ERROR: redirect loop for: %s", URL_STR_(entry->Url)); - bw->redirect_level = 0; - return 0; + a_UIcmd_set_msg(bw, "ERROR: redirect loop for: %s", URL_STR_(entry->Url)); + bw->redirect_level = 0; + return 0; } if ((entry->Flags & CA_Redirect && entry->Location) && -- cgit v1.2.3