Actually correctly escape output
This commit is contained in:
parent
e785ca5448
commit
cbd45bfce8
2
meal.hpp
2
meal.hpp
@ -28,6 +28,7 @@ public:
|
|||||||
}
|
}
|
||||||
void setName(const std::string &name) {
|
void setName(const std::string &name) {
|
||||||
_name = name;
|
_name = name;
|
||||||
|
replaceStr(_name, "\"", "\\\"");
|
||||||
}
|
}
|
||||||
void setPrice(int price) {
|
void setPrice(int price) {
|
||||||
_price = price;
|
_price = price;
|
||||||
@ -37,6 +38,7 @@ public:
|
|||||||
}
|
}
|
||||||
void setDesc(const std::string &desc) {
|
void setDesc(const std::string &desc) {
|
||||||
_desc = desc;
|
_desc = desc;
|
||||||
|
replaceStr(_desc, "\"", "\\\"");
|
||||||
}
|
}
|
||||||
std::string jsonify() const;
|
std::string jsonify() const;
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user