mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Drop Ruby 1.8 compat code
This commit is contained in:
parent
5e2e41f283
commit
1115703b7c
1 changed files with 4 additions and 12 deletions
|
@ -19,18 +19,10 @@ module Rack
|
||||||
end
|
end
|
||||||
|
|
||||||
def cleanup(path)
|
def cleanup(path)
|
||||||
if path.respond_to?(:encoding)
|
|
||||||
# Ruby 1.9+ M17N
|
|
||||||
encoding = path.encoding
|
encoding = path.encoding
|
||||||
dot = '.'.encode(encoding)
|
dot = '.'.encode(encoding)
|
||||||
slash = '/'.encode(encoding)
|
slash = '/'.encode(encoding)
|
||||||
backslash = '\\'.encode(encoding)
|
backslash = '\\'.encode(encoding)
|
||||||
else
|
|
||||||
# Ruby 1.8
|
|
||||||
dot = '.'
|
|
||||||
slash = '/'
|
|
||||||
backslash = '\\'
|
|
||||||
end
|
|
||||||
|
|
||||||
parts = []
|
parts = []
|
||||||
unescaped = path.gsub(/%2e/i, dot).gsub(/%2f/i, slash).gsub(/%5c/i, backslash)
|
unescaped = path.gsub(/%2e/i, dot).gsub(/%2f/i, slash).gsub(/%5c/i, backslash)
|
||||||
|
|
Loading…
Reference in a new issue