From ebd5c75e33b92f65f54977b0ea4a5afd9c622ba4 Mon Sep 17 00:00:00 2001 From: taggon Date: Wed, 23 Nov 2011 02:31:07 +0000 Subject: [PATCH] Fixed a bug for setRequestMethod() git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9859 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 06b3c9817..fbcdf4f0a 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -644,15 +644,15 @@ class Context { /** * @brief determine request method (GET/POST/XMLRPC/JSON) - * @param[in] $type request method + * @param[in] $type request method (optional) * @return none **/ - function setRequestMethod($type) { + function setRequestMethod($type='') { is_a($this,'Context')?$self=&$this:$self=&Context::getInstance(); ($type && $self->request_method=$type) or - (strpos($_SERVER['CONTENT_TYPE'],'json') && $this->request_method='JSON') or - ($GLOBALS['HTTP_RAW_POST_DATA'] && $this->request_method='XMLRPC') or + (strpos($_SERVER['CONTENT_TYPE'],'json') && $self->request_method='JSON') or + ($GLOBALS['HTTP_RAW_POST_DATA'] && $self->request_method='XMLRPC') or ($self->request_method = $_SERVER['REQUEST_METHOD']); }