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

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/index.php b/index.php
index 6971e346..654b9446 100644
--- a/index.php
+++ b/index.php
@@ -6,6 +6,12 @@ declare(strict_types=1);
* PHPPgAdmin 6.1.3
*/
+\defined('BASE_PATH') || \define('BASE_PATH', __DIR__);
+
+/**
+ * PHPPgAdmin 6.1.3.
+ */
+
// This section is made to be able to parse requests coming from PHP Builtin webserver
if (\PHP_SAPI === 'cli-server') {
$will_redirect = false;
@@ -16,7 +22,9 @@ if (\PHP_SAPI === 'cli-server') {
$will_redirect = true;
$req_uri = \mb_substr($req_uri, 10);
}
- $filePath = \realpath(\ltrim($req_uri, '/'));
+ $guessesPath = __DIR__ . $req_uri;
+ $filePath = \realpath($guessesPath);
+
$new_location = 'Location: http://' . $_SERVER['HTTP_HOST'] . $req_uri;
if ($filePath && // 1. check that filepath is set