summaryrefslogtreecommitdiff
path: root/sfeed_opml_export
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2017-12-10 13:36:41 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2017-12-10 13:36:41 +0100
commitdd00baa7ecde11cd7a6858203ee372db3b6dea60 (patch)
tree7f8701d73676f947d60341bf7c4c70d53de02537 /sfeed_opml_export
parent7d1a09873ed080ad438adf4ad4d2800f93cc0271 (diff)
sfeed_opml_import/sfeed_opml_export: allow " and \ in fields
make sure to escape them.
Diffstat (limited to 'sfeed_opml_export')
-rwxr-xr-xsfeed_opml_export11
1 files changed, 10 insertions, 1 deletions
diff --git a/sfeed_opml_export b/sfeed_opml_export
index 9665792..212b3c6 100755
--- a/sfeed_opml_export
+++ b/sfeed_opml_export
@@ -22,11 +22,20 @@ loadconfig() {
fi
}
+# escape(s)
+escape() {
+ printf '%s' "$1" | sed 's@"@\&quot;@g'
+}
+
# override feeds function to ouput opml XML.
# feed(name, feedurl, [basesiteurl], [encoding])
feed() {
+ name=$(escape "$1")
+ xmlurl=$(escape "$2")
+ htmlurl=$(escape "$3")
+
printf '\t<outline title="%s" text="%s" xmlUrl="%s" htmlUrl="%s"/>\n' \
- "$1" "$1" "$2" "$3"
+ "${name}" "${name}" "${xmlurl}" "${htmlurl}"
}
# load config file.