diff --git a/Src/Common/FwUtils/StringTable.cs b/Src/Common/FwUtils/StringTable.cs index d0fe674267..48bb443e82 100644 --- a/Src/Common/FwUtils/StringTable.cs +++ b/Src/Common/FwUtils/StringTable.cs @@ -177,9 +177,10 @@ private void MergeCustomGroups(XmlNode parentNode, XmlNodeList customGroupNodeLi // 1. Import new strings, or override extant strings with custom strings. foreach (XmlNode customStringNode in customGroupNode.SelectNodes("string")) { - string customId = XmlUtils.GetMandatoryAttributeValue(customStringNode, "id"); - string customTxt = GetTxtAtributeValue(customStringNode); - XmlNode srcMatchingStringNode = srcMatchingGroupNode.SelectSingleNode("string[@id='" + customId + "']"); + var customId = XmlUtils.GetMandatoryAttributeValue(customStringNode, "id"); + var customTxt = GetTxtAtributeValue(customStringNode); + // escape customId for use in XPath query, in case it contains characters that are not valid in XPath queries. + var srcMatchingStringNode = srcMatchingGroupNode.SelectSingleNode("string[@id='" + XmlUtils.MakeSafeXml(customId) + "']"); if (srcMatchingStringNode == null) { // Import the new string into the extant group.