Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/data/odk-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const convertObjectToXml = (data) => {
// and are XML-encoded for safety. Object keys are assumed safe and not encoded,
// as they are generated by the application, not users.

let output = '';
if (typeof data === 'object') {
let output = '';

for (const k in data) {
if (Object.hasOwn(data, k)) {
if (Array.isArray(data[k])) {
Expand All @@ -40,10 +41,11 @@ const convertObjectToXml = (data) => {
}
}
}

return output;
} else {
return encodeXML(String(data));
}
return output;
};

const buildSubmission = (formId, formVersion, data) => {
Expand Down