validate pair delimiters does not contain escape character

This commit is contained in:
Arthur Passos 2023-03-20 13:16:55 -03:00
parent f9af3995d3
commit c677be1ccd

View File

@ -25,7 +25,9 @@ Configuration ConfigurationFactory::createWithoutEscaping(char key_value_delimit
Configuration ConfigurationFactory::createWithEscaping(char key_value_delimiter, char quoting_character, std::vector<char> pair_delimiters)
{
if (key_value_delimiter == EscapedCharacterReader::ESCAPE_CHARACTER || quoting_character == EscapedCharacterReader::ESCAPE_CHARACTER)
if (key_value_delimiter == EscapedCharacterReader::ESCAPE_CHARACTER
|| quoting_character == EscapedCharacterReader::ESCAPE_CHARACTER
|| std::find(pair_delimiters.begin(), pair_delimiters.end(), EscapedCharacterReader::ESCAPE_CHARACTER) != pair_delimiters.end())
{
throw Exception(
ErrorCodes::BAD_ARGUMENTS,