Class: CGI

Inherits:
Object
  • Object
show all
Defined in:
lib/cgi.rb

Class Method Summary collapse

Class Method Details

.escapeHTML(string) ⇒ Object Also known as: escape_html



3
4
5
6
7
8
9
10
# File 'lib/cgi.rb', line 3

def escapeHTML(string)
  string.
    gsub('&', '&').
    gsub('<', '&lt;').
    gsub('>', '&gt;').
    gsub("'", '&apos;').
    gsub('"', '&quot;')
end