changeset 1028:7d3d7c405cf4

Added support for a quoted URL in META refresh
author Jorge Arellano Cid <jcid@dillo.org>
date Thu, 26 Mar 2009 11:21:20 -0400
parents bdf5dcd6c87e
children 85fd6bedbab1
files ChangeLog src/html.cc
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 26 08:31:24 2009 -0400
+++ b/ChangeLog	Thu Mar 26 11:21:20 2009 -0400
@@ -98,6 +98,7 @@
  - Fixed collapsing of whitespace entities in HTML mode.
  - Updated the URL resolver to comply with RFC-3986.
  - Fixed handling of META's content-type with no MIME type (e.g. only charset).
+ - Added support for a quoted URL in META refresh.
    Patches: Jorge Arellano Cid
 
 dw
--- a/src/html.cc	Thu Mar 26 08:31:24 2009 -0400
+++ b/src/html.cc	Thu Mar 26 11:21:20 2009 -0400
@@ -2786,7 +2786,7 @@
 " <a href='%s'>here</a>%s</td></tr></table><br>\n";
 
    const char *equiv, *content, *new_content;
-   char delay_str[64];
+   char delay_str[64], *mr_url, *p;
    Dstr *ds_msg;
    int delay;
 
@@ -2809,12 +2809,21 @@
          }
          /* Skip to anything after "URL=" */
          while (*content && *(content++) != '=') ;
+         /* 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 = strdup(content + 1);
+         } else {
+            mr_url = strdup(content);
+         }
 
          /* Send a custom HTML message.
           * TODO: This is a hairy hack,
           *       It'd be much better to build a widget. */
          ds_msg = dStr_sized_new(256);
-         dStr_sprintf(ds_msg, meta_template, content, delay_str);
+         dStr_sprintf(ds_msg, meta_template, mr_url, delay_str);
          {
             int o_InFlags = html->InFlags;
             int o_TagSoup = html->TagSoup;