summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/webrick/httputils.rb16
-rw-r--r--version.h2
2 files changed, 5 insertions, 13 deletions
diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb
index c57af2c860..976d3e915e 100644
--- a/lib/webrick/httputils.rb
+++ b/lib/webrick/httputils.rb
@@ -23,16 +23,8 @@ module WEBrick
ret = path.dup
ret.gsub!(%r{/+}o, '/') # // => /
- while ret.sub!(%r{/\.(/|\Z)}o, '/'); end # /. => /
- begin # /foo/.. => /foo
- match = ret.sub!(%r{/([^/]+)/\.\.(/|\Z)}o){
- if $1 == ".."
- raise "abnormal path `#{path}'"
- else
- "/"
- end
- }
- end while match
+ while ret.sub!(%r'/\.(?:/|\Z)', '/'); end # /. => /
+ while ret.sub!(%r'/(?!\.\./)[^/]+/\.\.(?:/|\Z)', '/'); end # /foo/.. => /foo
raise "abnormal path `#{path}'" if %r{/\.\.(/|\Z)} =~ ret
ret
@@ -154,8 +146,8 @@ module WEBrick
module_function :parse_header
def split_header_value(str)
- str.scan(/((?:"(?:\\.|[^"])+?"|[^",]+)+)
- (?:,\s*|\Z)/xn).collect{|v| v[0] }
+ str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+)
+ (?:,\s*|\Z)'xn).flatten
end
module_function :split_header_value
diff --git a/version.h b/version.h
index fc56fe5d00..2a7efa4214 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-08-04"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080804
-#define RUBY_PATCHLEVEL 68
+#define RUBY_PATCHLEVEL 69
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8