summaryrefslogtreecommitdiff
path: root/lib/api.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-05 03:19:12 +0000
committerZach Copley <zach@status.net>2010-02-05 03:19:12 +0000
commit23802e58d6d01e5f8dacade2161147d31b2dacb9 (patch)
tree707120cc8d2d0217e4168473b7a7ef25e94919e0 /lib/api.php
parent4502bea9a86fe5992eb9b359d90f0c1f004998c1 (diff)
parent857494c9c61d872b7decf69de226bba6cd250d99 (diff)
Merge branch 'temp'
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/api.php b/lib/api.php
index 10a2fae28..f81975216 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -1249,10 +1249,27 @@ class ApiAction extends Action
case 'api':
break;
default:
+
+ $name = null;
+ $url = null;
+
$ns = Notice_source::staticGet($source);
+
if ($ns) {
- $source_name = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
+ $name = $ns->name;
+ $url = $ns->url;
+ } else {
+ $app = Oauth_application::staticGet('name', $source);
+ if ($app) {
+ $name = $app->name;
+ $url = $app->source_url;
+ }
+ }
+
+ if (!empty($name) && !empty($url)) {
+ $source_name = '<a href="' . $url . '">' . $name . '</a>';
}
+
break;
}
return $source_name;