Skip to content

Commit 0422cd1

Browse files
Copilotcziter15
andauthored
(fix) Add JSON escaping for device parameter fields (id, label, value) (#59)
* Initial plan * (feat) Add JSON escaping for device params id, label, and value fields Co-authored-by: cziter15 <5003708+cziter15@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cziter15 <5003708+cziter15@users.noreply.github.com>
1 parent dcda38a commit 0422cd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ksf/comp/ksDevicePortal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,11 @@ namespace ksf::comps
456456
for (auto paramRef : paramListRef)
457457
{
458458
response += PSTR("{\"id\": \"");
459-
response += paramRef.id;
459+
response += ksf::jsonEscape(paramRef.id);
460460
response += PSTR("\", \"label\": \"");
461-
response += paramRef.label;
461+
response += ksf::jsonEscape(paramRef.label);
462462
response += PSTR("\", \"value\": \"");
463-
response += paramRef.value;
463+
response += ksf::jsonEscape(paramRef.value);
464464
response += PSTR("\", \"type\": \"");
465465

466466
switch (paramRef.type)

0 commit comments

Comments
 (0)