Remove deprecated App::cmd - replace with DI::args()->getCommand()

This commit is contained in:
Philipp Holzer 2019-12-16 01:33:13 +01:00
commit 33674808dc
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
16 changed files with 23 additions and 25 deletions

View file

@ -45,7 +45,7 @@ function api_post(App $a)
function api_content(App $a)
{
if ($a->cmd == 'api/oauth/authorize') {
if (DI::args()->getCommand() == 'api/oauth/authorize') {
/*
* api/oauth/authorize interact with the user. return a standard page
*/

View file

@ -221,7 +221,7 @@ function cal_content(App $a)
foreach ($r as $rr) {
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
if (empty($links[$j])) {
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
$links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}

View file

@ -335,19 +335,19 @@ function dfrn_request_post(App $a)
$url = Network::isUrlValid($url);
if (!$url) {
notice(L10n::t('Invalid profile URL.') . EOL);
DI::baseUrl()->redirect($a->cmd);
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (!Network::isUrlAllowed($url)) {
notice(L10n::t('Disallowed profile URL.') . EOL);
DI::baseUrl()->redirect($a->cmd);
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (Network::isUrlBlocked($url)) {
notice(L10n::t('Blocked domain') . EOL);
DI::baseUrl()->redirect($a->cmd);
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
@ -355,7 +355,7 @@ function dfrn_request_post(App $a)
if (!count($parms)) {
notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
DI::baseUrl()->redirect($a->cmd);
DI::baseUrl()->redirect(DI::args()->getCommand());
} else {
if (empty($parms['fn'])) {
notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);

View file

@ -217,7 +217,7 @@ function events_content(App $a)
}
if ($a->argc == 1) {
$_SESSION['return_path'] = $a->cmd;
$_SESSION['return_path'] = DI::args()->getCommand();
}
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
@ -350,7 +350,7 @@ function events_content(App $a)
foreach ($r as $rr) {
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
if (empty($links[$j])) {
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
$links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}

View file

@ -11,6 +11,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\Network;
@ -38,7 +39,7 @@ function match_content(App $a)
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
$_SESSION['return_path'] = $a->cmd;
$_SESSION['return_path'] = DI::args()->getCommand();
$profile = Profile::getByUID(local_user());

View file

@ -89,7 +89,7 @@ function message_post(App $a)
$a->argc = 2;
$a->argv[1] = 'new';
} else {
DI::baseUrl()->redirect($a->cmd . '/' . $ret);
DI::baseUrl()->redirect(DI::args()->getCommand() . '/' . $ret);
}
}

View file

@ -914,7 +914,7 @@ function network_tabs(App $a)
$all_active = 'active';
}
$cmd = $a->cmd;
$cmd = DI::args()->getCommand();
// tabs
$tabs = [

View file

@ -846,7 +846,7 @@ function photos_content(App $a)
$phototypes = Images::supportedTypes();
$_SESSION['photo_return'] = $a->cmd;
$_SESSION['photo_return'] = DI::args()->getCommand();
// Parse arguments
$datum = null;
@ -1362,7 +1362,7 @@ function photos_content(App $a)
if (!empty($link_item['id']) && !empty($link_item['uri'])) {
$cmnt_tpl = Renderer::getMarkupTemplate('comment_item.tpl');
$tpl = Renderer::getMarkupTemplate('photo_item.tpl');
$return_path = $a->cmd;
$return_path = DI::args()->getCommand();
if ($cmd === 'view' && ($can_post || Security::canWriteToUserWall($owner_uid))) {
$like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl');

View file

@ -86,7 +86,7 @@ function pubsub_post(App $a)
{
$xml = Network::postdata();
Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Data: ' . $xml, Logger::DATA);
$nick = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : '');

View file

@ -41,7 +41,7 @@ function suggest_content(App $a)
return;
}
$_SESSION['return_path'] = $a->cmd;
$_SESSION['return_path'] = DI::args()->getCommand();
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();

View file

@ -124,7 +124,7 @@ function videos_content(App $a)
//$phototypes = Photo::supportedTypes();
$_SESSION['video_return'] = $a->cmd;
$_SESSION['video_return'] = DI::args()->getCommand();
//
// Parse arguments