swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

中间件注册器中变量名混淆 #1295

Closed dmk629 closed 4 years ago

dmk629 commented 4 years ago
Q A
Bug report? no
Feature request? no
Swoft version 2.0.6
Swoole version 4.4.14
PHP version 7.3.1
Runtime environment CentOS 7

Describe the bug /vendor/swoft/http-server/src/Middleware/MiddlewareRegister.php 105行 两个相同变量进行非空判断。

if (!empty($oneMethodMiddlewares) || !empty($oneMethodMiddlewares)) {
//more
inhere commented 4 years ago

@dmk629 在 2.0.9 里面已经修正了。可以升级一下到最新版本

https://github.com/swoft-cloud/swoft-component/blob/7aac80da2ecbc11a6b869e4ba2a83284d3fdcab0/src/http-server/src/Middleware/MiddlewareRegister.php#L105-L110