@@ -140,7 +140,6 @@ use Tie::RefHash ();
140140use HTTP::Request 1.30 ();
141141use HTML::Form 1.00 ();
142142use HTML::TokeParser ();
143- use Scalar::Util qw( tainted ) ;
144143
145144use parent ' LWP::UserAgent' ;
146145
@@ -3364,8 +3363,6 @@ sub _update_page {
33643363 my $content = $res -> decoded_content();
33653364 $content = $res -> content if ( not defined $content );
33663365
3367- $content .= _taintedness();
3368-
33693366 if ( $self -> is_html ) {
33703367 $self -> update_html($content );
33713368 }
@@ -3376,43 +3373,6 @@ sub _update_page {
33763373 return $res ;
33773374} # _update_page
33783375
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-
34163376=head2 $mech->_modify_request( $req )
34173377
34183378Modifies a L<HTTP::Request> before the request is sent out,
0 commit comments