if (!empty($r->file_id)) {
return $r;
}
- }
- $redir->httpcode = $redir_info['code'];
- $redir->redirections = intval($redir_info['redirects']);
- $redir->file = new File();
- $redir->file->url = $redir_info ? $redir_info['url'] : $in_url;
- $redir->file->mimetype = $redir_info['type'];
- $redir->file->size = $redir_info['size'];
- $redir->file->date = $redir_info['time'];
- if($redir_info['protected']) $redir->file->protected = true;
+ $redir->httpcode = $redir_info['code'];
+ $redir->redirections = intval($redir_info['redirects']);
+ $redir->file = new File();
+ $redir->file->url = $redir_info ? $redir_info['url'] : $in_url;
+ $redir->file->mimetype = $redir_info['type'];
+ $redir->file->size = $redir_info['size'];
+ $redir->file->date = $redir_info['time'];
+ if ($redir_info['protected']) {
+ $redir->file->protected = true;
+ }
+ }
return $redir;
}
// Use the local user's shortening preferences, if applicable.
$stored->rendered = $actor->isLocal()
? $actor->shortenLinks($act->content)
- : $act->content;
+ : common_purify($act->content);
$stored->content = common_strip_html($stored->rendered);
// Maybe a missing act-time should be fatal if the actor is not local?
}
$this->initDocument('json');
$error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']);
- $this->text(json_encode($error_array));
+ print(json_encode($error_array));
$this->endDocument('json');
break;
case 'text':
'(?:'.
'(?:'. //Known protocols
'(?:'.
- '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://)'.
+ '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|ircs?)://)'.
'|'.
'(?:(?:mailto|aim|tel|xmpp):)'.
')'.
$results = array();
foreach($this->profiles as $profile){
$avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE);
+ $acct = $profile->getAcctUri();
+ $identifier = split(':', $profile->getAcctUri(), 2)[1];
$results[] = array(
- 'value' => '@'.$profile->nickname,
- 'nickname' => $profile->nickname,
- 'label'=> $profile->getFancyName(),
+ 'value' => '@'.$identifier,
+ 'nickname' => $profile->getNickname(),
+ 'acct_uri' => $acct,
+ 'label'=> "${identifier} (".$profile->getFullname().")",
'avatar' => $avatarUrl,
'type' => 'user'
);
} else {
$avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE);
}
+ $acct = $profile->getAcctUri();
+ $identifier = split(':', $profile->getAcctUri(), 2)[1];
$results[] = array(
- 'value' => '!'.$group->nickname,
- 'nickname' => $group->nickname,
- 'label'=> $group->getFancyName(),
+ 'value' => '!'.$group->getNickname(),
+ 'nickname' => $group->getNickname(),
+ 'acct_uri' => $acct,
+ 'label'=> "${identifier} (".$group->getFullname().")",
'avatar' => $avatarUrl,
'type' => 'group');
}