mraible commented on code in PR #221:
URL: https://github.com/apache/roller/pull/221#discussion_r4402289373
##########
app/src/main/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java:
##########
@@ -270,6 +285,26 @@ private void importOpmlElement(
}
}
+ /**
+ * Returns the value if it is an absolute http or https URL, else null.
+ */
+ static String webLinkOrNull(String value) {
+ if (value == null) {
+ return null;
+ }
+ try {
+ URI uri = new URI(value.trim());
+ String scheme = uri.getScheme();
+ if (scheme != null && uri.getHost() != null
Review Comment:
Optional: `new URI(...)` gives a null host for hostnames with underscores
(like `http://my_blog.example.com/`) and throws on an unencoded `|` or `{}`.
Outlines like that imported before and are now skipped. If that matters, you
could fall back to a scheme-prefix check when parsing fails. Otherwise it might
be worth noting in CHANGES.md that malformed http URLs are skipped too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]