]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Remove api test pconfig debug
[friendica.git] / include / api.php
index ad991485a4da241e0c536d0746f2e85f98c8fd0c..d307afa953639ed65a4bbe15e015f090cc23cda0 100644 (file)
@@ -169,7 +169,8 @@ function api_login(App $a)
        $oauth1 = new FKOAuth1();
        // login with oauth
        try {
-               list($consumer, $token) = $oauth1->verify_request(OAuthRequest::from_request());
+               $request = OAuthRequest::from_request();
+               list($consumer, $token) = $oauth1->verify_request($request);
                if (!is_null($token)) {
                        $oauth1->loginUser($token->uid);
                        Addon::callHooks('logged_in', $a->user);
@@ -579,7 +580,9 @@ function api_get_user(App $a, $contact_id = null)
        // $called_api is the API path exploded on / and is expected to have at least 2 elements
        if (is_null($user) && ($a->argc > (count($called_api) - 1)) && (count($called_api) > 0)) {
                $argid = count($called_api);
-               list($user, $null) = explode(".", $a->argv[$argid]);
+               if (!empty($a->argv[$argid])) {
+                       list($user, $null) = explode(".", $a->argv[$argid]);
+               }
                if (is_numeric($user)) {
                        $user = dbesc(api_unique_id_to_nurl(intval($user)));
 
@@ -769,6 +772,7 @@ function api_get_user(App $a, $contact_id = null)
                $theme_info = dba::selectFirst('user', ['theme'], ['uid' => $ret['uid']]);
                if ($theme_info['theme'] === 'frio') {
                        $schema = PConfig::get($ret['uid'], 'frio', 'schema');
+
                        if ($schema && ($schema != '---')) {
                                if (file_exists('view/theme/frio/schema/'.$schema.'.php')) {
                                        $schemefile = 'view/theme/frio/schema/'.$schema.'.php';
@@ -4532,7 +4536,7 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
        $owner_record = q("SELECT * FROM `contact` WHERE `uid`= %d AND `self` LIMIT 1", intval(api_user()));
 
        $arr = [];
-       $arr['guid']          = get_guid(32);
+       $arr['guid']          = System::createGUID(32);
        $arr['uid']           = intval(api_user());
        $arr['uri']           = $uri;
        $arr['parent-uri']    = $uri;