mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Fix actions: returning string copy after evaluation
This commit is contained in:
parent
b2bbe24e29
commit
ec9a97324f
@ -36,7 +36,7 @@ namespace ModSecurity {
|
|||||||
namespace actions {
|
namespace actions {
|
||||||
|
|
||||||
|
|
||||||
std::string & Action::evaluate(std::string value,
|
std::string Action::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ class Action {
|
|||||||
int action_kind;
|
int action_kind;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
virtual std::string& evaluate(std::string exp,
|
virtual std::string evaluate(std::string exp,
|
||||||
Assay *assay);
|
Assay *assay);
|
||||||
virtual bool evaluate(Assay *assay);
|
virtual bool evaluate(Assay *assay);
|
||||||
virtual bool evaluate(Rule *rule);
|
virtual bool evaluate(Rule *rule);
|
||||||
|
@ -35,12 +35,13 @@ Base64Decode::Base64Decode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Base64Decode::evaluate(std::string value,
|
std::string Base64Decode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation base64decode
|
* @todo Implement the transformation base64decode
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation 64 is not implemented yet.");
|
assay->debug(4, "Transformation 64 is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Base64Decode : public Transformation {
|
class Base64Decode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Base64Decode(std::string action);
|
explicit Base64Decode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ Base64DecodeExt::Base64DecodeExt(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Base64DecodeExt::evaluate(std::string value,
|
std::string Base64DecodeExt::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation Base64DecodeExt
|
* @todo Implement the transformation Base64DecodeExt
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation Base64DecodeExt is not implemented yet.");
|
assay->debug(4, "Transformation Base64DecodeExt is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Base64DecodeExt : public Transformation {
|
class Base64DecodeExt : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Base64DecodeExt(std::string action);
|
explicit Base64DecodeExt(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ CmdLine::CmdLine(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& CmdLine::evaluate(std::string value,
|
std::string CmdLine::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation CmdLine
|
* @todo Implement the transformation CmdLine
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation CmdLine is not implemented yet.");
|
assay->debug(4, "Transformation CmdLine is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class CmdLine : public Transformation {
|
class CmdLine : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit CmdLine(std::string action);
|
explicit CmdLine(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,13 +35,14 @@ CompressWhitespace::CompressWhitespace(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& CompressWhitespace::evaluate(std::string value,
|
std::string CompressWhitespace::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation CompressWhitespace
|
* @todo Implement the transformation CompressWhitespace
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation CompressWhitespace is " \
|
assay->debug(4, "Transformation CompressWhitespace is " \
|
||||||
"not implemented yet.");
|
"not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class CompressWhitespace : public Transformation {
|
class CompressWhitespace : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit CompressWhitespace(std::string action);
|
explicit CompressWhitespace(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ CssDecode::CssDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& CssDecode::evaluate(std::string value,
|
std::string CssDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation CssDecode
|
* @todo Implement the transformation CssDecode
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation CssDecode is not implemented yet.");
|
assay->debug(4, "Transformation CssDecode is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class CssDecode : public Transformation {
|
class CssDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit CssDecode(std::string action);
|
explicit CssDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ EscapeSeqDecode::EscapeSeqDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& EscapeSeqDecode::evaluate(std::string value,
|
std::string EscapeSeqDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation EscapeSeqDecode
|
* @todo Implement the transformation EscapeSeqDecode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class EscapeSeqDecode : public Transformation {
|
class EscapeSeqDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit EscapeSeqDecode(std::string action);
|
explicit EscapeSeqDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ HexDecode::HexDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& HexDecode::evaluate(std::string value,
|
std::string HexDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation HexDecode
|
* @todo Implement the transformation HexDecode
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation HexDecode is not implemented yet.");
|
assay->debug(4, "Transformation HexDecode is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class HexDecode : public Transformation {
|
class HexDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit HexDecode(std::string action);
|
explicit HexDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ HexEncode::HexEncode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& HexEncode::evaluate(std::string value,
|
std::string HexEncode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation HexEncode
|
* @todo Implement the transformation HexEncode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class HexEncode : public Transformation {
|
class HexEncode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit HexEncode(std::string action);
|
explicit HexEncode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ HtmlEntityDecode::HtmlEntityDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& HtmlEntityDecode::evaluate(std::string value,
|
std::string HtmlEntityDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation HtmlEntityDecode
|
* @todo Implement the transformation HtmlEntityDecode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class HtmlEntityDecode : public Transformation {
|
class HtmlEntityDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit HtmlEntityDecode(std::string action);
|
explicit HtmlEntityDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ JsDecode::JsDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& JsDecode::evaluate(std::string value,
|
std::string JsDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation JsDecode
|
* @todo Implement the transformation JsDecode
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation JsDecode is not implemented yet.");
|
assay->debug(4, "Transformation JsDecode is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class JsDecode : public Transformation {
|
class JsDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit JsDecode(std::string action);
|
explicit JsDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ Length::Length(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Length::evaluate(std::string value,
|
std::string Length::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation Length
|
* @todo Implement the transformation Length
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation Length is not implemented yet.");
|
assay->debug(4, "Transformation Length is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Length : public Transformation {
|
class Length : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Length(std::string action);
|
explicit Length(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ LowerCase::LowerCase(std::string a)
|
|||||||
: Transformation(a) {
|
: Transformation(a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string & LowerCase::evaluate(std::string value,
|
std::string LowerCase::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
std::locale loc;
|
std::locale loc;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace transformations {
|
|||||||
class LowerCase : public Transformation {
|
class LowerCase : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit LowerCase(std::string action);
|
explicit LowerCase(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ Md5::Md5(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Md5::evaluate(std::string value,
|
std::string Md5::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation Md5
|
* @todo Implement the transformation Md5
|
||||||
|
@ -31,7 +31,8 @@ namespace transformations {
|
|||||||
class Md5 : public Transformation {
|
class Md5 : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Md5(std::string action);
|
explicit Md5(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string
|
||||||
|
evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ None::None(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& None::evaluate(std::string value,
|
std::string None::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation None
|
* @todo Implement the transformation None
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation None is not implemented yet.");
|
assay->debug(4, "Transformation None is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class None : public Transformation {
|
class None : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit None(std::string action);
|
explicit None(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ NormalisePath::NormalisePath(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& NormalisePath::evaluate(std::string value,
|
std::string NormalisePath::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation NormalisePath
|
* @todo Implement the transformation NormalisePath
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class NormalisePath : public Transformation {
|
class NormalisePath : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit NormalisePath(std::string action);
|
explicit NormalisePath(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ NormalisePathWin::NormalisePathWin(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& NormalisePathWin::evaluate(std::string value,
|
std::string NormalisePathWin::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation NormalisePathWin
|
* @todo Implement the transformation NormalisePathWin
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class NormalisePathWin : public Transformation {
|
class NormalisePathWin : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit NormalisePathWin(std::string action);
|
explicit NormalisePathWin(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ ParityEven7bit::ParityEven7bit(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& ParityEven7bit::evaluate(std::string value,
|
std::string ParityEven7bit::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation ParityEven7bit
|
* @todo Implement the transformation ParityEven7bit
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class ParityEven7bit : public Transformation {
|
class ParityEven7bit : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit ParityEven7bit(std::string action);
|
explicit ParityEven7bit(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ ParityOdd7bit::ParityOdd7bit(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& ParityOdd7bit::evaluate(std::string value,
|
std::string ParityOdd7bit::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation ParityOdd7bit
|
* @todo Implement the transformation ParityOdd7bit
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class ParityOdd7bit : public Transformation {
|
class ParityOdd7bit : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit ParityOdd7bit(std::string action);
|
explicit ParityOdd7bit(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ ParityZero7bit::ParityZero7bit(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& ParityZero7bit::evaluate(std::string value,
|
std::string ParityZero7bit::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation ParityZero7bit
|
* @todo Implement the transformation ParityZero7bit
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class ParityZero7bit : public Transformation {
|
class ParityZero7bit : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit ParityZero7bit(std::string action);
|
explicit ParityZero7bit(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RemoveComments::RemoveComments(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& RemoveComments::evaluate(std::string value,
|
std::string RemoveComments::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation RemoveComments
|
* @todo Implement the transformation RemoveComments
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class RemoveComments : public Transformation {
|
class RemoveComments : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit RemoveComments(std::string action);
|
explicit RemoveComments(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RemoveCommentsChar::RemoveCommentsChar(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& RemoveCommentsChar::evaluate(std::string value,
|
std::string RemoveCommentsChar::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation RemoveCommentsChar
|
* @todo Implement the transformation RemoveCommentsChar
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class RemoveCommentsChar : public Transformation {
|
class RemoveCommentsChar : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit RemoveCommentsChar(std::string action);
|
explicit RemoveCommentsChar(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RemoveNulls::RemoveNulls(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& RemoveNulls::evaluate(std::string value,
|
std::string RemoveNulls::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation RemoveNulls
|
* @todo Implement the transformation RemoveNulls
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class RemoveNulls : public Transformation {
|
class RemoveNulls : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit RemoveNulls(std::string action);
|
explicit RemoveNulls(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RemoveWhitespace::RemoveWhitespace(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& RemoveWhitespace::evaluate(std::string value,
|
std::string RemoveWhitespace::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation RemoveWhitespace
|
* @todo Implement the transformation RemoveWhitespace
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class RemoveWhitespace : public Transformation {
|
class RemoveWhitespace : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit RemoveWhitespace(std::string action);
|
explicit RemoveWhitespace(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ ReplaceComments::ReplaceComments(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& ReplaceComments::evaluate(std::string value,
|
std::string ReplaceComments::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation ReplaceComments
|
* @todo Implement the transformation ReplaceComments
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class ReplaceComments : public Transformation {
|
class ReplaceComments : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit ReplaceComments(std::string action);
|
explicit ReplaceComments(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ ReplaceNulls::ReplaceNulls(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& ReplaceNulls::evaluate(std::string value,
|
std::string ReplaceNulls::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation ReplaceNulls
|
* @todo Implement the transformation ReplaceNulls
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class ReplaceNulls : public Transformation {
|
class ReplaceNulls : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit ReplaceNulls(std::string action);
|
explicit ReplaceNulls(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ Sha1::Sha1(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Sha1::evaluate(std::string value,
|
std::string Sha1::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation Sha1
|
* @todo Implement the transformation Sha1
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Sha1 : public Transformation {
|
class Sha1 : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Sha1(std::string action);
|
explicit Sha1(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,13 @@ SqlHexDecode::SqlHexDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& SqlHexDecode::evaluate(std::string value,
|
std::string SqlHexDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation SqlHexDecode
|
* @todo Implement the transformation SqlHexDecode
|
||||||
*/
|
*/
|
||||||
assay->debug(4, "Transformation SqlHexDecode is not implemented yet.");
|
assay->debug(4, "Transformation SqlHexDecode is not implemented yet.");
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace transformations
|
} // namespace transformations
|
||||||
|
@ -31,7 +31,8 @@ namespace transformations {
|
|||||||
class SqlHexDecode : public Transformation {
|
class SqlHexDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit SqlHexDecode(std::string action);
|
explicit SqlHexDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string
|
||||||
|
evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ Transformation::Transformation(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string &Transformation::evaluate(std::string value,
|
std::string Transformation::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class Transformation : public Action {
|
|||||||
explicit Transformation(std::string action);
|
explicit Transformation(std::string action);
|
||||||
static Transformation* instantiate(std::string);
|
static Transformation* instantiate(std::string);
|
||||||
|
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,7 +56,8 @@ Trim::Trim(std::string action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string& Trim::evaluate(std::string value,
|
std::string
|
||||||
|
Trim::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
return *this->trim(&value);
|
return *this->trim(&value);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Trim : public Transformation {
|
class Trim : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Trim(std::string action);
|
explicit Trim(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
|
|
||||||
std::string *ltrim(std::string *s);
|
std::string *ltrim(std::string *s);
|
||||||
|
@ -38,7 +38,7 @@ TrimLeft::TrimLeft(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& TrimLeft::evaluate(std::string value,
|
std::string TrimLeft::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
return *trim(&value);
|
return *trim(&value);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace transformations {
|
|||||||
class TrimLeft : public Trim {
|
class TrimLeft : public Trim {
|
||||||
public:
|
public:
|
||||||
explicit TrimLeft(std::string action);
|
explicit TrimLeft(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ TrimRight::TrimRight(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& TrimRight::evaluate(std::string value,
|
std::string TrimRight::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
return *this->trim(&value);
|
return *this->trim(&value);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace transformations {
|
|||||||
class TrimRight : public Trim {
|
class TrimRight : public Trim {
|
||||||
public:
|
public:
|
||||||
explicit TrimRight(std::string action);
|
explicit TrimRight(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ UrlDecode::UrlDecode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& UrlDecode::evaluate(std::string value,
|
std::string UrlDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation UrlDecode
|
* @todo Implement the transformation UrlDecode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class UrlDecode : public Transformation {
|
class UrlDecode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit UrlDecode(std::string action);
|
explicit UrlDecode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ UrlDecodeUni::UrlDecodeUni(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& UrlDecodeUni::evaluate(std::string value,
|
std::string UrlDecodeUni::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation UrlDecodeUni
|
* @todo Implement the transformation UrlDecodeUni
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class UrlDecodeUni : public Transformation {
|
class UrlDecodeUni : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit UrlDecodeUni(std::string action);
|
explicit UrlDecodeUni(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ UrlEncode::UrlEncode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& UrlEncode::evaluate(std::string value,
|
std::string UrlEncode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation UrlEncode
|
* @todo Implement the transformation UrlEncode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class UrlEncode : public Transformation {
|
class UrlEncode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit UrlEncode(std::string action);
|
explicit UrlEncode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ Utf8Unicode::Utf8Unicode(std::string action)
|
|||||||
this->action_kind = 1;
|
this->action_kind = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string& Utf8Unicode::evaluate(std::string value,
|
std::string Utf8Unicode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
/**
|
||||||
* @todo Implement the transformation Utf8Unicode
|
* @todo Implement the transformation Utf8Unicode
|
||||||
|
@ -31,7 +31,7 @@ namespace transformations {
|
|||||||
class Utf8Unicode : public Transformation {
|
class Utf8Unicode : public Transformation {
|
||||||
public:
|
public:
|
||||||
explicit Utf8Unicode(std::string action);
|
explicit Utf8Unicode(std::string action);
|
||||||
std::string& evaluate(std::string exp,
|
std::string evaluate(std::string exp,
|
||||||
Assay *assay) override;
|
Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user