]> git.mxchange.org Git - friendica.git/commitdiff
Use Arguments->getCommand() where it makes more sense than getQueryString()
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 9 Sep 2020 04:15:25 +0000 (00:15 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 12 Sep 2020 13:09:15 +0000 (09:09 -0400)
- Remove a couple of intermediary query string variables

include/api.php
include/conversation.php
mod/network.php
src/Module/BaseApi.php

index 5ae4754b57c9ed80ddaf3b3d01372a30651e750a..643f57b63416f13cc7b6a4c5ae5da3fe44b07cb2 100644 (file)
@@ -311,22 +311,22 @@ function api_call(App $a, App\Arguments $args = null)
        }
 
        $type = "json";
-       if (strpos($args->getQueryString(), ".xml") > 0) {
+       if (strpos($args->getCommand(), ".xml") > 0) {
                $type = "xml";
        }
-       if (strpos($args->getQueryString(), ".json") > 0) {
+       if (strpos($args->getCommand(), ".json") > 0) {
                $type = "json";
        }
-       if (strpos($args->getQueryString(), ".rss") > 0) {
+       if (strpos($args->getCommand(), ".rss") > 0) {
                $type = "rss";
        }
-       if (strpos($args->getQueryString(), ".atom") > 0) {
+       if (strpos($args->getCommand(), ".atom") > 0) {
                $type = "atom";
        }
 
        try {
                foreach ($API as $p => $info) {
-                       if (strpos($args->getQueryString(), $p) === 0) {
+                       if (strpos($args->getCommand(), $p) === 0) {
                                if (!api_check_method($info['method'])) {
                                        throw new MethodNotAllowedException();
                                }
index 4afc7c699d3a8e2eb75824e7e13cb8b58cca3945..bd1e0382294101e448e4d5908d746070965dfdd3 100644 (file)
@@ -1148,17 +1148,12 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
        $jotplugins = '';
        Hook::callAll('jot_tool', $jotplugins);
 
-       $query_str = DI::args()->getQueryString();
-       if (strpos($query_str, 'public=1') !== false) {
-               $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
-       }
-
        // $tpl = Renderer::replaceMacros($tpl,array('$jotplugins' => $jotplugins));
        $tpl = Renderer::getMarkupTemplate("jot.tpl");
 
        $o .= Renderer::replaceMacros($tpl,[
                '$new_post' => DI::l10n()->t('New Post'),
-               '$return_path'  => $query_str,
+               '$return_path'  => DI::args()->getQueryString(),
                '$action'       => 'item',
                '$share'        => ($x['button'] ?? '') ?: DI::l10n()->t('Share'),
                '$loading'      => DI::l10n()->t('Loading...'),
index 48f250e44c02fedc1d2f2ada4c02de1e4597bd16..60bb409e32701b6c2001f77ea4c3b67b6ce972e4 100644 (file)
@@ -635,9 +635,7 @@ function network_display_post($a, $pager, $mark_all, $update, $ordering, $items)
                $parents_str = implode(', ', $parents_arr);
        }
 
-       $query_string = DI::args()->getQueryString();
-
-       $pager->setQueryString($query_string);
+       $pager->setQueryString(DI::args()->getQueryString());
 
        // We aren't going to try and figure out at the item, group, and page
        // level which items you've seen and which you haven't. If you're looking
index 5a5326756dcb17b47badbccf3b06b85fe9845551..75791e0eaede651156833081163ad606495aa6db 100644 (file)
@@ -42,13 +42,13 @@ class BaseApi extends BaseModule
        {
                $arguments = DI::args();
 
-               if (substr($arguments->getQueryString(), -4) === '.xml') {
+               if (substr($arguments->getCommand(), -4) === '.xml') {
                        self::$format = 'xml';
                }
-               if (substr($arguments->getQueryString(), -4) === '.rss') {
+               if (substr($arguments->getCommand(), -4) === '.rss') {
                        self::$format = 'rss';
                }
-               if (substr($arguments->getQueryString(), -4) === '.atom') {
+               if (substr($arguments->getCommand(), -4) === '.atom') {
                        self::$format = 'atom';
                }
        }