Ignore:
Timestamp:
2014-03-18T16:45:46+13:00 (10 years ago)
Author:
ak19
Message:

Commit 5 for security. Handles setmacro() occurrences in non action.cpp files. cl is safe from hacks now.

File:
1 edited

Legend:

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

    r19047 r28912  
    107107
    108108  if (section.OID != args["d"]) {
    109     text_t httpprevarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + dm_safe(section.OID);
     109    text_t httpprevarrow = "_httpdocument_&cl=" + encodeForURL(args["cl"]) + "&d=" + dm_safe(section.OID);
    110110    text_t parentarrow = "<a href=\"" + httpprevarrow + "\">_iconprev_</a>\n";
    111111    disp.setmacro ("httpprevarrow", "document", httpprevarrow);
     
    176176
    177177  if (!found) {
    178     httpnextarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + sections.docInfo[0].OID;
     178    httpnextarrow = "_httpdocument_&cl=" + encodeForURL(args["cl"]) + "&d=" + sections.docInfo[0].OID;
    179179    nextarrow = "<a href=\"" + httpnextarrow + "\">" +
    180180      sections.docInfo[0].metadata["Title"].values[0] + "_iconnext_</a>\n";
     
    182182  } else {
    183183    if (!previousOID.empty()) {
    184       httpprevarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + dm_safe(previousOID);
     184      httpprevarrow = "_httpdocument_&cl=" + encodeForURL(args["cl"]) + "&d=" + dm_safe(previousOID);
    185185      prevarrow = "<a href=\"" + httpprevarrow + "\">_iconprev_" + previoustitle + "</a>\n";
    186186    }
    187187    if (!nextOID.empty()) {
    188       httpnextarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + dm_safe(nextOID);
     188      httpnextarrow = "_httpdocument_&cl=" + encodeForURL(args["cl"]) + "&d=" + dm_safe(nextOID);
    189189      nextarrow = "<a href=\"" + httpnextarrow + "\">" + nexttitle + "_iconnext_</a>\n";
    190190    }
Note: See TracChangeset for help on using the changeset viewer.