aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciano Lima <lucianomlima@ymail.com>2013-01-29 23:32:39 -0300
committerCash Costello <cash.costello@gmail.com>2013-01-30 07:28:15 -0500
commit5079efbd59324e28aeb29b7ebbe5c4e069885bb4 (patch)
tree73555c0c00393b99245121e24c98924ba8ed6001
parent684ad918a53307e18248c4e52f9405d3a787051d (diff)
downloadelgg-5079efbd59324e28aeb29b7ebbe5c4e069885bb4.tar.gz
elgg-5079efbd59324e28aeb29b7ebbe5c4e069885bb4.tar.bz2
Check if the is a valid viewtype
Signed-off-by: Luciano Lima <lucianomlima@ymail.com>
-rw-r--r--engine/lib/web_services.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/engine/lib/web_services.php b/engine/lib/web_services.php
index c8e4a13cc..1a15ecc15 100644
--- a/engine/lib/web_services.php
+++ b/engine/lib/web_services.php
@@ -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");