Method: Object#taint
- Defined in:
- object.c
#taint ⇒ Object
Marks obj as tainted---if the $SAFE
level is set appropriately, many method calls which might alter the running programs environment will refuse to accept tainted strings.
|
# File 'object.c'
/*
* call-seq:
* obj.taint -> obj
*
* Marks <i>obj</i> as tainted---if the <code>$SAFE</code> level is
* set appropriately, many method calls which might alter the running
* programs environment will refuse to accept tainted strings.
*/
VALUE
rb_obj_taint(VALUE obj)
{
rb_secure(4);
if (!OBJ_TAINTED(obj)) {
if (OBJ_FROZEN(obj)) {
rb_error_frozen("object");
}
OBJ_TAINT(obj);
}
return obj;
}
|