The tr/// does nothing. This:
tr/[^\w\/\.\-\?\=\&\@\%]//
does nothing. When there's no right side, and no flags, the left side is copied to the right side, and thus we've got a mapping of % to itself, w to itself, and so on.

Which brings up the second problem. You seem to be treating it like a s///, rather than a tr///, and they share only the slashes. {grin} There's no "character classes" in tr///, nor do the square brackets mean what you think they mean, nor does the \w mean anything other than backslash followed by the letter w.

As for the "external redirect" issue, dws and tilly helped me determine that CGI.pm now in fact (in violation of the spec) sends both a Status-302 and a Location header to the server, which the server error-corrects by turning an internal redirect into a fully-qualified external redirect. Ewww. This is sooooo broken, and was therefore unexpected when I posted my first note.

So, you're safe, but only because others have padded the hallways for you, and only because everybody is error-correcting for you. {grin}

-- Randal L. Schwartz, Perl hacker


In reply to Re: Re: Re: Instant redirect from form input by merlyn
in thread Instant redirect from form input by Clownburner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.