lib/contrast/utils/class_util.rb in contrast-agent-3.12.1 vs lib/contrast/utils/class_util.rb in contrast-agent-3.12.2
- old
+ new
@@ -54,10 +54,12 @@
#
# @param object [Object] the entity to convert to a String
# @return [String] the human readable form of the String, as defined by
# https://bitbucket.org/contrastsecurity/assess-specifications/src/master/vulnerability/capture-snapshot.md
def to_contrast_string object
- if object.cs__is_a?(String)
+ # Only treat object like a string if it actually is a string
+ # some subclasses of String override string methods we depend on
+ if object.cs__class == String
cached = to_cached_string(object)
return cached if cached
object.dup
elsif object.cs__is_a?(Symbol)