]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better @ links
authorEvan Prodromou <evan@prodromou.name>
Thu, 4 Sep 2008 22:41:29 +0000 (18:41 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 4 Sep 2008 22:41:29 +0000 (18:41 -0400)
darcs-hash:20080904224129-84dde-6844b29ab1818954aacaf6d9ef11371dbb11812a.gz

lib/util.php

index df64e74be8cc2f10e29d67b8e1c2970715b11c07..ff22ac644dfa3943a1b0fdc2b748ea996bad2b7d 100644 (file)
@@ -686,7 +686,7 @@ function common_render_content($text, $notice) {
        $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r);
        $id = $notice->profile_id;
        $r = preg_replace('@https?://[^)\]>\s]+@', '<a href="\0" class="extlink">\0</a>', $r);
-       $r = preg_replace('/(^|\s+)@([a-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r);
+       $r = preg_replace('/(^|\s+)@([A-Za-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r);
        $r = preg_replace('/^T ([A-Z0-9]{1,64}) /e', "'T '.common_at_link($id, '\\1').' '", $r);
        $r = preg_replace('/(^|\s+)#([A-Za-z0-9_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
        # XXX: machine tags
@@ -703,7 +703,7 @@ function common_tag_link($tag) {
 
 function common_at_link($sender_id, $nickname) {
        $sender = Profile::staticGet($sender_id);
-       $recipient = common_relative_profile($sender, $nickname);
+       $recipient = common_relative_profile($sender, common_canonical_nickname($nickname));
        if ($recipient) {
                return '<a href="'.htmlspecialchars($recipient->profileurl).'" class="atlink">'.$nickname.'</a>';
        } else {