From 930f7e117d81a06ed31abbaecbbb7769f40ac2d2 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Sun, 10 Jan 2021 22:21:29 +0000 Subject: [PATCH] Suppress PHP 8 deprecation warning in __arcanist_init_script__ Summary: As of PHP 8, the XML entity loader is disabled by default and the libxml_disable_entity_loader function is deprecated. Thus suppress the deprecation warning for now; we could skip the function call, but this is safer. Test Plan: Used to create this revision with PHP 8 on macOS Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D21497 --- support/init/init-script.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support/init/init-script.php b/support/init/init-script.php index 2b742074..9b67daef 100644 --- a/support/init/init-script.php +++ b/support/init/init-script.php @@ -94,8 +94,11 @@ function __arcanist_init_script__() { ))); // Disable the insanely dangerous XML entity loader by default. + // PHP 8 deprecates this function and disables this by default; remove once + // PHP 7 is no longer supported or a future version has removed the function + // entirely. if (function_exists('libxml_disable_entity_loader')) { - libxml_disable_entity_loader(true); + @libxml_disable_entity_loader(true); } $root = dirname(dirname(dirname(__FILE__)));