|
@@ -57,16 +57,20 @@ App.config = Em.Object.create({
|
|
* Special characters in XML are defined at
|
|
* Special characters in XML are defined at
|
|
* http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML
|
|
* http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML
|
|
*/
|
|
*/
|
|
- escapeXMLCharacters: function(value) {
|
|
|
|
|
|
+ escapeXMLCharacters: function(value, toXML) {
|
|
var self = this;
|
|
var self = this;
|
|
// To prevent double/triple replacing '>' to '>' to '>', we need
|
|
// To prevent double/triple replacing '>' to '>' to '>', we need
|
|
// to first unescape all XML chars, and then escape them again.
|
|
// to first unescape all XML chars, and then escape them again.
|
|
var newValue = String(value).replace(/(&|<|>|"|')/g, function (s) {
|
|
var newValue = String(value).replace(/(&|<|>|"|')/g, function (s) {
|
|
return self.xmlUnEscapeMap[s];
|
|
return self.xmlUnEscapeMap[s];
|
|
});
|
|
});
|
|
- return String(newValue).replace(/[&<>"']/g, function (s) {
|
|
|
|
- return self.xmlEscapeMap[s];
|
|
|
|
- });
|
|
|
|
|
|
+ if (toXML) {
|
|
|
|
+ return String(newValue).replace(/[&<>"']/g, function (s) {
|
|
|
|
+ return self.xmlEscapeMap[s];
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ return newValue;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
preDefinedServiceConfigs: function () {
|
|
preDefinedServiceConfigs: function () {
|
|
var configs = this.get('preDefinedGlobalProperties');
|
|
var configs = this.get('preDefinedGlobalProperties');
|