Commit b6189203 by Qiang Xue

Fixed the bug that requesting protected or private action methods would cause…

Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404
parent 28949b3a
...@@ -38,6 +38,7 @@ Yii Framework 2 Change Log ...@@ -38,6 +38,7 @@ Yii Framework 2 Change Log
- Bug #3601: Fixed the bug that the refresh URL was not generated correctly by `Captcha` (qiangxue, klevron) - Bug #3601: Fixed the bug that the refresh URL was not generated correctly by `Captcha` (qiangxue, klevron)
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark) - Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
- Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul) - Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
- Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)
- Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue) - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue)
- Enh #2435: `yii\db\IntegrityException` is now thrown on database integrity errors instead of general `yii\db\Exception` (samdark) - Enh #2435: `yii\db\IntegrityException` is now thrown on database integrity errors instead of general `yii\db\Exception` (samdark)
- Enh #2837: Error page now shows arguments in stack trace method calls (samdark) - Enh #2837: Error page now shows arguments in stack trace method calls (samdark)
......
...@@ -216,7 +216,7 @@ class Controller extends Component implements ViewContextInterface ...@@ -216,7 +216,7 @@ class Controller extends Component implements ViewContextInterface
$methodName = 'action' . str_replace(' ', '', ucwords(implode(' ', explode('-', $id)))); $methodName = 'action' . str_replace(' ', '', ucwords(implode(' ', explode('-', $id))));
if (method_exists($this, $methodName)) { if (method_exists($this, $methodName)) {
$method = new \ReflectionMethod($this, $methodName); $method = new \ReflectionMethod($this, $methodName);
if ($method->getName() === $methodName) { if ($method->isPublic() && $method->getName() === $methodName) {
return new InlineAction($id, $this, $methodName); return new InlineAction($id, $this, $methodName);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment