]> git.mxchange.org Git - friendica.git/commitdiff
api post broken with recent change to use REQUEST vars in mod_item
authorfriendica <info@friendica.com>
Sun, 15 Jan 2012 21:57:00 +0000 (13:57 -0800)
committerfriendica <info@friendica.com>
Sun, 15 Jan 2012 21:57:00 +0000 (13:57 -0800)
boot.php
include/api.php
mod/item.php

index 1c20bebc5c393224f523ff8d4ee52bd80e59e571..f37696ffadeae6a0df96d28f930cdfabe62857b0 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1224' );
+define ( 'FRIENDICA_VERSION',      '2.3.1227' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
 define ( 'DB_UPDATE_VERSION',      1115      );
 
index aa05f0ad5e605f29b19c32fc02e0e1309ea8833d..08b28265c42a1d622e900cb019ba48d71ef1bce5 100644 (file)
@@ -26,6 +26,7 @@
        /**
         * Simple HTTP Login
         */
+
        function api_login(&$a){
                // login with oauth
                try{
@@ -56,7 +57,7 @@
 
                if (!isset($_SERVER['PHP_AUTH_USER'])) {
                   logger('API_login: ' . print_r($_SERVER,true), LOGGER_DEBUG);
-                   header('WWW-Authenticate: Basic realm="Friendika"');
+                   header('WWW-Authenticate: Basic realm="Friendica"');
                    header('HTTP/1.0 401 Unauthorized');
                    die('This api requires login');
                }
 
        // TODO - media uploads
        function api_statuses_update(&$a, $type) {
-               if (local_user()===false) return false;
+               if (local_user()===false) {
+                       logger('api_statuses_update: no user');
+                       return false;
+               }
                $user_info = api_get_user($a);
 
                // convert $_POST array items to the form we use for web posts.
                                $purifier = new HTMLPurifier($config);
                                $txt = $purifier->purify($txt);
 
-                               $_POST['body'] = html2bbcode($txt);
+                               $_REQUEST['body'] = html2bbcode($txt);
                        }
 
                }
                else
-                       $_POST['body'] = urldecode(requestdata('status'));
+                       $_REQUEST['body'] = urldecode(requestdata('status'));
 
                $parent = requestdata('in_reply_to_status_id');
                if(ctype_digit($parent))
-                       $_POST['parent'] = $parent;
+                       $_REQUEST['parent'] = $parent;
                else
-                       $_POST['parent_uri'] = $parent;
+                       $_REQUEST['parent_uri'] = $parent;
 
                if(requestdata('lat') && requestdata('long'))
-                       $_POST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
-               $_POST['profile_uid'] = local_user();
+                       $_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
+               $_REQUEST['profile_uid'] = local_user();
                if(requestdata('parent'))
-                       $_POST['type'] = 'net-comment';
+                       $_REQUEST['type'] = 'net-comment';
                else
-                       $_POST['type'] = 'wall';
+                       $_REQUEST['type'] = 'wall';
 
                // set this so that the item_post() function is quiet and doesn't redirect or emit json
 
-               $_POST['api_source'] = true;
+               $_REQUEST['api_source'] = true;
 
                // call out normal post function
 
index b5db29db0795a6ab758c9d929799e2f1cdc26b89..f7eb0961c84ccd4eda86033bf84fe2d5d9ed95fd 100644 (file)
@@ -38,7 +38,7 @@ function item_post(&$a) {
 
        call_hooks('post_local_start', $_REQUEST);
 //     logger('postinput ' . file_get_contents('php://input'));
-       logger('postvars' . print_r($_REQUEST,true), LOGGER_DATA);
+       logger('postvars ' . print_r($_REQUEST,true), LOGGER_DATA);
 
        $api_source = ((x($_REQUEST,'api_source') && $_REQUEST['api_source']) ? true : false);
        $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');