summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index 1b672561f..997f32430 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1292,4 +1292,20 @@ function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) {
return common_default_avatar($size);
}
}
- \ No newline at end of file
+
+function common_profile_uri($profile) {
+ if (!$profile) {
+ return NULL;
+ }
+ $user = User::staticGet($profile->id);
+ if ($user) {
+ return $user->uri;
+ }
+
+ $remote = Remote_profile::staticGet($profile->id);
+ if ($remote) {
+ return $remote->uri;
+ }
+ # XXX: this is a very bad profile!
+ return NULL;
+} \ No newline at end of file