Skip to content

Commit

Permalink
Fix #17853: Fix errors in ActiveField to be properly caught when PHP …
Browse files Browse the repository at this point in the history
…7 is used

Changed __toString method to catch all PHP 7 error types. \Throwable is part of PHP 7+, so I left the \Exception in for older PHP.
  • Loading branch information
My6UoT9 authored and samdark committed Oct 3, 2019
1 parent c87855b commit 23a8d04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.28 under development
------------------------

- Bug #17853: Fix errors in ActiveField to be properly caught when PHP 7 is used (My6UoT9)
- Bug #17573: `Request::getUserIP()` security fix for the case when `Request::$trustedHost` and `Request::$ipHeaders` are used (kamarton)


Expand Down
3 changes: 3 additions & 0 deletions framework/widgets/ActiveField.php
Expand Up @@ -177,6 +177,9 @@ public function __toString()
} catch (\Exception $e) {
ErrorHandler::convertExceptionToError($e);
return '';
} catch (\Throwable $e) {
ErrorHandler::convertExceptionToError($e);
return '';
}
}

Expand Down

0 comments on commit 23a8d04

Please sign in to comment.