Remove deprecated App::query_string - replace with DI::args()->getQueryString()

This commit is contained in:
nupplaPhil
2019-12-16 01:30:34 +01:00
parent 26af2feee2
commit e6f61c2cc7
33 changed files with 63 additions and 66 deletions
-3
View File
@@ -40,8 +40,6 @@ use Psr\Log\LoggerInterface;
*/
class App
{
/** @deprecated 2019.09 - use App\Arguments->getQueryString() */
public $query_string;
/**
* @var Page The current page environment
*/
@@ -175,7 +173,6 @@ class App
$this->cmd = $args->getCommand();
$this->argv = $args->getArgv();
$this->argc = $args->getArgc();
$this->query_string = $args->getQueryString();
$this->module = $module->getName();
$this->page = $page;
+1 -1
View File
@@ -1757,7 +1757,7 @@ class Contact
$cid, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()];
}
$pager = new Pager($a->query_string);
$pager = new Pager(DI::args()->getQueryString());
$params = ['order' => ['received' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
+4 -4
View File
@@ -144,7 +144,7 @@ class Profile
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
if (!DBA::isResult($user) && empty($profiledata)) {
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
return;
}
@@ -165,7 +165,7 @@ class Profile
$pdata = self::getByNickname($nickname, $user['uid'], $profile);
if (empty($pdata) && empty($profiledata)) {
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
return;
}
@@ -1077,7 +1077,7 @@ class Profile
// Remove the "addr" parameter from the destination. It is later added as separate parameter again.
$addr_request = 'addr=' . urlencode($addr);
$query = rtrim(str_replace($addr_request, '', $a->query_string), '?&');
$query = rtrim(str_replace($addr_request, '', DI::args()->getQueryString()), '?&');
// The other instance needs to know where to redirect.
$dest = urlencode(DI::baseUrl()->get() . '/' . $query);
@@ -1164,7 +1164,7 @@ class Profile
$arr = [
'visitor' => $visitor,
'url' => $a->query_string
'url' => DI::args()->getQueryString()
];
/**
* @hooks magic_auth_success
+1 -3
View File
@@ -46,13 +46,11 @@ class Contact extends BaseAdminModule
{
parent::content($parameters);
$a = DI::app();
$condition = ['uid' => 0, 'blocked' => true];
$total = DBA::count('contact', $condition);
$pager = new Pager($a->query_string, 30);
$pager = new Pager(DI::args()->getQueryString(), 30);
$contacts = Model\Contact::selectToArray([], $condition, ['limit' => [$pager->getStart(), $pager->getItemsPerPage()]]);
+1 -1
View File
@@ -179,7 +179,7 @@ class Users extends BaseAdminModule
/* get pending */
$pending = Register::getPending();
$pager = new Pager($a->query_string, 100);
$pager = new Pager(DI::args()->getQueryString(), 100);
// @TODO Move below block to Model\User::getUsers($start, $count, $order = 'contact.name', $order_direction = '+')
$valid_orders = [
+1 -1
View File
@@ -49,7 +49,7 @@ class AllFriends extends BaseModule
$total = Model\GContact::countAllFriends(local_user(), $cid);
$pager = new Pager($app->query_string);
$pager = new Pager(DI::args()->getQueryString());
$friends = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
if (empty($friends)) {
+1 -1
View File
@@ -55,7 +55,7 @@ abstract class BaseAdminModule extends BaseModule
if (!is_site_admin()) {
notice(L10n::t('Please login to continue.'));
Session::set('return_path', $a->query_string);
Session::set('return_path', DI::args()->getQueryString());
DI::baseUrl()->redirect('login');
}
+1 -1
View File
@@ -25,7 +25,7 @@ class Bookmarklet extends BaseModule
if (!local_user()) {
$output = '<h2>' . L10n::t('Login') . '</h2>';
$output .= Login::form($app->query_string, intval($config->get('config', 'register_policy')) === Register::CLOSED ? false : true);
$output .= Login::form(DI::args()->getQueryString(), intval($config->get('config', 'register_policy')) === Register::CLOSED ? false : true);
return $output;
}
+3 -3
View File
@@ -425,7 +425,7 @@ class Contact extends BaseModule
if (!empty($_REQUEST['confirm'])) {
// <form> can't take arguments in its 'action' parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
$query = explode_querystring(DI::args()->getQueryString());
$inputs = [];
foreach ($query['args'] as $arg) {
if (strpos($arg, 'confirm=') === false) {
@@ -467,7 +467,7 @@ class Contact extends BaseModule
}
}
$_SESSION['return_path'] = $a->query_string;
$_SESSION['return_path'] = DI::args()->getQueryString();
if (!empty($a->data['contact']) && is_array($a->data['contact'])) {
$contact = $a->data['contact'];
@@ -776,7 +776,7 @@ class Contact extends BaseModule
if (DBA::isResult($r)) {
$total = $r[0]['total'];
}
$pager = new Pager($a->query_string);
$pager = new Pager(DI::args()->getQueryString());
$contacts = [];
+1 -1
View File
@@ -52,7 +52,7 @@ class Directory extends BaseModule
$gDirPath = Profile::zrl($dirURL, true);
}
$pager = new Pager($app->query_string, 60);
$pager = new Pager(DI::args()->getQueryString(), 60);
$profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
+1 -1
View File
@@ -46,7 +46,7 @@ class Home extends BaseModule
}
}
$login = Login::form($app->query_string, $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
$login = Login::form(DI::args()->getQueryString(), $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
$content = '';
Hook::callAll('home_content', $content);
+1 -1
View File
@@ -25,7 +25,7 @@ class Objects extends BaseModule
}
if (!ActivityPub::isRequest()) {
DI::baseUrl()->redirect(str_replace('objects/', 'display/', $a->query_string));
DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
}
/// @todo Add Authentication to enable fetching of non public content
+2 -2
View File
@@ -258,7 +258,7 @@ class Profile extends BaseModule
return '';
}
$pager = new Pager($a->query_string);
$pager = new Pager(DI::args()->getQueryString());
} else {
$sql_post_table = "";
@@ -302,7 +302,7 @@ class Profile extends BaseModule
$itemspage_network = $a->force_max_items;
}
$pager = new Pager($a->query_string, $itemspage_network);
$pager = new Pager(DI::args()->getQueryString(), $itemspage_network);
$pager_sql = sprintf(" LIMIT %d, %d ", $pager->getStart(), $pager->getItemsPerPage());
+1 -1
View File
@@ -69,7 +69,7 @@ class Contacts extends BaseModule
$total = DBA::count('contact', $condition);
$pager = new Pager($a->query_string);
$pager = new Pager(DI::args()->getQueryString());
$params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
+1 -1
View File
@@ -95,7 +95,7 @@ class Login extends BaseModule
}
if (is_null($return_path)) {
$return_path = $a->query_string;
$return_path = DI::args()->getQueryString();
}
if (local_user()) {
+1 -1
View File
@@ -890,7 +890,7 @@ class Post
$template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
$comment_box = Renderer::replaceMacros($template, [
'$return_path' => $a->query_string,
'$return_path' => DI::args()->getQueryString(),
'$threaded' => $this->isThreaded(),
'$jsreload' => '',
'$wall' => ($conv->getMode() === 'profile'),