Method: Jamf::Utility#escape_xml
- Defined in:
- lib/jamf/utility.rb
#escape_xml(string) ⇒ String
Given a string of xml element text, escape any characters that would make XML unhappy.
* & => &
* " => "
* < => <
* > => >
* ' => '
447 448 449 |
# File 'lib/jamf/utility.rb', line 447 def escape_xml(string) string.gsub(/&/, '&').gsub(/"/, '"').gsub(/>/, '>').gsub(/</, '<').gsub(/'/, ''') end |