multipass 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/multipass.rb +8 -6
- data/multipass.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/multipass.rb
CHANGED
@@ -102,12 +102,14 @@ class MultiPass
|
|
102
102
|
# converts unicode (\u003c) to the actual character
|
103
103
|
# http://rishida.net/tools/conversion/
|
104
104
|
def unencode_javascript_unicode_escape(str)
|
105
|
-
str.gsub!
|
106
|
-
|
107
|
-
|
108
|
-
s
|
109
|
-
|
110
|
-
|
105
|
+
if str.respond_to?(:gsub!)
|
106
|
+
str.gsub!(/\\u([0-9a-fA-F]{4})/) do |s|
|
107
|
+
int = $1.to_i(16)
|
108
|
+
if int.zero? && s != "0000"
|
109
|
+
s
|
110
|
+
else
|
111
|
+
[int].pack("U")
|
112
|
+
end
|
111
113
|
end
|
112
114
|
end
|
113
115
|
str
|
data/multipass.gemspec
CHANGED