Fixes #13689: Fixed handling of errors in closures

This commit is contained in:
Michael Härtl
2017-03-21 18:23:27 +01:00
committed by Alexander Makarov
parent db0e7a6c8f
commit 6792099bcc
2 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ Yii Framework 2 Change Log
- Bug #13848: `yii\di\Instance::ensure()` wasn't throwing an exception when `$type` is specified and `$reference` object isn't instance of `$type` (c-jonua)
- Enh #13226: `yii cache` command now warns about the fact that it's not able to flush APC cache from console (samdark)
- Bug #13689: Fixed handling of errors in closures (mikehaertl)
- Bug #11719: Fixed `yii\db\Connection::$enableQueryCache` caused infinite loop when the same connection was used for `yii\caching\DbCache` (michaelarnauts)
- Bug #10346: Fixed "DOMException: Invalid Character Error" in `yii\web\XmlResponseFormatter::buildXml()` (sasha-ch)
- Bug #13694: `yii\widgets\Pjax` now sends `X-Pjax-Url` header with response to fix redirect (wleona3, Faryshta)

View File

@ -191,7 +191,7 @@ class ErrorHandler extends \yii\base\ErrorHandler
$url = null;
$shouldGenerateLink = true;
if ($method !== null) {
if ($method !== null && substr_compare($method, '{closure}', -9) !== 0) {
$reflection = new \ReflectionMethod($class, $method);
$shouldGenerateLink = $reflection->isPublic() || $reflection->isProtected();
}