Change 23636 by [EMAIL PROTECTED] on 2004/12/10 10:02:12

        Subject: [PATCH] Test rt.perl.org 5900
        From: Michael G Schwern <[EMAIL PROTECTED]>
        Date: Thu, 9 Dec 2004 22:11:59 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/t/op/taint.t#64 edit

Differences ...

==== //depot/perl/t/op/taint.t#64 (xtext) ====
Index: perl/t/op/taint.t
--- perl/t/op/taint.t#63~23635~ Fri Dec 10 01:51:44 2004
+++ perl/t/op/taint.t   Fri Dec 10 02:02:12 2004
@@ -17,7 +17,7 @@
 use File::Spec::Functions;
 
 BEGIN { require './test.pl'; }
-plan tests => 236;
+plan tests => 238;
 
 
 $| = 1;
@@ -1067,4 +1067,25 @@
     $result = $tainted_false ? $tainted_whatever : $untainted_whatever;
     test $result eq "The Fabulous Johnny Cash";
     test !tainted( $result );
+}
+
+{
+    # rt.perl.org 5900  $1 remains tainted if...
+    # 1) The regular expression contains a scalar variable AND
+    # 2) The regular expression appears in an elsif clause
+
+    my $foo = "abcdefghi" . $TAINT;
+
+    my $valid_chars = 'a-z';
+    if ( $foo eq '' ) {
+    }
+    elsif ( $foo =~ /([$valid_chars]+)/o ) {
+        test not tainted $1;
+    }
+
+    if ( $foo eq '' ) {
+    }
+    elsif ( my @bar = $foo =~ /([$valid_chars]+)/o ) {
+        test not any_tainted @bar;
+    }
 }
End of Patch.

Reply via email to