Remove deprecated App::query_string - replace with DI::args()->getQueryString()
This commit is contained in:
parent
26af2feee2
commit
e6f61c2cc7
|
@ -291,22 +291,22 @@ function api_call(App $a)
|
||||||
global $API, $called_api;
|
global $API, $called_api;
|
||||||
|
|
||||||
$type = "json";
|
$type = "json";
|
||||||
if (strpos($a->query_string, ".xml") > 0) {
|
if (strpos(DI::args()->getQueryString(), ".xml") > 0) {
|
||||||
$type = "xml";
|
$type = "xml";
|
||||||
}
|
}
|
||||||
if (strpos($a->query_string, ".json") > 0) {
|
if (strpos(DI::args()->getQueryString(), ".json") > 0) {
|
||||||
$type = "json";
|
$type = "json";
|
||||||
}
|
}
|
||||||
if (strpos($a->query_string, ".rss") > 0) {
|
if (strpos(DI::args()->getQueryString(), ".rss") > 0) {
|
||||||
$type = "rss";
|
$type = "rss";
|
||||||
}
|
}
|
||||||
if (strpos($a->query_string, ".atom") > 0) {
|
if (strpos(DI::args()->getQueryString(), ".atom") > 0) {
|
||||||
$type = "atom";
|
$type = "atom";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach ($API as $p => $info) {
|
foreach ($API as $p => $info) {
|
||||||
if (strpos($a->query_string, $p) === 0) {
|
if (strpos(DI::args()->getQueryString(), $p) === 0) {
|
||||||
if (!api_check_method($info['method'])) {
|
if (!api_check_method($info['method'])) {
|
||||||
throw new MethodNotAllowedException();
|
throw new MethodNotAllowedException();
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ function api_call(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::warning(API_LOG_PREFIX . 'not implemented', ['module' => 'api', 'action' => 'call', 'query' => $a->query_string]);
|
Logger::warning(API_LOG_PREFIX . 'not implemented', ['module' => 'api', 'action' => 'call', 'query' => DI::args()->getQueryString()]);
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
} catch (HTTPException $e) {
|
} catch (HTTPException $e) {
|
||||||
header("HTTP/1.1 {$e->getCode()} {$e->httpdesc}");
|
header("HTTP/1.1 {$e->getCode()} {$e->httpdesc}");
|
||||||
|
@ -389,7 +389,7 @@ function api_error($type, $e)
|
||||||
|
|
||||||
$error = ["error" => $error,
|
$error = ["error" => $error,
|
||||||
"code" => $e->getCode() . " " . $e->httpdesc,
|
"code" => $e->getCode() . " " . $e->httpdesc,
|
||||||
"request" => $a->query_string];
|
"request" => DI::args()->getQueryString()];
|
||||||
|
|
||||||
$return = api_format_data('status', $type, ['status' => $error]);
|
$return = api_format_data('status', $type, ['status' => $error]);
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ function api_rss_extra(App $a, $arr, $user_info)
|
||||||
$arr['$user'] = $user_info;
|
$arr['$user'] = $user_info;
|
||||||
$arr['$rss'] = [
|
$arr['$rss'] = [
|
||||||
'alternate' => $user_info['url'],
|
'alternate' => $user_info['url'],
|
||||||
'self' => System::baseUrl() . "/" . $a->query_string,
|
'self' => System::baseUrl() . "/" . DI::args()->getQueryString(),
|
||||||
'base' => System::baseUrl(),
|
'base' => System::baseUrl(),
|
||||||
'updated' => api_date(null),
|
'updated' => api_date(null),
|
||||||
'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||||
|
|
|
@ -559,7 +559,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
||||||
$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
|
$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
|
||||||
|
|
||||||
if (!$update) {
|
if (!$update) {
|
||||||
$_SESSION['return_path'] = $a->query_string;
|
$_SESSION['return_path'] = DI::args()->getQueryString();
|
||||||
}
|
}
|
||||||
|
|
||||||
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
|
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
|
||||||
|
@ -780,7 +780,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
||||||
|
|
||||||
$o = Renderer::replaceMacros($page_template, [
|
$o = Renderer::replaceMacros($page_template, [
|
||||||
'$baseurl' => System::baseUrl($ssl_state),
|
'$baseurl' => System::baseUrl($ssl_state),
|
||||||
'$return_path' => $a->query_string,
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
'$live_update' => $live_update_div,
|
'$live_update' => $live_update_div,
|
||||||
'$remove' => L10n::t('remove'),
|
'$remove' => L10n::t('remove'),
|
||||||
'$mode' => $mode,
|
'$mode' => $mode,
|
||||||
|
@ -1193,7 +1193,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
||||||
$private_post = 0;
|
$private_post = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_str = $a->query_string;
|
$query_str = DI::args()->getQueryString();
|
||||||
if (strpos($query_str, 'public=1') !== false) {
|
if (strpos($query_str, 'public=1') !== false) {
|
||||||
$query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
|
$query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,7 +368,7 @@ function drop_item($id, $return = '')
|
||||||
if (!empty($_REQUEST['confirm'])) {
|
if (!empty($_REQUEST['confirm'])) {
|
||||||
// <form> can't take arguments in its "action" parameter
|
// <form> can't take arguments in its "action" parameter
|
||||||
// so add any arguments as hidden inputs
|
// so add any arguments as hidden inputs
|
||||||
$query = explode_querystring($a->query_string);
|
$query = explode_querystring(DI::args()->getQueryString());
|
||||||
$inputs = [];
|
$inputs = [];
|
||||||
|
|
||||||
foreach ($query['args'] as $arg) {
|
foreach ($query['args'] as $arg) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ function api_content(App $a)
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
/// @TODO We need login form to redirect to this page
|
/// @TODO We need login form to redirect to this page
|
||||||
notice(L10n::t('Please login to continue.') . EOL);
|
notice(L10n::t('Please login to continue.') . EOL);
|
||||||
return Login::form($a->query_string, false, $request->get_parameters());
|
return Login::form(DI::args()->getQueryString(), false, $request->get_parameters());
|
||||||
}
|
}
|
||||||
//FKOAuth1::loginUser(4);
|
//FKOAuth1::loginUser(4);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ use Friendica\Content\Pager;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\DI;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module;
|
use Friendica\Module;
|
||||||
use Friendica\Util\Proxy as ProxyUtils;
|
use Friendica\Util\Proxy as ProxyUtils;
|
||||||
|
@ -91,7 +92,7 @@ function common_content(App $a)
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
if ($cid) {
|
if ($cid) {
|
||||||
$common_friends = Model\GContact::commonFriends($uid, $cid, $pager->getStart(), $pager->getItemsPerPage());
|
$common_friends = Model\GContact::commonFriends($uid, $cid, $pager->getStart(), $pager->getItemsPerPage());
|
||||||
|
|
|
@ -149,7 +149,7 @@ function community_content(App $a, $update = 0)
|
||||||
$itemspage_network = $a->force_max_items;
|
$itemspage_network = $a->force_max_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string, $itemspage_network);
|
$pager = new Pager(DI::args()->getQueryString(), $itemspage_network);
|
||||||
|
|
||||||
$r = community_getitems($pager->getStart(), $pager->getItemsPerPage(), $content, $accounttype);
|
$r = community_getitems($pager->getStart(), $pager->getItemsPerPage(), $content, $accounttype);
|
||||||
|
|
||||||
|
|
|
@ -320,7 +320,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
$o .= "<script> var netargs = '?f=&item_id=" . $item_id . "'; </script>";
|
$o .= "<script> var netargs = '?f=&item_id=" . $item_id . "'; </script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= conversation($a, [$item], new Pager($a->query_string), 'display', $update_uid, false, 'commented', $item_uid);
|
$o .= conversation($a, [$item], new Pager(DI::args()->getQueryString()), 'display', $update_uid, false, 'commented', $item_uid);
|
||||||
|
|
||||||
// Preparing the meta header
|
// Preparing the meta header
|
||||||
$description = trim(HTML::toPlaintext(BBCode::convert($item["body"], false), 0, true));
|
$description = trim(HTML::toPlaintext(BBCode::convert($item["body"], false), 0, true));
|
||||||
|
|
|
@ -667,7 +667,7 @@ function item_post(App $a) {
|
||||||
$datarray["item_id"] = -1;
|
$datarray["item_id"] = -1;
|
||||||
$datarray["author-network"] = Protocol::DFRN;
|
$datarray["author-network"] = Protocol::DFRN;
|
||||||
|
|
||||||
$o = conversation($a, [array_merge($contact_record, $datarray)], new Pager($a->query_string), 'search', false, true);
|
$o = conversation($a, [array_merge($contact_record, $datarray)], new Pager(DI::args()->getQueryString()), 'search', false, true);
|
||||||
Logger::log('preview: ' . $o);
|
Logger::log('preview: ' . $o);
|
||||||
echo json_encode(['preview' => $o]);
|
echo json_encode(['preview' => $o]);
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -134,7 +134,7 @@ function message_content(App $a)
|
||||||
if (!empty($_REQUEST['confirm'])) {
|
if (!empty($_REQUEST['confirm'])) {
|
||||||
// <form> can't take arguments in its "action" parameter
|
// <form> can't take arguments in its "action" parameter
|
||||||
// so add any arguments as hidden inputs
|
// so add any arguments as hidden inputs
|
||||||
$query = explode_querystring($a->query_string);
|
$query = explode_querystring(DI::args()->getQueryString());
|
||||||
$inputs = [];
|
$inputs = [];
|
||||||
foreach ($query['args'] as $arg) {
|
foreach ($query['args'] as $arg) {
|
||||||
if (strpos($arg, 'confirm=') === false) {
|
if (strpos($arg, 'confirm=') === false) {
|
||||||
|
@ -265,7 +265,7 @@ function message_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$_SESSION['return_path'] = $a->query_string;
|
$_SESSION['return_path'] = DI::args()->getQueryString();
|
||||||
|
|
||||||
if ($a->argc == 1) {
|
if ($a->argc == 1) {
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ function message_content(App $a)
|
||||||
$total = $r[0]['total'];
|
$total = $r[0]['total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ function network_init(App $a)
|
||||||
|
|
||||||
// convert query string to array. remove friendica args
|
// convert query string to array. remove friendica args
|
||||||
$query_array = [];
|
$query_array = [];
|
||||||
parse_str(parse_url($a->query_string, PHP_URL_QUERY), $query_array);
|
parse_str(parse_url(DI::args()->getQueryString(), PHP_URL_QUERY), $query_array);
|
||||||
|
|
||||||
// fetch last used network view and redirect if needed
|
// fetch last used network view and redirect if needed
|
||||||
if (!$is_a_date_query) {
|
if (!$is_a_date_query) {
|
||||||
|
@ -140,7 +140,7 @@ function network_init(App $a)
|
||||||
$a->page['aside'] .= ForumManager::widget(local_user(), $cid);
|
$a->page['aside'] .= ForumManager::widget(local_user(), $cid);
|
||||||
$a->page['aside'] .= Widget::postedByYear('network', local_user(), false);
|
$a->page['aside'] .= Widget::postedByYear('network', local_user(), false);
|
||||||
$a->page['aside'] .= Widget::networks('network', $_GET['nets'] ?? '');
|
$a->page['aside'] .= Widget::networks('network', $_GET['nets'] ?? '');
|
||||||
$a->page['aside'] .= Widget\SavedSearches::getHTML($a->query_string);
|
$a->page['aside'] .= Widget\SavedSearches::getHTML(DI::args()->getQueryString());
|
||||||
$a->page['aside'] .= Widget::fileAs('network', $_GET['file'] ?? '');
|
$a->page['aside'] .= Widget::fileAs('network', $_GET['file'] ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ function network_content(App $a, $update = 0, $parent = 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @TODO Is this really necessary? $a is already available to hooks
|
/// @TODO Is this really necessary? $a is already available to hooks
|
||||||
$arr = ['query' => $a->query_string];
|
$arr = ['query' => DI::args()->getQueryString()];
|
||||||
Hook::callAll('network_content_init', $arr);
|
Hook::callAll('network_content_init', $arr);
|
||||||
|
|
||||||
$flat_mode = false;
|
$flat_mode = false;
|
||||||
|
@ -389,7 +389,7 @@ function networkFlatView(App $a, $update = 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
networkPager($a, $pager, $update);
|
networkPager($a, $pager, $update);
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
$sql_range = '';
|
$sql_range = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
$pager_sql = networkPager($a, $pager, $update);
|
$pager_sql = networkPager($a, $pager, $update);
|
||||||
|
|
||||||
|
@ -869,7 +869,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
$date_offset = $_GET['offset'];
|
$date_offset = $_GET['offset'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_string = $a->query_string;
|
$query_string = DI::args()->getQueryString();
|
||||||
if ($date_offset && !preg_match('/[?&].offset=/', $query_string)) {
|
if ($date_offset && !preg_match('/[?&].offset=/', $query_string)) {
|
||||||
$query_string .= '&offset=' . urlencode($date_offset);
|
$query_string .= '&offset=' . urlencode($date_offset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Friendica\Content\Nav;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ function notes_content(App $a, $update = false)
|
||||||
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
|
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
|
||||||
'contact-id'=> $a->contact['id']];
|
'contact-id'=> $a->contact['id']];
|
||||||
|
|
||||||
$pager = new Pager($a->query_string, 40);
|
$pager = new Pager(DI::args()->getQueryString(), 40);
|
||||||
|
|
||||||
$params = ['order' => ['created' => true],
|
$params = ['order' => ['created' => true],
|
||||||
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
|
|
|
@ -116,7 +116,7 @@ function notifications_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the pager
|
// Set the pager
|
||||||
$pager = new Pager($a->query_string, $perpage);
|
$pager = new Pager(DI::args()->getQueryString(), $perpage);
|
||||||
|
|
||||||
// Add additional informations (needed for json output)
|
// Add additional informations (needed for json output)
|
||||||
$notifs['items_page'] = $pager->getItemsPerPage();
|
$notifs['items_page'] = $pager->getItemsPerPage();
|
||||||
|
|
|
@ -984,7 +984,7 @@ function photos_content(App $a)
|
||||||
// ACL permissions box
|
// ACL permissions box
|
||||||
'$group_perms' => L10n::t('Show to Groups'),
|
'$group_perms' => L10n::t('Show to Groups'),
|
||||||
'$contact_perms' => L10n::t('Show to Contacts'),
|
'$contact_perms' => L10n::t('Show to Contacts'),
|
||||||
'$return_path' => $a->query_string,
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
@ -1008,7 +1008,7 @@ function photos_content(App $a)
|
||||||
$total = count($r);
|
$total = count($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string, 20);
|
$pager = new Pager(DI::args()->getQueryString(), 20);
|
||||||
|
|
||||||
/// @TODO I have seen this many times, maybe generalize it script-wide and encapsulate it?
|
/// @TODO I have seen this many times, maybe generalize it script-wide and encapsulate it?
|
||||||
$order_field = $_GET['order'] ?? '';
|
$order_field = $_GET['order'] ?? '';
|
||||||
|
@ -1030,7 +1030,7 @@ function photos_content(App $a)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($cmd === 'drop') {
|
if ($cmd === 'drop') {
|
||||||
$drop_url = $a->query_string;
|
$drop_url = DI::args()->getQueryString();
|
||||||
|
|
||||||
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
||||||
'$method' => 'post',
|
'$method' => 'post',
|
||||||
|
@ -1137,7 +1137,7 @@ function photos_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cmd === 'drop') {
|
if ($cmd === 'drop') {
|
||||||
$drop_url = $a->query_string;
|
$drop_url = DI::args()->getQueryString();
|
||||||
|
|
||||||
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
|
||||||
'$method' => 'post',
|
'$method' => 'post',
|
||||||
|
@ -1284,7 +1284,7 @@ function photos_content(App $a)
|
||||||
$condition = ["`parent` = ? AND `parent` != `id`", $link_item['parent']];
|
$condition = ["`parent` = ? AND `parent` != `id`", $link_item['parent']];
|
||||||
$total = DBA::count('item', $condition);
|
$total = DBA::count('item', $condition);
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
$result = Item::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params);
|
$result = Item::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params);
|
||||||
|
@ -1348,7 +1348,7 @@ function photos_content(App $a)
|
||||||
// ACL permissions box
|
// ACL permissions box
|
||||||
'$group_perms' => L10n::t('Show to Groups'),
|
'$group_perms' => L10n::t('Show to Groups'),
|
||||||
'$contact_perms' => L10n::t('Show to Contacts'),
|
'$contact_perms' => L10n::t('Show to Contacts'),
|
||||||
'$return_path' => $a->query_string,
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1371,7 +1371,7 @@ function photos_content(App $a)
|
||||||
'$likethis' => L10n::t("I like this \x28toggle\x29"),
|
'$likethis' => L10n::t("I like this \x28toggle\x29"),
|
||||||
'$nolike' => L10n::t("I don't like this \x28toggle\x29"),
|
'$nolike' => L10n::t("I don't like this \x28toggle\x29"),
|
||||||
'$wait' => L10n::t('Please wait'),
|
'$wait' => L10n::t('Please wait'),
|
||||||
'$return_path' => $a->query_string,
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1549,7 +1549,7 @@ function photos_content(App $a)
|
||||||
$total = count($r);
|
$total = count($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string, 20);
|
$pager = new Pager(DI::args()->getQueryString(), 20);
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`,
|
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`,
|
||||||
ANY_VALUE(`type`) AS `type`, ANY_VALUE(`album`) AS `album`, max(`scale`) AS `scale`,
|
ANY_VALUE(`type`) AS `type`, ANY_VALUE(`album`) AS `album`, max(`scale`) AS `scale`,
|
||||||
|
|
|
@ -80,7 +80,7 @@ function regmod_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
info(L10n::t('Please login.') . EOL);
|
info(L10n::t('Please login.') . EOL);
|
||||||
return Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 0 : 1);
|
return Login::form(DI::args()->getQueryString(), intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_site_admin() || !empty($_SESSION['submanage'])) {
|
if (!is_site_admin() || !empty($_SESSION['submanage'])) {
|
||||||
|
|
|
@ -1152,7 +1152,7 @@ function settings_content(App $a)
|
||||||
$private_post = 0;
|
$private_post = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_str = $a->query_string;
|
$query_str = DI::args()->getQueryString();
|
||||||
if (strpos($query_str, 'public=1') !== false) {
|
if (strpos($query_str, 'public=1') !== false) {
|
||||||
$query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
|
$query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ function suggest_content(App $a)
|
||||||
if (!empty($_GET['ignore'])) {
|
if (!empty($_GET['ignore'])) {
|
||||||
// <form> can't take arguments in its "action" parameter
|
// <form> can't take arguments in its "action" parameter
|
||||||
// so add any arguments as hidden inputs
|
// so add any arguments as hidden inputs
|
||||||
$query = explode_querystring($a->query_string);
|
$query = explode_querystring(DI::args()->getQueryString());
|
||||||
$inputs = [];
|
$inputs = [];
|
||||||
foreach ($query['args'] as $arg) {
|
foreach ($query['args'] as $arg) {
|
||||||
if (strpos($arg, 'confirm=') === false) {
|
if (strpos($arg, 'confirm=') === false) {
|
||||||
|
|
|
@ -212,7 +212,7 @@ function videos_content(App $a)
|
||||||
$total = count($r);
|
$total = count($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string, 20);
|
$pager = new Pager(DI::args()->getQueryString(), 20);
|
||||||
|
|
||||||
$r = q("SELECT hash, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`created`) AS `created`,
|
$r = q("SELECT hash, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`created`) AS `created`,
|
||||||
ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`filetype`) as `filetype`
|
ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`filetype`) as `filetype`
|
||||||
|
|
|
@ -40,8 +40,6 @@ use Psr\Log\LoggerInterface;
|
||||||
*/
|
*/
|
||||||
class App
|
class App
|
||||||
{
|
{
|
||||||
/** @deprecated 2019.09 - use App\Arguments->getQueryString() */
|
|
||||||
public $query_string;
|
|
||||||
/**
|
/**
|
||||||
* @var Page The current page environment
|
* @var Page The current page environment
|
||||||
*/
|
*/
|
||||||
|
@ -175,7 +173,6 @@ class App
|
||||||
$this->cmd = $args->getCommand();
|
$this->cmd = $args->getCommand();
|
||||||
$this->argv = $args->getArgv();
|
$this->argv = $args->getArgv();
|
||||||
$this->argc = $args->getArgc();
|
$this->argc = $args->getArgc();
|
||||||
$this->query_string = $args->getQueryString();
|
|
||||||
$this->module = $module->getName();
|
$this->module = $module->getName();
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
|
|
||||||
|
|
|
@ -1757,7 +1757,7 @@ class Contact
|
||||||
$cid, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()];
|
$cid, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
$params = ['order' => ['received' => true],
|
$params = ['order' => ['received' => true],
|
||||||
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
|
|
|
@ -144,7 +144,7 @@ class Profile
|
||||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
|
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
|
||||||
|
|
||||||
if (!DBA::isResult($user) && empty($profiledata)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ class Profile
|
||||||
$pdata = self::getByNickname($nickname, $user['uid'], $profile);
|
$pdata = self::getByNickname($nickname, $user['uid'], $profile);
|
||||||
|
|
||||||
if (empty($pdata) && empty($profiledata)) {
|
if (empty($pdata) && empty($profiledata)) {
|
||||||
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
|
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1077,7 +1077,7 @@ class Profile
|
||||||
|
|
||||||
// Remove the "addr" parameter from the destination. It is later added as separate parameter again.
|
// Remove the "addr" parameter from the destination. It is later added as separate parameter again.
|
||||||
$addr_request = 'addr=' . urlencode($addr);
|
$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.
|
// The other instance needs to know where to redirect.
|
||||||
$dest = urlencode(DI::baseUrl()->get() . '/' . $query);
|
$dest = urlencode(DI::baseUrl()->get() . '/' . $query);
|
||||||
|
@ -1164,7 +1164,7 @@ class Profile
|
||||||
|
|
||||||
$arr = [
|
$arr = [
|
||||||
'visitor' => $visitor,
|
'visitor' => $visitor,
|
||||||
'url' => $a->query_string
|
'url' => DI::args()->getQueryString()
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* @hooks magic_auth_success
|
* @hooks magic_auth_success
|
||||||
|
|
|
@ -46,13 +46,11 @@ class Contact extends BaseAdminModule
|
||||||
{
|
{
|
||||||
parent::content($parameters);
|
parent::content($parameters);
|
||||||
|
|
||||||
$a = DI::app();
|
|
||||||
|
|
||||||
$condition = ['uid' => 0, 'blocked' => true];
|
$condition = ['uid' => 0, 'blocked' => true];
|
||||||
|
|
||||||
$total = DBA::count('contact', $condition);
|
$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()]]);
|
$contacts = Model\Contact::selectToArray([], $condition, ['limit' => [$pager->getStart(), $pager->getItemsPerPage()]]);
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ class Users extends BaseAdminModule
|
||||||
/* get pending */
|
/* get pending */
|
||||||
$pending = Register::getPending();
|
$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 = '+')
|
// @TODO Move below block to Model\User::getUsers($start, $count, $order = 'contact.name', $order_direction = '+')
|
||||||
$valid_orders = [
|
$valid_orders = [
|
||||||
|
|
|
@ -49,7 +49,7 @@ class AllFriends extends BaseModule
|
||||||
|
|
||||||
$total = Model\GContact::countAllFriends(local_user(), $cid);
|
$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());
|
$friends = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
|
||||||
if (empty($friends)) {
|
if (empty($friends)) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ abstract class BaseAdminModule extends BaseModule
|
||||||
|
|
||||||
if (!is_site_admin()) {
|
if (!is_site_admin()) {
|
||||||
notice(L10n::t('Please login to continue.'));
|
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');
|
DI::baseUrl()->redirect('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Bookmarklet extends BaseModule
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
$output = '<h2>' . L10n::t('Login') . '</h2>';
|
$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;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -425,7 +425,7 @@ class Contact extends BaseModule
|
||||||
if (!empty($_REQUEST['confirm'])) {
|
if (!empty($_REQUEST['confirm'])) {
|
||||||
// <form> can't take arguments in its 'action' parameter
|
// <form> can't take arguments in its 'action' parameter
|
||||||
// so add any arguments as hidden inputs
|
// so add any arguments as hidden inputs
|
||||||
$query = explode_querystring($a->query_string);
|
$query = explode_querystring(DI::args()->getQueryString());
|
||||||
$inputs = [];
|
$inputs = [];
|
||||||
foreach ($query['args'] as $arg) {
|
foreach ($query['args'] as $arg) {
|
||||||
if (strpos($arg, 'confirm=') === false) {
|
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'])) {
|
if (!empty($a->data['contact']) && is_array($a->data['contact'])) {
|
||||||
$contact = $a->data['contact'];
|
$contact = $a->data['contact'];
|
||||||
|
@ -776,7 +776,7 @@ class Contact extends BaseModule
|
||||||
if (DBA::isResult($r)) {
|
if (DBA::isResult($r)) {
|
||||||
$total = $r[0]['total'];
|
$total = $r[0]['total'];
|
||||||
}
|
}
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
|
|
||||||
$contacts = [];
|
$contacts = [];
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class Directory extends BaseModule
|
||||||
$gDirPath = Profile::zrl($dirURL, true);
|
$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);
|
$profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
|
||||||
|
|
||||||
|
|
|
@ -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 = '';
|
$content = '';
|
||||||
Hook::callAll('home_content', $content);
|
Hook::callAll('home_content', $content);
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Objects extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ActivityPub::isRequest()) {
|
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
|
/// @todo Add Authentication to enable fetching of non public content
|
||||||
|
|
|
@ -258,7 +258,7 @@ class Profile extends BaseModule
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$pager = new Pager($a->query_string);
|
$pager = new Pager(DI::args()->getQueryString());
|
||||||
} else {
|
} else {
|
||||||
$sql_post_table = "";
|
$sql_post_table = "";
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ class Profile extends BaseModule
|
||||||
$itemspage_network = $a->force_max_items;
|
$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());
|
$pager_sql = sprintf(" LIMIT %d, %d ", $pager->getStart(), $pager->getItemsPerPage());
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Contacts extends BaseModule
|
||||||
|
|
||||||
$total = DBA::count('contact', $condition);
|
$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()]];
|
$params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Login extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($return_path)) {
|
if (is_null($return_path)) {
|
||||||
$return_path = $a->query_string;
|
$return_path = DI::args()->getQueryString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
|
|
|
@ -890,7 +890,7 @@ class Post
|
||||||
|
|
||||||
$template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
|
$template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
|
||||||
$comment_box = Renderer::replaceMacros($template, [
|
$comment_box = Renderer::replaceMacros($template, [
|
||||||
'$return_path' => $a->query_string,
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
'$threaded' => $this->isThreaded(),
|
'$threaded' => $this->isThreaded(),
|
||||||
'$jsreload' => '',
|
'$jsreload' => '',
|
||||||
'$wall' => ($conv->getMode() === 'profile'),
|
'$wall' => ($conv->getMode() === 'profile'),
|
||||||
|
|
Loading…
Reference in a new issue