Update webpagetool.php

This commit is contained in:
Namhyeon Go 2018-05-12 21:59:00 +09:00 committed by GitHub
parent 48e0534b32
commit ce1e01dd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,18 @@ if(!function_exists("get_web_legacy")) {
}
}
if(!function_exists("get_web_build_qs")) {
function get_web_build_qs($url, $data) {
$pos = strpos($url, '?');
if ($pos === false) {
$url = $url . '?' . http_build_query($data);
} else {
$url = $url . '&' . http_build_query($data);
}
return $url;
}
}
if(!function_exists("get_web_cmd")) {
function get_web_cmd($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
$output = "";
@ -73,12 +85,7 @@ if(!function_exists("get_web_page")) {
}
if($method == "get" && count($data) > 0) {
$pos = strpos($url, '?');
if ($pos === false) {
$url = $url . '?' . http_build_query($data);
} else {
$url = $url . '&' . http_build_query($data);
}
$url = get_web_build_qs($url, $data);
}
$ch = curl_init($url);