return true;
} else {
- return common_valid_http_url($callback);
+ return filter_var($callback, FILTER_VALIDATE_URL);
}
}
}
// TRANS: Subtitle for timeline of most recent mentions of a user.
// TRANS: %1$s is the StatusNet sitename, %2$s is a user nickname,
// TRANS: %3$s is a user's full name.
- _('%1$s updates that reply to updates from %2$s / %3$s.'),
- $sitename, $this->target->getBestName(), $this->target->nickname
+ _('%1$s updates that reply to updates from %3$s / %2$s.'),
+ $sitename, $this->target->nickname, $this->target->getBestName()
);
switch($this->format) {
*
* @return success flag
*/
- function prepare($args)
+ protected function prepare(array $args=array())
{
parent::prepare($args);
if ($this->boolean('ajax')) {
*
* @return Notice
*/
- function getNotice()
+ protected function getNotice()
{
$id = $this->arg('notice');
$notice = Notice::getKV('id', $id);
- if (empty($notice)) {
+ if (!$notice instanceof Notice) {
// Did we used to have it, and it got deleted?
$deleted = Deleted_notice::getKV($id);
- if (!empty($deleted)) {
+ if ($deleted instanceof Deleted_notice) {
// TRANS: Client error displayed trying to show a deleted notice.
$this->clientError(_('Notice deleted.'), 410);
} else {
*
* @return void
*/
- function handle($args)
+ protected function handle()
{
- parent::handle($args);
+ parent::handle();
if ($this->boolean('ajax')) {
$this->showAjax();
} else if ($this->arg('screen_name')) {
$nickname = common_canonical_nickname($this->arg('screen_name'));
$user = User::getKV('nickname', $nickname);
- return $user ? $user->getProfile() : null;
+ return $user instanceof User ? $user->getProfile() : null;
} else {
// Fall back to trying the currently authenticated user
return $this->scoped;
{
$con = Consumer::getKV('consumer_key', $consumerKey);
- if (!$con) {
+ if (!$con instanceof Consumer) {
// Create an anon consumer and anon application if one
// doesn't exist already
$headers = array('Content-Type: application/x-www-form-urlencoded');
$post = array('hub.mode' => $mode,
'hub.callback' => $callback,
- 'hub.verify' => 'async', // TODO: deprecated, remove when noone uses PuSH <0.4
+ 'hub.verify' => 'async', // TODO: deprecated, remove when noone uses PuSH <0.4 (only 'async' method used there)
'hub.verify_token' => 'Deprecated-since-PuSH-0.4', // TODO: rm!
'hub.secret' => $this->secret,