oalders / html-restrict

HTML::Restrict - Strip away unwanted HTML tags
Other
10 stars 9 forks source link

protect against undef string comparison #4

Closed evoyy closed 11 years ago

evoyy commented 11 years ago

Due to checking for relative URI schemes (represented by undef), I am getting uninitialized string comparison warnings in my app. Perl6::Junction does not have warnings enabled, and as a result, testing on the command line does not produce any warnings.

The problem is here:

if none( @{ $self->get_uri_schemes } ) eq $uri->scheme;

where either side of the expression can cause an undef comparison.

My fix adds a few more lines, but I have also provided thorough tests. Please let me know what you think.

oalders commented 11 years ago

Thanks for all of your commits. I've foolishly left the master branch in a state I don't want to release and I'm actually moving to a new place this weekend, so I'm a bit short on time. I hope to look at all of your pull requests closely next week. :)

evoyy commented 11 years ago

No problem, please take your time.

oalders commented 11 years ago

Good catch. Thanks very much for this!