X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelineuser.php;h=e8c58e6e8b85d405d596b407484e3699d2d66b5c;hb=ba623d2b4e9928ddf9ca4676fac4d46bba4bd181;hp=b105a29dd14a5c7f56727d8ade40cbe827d8a95d;hpb=d1b10ee92bec69e8401bca743b8145f98437074f;p=quix0rs-gnu-social.git diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index b105a29dd1..e8c58e6e8b 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -79,6 +79,10 @@ class ApiTimelineUserAction extends ApiBareAuthAction $this->clientError(_('No such user.'), 404); } + if (!$this->target->isLocal()) { + $this->serverError(_('Remote user timelines are not available here yet.'), 501); + } + $this->notices = $this->getNotices(); return true; @@ -134,12 +138,17 @@ class ApiTimelineUserAction extends ApiBareAuthAction 'id' => $this->target->id), array('max_id' => $this->next_id)) : null; - $lastNotice = $this->notices[0]; - $lastId = $lastNotice->id; + + $prevExtra = array(); + if (!empty($this->notices)) { + assert($this->notices[0] instanceof Notice); + $prevExtra['since_id'] = $this->notices[0]->id; + } + $prevUrl = common_local_url('ApiTimelineUser', array('format' => $this->format, 'id' => $this->target->id), - array('since_id' => $lastId)); + $prevExtra); $firstUrl = common_local_url('ApiTimelineUser', array('format' => $this->format, 'id' => $this->target->id)); @@ -400,7 +409,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction // Get (safe!) HTML and text versions of the content - $rendered = $this->purify($sourceContent); + $rendered = common_purify($sourceContent); $content = common_strip_html($rendered); $shortened = $this->auth_user->shortenLinks($content); @@ -499,13 +508,4 @@ class ApiTimelineUserAction extends ApiBareAuthAction return $saved; } - - function purify($content) - { - require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; - - $config = array('safe' => 1, - 'deny_attribute' => 'id,style,on*'); - return htmLawed($content, $config); - } }