$string =~ s/(<br>)+$//i;
| [reply] [d/l] |
If you're including the input text be sure to run it through
several fairly severe cleansings. You may want to strip
any javascript, forms, ssi, applets and other goodies not desired.
In fact if you're just looking for text perhaps stripping all
tag might help.
$textin =~ s/<[^>]*>//sg; ## strip normal tags
$textin =~ s/^[^>]*>//sg; ## strip sneaky left over stuff
$textin =~ s/<[^<]*$//sg; ## strip sneaky left over stuff
That should get rid of most attacks to your script.
Of course you can always just strip forms, ssi, etc. and leave
normal tags alone. It all depends on how severe you feel you
need to be -- or can afford.
Claude
| [reply] [d/l] |
If the <br> tag is all that is on the line then
$line =~ s/^<br>$//i; will kill it.
$line =~ s/^\s*<br>\s*$//i; would remove a tag that is only surrounded by whitespace.
If you want to remove a particular tag/sets of tage from the entire document, take a look at HTML::Filter. It would seem to do some quite interesting things.
$japh->{'Caillte'} = $me;
| [reply] [d/l] [select] |
I'm sorry, that was <br>'s. | [reply] [d/l] |