summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/html.cc23
-rw-r--r--test/html/Makefile.am1
-rw-r--r--test/html/render/meta-refresh-0-no-url.html10
-rw-r--r--test/html/render/meta-refresh-0-no-url.ref.html9
5 files changed, 37 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index ec0fe050..b63696bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ dillo-3.2.0 [Not released yet]
+- Ignore empty page title for tab labels.
Fix segfault when clicking the "Done" button in downloads dialog.
Add zoom support using Ctrl +/-/0 and the "zoom_factor" option.
+ Fix wrong redirect by meta refresh without URL.
Patches: Rodrigo Arias Mallo
dillo-3.1.1 [Jun 8, 2024]
diff --git a/src/html.cc b/src/html.cc
index 471a1afa..a55fd2a8 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -3152,19 +3152,28 @@ static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize)
sprintf(delay_str, ".");
}
/* Skip to anything after "URL=" or ";" if "URL=" is not found */
+ int has_url = 1;
if ((p = dStriAsciiStr(content, "url=")))
content = p + strlen("url=");
else if ((p = strstr(content, ";")))
content = p + strlen(";");
- /* Handle the case of a quoted URL */
- if (*content == '"' || *content == '\'') {
- if ((p = strchr(content + 1, *content)))
- mr_url = dStrndup(content + 1, p - content - 1);
- else
- mr_url = dStrdup(content + 1);
+ else
+ has_url = 0;
+
+ if (has_url) {
+ /* Handle the case of a quoted URL */
+ if (*content == '"' || *content == '\'') {
+ if ((p = strchr(content + 1, *content)))
+ mr_url = dStrndup(content + 1, p - content - 1);
+ else
+ mr_url = dStrdup(content + 1);
+ } else {
+ mr_url = dStrdup(content);
+ }
} else {
- mr_url = dStrdup(content);
+ mr_url = dStrdup("");
}
+
new_url = a_Html_url_new(html, mr_url, NULL, 0);
if (a_Url_cmp(html->base_url, new_url) == 0) {
diff --git a/test/html/Makefile.am b/test/html/Makefile.am
index e96e9f15..4e55d8f8 100644
--- a/test/html/Makefile.am
+++ b/test/html/Makefile.am
@@ -23,6 +23,7 @@ TESTS = \
render/max-width-div-clamp.html \
render/max-width-html.html \
render/max-width-nested-div.html \
+ render/meta-refresh-0-no-url.html \
render/min-width-body.html \
render/min-width-div-extend.html \
render/min-width-div.html \
diff --git a/test/html/render/meta-refresh-0-no-url.html b/test/html/render/meta-refresh-0-no-url.html
new file mode 100644
index 00000000..7af8f961
--- /dev/null
+++ b/test/html/render/meta-refresh-0-no-url.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test meta refresh 0 without URL</title>
+ <meta http-equiv="Refresh" content="0">
+ </head>
+ <body>
+ <p>Should be ignored.</p>
+ </body>
+</html>
diff --git a/test/html/render/meta-refresh-0-no-url.ref.html b/test/html/render/meta-refresh-0-no-url.ref.html
new file mode 100644
index 00000000..12ac12bc
--- /dev/null
+++ b/test/html/render/meta-refresh-0-no-url.ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test meta refresh 0 without URL</title>
+ </head>
+ <body>
+ <p>Should be ignored.</p>
+ </body>
+</html>