]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fallback to json in web services
authorCash Costello <cash.costello@gmail.com>
Sun, 10 Mar 2013 16:19:05 +0000 (12:19 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 10 Mar 2013 16:19:05 +0000 (12:19 -0400)
CHANGES.txt
engine/lib/web_services.php

index fd9d0eef65f5c0e0321df40954128553d2b9bdb1..130d0652dd55074bdf775c814c0d3f42d87510a2 100644 (file)
@@ -1,6 +1,7 @@
 Version 1.8.14
-(X xx, 2013 from https://github.com/Elgg/Elgg/tree/1.8)
+(March xx, 2013 from https://github.com/Elgg/Elgg/tree/1.8)
   Contributing Developers:
+   * Cash Costello
    * Luciano Lima
    * PaweÅ‚ Sroka
 
@@ -8,7 +9,7 @@ Version 1.8.14
    *
 
   Enhancements:
-   * Web services fall back to xml if the viewtype is invalid
+   * Web services fall back to json if the viewtype is invalid
 
 
 Version 1.8.13
index b6289184af863f3901e286b47f6264d3ed0be0ab..b440e3afbc905a910e2e08e80325d5ff8fc5369a 100644 (file)
@@ -1267,14 +1267,14 @@ function service_handler($handler, $request) {
        $request = explode('/', $request);
 
        // after the handler, the first identifier is response format
-       // ex) http://example.org/services/api/rest/xml/?method=test
+       // ex) http://example.org/services/api/rest/json/?method=test
        $response_format = array_shift($request);
        // Which view - xml, json, ...
        if ($response_format && elgg_is_valid_view_type($response_format)) {
                elgg_set_viewtype($response_format);
        } else {
-               // default to xml
-               elgg_set_viewtype("xml");
+               // default to json
+               elgg_set_viewtype("json");
        }
 
        if (!isset($CONFIG->servicehandler) || empty($handler)) {