Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2019-08-20 05:16:26 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2019-08-20 05:16:26 +0300
commite7c6eaf667c3c14717391bea7227ecb6fae38198 (patch)
tree376425f61187ff814e79320ef64dc364bfd04bbe /libraries
parent4111f215c6b641204245d60905ef19e1877e93e2 (diff)
Use the router for phpinfo.php
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/classes/Controllers/HomeController.php2
-rw-r--r--libraries/entry_points/phpinfo.php23
2 files changed, 24 insertions, 1 deletions
diff --git a/libraries/classes/Controllers/HomeController.php b/libraries/classes/Controllers/HomeController.php
index 0f6bbc763a..97478262c6 100644
--- a/libraries/classes/Controllers/HomeController.php
+++ b/libraries/classes/Controllers/HomeController.php
@@ -213,7 +213,7 @@ class HomeController extends AbstractController
'id' => 'li_phpinfo',
'class' => null,
'url' => [
- 'href' => 'phpinfo.php' . Url::getCommon(),
+ 'href' => Url::getFromRoute('/phpinfo'),
'target' => '_blank',
'id' => null,
'class' => null,
diff --git a/libraries/entry_points/phpinfo.php b/libraries/entry_points/phpinfo.php
new file mode 100644
index 0000000000..238b28513d
--- /dev/null
+++ b/libraries/entry_points/phpinfo.php
@@ -0,0 +1,23 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * phpinfo() wrapper to allow displaying only when configured to do so.
+ *
+ * @package PhpMyAdmin
+ */
+declare(strict_types=1);
+
+if (! defined('PHPMYADMIN')) {
+ exit;
+}
+
+$response = PhpMyAdmin\Response::getInstance();
+$response->disable();
+$response->getHeader()->sendHttpHeaders();
+
+/**
+ * Displays PHP information
+ */
+if ($GLOBALS['cfg']['ShowPhpInfo']) {
+ phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
+}