summaryrefslogtreecommitdiff
path: root/app/Http/RequestHandlers/PhpInformation.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Http/RequestHandlers/PhpInformation.php')
-rw-r--r--app/Http/RequestHandlers/PhpInformation.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Http/RequestHandlers/PhpInformation.php b/app/Http/RequestHandlers/PhpInformation.php
index 143ea86e60..5cceecc380 100644
--- a/app/Http/RequestHandlers/PhpInformation.php
+++ b/app/Http/RequestHandlers/PhpInformation.php
@@ -45,8 +45,12 @@ final class PhpInformation implements RequestHandlerInterface
ob_start();
phpinfo(INFO_ALL & ~INFO_CREDITS & ~INFO_LICENSE);
$phpinfo = ob_get_clean();
- preg_match('%<body>(.*)</body>%s', $phpinfo, $matches);
- $phpinfo = $matches[1];
+ if (preg_match('%<body>(.*)</body>%s', $phpinfo, $matches)) {
+ $phpinfo = $matches[1];
+ } else {
+ // Some web hosts use custom PHP builds with a non-standard phpinfo()
+ $phpinfo = '<pre>' . $phpinfo . '</pre>';
+ }
return $this->viewResponse('admin/server-information', [
'title' => I18N::translate('Server information'),