initial commit with stuff from arise
Some checks are pending
Deploy Arise to html branch / Deploy Arise (push) Waiting to run
Some checks are pending
Deploy Arise to html branch / Deploy Arise (push) Waiting to run
This commit is contained in:
commit
0faf445b39
62 changed files with 3401 additions and 0 deletions
25
lib/functions/inline/clean_xml_string.sh
Normal file
25
lib/functions/inline/clean_xml_string.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
#############
|
||||
# DESCRIPTION
|
||||
#############
|
||||
# Cleans special characters out of a string intended for use in xml format
|
||||
#
|
||||
#############
|
||||
# Usage:
|
||||
# clean_xml_string "string with special characters"
|
||||
|
||||
clean_xml_string() {
|
||||
# unclean string -> clean string
|
||||
input_string="$1"
|
||||
# replace & with &
|
||||
input_string=${input_string//\&/\&}
|
||||
# replace < with <
|
||||
input_string=${input_string//</\<}
|
||||
# replace > with >
|
||||
input_string=${input_string//>/\>}
|
||||
# replace ' with '
|
||||
input_string=${input_string//\'/\'}
|
||||
# replace " with "
|
||||
input_string=${input_string//\"/\"}
|
||||
echo "$input_string"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue