From 6bdf4a1a25f1fc2e84fdc65e3e6a74578536f137 Mon Sep 17 00:00:00 2001 From: wn Date: Sat, 12 Dec 2020 09:50:43 -0600 Subject: Switch to 'get_error_types()' to ensure availability in 'include/functions.php'. The global in 'sanity_check()' was null... possibly due to circular requires? --- include/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index ceb7fbd9e..2f4ee8e35 100644 --- a/include/functions.php +++ b/include/functions.php @@ -327,7 +327,7 @@ function sanity_check() { require_once 'errors.php'; - global $ERRORS; + $ERRORS = get_error_types(); $error_code = 0; $schema_version = get_schema_version(true); @@ -540,7 +540,7 @@ */ function error_json($code) { require_once "errors.php"; - global $ERRORS; + $ERRORS = get_error_types(); @$message = $ERRORS[$code]; -- cgit v1.2.3-54-g00ecf From 936b91a7e656169c7cc2f4652ee4ab9114d11dbc Mon Sep 17 00:00:00 2001 From: wn Date: Sat, 12 Dec 2020 09:53:08 -0600 Subject: Don't do deprecated 'libxml_disable_entity_loader(true)' under PHP 8. https://github.com/php/php-src/blob/2d467abc46ec4ee97484d4e35909bed322600037/UPGRADING#L886 --- include/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 2f4ee8e35..a70b4ac44 100644 --- a/include/functions.php +++ b/include/functions.php @@ -18,7 +18,10 @@ $fetch_effective_url = false; $fetch_curl_used = false; - libxml_disable_entity_loader(true); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { + libxml_disable_entity_loader(true); + } + libxml_use_internal_errors(true); // separate test because this is included before sanity checks -- cgit v1.2.3-54-g00ecf