Sha256: 2cebeae5b9c9740c9fcc473b22c300fdf33ca5595c43d8e5a286364a00d27235

Contents?: true

Size: 372 Bytes

Versions: 92

Compression:

Stored size: 372 Bytes

Contents

class CGI
  TABLE_FOR_ESCAPE_HTML__ = {
    '&' => '&',
    '"' => '"',
    '<' => '&lt;',
    '>' => '&gt;',
  }

  # Escape special characters in HTML, namely &\"<>
  #   CGI::escapeHTML('Usage: foo "bar" <baz>')
  #      # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
  def CGI::escapeHTML(string)
    string.gsub(/[&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
  end

end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
rhodes-3.2.2 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.2.beta lib/extensions/rhocgi/cgi.rb
rhodes-3.2.1 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.9 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.8 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.7 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.6 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.5 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.4 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.2 lib/extensions/rhocgi/cgi.rb
rhodes-3.2.0.beta.1 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.1 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.1.beta lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0.beta.5 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0.beta.4 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0.beta.3 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0.beta.2 lib/extensions/rhocgi/cgi.rb
rhodes-3.1.0.beta.1 lib/extensions/rhocgi/cgi.rb