- bugfix: error-pages now get correct request protocol
authoroes <oes@users.sourceforge.net>
Fri, 5 Apr 2002 15:51:24 +0000 (15:51 +0000)
committeroes <oes@users.sourceforge.net>
Fri, 5 Apr 2002 15:51:24 +0000 (15:51 +0000)
 - fix for invalid HTML in trust info

filters.c

index e899f91..02259d8 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.54 2002/04/02 14:55:56 oes Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.55 2002/04/02 16:13:51 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -38,6 +38,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.54 2002/04/02 14:55:56 oes Exp $"
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.55  2002/04/02 16:13:51  oes
+ *    Fix: No "Go there anyway" for SSL
+ *
  *    Revision 1.54  2002/04/02 14:55:56  oes
  *    Bugfix: is_untrusted_url() now depends on FEATURE_TRUST, not FEATURE_COOKIE_JAR
  *
@@ -827,6 +830,7 @@ struct http_response *block_url(struct client_state *csp)
          err = map_block_killer(exports, "force-support");
       }
 
+      if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1);
       if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0);
       if (!err) err = map(exports, "path", 1, html_encode(csp->http->path), 0);
 
@@ -898,9 +902,10 @@ struct http_response *trust_url(struct client_state *csp)
    }
 
    /*
-    * Export the host, port, and referrer information
+    * Export the protocol, host, port, and referrer information
     */
    err = map(exports, "hostport", 1, csp->http->hostport, 1);
+   if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); 
    if (!err) err = map(exports, "path", 1, csp->http->path, 1);
 
    if (NULL != (p = get_header_value(csp->headers, "Referer:")))
@@ -947,7 +952,7 @@ struct http_response *trust_url(struct client_state *csp)
       p = strdup("");
       for (l = csp->config->trust_info->first; l ; l = l->next)
       {
-         sprintf(buf, "<li> <a href=%s>%s</a><br>\n",l->str, l->str);
+         sprintf(buf, "<li> <a href=\"%s\">%s</a><br>\n",l->str, l->str);
          string_append(&p, buf);
       }
       err = map(exports, "trust-info", 1, p, 0);