改进input助手函数

This commit is contained in:
thinkphp
2016-11-14 22:44:18 +08:00
parent de51ad6bb6
commit 8d65e16047

View File

@@ -125,7 +125,7 @@ if (!function_exists('input')) {
} }
if ($pos = strpos($key, '.')) { if ($pos = strpos($key, '.')) {
// 指定参数来源 // 指定参数来源
list($method, $key) = explode('.', $key); list($method, $key) = explode('.', $key, 2);
if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) { if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) {
$key = $method . '.' . $key; $key = $method . '.' . $key;
$method = 'param'; $method = 'param';