Re: HREF exploit
| From: | Daniel Tryba | Date: | Wed, 26 Jul 2000 22:14:52 +0000 |
| Subject: | Re: HREF exploit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8421@lists.php.net to get a copy of this message | ||
On Wed, Jul 26, 2000 at 04:27:50PM -0500, David Norman wrote:
> What I've got now doesn't work right because it grabs *everything* between
> the very first carrot and the very last carrot. Can anyone think of a loop
> to wrap around what I've got to grab the correct stuff between carrots?
> Heck, I don't care if it's totally different code... just as long as it
> works.
>
Ehhhh, use perl regular expressions, normally a regexp will be greedy
and try to match as much als possible. With the perl regexps you can
make a minimal matching regexp:
echo preg_replace("/<.*?>/","", $input);
This would strip tags only and not the stuff betweens the tags also.
(the ? after a *,+ etc... will make it minimal).
--
Daniel Tryba