aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2015-09-23 12:06:00 +0200
committerMarcoFalke <falke.marco@gmail.com>2015-09-23 12:06:00 +0200
commit43edd515e544b46ca548933135326fbe4a4b4e5a (patch)
treedeed6fc8e6db0a42fe44f1643e2d508c62088618
parente59d2a80f9167031521d882394a08b02fa9d0343 (diff)
downloadbitcoin-43edd515e544b46ca548933135326fbe4a4b4e5a.tar.xz
SanitizeString: Allow hypen char
-rw-r--r--src/test/util_tests.cpp4
-rw-r--r--src/utilstrencodings.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index bde16a517f..997dc31931 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -413,10 +413,10 @@ BOOST_AUTO_TEST_CASE(test_FormatSubVersion)
comments.push_back(std::string("comment1"));
std::vector<std::string> comments2;
comments2.push_back(std::string("comment1"));
- comments2.push_back(SanitizeString(std::string("Comment2; .,_?@; !\"#$%&'()*+-/<=>[]\\^`{|}~"), SAFE_CHARS_UA_COMMENT)); // Semicolon is discouraged but not forbidden by BIP-0014
+ comments2.push_back(SanitizeString(std::string("Comment2; .,_?@-; !\"#$%&'()*+/<=>[]\\^`{|}~"), SAFE_CHARS_UA_COMMENT)); // Semicolon is discouraged but not forbidden by BIP-0014
BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, std::vector<std::string>()),std::string("/Test:0.9.99/"));
BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments),std::string("/Test:0.9.99(comment1)/"));
- BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments2),std::string("/Test:0.9.99(comment1; Comment2; .,_?@; )/"));
+ BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments2),std::string("/Test:0.9.99(comment1; Comment2; .,_?@-; )/"));
}
BOOST_AUTO_TEST_CASE(test_ParseFixedPoint)
diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp
index 76c22f7353..c5a2b5cdbb 100644
--- a/src/utilstrencodings.cpp
+++ b/src/utilstrencodings.cpp
@@ -18,8 +18,8 @@ static const string CHARS_ALPHA_NUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO
static const string SAFE_CHARS[] =
{
- CHARS_ALPHA_NUM + " .,;_/:?@()", // SAFE_CHARS_DEFAULT
- CHARS_ALPHA_NUM + " .,;_?@" // SAFE_CHARS_UA_COMMENT
+ CHARS_ALPHA_NUM + " .,;-_/:?@()", // SAFE_CHARS_DEFAULT
+ CHARS_ALPHA_NUM + " .,;-_?@" // SAFE_CHARS_UA_COMMENT
};
string SanitizeString(const string& str, int rule)