Fixed a bug for setRequestMethod()

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9859 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-11-23 02:31:07 +00:00
parent 7ee45e57c7
commit ebd5c75e33

View file

@ -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']);
}