@@ -140,7 +140,6 @@ use Tie::RefHash ();
140
140
use HTTP::Request 1.30 ();
141
141
use HTML::Form 1.00 ();
142
142
use HTML::TokeParser ();
143
- use Scalar::Util qw( tainted ) ;
144
143
145
144
use parent ' LWP::UserAgent' ;
146
145
@@ -3364,8 +3363,6 @@ sub _update_page {
3364
3363
my $content = $res -> decoded_content();
3365
3364
$content = $res -> content if ( not defined $content );
3366
3365
3367
- $content .= _taintedness();
3368
-
3369
3366
if ( $self -> is_html ) {
3370
3367
$self -> update_html($content );
3371
3368
}
@@ -3376,43 +3373,6 @@ sub _update_page {
3376
3373
return $res ;
3377
3374
} # _update_page
3378
3375
3379
- our $_taintbrush;
3380
-
3381
- # This is lifted wholesale from Test::Taint
3382
- sub _taintedness {
3383
- return $_taintbrush if defined $_taintbrush;
3384
-
3385
- # Somehow we need to get some taintedness into our $_taintbrush.
3386
- # Let's try the easy way first. Either of these should be
3387
- # tainted, unless somebody has untainted them, so this
3388
- # will almost always work on the first try.
3389
- # (Unless, of course, taint checking has been turned off!)
3390
- $_taintbrush = substr ( " $0 $^X" , 0, 0 );
3391
- return $_taintbrush if tainted($_taintbrush);
3392
-
3393
- # Let's try again. Maybe somebody cleaned those.
3394
- $_taintbrush = substr ( join ( q{ } , grep { defined } @ARGV , %ENV ), 0, 0 );
3395
- return $_taintbrush if tainted($_taintbrush);
3396
-
3397
- # If those don't work, go try to open some file from some unsafe
3398
- # source and get data from them. That data is tainted.
3399
- # (Yes, even reading from /dev/null works!)
3400
- for my $filename ( qw( /dev/null / . ..) , values %INC , $0 , $^X ) {
3401
- if ( open my $fh , ' <' , $filename ) {
3402
- my $data ;
3403
- if ( defined sysread $fh , $data , 1 ) {
3404
- $_taintbrush = substr ( $data , 0, 0 );
3405
- last if tainted($_taintbrush);
3406
- }
3407
- }
3408
- }
3409
-
3410
- # Sanity check
3411
- die (" Our taintbrush should have zero length!" ) if length $_taintbrush;
3412
-
3413
- return $_taintbrush;
3414
- }
3415
-
3416
3376
=head2 $mech->_modify_request( $req )
3417
3377
3418
3378
Modifies a L<HTTP::Request> before the request is sent out,
0 commit comments