}
emptyLines = 0;
boolean lineComplete = true;
-
- /* filter http(s) links to own node. */
- String hostHeader = (context.getRequest() != null) ? context.getRequest().getHttpRequest().getHeader("host") : null;
- logger.log(Level.FINEST, "hostHeader: %s", hostHeader);
- if (hostHeader != null) {
- for (String toRemove : new String[] { "http://" + hostHeader + "/", "https://" + hostHeader + "/", "http://" + hostHeader, "https://" + hostHeader }) {
- while (line.indexOf(toRemove) != -1) {
- line = line.replace(toRemove, "");
- }
- }
- }
-
while (line.length() > 0) {
int nextKsk = line.indexOf("KSK@");
int nextChk = line.indexOf("CHK@");
} else if (linkType == LinkType.POST) {
String postId = link.substring(7);
Post post = core.getPost(postId, false);
- if (post != null) {
+ if ((post != null) && (post.getSone() != null)) {
String postText = post.getText();
postText = postText.substring(0, Math.min(postText.length(), 20)) + "…";
Sone postSone = post.getSone();