mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-30 01:56:35 +08:00
Fix #20348: ErrorHandler::convertExceptionToError() Passing E_USER_ERROR to trigger_error() is deprecated since PHP 8.4
This commit is contained in:
@ -174,12 +174,14 @@ class ActiveField extends Component
|
||||
// use trigger_error to bypass this limitation
|
||||
try {
|
||||
return $this->render();
|
||||
} catch (\Exception $e) {
|
||||
ErrorHandler::convertExceptionToError($e);
|
||||
return '';
|
||||
} catch (\Throwable $e) {
|
||||
ErrorHandler::convertExceptionToError($e);
|
||||
return '';
|
||||
if (PHP_VERSION_ID < 70400) {
|
||||
trigger_error(ErrorHandler::convertExceptionToString($e), E_USER_ERROR);
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user