Ignore:
Timestamp:
2014-03-14T22:46:25+13:00 (10 years ago)
Author:
ak19
Message:

Third commit for security, for ensuring cgiargs macros are websafe. This time all the changes to the runtime action classes.

File:
1 edited

Legend:

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

    r28898 r28899  
    136136}
    137137
    138 
    139 text_t encodeForMySQL(const text_t& in, const text_t& immuneChars, const SQLMode mode) {
    140   text_t out;
    141   text_t::const_iterator here = in.begin();
    142   text_t::const_iterator end = in.end();
    143   while (here != end) {
    144     out += encodeForMySQL(immuneChars, *here, mode); // IMMUNE_SQL and STANDARD SQLMode by default
     138text_t encodeForSQL(const text_t& in, const text_t& immuneChars, const SQLMode mode) {
     139  text_t out;
     140  text_t::const_iterator here = in.begin();
     141  text_t::const_iterator end = in.end();
     142  while (here != end) {
     143    out += encodeForSQL(immuneChars, *here, mode); // IMMUNE_SQL and STANDARD SQLMode by default
    145144    ++here;
    146145  }
     
    320319
    321320/*
     321
     322 C++ port of OWASP-ESAPI for MySQL. Not sure if this is is the same for SQLite
     323
    322324http://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/main/java/org/owasp/esapi/codecs/MySQLCodec.java
    323325 Defense Option 3 of https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
     
    335337
    336338*/
    337 text_t encodeForMySQL(const text_t& immuneChars, const unsigned short in, const SQLMode mode) {
     339text_t encodeForSQL(const text_t& immuneChars, const unsigned short in, const SQLMode mode) {
    338340 
    339341  text_t result = "";
     
    392394}
    393395
     396// Unused at present.
    394397// See Codec.hex[] initialization and Codec.getHexForNonAlphanumeric(c) and Codec.toHex(c)
    395398// http://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/main/java/org/owasp/esapi/codecs/Codec.java
Note: See TracChangeset for help on using the changeset viewer.