summaryrefslogtreecommitdiff
path: root/lib/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/api.php b/lib/api.php
index fd07bbbbe..22eef7436 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -1103,7 +1103,7 @@ class ApiAction extends Action
}
}
- function serverError($msg, $code = 500, $content_type = 'json')
+ function serverError($msg, $code = 500, $content_type = 'xml')
{
$action = $this->trimmed('action');
@@ -1154,7 +1154,6 @@ class ApiAction extends Action
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
'xml:lang' => 'en-US',
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
- Event::handle('StartApiAtom', array($this));
}
function endTwitterAtom()
@@ -1321,4 +1320,22 @@ class ApiAction extends Action
}
}
+ function getSelfUri($action, $aargs)
+ {
+ parse_str($_SERVER['QUERY_STRING'], $params);
+ $pstring = '';
+ if (!empty($params)) {
+ unset($params['p']);
+ $pstring = http_build_query($params);
+ }
+
+ $uri = common_local_url($action, $aargs);
+
+ if (!empty($pstring)) {
+ $uri .= '?' . $pstring;
+ }
+
+ return $uri;
+ }
+
}