tidy
don't log if uri is undef
use quotemeta before using input string as regex
fix test broken by change in content