Update webpagetool.php

This commit is contained in:
Namhyeon Go 2018-12-13 13:07:51 +09:00 committed by GitHub
parent 0611d74150
commit c87d661362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,8 +249,18 @@ if(!function_exists("get_web_curl")) {
if(count($data) > 0) { if(count($data) > 0) {
if($method == "post") { if($method == "post") {
foreach($data as $k=>$v) {
if(substr($v, 0, 1) == "@") { // if this is a file
if(function_exists("curl_file_create")) { // php 5.5+
$data[$k] = curl_file_create(substr($v, 1));
} else {
$data[$k] = "@" . realpath(substr($v, 1));
}
}
}
$options[CURLOPT_POST] = 1; $options[CURLOPT_POST] = 1;
$options[CURLOPT_POSTFIELDS] = get_web_build_qs("", $data); $options[CURLOPT_POSTFIELDS] = $data;
} }
if($method == "get") { if($method == "get") {