ews-javascript-api
ews-javascript-api copied to clipboard
CreateItem fails if Subject contains '&'
Encountered an error "An error occurred while parsing EntityName.." Found out that CreateItem fails if Subject contains '&'.
Obviously the reason is that XML are not allowed to contain 5 special characters (&, <, >, ", '). This could be easily fixed by replacing with &...
Besides Subject there are other places where special characters should be replaced. At least in body text. I added processing Subject and body text to my code, but I guess would it be better to add to ews-javascript-api?
I wanted to keep it minimal dependency on other packages.
escaping internally can have non intended effect. at this time any free form text should be escaped.
At least, it might be a good idea to add this to documentation. It's not obvious that text should be escaped - everything worked fine in our case for quite a long time till we encountered a subject containing '&'...
I will update the docs