in reply to Change URIs in Text to HTML-Links
You left out the mandatory "escape HTML entity" calls.
Shame on you.
Yes, I've already complained to the author. He "fixed" the manpage incorrectly, by escaping the entire source text first. That breaks in-page URLs that look like http://example.com/foo/bar?a=b&c=d. {sigh} I was too worn out explaining to him why that was wrong to submit another fix.use HTML::Entities qw(encode_entities); use URI::Find; ... my $finder = URI::Find->new # instead of URI::Find::Schemeless ( sub { my ($uri, $originalUri) = @_; return join "", q/<a href="/, encode_entities("$uri"), q/">/, encode_entities($originalUri), q/>/; } ); ...
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
---|
In Section
Tutorials