Update webpagetool.php

This commit is contained in:
Namhyeon Go 2019-04-15 14:05:40 +09:00 committed by GitHub
parent 8d7c46f342
commit 8827bfe8e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,10 +97,11 @@ if(!check_function_exists("get_web_cmd")) {
// the same as --form
$args[] = sprintf("-F %s='%s'", make_safe_argument($k), make_safe_argument($v));
} else {
// the same as --data
if(array_key_equals("Content-Type", $headers, "multipart/form-data")) {
$args[] = sprintf("-F %s='%s'", make_safe_argument($k), make_safe_argument($v));
} else { // x-www-form-urlencoded
} elseif(array_key_equals("Content-Type", $headers, "x-www-form-urlencoded")) (
$args[] = sprintf("--data-urlencode %s='%s'", make_safe_argument($k), make_safe_argument($v));
} else { // the same as --data
$args[] = sprintf("-d %s='%s'", make_safe_argument($k), make_safe_argument($v));
}
}