lib/plezi/server/helpers/http.rb in plezi-0.7.2 vs lib/plezi/server/helpers/http.rb in plezi-0.7.3

- old
+ new

@@ -124,19 +124,22 @@ elsif object.is_a?(Array) object.each {|v| encode v, decode_method} elsif object.is_a?(String) case decode_method when :uri, :url, :form + object.force_encoding "binary" object.gsub!(/[^a-zA-Z0-9\*\.\_\-]/) {|m| m.ord <= 16 ? "%0#{m.ord.to_s(16)}" : "%#{m.ord.to_s(16)}"} when :html object.gsub!('&', "&amp;") object.gsub!('"', "&quot;") object.gsub!(">", "&gt;") object.gsub!("<", "&lt;") object.gsub!(/[^\sa-zA-Z\d\&\;]/) {|m| "&#%04d;" % m.unpack('U')[0] } # object.gsub!(/[^\s]/) {|m| "&#%04d;" % m.unpack('U')[0] } + object.force_encoding "binary" when :utf8 object.gsub!(/[^\sa-zA-Z\d]/) {|m| "&#%04d;" % m.unpack('U')[0] } + object.force_encoding "binary" else end return object elsif object.is_a?(Symbol)