PATH_SEPARATOR = {'UNIX'=>'/', 'WINDOWS'=>'\', 'MACINTOSH'=>':'}
@@ -441,7 +441,7 @@
def CGI::escapeElement(string, *elements)
elements = elements[0] if elements[0].kind_of?(Array)
unless elements.empty?
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/ni) do
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
CGI::escapeHTML($&)
end
else
@@ -462,7 +462,7 @@
def CGI::unescapeElement(string, *elements)
elements = elements[0] if elements[0].kind_of?(Array)
unless elements.empty?
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/ni) do
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
CGI::unescapeHTML($&)
end
else
@@ -586,7 +586,7 @@
options.delete("nph") if defined?(MOD_RUBY)
if options.delete("nph") or
(/IIS\/(\d+)/n.match(env_table['SERVER_SOFTWARE']) and $1.to_i < 5)
(/IIS\/(\d+)/.match(env_table['SERVER_SOFTWARE']) and $1.to_i < 5)
buf += (env_table["SERVER_PROTOCOL"] or "HTTP/1.0") + " " +
(HTTP_STATUS[options["status"]] or options["status"] or "200 OK") +
EOL +
@@ -657,19 +657,19 @@
if defined?(MOD_RUBY)
table = Apache::request.headers_out
buf.scan(/([^:]+): (.+)#{EOL}/n){ |name, value|
buf.scan(/([^:]+): (.+)#{EOL}/){ |name, value|
warn sprintf("name:%s value:%s\n", name, value) if $DEBUG
case name
when 'Set-Cookie'
table.add(name, value)
when /^status$/ni
when /^status$/i
Apache::request.status_line = value
Apache::request.status = value.to_i
when /^content-type$/ni
when /^content-type$/i
Apache::request.content_type = value
when /^content-encoding$/ni
when /^content-encoding$/i
Apache::request.content_encoding = value
when /^location$/ni
when /^location$/i
if Apache::request.status == 200
Apache::request.status = 302
end
/Content-Disposition:.* name="?([^\";\s]*)"?/i.match(head)
name = ($1 || "").dup
if params.has_key?(name)
@@ -1087,12 +1087,12 @@
%|(offline mode: enter name=value pairs on standard input)\n|
)
end
readlines.join(' ').gsub(/\n/n, '')
end.gsub(/\\=/n, '%3D').gsub(/\\&/n, '%26')
readlines.join(' ').gsub(/\n/, '')
end.gsub(/\\=/, '%3D').gsub(/\\&/, '%26')
words = Shellwords.shellwords(string)
if words.find{|x| /=/n.match(x) }
if words.find{|x| /=/.match(x) }
words.join('&')
else
words.join('+')
@@ -1159,7 +1159,7 @@
# Reads query parameters in the @params field, and cookies into @cookies.
def initialize_query()
if ("POST" == env_table['REQUEST_METHOD']) and