mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Bug Fix - Bug #248
- Fixed bug where both single and double quotes are stored as ampersand-quote-semi-colon, leading to the gradual conversion of one to the other. Fix is backward compatible. Thanks to John Florian.
This commit is contained in:
parent
c4dcdbff0f
commit
d3fcd40279
2 changed files with 14 additions and 2 deletions
14
src/Att.cpp
14
src/Att.cpp
|
@ -711,8 +711,11 @@ void Att::encode (std::string& value) const
|
|||
while ((i = value.find ('\t')) != std::string::npos)
|
||||
value.replace (i, 1, "&tab;"); // no i18n
|
||||
|
||||
while ((i = value.find ('\'')) != std::string::npos)
|
||||
value.replace (i, 1, "&squot;"); // no i18n
|
||||
|
||||
while ((i = value.find ('"')) != std::string::npos)
|
||||
value.replace (i, 1, """); // no i18n
|
||||
value.replace (i, 1, "&dquot;"); // no i18n
|
||||
|
||||
while ((i = value.find (',')) != std::string::npos)
|
||||
value.replace (i, 1, ","); // no i18n
|
||||
|
@ -730,7 +733,8 @@ void Att::encode (std::string& value) const
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Decode values after parse.
|
||||
// \t <- &tab;
|
||||
// " <- "
|
||||
// " <- " or &dquot;
|
||||
// ' <- &squot;
|
||||
// , <- ,
|
||||
// [ <- &open;
|
||||
// ] <- &close;
|
||||
|
@ -742,6 +746,12 @@ void Att::decode (std::string& value) const
|
|||
while ((i = value.find ("&tab;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 5, "\t");
|
||||
|
||||
while ((i = value.find ("&dquot;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 7, "\"");
|
||||
|
||||
while ((i = value.find ("&squot;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 7, "'");
|
||||
|
||||
while ((i = value.find (""")) != std::string::npos) // no i18n
|
||||
value.replace (i, 6, "\"");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue