Open dimayakovlev opened 2 years ago
Example of updated function exec_action()
.
function exec_action($a) {
global $plugins;
foreach ($plugins as $hook) {
if ($hook['hook'] == $a) {
if (is_frontend()) {
call_user_func_array($hook['function'], $hook['args']);
} else {
try {
call_user_func_array($hook['function'], $hook['args']);
} catch (Throwable $e) {
if (error_reporting() !== 0) {
error_log($e);
if (filter_var(ini_get('display_errors'), FILTER_VALIDATE_BOOLEAN)) echo $e;
if (isDebug()) debugLog($e);
}
}
}
}
}
}
This will prevent losing access to administration panel on errors in actions PHP code.