in reply to URL, etc to Domain Name Stripper

When you say "taint approved stripper", do you mean that it returns a hostname suitable for use in a tainted environment?

--MidLifeXis

Replies are listed 'Best First'.
Re^2: URL, etc to Domain Name Stripper
by jnbek (Scribe) on Dec 30, 2009 at 22:04 UTC

    Yes, sorry. This can be used when running with the -T argument.

      By your definition, the following is "taint approved" as well:

      my $untained = $tainted =~ /^(.*)/s;

      Something's that safe for use under -T is something that's guaranteed to deliver exactly what it promises to deliver, and your code does not do that.

      print stripper('fqdn', 'www.a.;EVIL!/') # www.a.;EVIL!

      EVIL! can't contain [\s/] which makes it impractical as an attack vector in most situations, but there's no way that what the sub returns should be considered safe.