]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better regular expression for atlinks
authorEvan Prodromou <evan@prodromou.name>
Thu, 29 May 2008 17:32:34 +0000 (13:32 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 29 May 2008 17:32:34 +0000 (13:32 -0400)
darcs-hash:20080529173234-84dde-7b1e8fa0af993edd74b11f88bdfbc24e970298a7.gz

lib/util.php

index 54a30a914df840bbca9f4f6002ef5d606352ce71..5ed632b7bc5c2b6f02c83f5fbabb5b7b9209d2bb 100644 (file)
@@ -352,7 +352,7 @@ function common_canonical_email($email) {
 function common_render_content($text, $notice) {
        $r = htmlspecialchars($text);
        $id = $notice->profile_id;
-       $r = preg_replace('/\b@([\w-]+)\b/e', "@common_at_link($id,'\\1')", $r);
+       $r = preg_replace('/(^|\s)@([\w-]+)($|\s)/e', "'\\1'.@common_at_link($id, '\\2').'\\3'", $r);
        # XXX: # tags
        # XXX: machine tags
        return $r;