bugsnag 2.8.4 → 2.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/bugsnag/helpers.rb +13 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82e8e7e46403a193b059ff577ea4b7808ab2f82
|
4
|
+
data.tar.gz: 12c42851511672d1a2209fc6c46effbef3447e6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee30f99540b90d2d898bc8037e2ce2f534a52ca30c8d57ecff9313557c6af717a90c691ac781cfad56af133b6ad0ae7a5a4eff46b4579ebba7881c52333a14f
|
7
|
+
data.tar.gz: 227828a21ae4cf499392bc41c44639db5f6decf7d9515c46a4363d809b4b5e9256af4d3f3f66a5628d16ab9b2aa3ffc516b8f7afe6807d84a32ab165ba67e4de
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.8.
|
1
|
+
2.8.5
|
data/lib/bugsnag/helpers.rb
CHANGED
@@ -3,26 +3,23 @@ require 'uri'
|
|
3
3
|
module Bugsnag
|
4
4
|
module Helpers
|
5
5
|
MAX_STRING_LENGTH = 4096
|
6
|
+
ENCODING_OPTIONS = {:invalid => :replace, :undef => :replace}.freeze
|
6
7
|
|
7
|
-
def self.cleanup_obj(obj, filters = nil, seen=
|
8
|
+
def self.cleanup_obj(obj, filters = nil, seen = {})
|
8
9
|
return nil unless obj
|
9
10
|
|
10
11
|
# Protect against recursion of recursable items
|
11
|
-
if obj.is_a?(Hash) || obj.is_a?(Array) || obj.is_a?(Set)
|
12
|
-
return
|
13
|
-
|
14
|
-
# We duplicate the seen set here so that no updates by further cleanup_obj calls
|
15
|
-
# are persisted beyond that call.
|
16
|
-
seen = seen.dup
|
17
|
-
seen << obj
|
12
|
+
protection = if obj.is_a?(Hash) || obj.is_a?(Array) || obj.is_a?(Set)
|
13
|
+
return seen[obj] if seen[obj]
|
14
|
+
seen[obj] = '[RECURSION]'.freeze
|
18
15
|
end
|
19
16
|
|
20
|
-
case obj
|
17
|
+
value = case obj
|
21
18
|
when Hash
|
22
19
|
clean_hash = {}
|
23
20
|
obj.each do |k,v|
|
24
21
|
if filters_match?(k, filters)
|
25
|
-
clean_hash[k] =
|
22
|
+
clean_hash[k] = '[FILTERED]'.freeze
|
26
23
|
else
|
27
24
|
clean_obj = cleanup_obj(v, filters, seen)
|
28
25
|
clean_hash[k] = clean_obj
|
@@ -39,19 +36,22 @@ module Bugsnag
|
|
39
36
|
str = obj.to_s
|
40
37
|
# avoid leaking potentially sensitive data from objects' #inspect output
|
41
38
|
if str =~ /#<.*>/
|
42
|
-
'[OBJECT]'
|
39
|
+
'[OBJECT]'.freeze
|
43
40
|
else
|
44
41
|
cleanup_string(str)
|
45
42
|
end
|
46
43
|
end
|
44
|
+
|
45
|
+
seen[obj] = value if protection
|
46
|
+
value
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.cleanup_string(str)
|
50
50
|
if defined?(str.encoding) && defined?(Encoding::UTF_8)
|
51
51
|
if str.encoding == Encoding::UTF_8
|
52
|
-
str.valid_encoding? ? str : str.encode('utf-16',
|
52
|
+
str.valid_encoding? ? str : str.encode('utf-16', ENCODING_OPTIONS).encode('utf-8')
|
53
53
|
else
|
54
|
-
str.encode('utf-8',
|
54
|
+
str.encode('utf-8', ENCODING_OPTIONS)
|
55
55
|
end
|
56
56
|
elsif defined?(Iconv)
|
57
57
|
Iconv.conv('UTF-8//IGNORE', 'UTF-8', str) || str
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|