Browse Source

Add more escaping char in the good order to avoid breaking XML quote for Databases

LecygneNoir 8 months ago
parent
commit
4c834e4385
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      rollback_database.sh

+ 6
- 2
rollback_database.sh View File

@@ -51,11 +51,15 @@ for key in $(grep Key ${ORIGINAL_XML}  | awk -F'"' '{print $2}'); do
51 51
 
52 52
     # Escape special char causing problem in with sed and xml
53 53
     msgstr=${msgstr//'\n'/'\\n'}
54
-    msgstr=${msgstr//'&'/'&'}
54
+    msgstr=${msgstr//' & '/' & '}
55 55
     msgstr=${msgstr//'\"'/"""}
56
+    msgstr=${msgstr//'&'/'\&'}
57
+
56 58
     msgid=${msgid//'\n'/'\\n'}
57
-    msgid=${msgid//'&'/'&'}
59
+    msgid=${msgid//' & '/' & '}
58 60
     msgid=${msgid//'\"'/"""}
61
+    msgid=${msgid//'&'/'\&'}
62
+
59 63
 
60 64
 
61 65
     if [[ "${msgstr}" == "" ]]; then

Loading…
Cancel
Save