55
55
* 07/07/2020 - class declaration changed to PHP5-7
56
56
* 07/07/2020 - undefined var fix
57
57
* 02/10/2020 - removed using of globals array
58
+ * 22/01/2021 - $HTTP_SERVER_VARS replaced with $_SERVER
58
59
*/
59
60
60
61
/* load classes
@@ -3625,14 +3626,14 @@ function __construct($wsdl=false){
3625
3626
parent ::nusoap_base ();
3626
3627
// turn on debugging?
3627
3628
global $ debug ;
3628
- global $ HTTP_SERVER_VARS ;
3629
+ global $ _SERVER ;
3629
3630
3630
3631
if (isset ($ _SERVER )) {
3631
3632
$ this ->debug ("_SERVER is defined: " );
3632
3633
$ this ->appendDebug ($ this ->varDump ($ _SERVER ));
3633
- } elseif (isset ($ HTTP_SERVER_VARS )) {
3634
+ } elseif (isset ($ _SERVER )) {
3634
3635
$ this ->debug ("HTTP_SERVER_VARS is defined: " );
3635
- $ this ->appendDebug ($ this ->varDump ($ HTTP_SERVER_VARS ));
3636
+ $ this ->appendDebug ($ this ->varDump ($ _SERVER ));
3636
3637
} else {
3637
3638
$ this ->debug ("Neither _SERVER nor HTTP_SERVER_VARS is defined. " );
3638
3639
}
@@ -3648,8 +3649,8 @@ function __construct($wsdl=false){
3648
3649
$ this ->debug_flag = substr ($ v , 6 );
3649
3650
}
3650
3651
}
3651
- } elseif (isset ($ HTTP_SERVER_VARS ['QUERY_STRING ' ])) {
3652
- $ qs = explode ('& ' , $ HTTP_SERVER_VARS ['QUERY_STRING ' ]);
3652
+ } elseif (isset ($ _SERVER ['QUERY_STRING ' ])) {
3653
+ $ qs = explode ('& ' , $ _SERVER ['QUERY_STRING ' ]);
3653
3654
foreach ($ qs as $ v ) {
3654
3655
if (substr ($ v , 0 , 6 ) == 'debug= ' ) {
3655
3656
$ this ->debug ("In nusoap_server, set debug_flag= " . substr ($ v , 6 ) . " based on query string #2 " );
@@ -3681,24 +3682,24 @@ function __construct($wsdl=false){
3681
3682
/**
3682
3683
* processes request and returns response
3683
3684
*
3684
- * @param string $data usually is the value of $HTTP_RAW_POST_DATA
3685
+ * @param string $data usually is the value of POST data
3685
3686
* @access public
3686
3687
*/
3687
3688
function service ($ data ){
3688
- global $ HTTP_SERVER_VARS ;
3689
+ global $ _SERVER ;
3689
3690
3690
3691
if (isset ($ _SERVER ['REQUEST_METHOD ' ])) {
3691
3692
$ rm = $ _SERVER ['REQUEST_METHOD ' ];
3692
- } elseif (isset ($ HTTP_SERVER_VARS ['REQUEST_METHOD ' ])) {
3693
- $ rm = $ HTTP_SERVER_VARS ['REQUEST_METHOD ' ];
3693
+ } elseif (isset ($ _SERVER ['REQUEST_METHOD ' ])) {
3694
+ $ rm = $ _SERVER ['REQUEST_METHOD ' ];
3694
3695
} else {
3695
3696
$ rm = '' ;
3696
3697
}
3697
3698
3698
3699
if (isset ($ _SERVER ['QUERY_STRING ' ])) {
3699
3700
$ qs = $ _SERVER ['QUERY_STRING ' ];
3700
- } elseif (isset ($ HTTP_SERVER_VARS ['QUERY_STRING ' ])) {
3701
- $ qs = $ HTTP_SERVER_VARS ['QUERY_STRING ' ];
3701
+ } elseif (isset ($ _SERVER ['QUERY_STRING ' ])) {
3702
+ $ qs = $ _SERVER ['QUERY_STRING ' ];
3702
3703
} else {
3703
3704
$ qs = '' ;
3704
3705
}
@@ -3769,7 +3770,7 @@ function service($data){
3769
3770
* @access private
3770
3771
*/
3771
3772
function parse_http_headers () {
3772
- global $ HTTP_SERVER_VARS ;
3773
+ global $ _SERVER ;
3773
3774
3774
3775
$ this ->request = '' ;
3775
3776
$ this ->SOAPAction = '' ;
@@ -3832,9 +3833,9 @@ function parse_http_headers() {
3832
3833
$ this ->request .= "$ k: $ v \r\n" ;
3833
3834
$ this ->debug ("$ k: $ v " );
3834
3835
}
3835
- } elseif (is_array ($ HTTP_SERVER_VARS )) {
3836
+ } elseif (is_array ($ _SERVER )) {
3836
3837
$ this ->debug ("In parse_http_headers, use HTTP_SERVER_VARS " );
3837
- foreach ($ HTTP_SERVER_VARS as $ k => $ v ) {
3838
+ foreach ($ _SERVER as $ k => $ v ) {
3838
3839
if (substr ($ k , 0 , 5 ) == 'HTTP_ ' ) {
3839
3840
$ k = str_replace (' ' , '- ' , strtolower (str_replace ('_ ' , ' ' , substr ($ k , 5 )))); $ k = strtolower (substr ($ k , 5 ));
3840
3841
} else {
@@ -4409,7 +4410,7 @@ function add_to_map($methodname,$in,$out){
4409
4410
* @access public
4410
4411
*/
4411
4412
function register ($ name ,$ in =array (),$ out =array (),$ namespace =false ,$ soapaction =false ,$ style =false ,$ use =false ,$ documentation ='' ,$ encodingStyle ='' ){
4412
- global $ HTTP_SERVER_VARS ;
4413
+ global $ _SERVER ;
4413
4414
4414
4415
if ($ this ->externalWSDLURL ){
4415
4416
die ('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL. ' );
@@ -4429,11 +4430,11 @@ function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=fa
4429
4430
if (isset ($ _SERVER )) {
4430
4431
$ SERVER_NAME = $ _SERVER ['SERVER_NAME ' ];
4431
4432
$ SCRIPT_NAME = isset ($ _SERVER ['PHP_SELF ' ]) ? $ _SERVER ['PHP_SELF ' ] : $ _SERVER ['SCRIPT_NAME ' ];
4432
- $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : (isset ($ HTTP_SERVER_VARS ['HTTPS ' ]) ? $ HTTP_SERVER_VARS ['HTTPS ' ] : 'off ' );
4433
- } elseif (isset ($ HTTP_SERVER_VARS )) {
4434
- $ SERVER_NAME = $ HTTP_SERVER_VARS ['SERVER_NAME ' ];
4435
- $ SCRIPT_NAME = isset ($ HTTP_SERVER_VARS ['PHP_SELF ' ]) ? $ HTTP_SERVER_VARS ['PHP_SELF ' ] : $ HTTP_SERVER_VARS ['SCRIPT_NAME ' ];
4436
- $ HTTPS = isset ($ HTTP_SERVER_VARS ['HTTPS ' ]) ? $ HTTP_SERVER_VARS ['HTTPS ' ] : 'off ' ;
4433
+ $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : (isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : 'off ' );
4434
+ } elseif (isset ($ _SERVER )) {
4435
+ $ SERVER_NAME = $ _SERVER ['SERVER_NAME ' ];
4436
+ $ SCRIPT_NAME = isset ($ _SERVER ['PHP_SELF ' ]) ? $ _SERVER ['PHP_SELF ' ] : $ _SERVER ['SCRIPT_NAME ' ];
4437
+ $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : 'off ' ;
4437
4438
} else {
4438
4439
$ this ->setError ("Neither _SERVER nor HTTP_SERVER_VARS is available " );
4439
4440
}
@@ -4498,18 +4499,18 @@ function fault($faultcode,$faultstring,$faultactor='',$faultdetail=''){
4498
4499
*/
4499
4500
function configureWSDL ($ serviceName ,$ namespace = false ,$ endpoint = false ,$ style ='rpc ' , $ transport = 'http://schemas.xmlsoap.org/soap/http ' , $ schemaTargetNamespace = false )
4500
4501
{
4501
- global $ HTTP_SERVER_VARS ;
4502
+ global $ _SERVER ;
4502
4503
4503
4504
if (isset ($ _SERVER )) {
4504
4505
$ SERVER_NAME = $ _SERVER ['SERVER_NAME ' ];
4505
4506
$ SERVER_PORT = $ _SERVER ['SERVER_PORT ' ];
4506
4507
$ SCRIPT_NAME = isset ($ _SERVER ['PHP_SELF ' ]) ? $ _SERVER ['PHP_SELF ' ] : $ _SERVER ['SCRIPT_NAME ' ];
4507
- $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : (isset ($ HTTP_SERVER_VARS ['HTTPS ' ]) ? $ HTTP_SERVER_VARS ['HTTPS ' ] : 'off ' );
4508
- } elseif (isset ($ HTTP_SERVER_VARS )) {
4509
- $ SERVER_NAME = $ HTTP_SERVER_VARS ['SERVER_NAME ' ];
4510
- $ SERVER_PORT = $ HTTP_SERVER_VARS ['SERVER_PORT ' ];
4511
- $ SCRIPT_NAME = isset ($ HTTP_SERVER_VARS ['PHP_SELF ' ]) ? $ HTTP_SERVER_VARS ['PHP_SELF ' ] : $ HTTP_SERVER_VARS ['SCRIPT_NAME ' ];
4512
- $ HTTPS = isset ($ HTTP_SERVER_VARS ['HTTPS ' ]) ? $ HTTP_SERVER_VARS ['HTTPS ' ] : 'off ' ;
4508
+ $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : (isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : 'off ' );
4509
+ } elseif (isset ($ _SERVER )) {
4510
+ $ SERVER_NAME = $ _SERVER ['SERVER_NAME ' ];
4511
+ $ SERVER_PORT = $ _SERVER ['SERVER_PORT ' ];
4512
+ $ SCRIPT_NAME = isset ($ _SERVER ['PHP_SELF ' ]) ? $ _SERVER ['PHP_SELF ' ] : $ _SERVER ['SCRIPT_NAME ' ];
4513
+ $ HTTPS = isset ($ _SERVER ['HTTPS ' ]) ? $ _SERVER ['HTTPS ' ] : 'off ' ;
4513
4514
} else {
4514
4515
$ this ->setError ("Neither _SERVER nor HTTP_SERVER_VARS is available " );
4515
4516
}
@@ -5326,12 +5327,12 @@ function getTypeDef($type, $ns) {
5326
5327
* @access private
5327
5328
*/
5328
5329
function webDescription (){
5329
- global $ HTTP_SERVER_VARS ;
5330
+ global $ _SERVER ;
5330
5331
5331
5332
if (isset ($ _SERVER )) {
5332
5333
$ PHP_SELF = $ _SERVER ['PHP_SELF ' ];
5333
- } elseif (isset ($ HTTP_SERVER_VARS )) {
5334
- $ PHP_SELF = $ HTTP_SERVER_VARS ['PHP_SELF ' ];
5334
+ } elseif (isset ($ _SERVER )) {
5335
+ $ PHP_SELF = $ _SERVER ['PHP_SELF ' ];
5335
5336
} else {
5336
5337
$ this ->setError ("Neither _SERVER nor HTTP_SERVER_VARS is available " );
5337
5338
}
0 commit comments