]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Check if the is a valid viewtype
authorLuciano Lima <lucianomlima@ymail.com>
Wed, 30 Jan 2013 02:32:39 +0000 (23:32 -0300)
committerCash Costello <cash.costello@gmail.com>
Wed, 30 Jan 2013 12:28:15 +0000 (07:28 -0500)
Signed-off-by: Luciano Lima <lucianomlima@ymail.com>
engine/lib/web_services.php

index c8e4a13cc1ccede4462b816b0ad9ec539792f85b..1a15ecc15c0df6e8a8796c182c50539ce9d55ed7 100644 (file)
@@ -1268,10 +1268,10 @@ function service_handler($handler, $request) {
 
        // after the handler, the first identifier is response format
        // ex) http://example.org/services/api/rest/xml/?method=test
-       $reponse_format = array_shift($request);
+       $response_format = array_shift($request);
        // Which view - xml, json, ...
-       if ($reponse_format) {
-               elgg_set_viewtype($reponse_format);
+       if ($response_format && elgg_is_valid_view_type($response_format)) {
+               elgg_set_viewtype($response_format);
        } else {
                // default to xml
                elgg_set_viewtype("xml");