public Method

Object.taint

obj.taint  obj

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.

Source Code

/*
*  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(obj)
   VALUE obj;
{
   rb_secure(4);
   if (!OBJ_TAINTED(obj)) {
       if (OBJ_FROZEN(obj)) {
           rb_error_frozen("object");
       }
       OBJ_TAINT(obj);
   }
   return obj;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.