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

This commit is contained in:
Philipp Holzer 2019-12-16 01:30:34 +01:00
commit e6f61c2cc7
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
33 changed files with 63 additions and 66 deletions

View file

@ -291,22 +291,22 @@ function api_call(App $a)
global $API, $called_api;
$type = "json";
if (strpos($a->query_string, ".xml") > 0) {
if (strpos(DI::args()->getQueryString(), ".xml") > 0) {
$type = "xml";
}
if (strpos($a->query_string, ".json") > 0) {
if (strpos(DI::args()->getQueryString(), ".json") > 0) {
$type = "json";
}
if (strpos($a->query_string, ".rss") > 0) {
if (strpos(DI::args()->getQueryString(), ".rss") > 0) {
$type = "rss";
}
if (strpos($a->query_string, ".atom") > 0) {
if (strpos(DI::args()->getQueryString(), ".atom") > 0) {
$type = "atom";
}
try {
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'])) {
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();
} catch (HTTPException $e) {
header("HTTP/1.1 {$e->getCode()} {$e->httpdesc}");
@ -389,7 +389,7 @@ function api_error($type, $e)
$error = ["error" => $error,
"code" => $e->getCode() . " " . $e->httpdesc,
"request" => $a->query_string];
"request" => DI::args()->getQueryString()];
$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['$rss'] = [
'alternate' => $user_info['url'],
'self' => System::baseUrl() . "/" . $a->query_string,
'self' => System::baseUrl() . "/" . DI::args()->getQueryString(),
'base' => System::baseUrl(),
'updated' => api_date(null),
'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),

View file

@ -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);
if (!$update) {
$_SESSION['return_path'] = $a->query_string;
$_SESSION['return_path'] = DI::args()->getQueryString();
}
$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, [
'$baseurl' => System::baseUrl($ssl_state),
'$return_path' => $a->query_string,
'$return_path' => DI::args()->getQueryString(),
'$live_update' => $live_update_div,
'$remove' => L10n::t('remove'),
'$mode' => $mode,
@ -1193,7 +1193,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
$private_post = 0;
}
$query_str = $a->query_string;
$query_str = DI::args()->getQueryString();
if (strpos($query_str, 'public=1') !== false) {
$query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
}

View file

@ -368,7 +368,7 @@ function drop_item($id, $return = '')
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) {