From 4ccf5b9d5c68386d5c5f65bf69adf3c426a8594c Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 12 May 2018 23:15:35 +0900 Subject: [PATCH] Update webpagetool.php --- helper/webpagetool.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/helper/webpagetool.php b/helper/webpagetool.php index b346a2e..8a286d7 100644 --- a/helper/webpagetool.php +++ b/helper/webpagetool.php @@ -59,14 +59,17 @@ if(!function_exists("get_web_page")) { $status = "-1"; $resno = "-1"; $errno = "-1"; - - if($method = "post.cmd" || $method == "get.cmd") { - $content = get_web_cmd($url, $method, $data, $proxy, $ua, $ct_out, $t_out); + + if($method == "post.cmd" || $method == "get.cmd") { + $res_methods = explode(".", $method); + $content = get_web_cmd($url, $res_methods[0], $data, $proxy, $ua, $ct_out, $t_out); } elseif($method == "get.fgc") { $content = get_web_fgc($url); } else { if(!in_array("curl", get_loaded_extensions())) { - return "cURL extension needs to be installed."; + $error_msg = "cURL extension needs to be installed."; + set_error($error_msg); + return $error_msg; } $options = array( @@ -87,7 +90,7 @@ if(!function_exists("get_web_page")) { ); if(empty($options[CURLOPT_USERAGENT])) { - $ua = "2018 ReasonableFramework;https://github.com/gnh1201/reasonableframework"; + $ua = "2018 ReasonableFramework: https://github.com/gnh1201/reasonableframework"; $options[CURLOPT_USERAGENT] = $ua; }