If you write links that has hashmarks in it, the activitystream_twitter_makelinks() produces links that has an tag in an another tag.

The error is in the activitystream_twitter_makelinks() function at the 81th line:

$text = preg_replace('/#(\w*)/', '<a href="http://hashtags.org/tag/\\1/">#\\1</a>', $text);
http://example.com/#lol

will become

<a href="http://example.com/#lol">http://example.com/<a href="http://hashtags.org/tag/#lol>#lol</a></a>

Comments

akalsey’s picture

Version: 6.x-1.0-rc2 » 6.x-2.x-dev
Status: Active » Fixed

I think the only proper way to handle this would be to only link a hashtag if it is preceded by whitespace or begins the string. This will mean that if someone were to say #hash#tag without a space separating them then only #hash would get linked and #tag would be ignored. I cant imagine that this is a common case.

Fixed in CVS rev 1.2.2.5.

This fix is going into 2.x only.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.