diff --git a/library/think/App.php b/library/think/App.php index a6205ff8..9d545d8f 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -194,7 +194,9 @@ class App $params = $reflect->getParameters(); foreach ($params as $param) { $name = $param->getName(); - if (1 == $type && !empty($vars)) { + if ('think\Request' == $param->getClass()->name) { + $args[] = Request::instance(); + } elseif (1 == $type && !empty($vars)) { $args[] = array_shift($vars); } elseif (0 == $type && isset($vars[$name])) { $args[] = $vars[$name]; diff --git a/library/think/Input.php b/library/think/Input.php index a6445b2d..834bd5f0 100644 --- a/library/think/Input.php +++ b/library/think/Input.php @@ -342,7 +342,7 @@ class Input // TODO 其他安全过滤 // 过滤查询特殊字符 - if (preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i', $value)) { + if (is_string($value) && preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i', $value)) { $value .= ' '; } } diff --git a/library/think/Route.php b/library/think/Route.php index 5d3badce..ebad2f9b 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -28,8 +28,8 @@ class Route private static $rest = [ 'index' => ['GET', '', 'index'], 'create' => ['GET', '/create', 'create'], - 'read' => ['GET', '/:id', 'read'], 'edit' => ['GET', '/:id/edit', 'edit'], + 'read' => ['GET', '/:id', 'read'], 'save' => ['POST', '', 'save'], 'update' => ['PUT', '/:id', 'update'], 'delete' => ['DELETE', '/:id', 'delete'],