Hi,
is this an intended behaviour or is it a bug? I did boil the
problem I detected down to the smallest possible code.
class C
t = Thread.new do
$SAFE = 1
def inspect
"<C>"
end
end
t.join
end
c = C.new
puts c.inspect
puts [c].inspect
not_reached
The output is:
<C>
insecure.rb:12:in `inspect': calling insecure method: inspect (SecurityError)
from insecure.rb:12:in `<main>'
Why is the first #inspect allowed, but the second is not?
Should I still use $SAFE at all?
Thanks in advance,
Bertram
···
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de