Ignore:
Timestamp:
2014-03-17T21:36:16+13:00 (10 years ago)
Author:
ak19
Message:

Fourth commit for security and safe cgiargs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/rssaction.cpp

    r28899 r28911  
    6868      << "<channel>\n"
    6969      << "  <title>_collectionname_</title>\n"
    70       << "  <link>_httpdomain__httppageabout_</link>\n"
     70      << "  <link>_httpdomainHtmlsafe__httppageabout_</link>\n"
    7171      << "  <description>_collectionextra_</description>\n"
    7272      << "  <language>_cgiarglHtmlsafe_</language>\n"
     
    7979      << "  <title>_collectionname_</title>\n"
    8080      << "  <url>_iconcollection_</url>\n"
    81       << "  <link>_httpdomain__httppageabout_</link>\n"
     81      << "  <link>_httpdomainHtmlsafe__httppageabout_</link>\n"
    8282      << "  <description>_collectionextra_</description>\n"
    8383      << "</image>\n";
     
    125125   
    126126    if(!args["hostname"].empty()) {
    127       disp.setmacro("httpdomain", "Global", "http://" + encodeForURL(args["hostname"]));
     127      disp.setmacro("httpdomain", "Global", "http://" + args["hostname"]);
     128      disp.setmacro("httpdomainHtmlsafe", "Global", "http://" + encodeForHTML(args["hostname"]));
    128129    }
    129130    else { // we shouldn't have to get here
    130       disp.setmacro("httpdomain", "Global", "http://localhost:8282"); // the default used in zextra.dm. (Could perhaps default this to localhost too)
     131      text_t default_domain = "http://localhost:8282";
     132      disp.setmacro("httpdomain", "Global", default_domain); // the default used in zextra.dm. (Could perhaps default this to localhost too)
     133      disp.setmacro("httpdomain", "Global", encodeForHTML(default_domain));
    131134    }
    132135  }
Note: See TracChangeset for help on using the changeset viewer.