]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix group fetch and regex for group link
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 22 Jan 2009 03:41:57 +0000 (22:41 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 22 Jan 2009 03:41:57 +0000 (22:41 -0500)
lib/util.php

index 03a99e54c1dc9680e64b86142a55d905cd984555..61b73a5569ab204009f818090ae81603853d4710 100644 (file)
@@ -424,7 +424,7 @@ function common_render_content($text, $notice)
     $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_at_hash_link($id, '\\2')", $r);
-    $r = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/e', "\\1'!'.common_group_link($id, '\\2')", $r);
+    $r = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/e', "'\\1!'.common_group_link($id, '\\2')", $r);
     return $r;
 }
 
@@ -599,7 +599,7 @@ function common_at_link($sender_id, $nickname)
 function common_group_link($sender_id, $nickname)
 {
     $sender = Profile::staticGet($sender_id);
-    $group = User_group::staticGet(common_canonical_nickname($nickname));
+    $group = User_group::staticGet('nickname', common_canonical_nickname($nickname));
     if ($group && $sender->isMember($group)) {
         return '<span class="vcard"><a href="'.htmlspecialchars($group->permalink()).'" class="url"><span class="fn nickname">'.$nickname.'</span></a></span>';
     } else {