From 2f1acf8b10cb783e4ee3b02647fc1c32c9ed4902 Mon Sep 17 00:00:00 2001 From: Dmitri Iouchtchenko Date: Sun, 6 Jun 2021 14:01:53 -0400 Subject: [PATCH] Suppress PHP 8 deprecation warning in startup Summary: Ref T13588. See D21497. 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: * Still works with PHP 7. * No more deprecation message with PHP 8. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T13588 Differential Revision: https://secure.phabricator.com/D21701 --- support/startup/PhabricatorStartup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support/startup/PhabricatorStartup.php b/support/startup/PhabricatorStartup.php index b687f27bb0..58031013ad 100644 --- a/support/startup/PhabricatorStartup.php +++ b/support/startup/PhabricatorStartup.php @@ -392,8 +392,11 @@ final class PhabricatorStartup { ini_set('memory_limit', -1); // If we have libxml, disable the incredibly dangerous entity loader. + // 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); } // See T13060. If the locale for this process (the parent process) is not