Loading core/assets/scaffold/files/default.settings.php +17 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,23 @@ */ # $settings['file_sa_core_2023_005_schemes'] = ['porcelain']; /** * Configuration for phpinfo() admin status report. * * Drupal's admin UI includes a report at admin/reports/status/php which shows * the output of phpinfo(). The full output can contain sensitive information * so by default Drupal removes some sections. * * This behaviour can be configured by setting this variable to a different * value corresponding to the flags parameter of phpinfo(). * * If you need to expose more information in the report - for example to debug a * problem - consider doing so temporarily. * * @see https://www.php.net/manual/function.phpinfo.php */ # $settings['sa_core_2023_004_phpinfo_flags'] = ~ (INFO_VARIABLES | INFO_ENVIRONMENT); /** * Private file path: * Loading core/modules/system/src/Controller/SystemInfoController.php +3 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\system\Controller; use Drupal\Core\Site\Settings; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; Loading Loading @@ -62,7 +63,8 @@ public function status() { public function php() { if (function_exists('phpinfo')) { ob_start(); phpinfo(~ (INFO_VARIABLES | INFO_ENVIRONMENT)); $phpinfo_flags = Settings::get('sa_core_2023_004_phpinfo_flags', ~ (INFO_VARIABLES | INFO_ENVIRONMENT)); phpinfo($phpinfo_flags); $output = ob_get_clean(); } else { Loading core/modules/system/tests/src/Functional/System/StatusTest.php +9 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,15 @@ public function testStatusPage() { $this->drupalGet('admin/reports/status/php'); $this->assertSession()->statusCodeEquals(200); $settings['settings']['sa_core_2023_004_phpinfo_flags'] = (object) [ 'value' => INFO_ALL, 'required' => TRUE, ]; $this->writeSettings($settings); $this->drupalGet('admin/reports/status/php'); $this->assertSession()->pageTextContains('PHP'); $this->assertSession()->pageTextContains('$_COOKIE'); // Check if cron error is displayed in errors section. $cron_last_run = \Drupal::state()->get('system.cron_last'); \Drupal::state()->set('system.cron_last', 0); Loading sites/default/default.settings.php +17 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,23 @@ */ # $settings['file_sa_core_2023_005_schemes'] = ['porcelain']; /** * Configuration for phpinfo() admin status report. * * Drupal's admin UI includes a report at admin/reports/status/php which shows * the output of phpinfo(). The full output can contain sensitive information * so by default Drupal removes some sections. * * This behaviour can be configured by setting this variable to a different * value corresponding to the flags parameter of phpinfo(). * * If you need to expose more information in the report - for example to debug a * problem - consider doing so temporarily. * * @see https://www.php.net/manual/function.phpinfo.php */ # $settings['sa_core_2023_004_phpinfo_flags'] = ~ (INFO_VARIABLES | INFO_ENVIRONMENT); /** * Private file path: * Loading Loading
core/assets/scaffold/files/default.settings.php +17 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,23 @@ */ # $settings['file_sa_core_2023_005_schemes'] = ['porcelain']; /** * Configuration for phpinfo() admin status report. * * Drupal's admin UI includes a report at admin/reports/status/php which shows * the output of phpinfo(). The full output can contain sensitive information * so by default Drupal removes some sections. * * This behaviour can be configured by setting this variable to a different * value corresponding to the flags parameter of phpinfo(). * * If you need to expose more information in the report - for example to debug a * problem - consider doing so temporarily. * * @see https://www.php.net/manual/function.phpinfo.php */ # $settings['sa_core_2023_004_phpinfo_flags'] = ~ (INFO_VARIABLES | INFO_ENVIRONMENT); /** * Private file path: * Loading
core/modules/system/src/Controller/SystemInfoController.php +3 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\system\Controller; use Drupal\Core\Site\Settings; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; Loading Loading @@ -62,7 +63,8 @@ public function status() { public function php() { if (function_exists('phpinfo')) { ob_start(); phpinfo(~ (INFO_VARIABLES | INFO_ENVIRONMENT)); $phpinfo_flags = Settings::get('sa_core_2023_004_phpinfo_flags', ~ (INFO_VARIABLES | INFO_ENVIRONMENT)); phpinfo($phpinfo_flags); $output = ob_get_clean(); } else { Loading
core/modules/system/tests/src/Functional/System/StatusTest.php +9 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,15 @@ public function testStatusPage() { $this->drupalGet('admin/reports/status/php'); $this->assertSession()->statusCodeEquals(200); $settings['settings']['sa_core_2023_004_phpinfo_flags'] = (object) [ 'value' => INFO_ALL, 'required' => TRUE, ]; $this->writeSettings($settings); $this->drupalGet('admin/reports/status/php'); $this->assertSession()->pageTextContains('PHP'); $this->assertSession()->pageTextContains('$_COOKIE'); // Check if cron error is displayed in errors section. $cron_last_run = \Drupal::state()->get('system.cron_last'); \Drupal::state()->set('system.cron_last', 0); Loading
sites/default/default.settings.php +17 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,23 @@ */ # $settings['file_sa_core_2023_005_schemes'] = ['porcelain']; /** * Configuration for phpinfo() admin status report. * * Drupal's admin UI includes a report at admin/reports/status/php which shows * the output of phpinfo(). The full output can contain sensitive information * so by default Drupal removes some sections. * * This behaviour can be configured by setting this variable to a different * value corresponding to the flags parameter of phpinfo(). * * If you need to expose more information in the report - for example to debug a * problem - consider doing so temporarily. * * @see https://www.php.net/manual/function.phpinfo.php */ # $settings['sa_core_2023_004_phpinfo_flags'] = ~ (INFO_VARIABLES | INFO_ENVIRONMENT); /** * Private file path: * Loading