From 231968238b051623a5335cb32753c4086c27397e Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 15 Sep 2018 13:43:53 +0900 Subject: [PATCH] Update webpagetool.php --- helper/webpagetool.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helper/webpagetool.php b/helper/webpagetool.php index de46dcb..a0b9338 100644 --- a/helper/webpagetool.php +++ b/helper/webpagetool.php @@ -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.";