Update webpagetool.php

This commit is contained in:
Namhyeon Go 2018-09-15 13:43:53 +09:00 committed by GitHub
parent 8f795d7296
commit 231968238b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,12 @@ if(!function_exists("get_web_cmd")) {
$cmd_fin = sprintf($cmd, make_safe_argument($ua), make_safe_argument($url), $params_cmd);
}
if($method == "jsonrpc") {
$cmd = "curl -A '%s' --header 'Content-Type: application/json' --request POST --data '%s' %s";
$cmd_fin = sprintf($cmd, make_safe_argument($ua), json_encode($data), $url);
$output = exec_command($cmd_fin, "shell_exec");
}
if(!empty($cmd_fin)) {
$output = exec_command($cmd_fin, "shell_exec");
}
@ -202,6 +208,8 @@ if(!function_exists("get_web_page")) {
$content = get_web_sock($url, $res_methods[0], $data, $proxy, $ua, $ct_out, $t_out);
} elseif(in_array("wget", $res_methods)) {
$content = get_web_wget($url, $res_methods[0], $data, $proxy, $ua, $ct_out, $t_out);
} elseif(in_array("jsonrpc", $res_methods)) {
$content = get_web_cmd($url, "jsonrpc", $data, $proxy, $ua, $ct_out, $t_out);
} else {
if(!in_array("curl", get_loaded_extensions())) {
$error_msg = "cURL extension needs to be installed.";