Skip to content

Commit

Permalink
Encode " \n\t[]{}^$?|.~!*" as b64
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger authored Jul 4, 2022
1 parent b0b8e85 commit 16b5774
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commons/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@ std::string Parameters::createParameterString(const std::vector<MMseqsParameter*
std::string value = MultiParam<NuclAA<std::string>>::format(tmpPar);
// encode parameters as base64 if it contains whitespaces
// whitespaces break parameters in the workflow shell scripts
if (value.find_first_of(" \n\t") != std::string::npos) {
if (value.find_first_of(" \n\t[]{}^$?|.~!*") != std::string::npos) {
ss << par[i]->name << " b64:" << base64_encode(value.c_str(), value.size()) << " ";
} else {
ss << par[i]->name << " " << value << " ";
Expand All @@ -2617,7 +2617,7 @@ std::string Parameters::createParameterString(const std::vector<MMseqsParameter*
std::string& value = *((std::string *) par[i]->value);
if (value != "") {
// see above
if (value.find_first_of(" \n\t") != std::string::npos) {
if (value.find_first_of(" \n\t[]{}^$?|.~!*") != std::string::npos) {
ss << par[i]->name << " b64:" << base64_encode(value.c_str(), value.size()) << " ";
} else {
ss << par[i]->name << " " << value << " ";
Expand All @@ -2634,7 +2634,7 @@ std::string Parameters::createParameterString(const std::vector<MMseqsParameter*
ss << par[i]->name << " ";
std::string value = MultiParam<NuclAA<std::string>>::format(*((MultiParam<NuclAA<std::string>> *) par[i]->value));
// see above
if (value.find_first_of(" \n\t") != std::string::npos) {
if (value.find_first_of(" \n\t[]{}^$?|.~!*") != std::string::npos) {
ss << par[i]->name << " b64:" << base64_encode(value.c_str(), value.size()) << " ";
} else {
ss << par[i]->name << " " << value << " ";
Expand Down

0 comments on commit 16b5774

Please sign in to comment.