We have moved to GitHub Issues
Created by Andy Dyton 15 May 2013, 09:53:15 Updated by Sebastiaan Janssen 14 Aug 2014, 08:26:58
Is duplicated by: U4-5300
When saving/publishing text that contains the "End-of-text character" (ETX) the following error is thrown:
'', hexadecimal value 0x03, is an invalid character.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: '', hexadecimal value 0x03, is an invalid character.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[ArgumentException: '', hexadecimal value 0x03, is an invalid character.] System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar(Int32 ch, Char* pDst, Boolean entitize) +3795464 System.Xml.XmlEncodedRawTextWriter.WriteCDataSection(String text) +770 System.Xml.XmlEncodedRawTextWriter.WriteCData(String text) +411 System.Xml.XmlWellFormedWriter.WriteCData(String text) +3015958 System.Xml.Linq.ElementWriter.WriteElement(XElement e) +224 System.Xml.Linq.XElement.WriteTo(XmlWriter writer) +149 System.Xml.Linq.XNode.GetXmlString(SaveOptions o) +274 Umbraco.Core.Services.ContentService.Save(IContent content, Boolean changeState, Int32 userId, Boolean raiseEvents) +655 Umbraco.Core.Services.ContentService.Save(IContent content, Int32 userId, Boolean raiseEvents) +20 umbraco.cms.businesslogic.web.Document.Save() +424 umbraco.cms.presentation.editContent.Save(Object sender, EventArgs e) +1971 umbraco.controls.ContentControl.SaveClick(Object sender, ImageClickEventArgs e) +682 umbraco.controls.ContentControl.DoSaveAndPublish(Object sender, ImageClickEventArgs e) +24 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +134 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +204 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
These kinds of characters can sneak in when people are copying/pasting from other documents, the characters are not visible, and to any non-technical content editors it's unclear what's gone wrong.
I upvoted this, as I just encoutered the exact same error, while simply copying a sentence from my browser into my Umbraco.
My solution was to re-type the sentence and I don't see what kind of special character I could have copied, but there you go.
Might want to add that I saw this in 6.1.2
I've attached a text file with all kinds of characters that give errors.
In the old Umbraco versions this was fixed with this issue: U4-367. In the newer (v6) version of Umbraco this isn't such a big issue since the cmsContentXmltable isn't updated, but the corrupt data still get's saved in the database (cmsPropertyData). This could potentially be a problem if, for example, a package updates the cmsContentXml table with these characters. If this happens it could potentially kill the entire website.
Something alike in 7.0.1, file attached. If you paste content of the file attached into a RTE, you'll get the error below:
Server error: Contact administrator, see log for full details. '□', hexadecimal value 0x0C, is an invalid character.
Can confirm that this is still an issue in 7.1.4.
Commit made by '''Sebastiaan Janssen''' on ''2014-08-13T09:38:40+02:00'' https://github.com/umbraco/Umbraco-CMS/commit/ba7a5a0e8a20b988cdebe94a3eca9c39fe4a2d4e
Moved some methods around, made them internal, removed cleaning of tags as that's already done by cleaning each property
I'll cherry pick for 6.2.2 tomorrow
Commit made by '''Sebastiaan Janssen''' on ''2014-08-14T10:26:38+02:00'' https://github.com/umbraco/Umbraco-CMS/commit/908afbd26467a640a3a59e7b552db14d3317d602
Issue when saving/publishing special characters - '' hexadecimal value 0x03, is an invalid character
Backwards Compatible: True
Affected versions: 6.0.5, 6.1.2, 6.1.5, 7.0.1, 7.1.4
Due in version: 7.1.5, 6.2.2