ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

CreateItem fails if Subject contains '&'

Open bladerunner2020 opened this issue 5 years ago • 3 comments

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?

bladerunner2020 avatar Jun 28 '20 17:06 bladerunner2020

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.

gautamsi avatar Jun 30 '20 03:06 gautamsi

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 '&'...

bladerunner2020 avatar Jul 01 '20 14:07 bladerunner2020

I will update the docs

gautamsi avatar Jul 02 '20 18:07 gautamsi