diff --git a/ChangeLog b/ChangeLog index abf9f3f9..5c6aefbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-09-18 Andrew Ruthven + * Don't try and use get_magic_quotes_gpc or get_magic_quotes_runtime on PHP 8 + or newer. + 2021-03-01 Florian Schlichting * release davical 1.1.10 * Update carddav/2042-REPORT-addressbook-query together with df6ff3a in AWL diff --git a/htdocs/setup.php b/htdocs/setup.php index 2a82dbf3..cb42df65 100644 --- a/htdocs/setup.php +++ b/htdocs/setup.php @@ -151,11 +151,23 @@ function check_suhosin_server_strip() { } function check_magic_quotes_gpc() { - return new CheckResult( (get_magic_quotes_gpc() == 0) ); + # get_magic_quotes_gpc has been removed as of PHP 8, so our check that it + # is disabled should ways pass from PHP 8 onwards. + if (version_compare(phpversion(), '8.0.0', '>=')) { + return new CheckResult(true); + } else { + return new CheckResult( (get_magic_quotes_gpc() == 0) ); + } } function check_magic_quotes_runtime() { - return new CheckResult( (get_magic_quotes_runtime() == 0) ); + # get_magic_quotes_runtime has been removed as of PHP 8, so our check that it + # is disabled should ways pass from PHP 8 onwards. + if (version_compare(phpversion(), '8.0.0', '>=')) { + return new CheckResult(true); + } else { + return new CheckResult( (get_magic_quotes_runtime() == 0) ); + } } function check_curl() {