diff options
author | Josh Richards <josh.t.richards@gmail.com> | 2023-06-16 09:41:02 -0400 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-08-16 11:06:21 +0200 |
commit | 8032b6ac6305a25dd67dd3755029c8fc64b9e7cd (patch) | |
tree | dbaf54314a422418c4f79d727a72c2a2d25f6a59 /lib | |
parent | 75180a629216af6b6d4b69bd53aab6d161e628c5 (diff) | |
download | nextcloud-server-8032b6ac6305a25dd67dd3755029c8fc64b9e7cd.tar.gz nextcloud-server-8032b6ac6305a25dd67dd3755029c8fc64b9e7cd.zip |
(base) Give a hint in web interface if SimpleXML (php-xml) is missing
Fixes #2180
And prevents #31473, #23970, #18610, #15708
Avoids a 500 error and also gives a useful error message on the web interface if this module isn't installed, gets overlooked during a PHP upgrade, etc.
While we check for it later, it's too late for session.
Inspired by #17163
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php index bf324e946bc..010fed1ea9f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -652,6 +652,13 @@ class OC { $bootstrapCoordinator->runInitialRegistration(); $eventLogger->start('init_session', 'Initialize session'); + + // Check for PHP SimpleXML extension earlier since we need it before our other checks and want to provide a useful hint for web users + // see https://github.com/nextcloud/server/pull/2619 + if (!function_exists('simplexml_load_file')) { + throw new \OCP\HintException('The PHP SimpleXML/PHP-XML extension is not installed.', 'Install the extension or make sure it is enabled.'); + } + OC_App::loadApps(['session']); if (!self::$CLI) { self::initSession(); |