Skip to content

Commit

Permalink
Fix undefined access to $l_oServer
Browse files Browse the repository at this point in the history
  • Loading branch information
rombert committed Dec 16, 2012
1 parent 0dfe254 commit dcc0fbe
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions api/soap/mantisconnect.php
Expand Up @@ -31,14 +31,8 @@
/**
* Checks if the request for the webservice is a documentation request (eg:
* WSDL) or an actual webservice call.
*
* The implementation of this method is based on soap_server::service() and
* adapted to work independent of the usage of nusoap
*
* @param $p_service The webservice class instance.
* @param $p_data The input that is based on the post data.
*/
function mci_is_webservice_call( $p_service, $p_data )
function mci_is_webservice_call()
{
global $QUERY_STRING;
global $_SERVER;
Expand All @@ -53,14 +47,12 @@ function mci_is_webservice_call( $p_service, $p_data )

if ( isset( $t_qs ) && preg_match( '/wsdl/', $t_qs ) ){
return false;
} else if ( $p_data == '' && isset ( $p_service) && $p_service->wsdl ) {
return false;
} else {
return true;
}
}

if ( !mci_is_webservice_call( $l_oServer, $t_input ) ) {
if ( !mci_is_webservice_call() ) {
# if we have a documentation request, do some tidy up to prevent lame bot loops e.g. /mantisconnect.php/mc_enum_etas/mc_project_get_versions/
$parts = explode ( 'mantisconnect.php/', strtolower($_SERVER['SCRIPT_NAME'] ), 2 );
if (isset( $parts[1] ) && (strlen ( $parts[1] ) > 0 ) ) {
Expand Down Expand Up @@ -107,7 +99,7 @@ function mci_is_webservice_call( $p_service, $p_data )
# only include the MantisBT / MantisConnect related files, if the current
# request is a webservice call (rather than webservice documentation request,
# eg: WSDL).
if ( mci_is_webservice_call( $l_oServer, $t_input ) ) {
if ( mci_is_webservice_call() ) {
require_once( 'mc_core.php' );
} else {
# if we have a documentation request, do some tidy up to prevent lame bot loops e.g. /mantisconnect.php/mc_enum_etas/mc_project_get_versions/
Expand Down

0 comments on commit dcc0fbe

Please sign in to comment.