From cbd45bfce87fc6f57129cb36657b072fed74d647 Mon Sep 17 00:00:00 2001 From: zvon Date: Mon, 3 May 2021 13:57:13 +0200 Subject: [PATCH] Actually correctly escape output --- meal.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meal.hpp b/meal.hpp index b7c178d..0ad8cd3 100644 --- a/meal.hpp +++ b/meal.hpp @@ -28,6 +28,7 @@ public: } void setName(const std::string &name) { _name = name; + replaceStr(_name, "\"", "\\\""); } void setPrice(int price) { _price = price; @@ -37,6 +38,7 @@ public: } void setDesc(const std::string &desc) { _desc = desc; + replaceStr(_desc, "\"", "\\\""); } std::string jsonify() const; private: