Skip to content

Commit 779ea3d

Browse files
committed
Update index.php
1 parent 6722558 commit 779ea3d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function parse_input($config, $request_headers, $request_data, $context_path, $q
249249
}
250250

251251
// Get Random
252-
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && startsWith(trim($arr2[1]), '$SYSTEM.RANDOM'))
252+
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && stripos(trim($arr2[1]), '$SYSTEM.RANDOM') === 0)
253253
{
254254
$key = trim(substr(trim($arr2[0]), strlen('$INPUT.')));
255255
$val = trim($arr2[1]);
@@ -282,7 +282,7 @@ function parse_input($config, $request_headers, $request_data, $context_path, $q
282282
}
283283
}
284284
}
285-
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && startsWith(trim($arr2[1]), '$JSON.REQUEST'))
285+
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && stripos(trim($arr2[1]), '$JSON.REQUEST') === 0)
286286
{
287287
$key = trim(substr(trim($arr2[0]), strlen('$INPUT.')));
288288
$val = trim($arr2[1]);
@@ -326,7 +326,7 @@ function parse_input($config, $request_headers, $request_data, $context_path, $q
326326
$res[$key] = json_encode(isset($value)?$value:'null');
327327
}
328328
}
329-
else if(stripos($params[0], '[') !== false && stripos($params[0], ']'))
329+
else if(stripos($params[0], '[') !== false && stripos($params[0], ']') !== false)
330330
{
331331
// parse as associated array
332332
$obj = json_decode($input, true);
@@ -369,7 +369,7 @@ function parse_input($config, $request_headers, $request_data, $context_path, $q
369369
}
370370
}
371371
// Get UUID
372-
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && trim($arr2[1]) == '$SYSTEM.UUID')
372+
if(stripos(trim($arr2[0]), '$INPUT.') === 0 && stripos(trim($arr2[1]), '$SYSTEM.UUID') === 0)
373373
{
374374
$key = trim(substr(trim($arr2[0]), strlen('$INPUT.')));
375375
$res[$key] = uniqid();
@@ -455,7 +455,8 @@ function parse_input($config, $request_headers, $request_data, $context_path, $q
455455
}
456456
else if(stripos($config['REQUEST_TYPE'], '/json') !== false
457457
|| stripos($config['REQUEST_TYPE'], '/xml') !== false
458-
|| stripos($config['REQUEST_TYPE'], '/soap+xml') !== false
458+
|| (stripos($config['REQUEST_TYPE'], 'soap') !== false
459+
&& stripos($config['REQUEST_TYPE'], 'xml') !== false)
459460
)
460461
{
461462
$obj = json_decode(json_encode($request_data));
@@ -822,7 +823,7 @@ function replace_number_format($string)
822823
{
823824
$total_length = strlen($string);
824825
$start = stripos($string, '$NUMBERFORMAT');
825-
$p1 = $p1 = find_bracket_position($string, $start);
826+
$p1 = find_bracket_position($string, $start);
826827
$formula = substr($string, $start, $p1);
827828
$fm1 = trim($formula, SPACE_TRIMMER);
828829
$fm1 = substr($fm1, 13, strlen($fm1)-7);
@@ -850,7 +851,7 @@ function replace_substring($string)
850851
{
851852
$total_length = strlen($string);
852853
$start = stripos($string, '$SUBSTRING');
853-
$p1 = $p1 = find_bracket_position($string, $start);
854+
$p1 = find_bracket_position($string, $start);
854855
$formula = substr($string, $start, $p1);
855856
$fm1 = trim($formula, SPACE_TRIMMER);
856857
$fm1 = substr($fm1, 10, strlen($fm1)-7);
@@ -953,7 +954,6 @@ function find_bracket_position($string, $start)
953954

954955
function replace_calc($string)
955956
{
956-
957957
if(stripos($string, '$CALC') !== false)
958958
{
959959
do
@@ -1084,7 +1084,7 @@ function get_request_body($parsed, $url)
10841084
$request_data = json_decode(json_encode($xml), true);
10851085
$request_data = fix_array_key($request_data);
10861086
}
1087-
else if(stripos($parsed['REQUEST_TYPE'], '/soap+xml') !== false)
1087+
else if(stripos($parsed['REQUEST_TYPE'], 'soap') !== false && stripos($parsed['REQUEST_TYPE'], 'xml') !== false)
10881088
{
10891089
$input_buffer = file_get_contents("php://input");
10901090
error_log("HTTP Request : \r\n".$input_buffer);

0 commit comments

Comments
 (0)