From: Nikolai Weibull Date: 2013-03-24T17:58:34+09:00 Subject: [ruby-core:53689] Re: [ruby-core:53685] Re: [ruby-core:53680] Re: [ruby-core:53679] Why doesn’t String#+ return an untrusted result if self or other is untrusted? On Sat, Mar 23, 2013 at 10:42 PM, Nikolai Weibull wrote: > On Sat, Mar 23, 2013 at 8:30 PM, KOSAKI Motohiro > wrote: >> On Sat, Mar 23, 2013 at 2:45 PM, Nikolai Weibull wrote: >>> Why doesn���t String#+ return an untrusted result if self or other is untrusted? >> IIUC, untrusted mean an object was created from untrusted code (i.e. $SAFE >=3). > OK, so the reasoning then is that since String#+ creates a result that > contains data from outside of the receiver, untrust isn���t inherited, > whereas with String#slice and String#downcase the whole result comes > from an untrusted source and thus untrust is inherited. (This explanation isn���t consistent with String#center, String#ljust, and String#rjust, as their results inherit untrust from the padding argument, so there must be something deeper going on here.)