diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f8d3543a..78440cb82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## Unreleased +### Added +- Support for handling the `uopz` extension to prevent the application from breaking due to disabled `exit` calls by `uopz`. ## 1.2.22 ### Fixes diff --git a/mailscanner/functions.php b/mailscanner/functions.php index 3830c6622..2eb3d591a 100644 --- a/mailscanner/functions.php +++ b/mailscanner/functions.php @@ -33,6 +33,15 @@ error_reporting(E_ALL ^ E_DEPRECATED ^ E_STRICT); } +if (extension_loaded('uopz') && !(ini_get('uopz.disable') || ini_get('uopz.exit'))) { + // uopz works at opcode level and disables exit calls + if (function_exists('uopz_allow_exit')) { + @uopz_allow_exit(true); + } else { + throw new \RuntimeException('The uopz extension ignores exit calls and breaks this application. Disable the extension or set "uopz.exit" to TRUE'); + } +} + // Read in MailWatch configuration file if (!is_readable(__DIR__ . '/conf.php')) { exit(__('cannot_read_conf'));