Class: CGI

Inherits:
Object show all
Defined in:
activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb

Overview

:nodoc:

Class Method Summary (collapse)

Class Method Details

+ (Object) escape_skipping_slashes(str)



5
6
7
8
9
10
# File 'activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb', line 5

def self.escape_skipping_slashes(str)
  str = str.join('/') if str.respond_to? :join
  str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
    "%#{$1.unpack('H2').first.upcase}"
  end.tr(' ', '+')
end