Skip to content

Commit fa087b9

Browse files
author
peejeh
committed
Fixed auth bug in PHPRestSQL::connect reported and fixed by Paul Tepper ([email protected])
1 parent 63a50f9 commit fa087b9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.htaccess.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RewriteEngine On
22
RewriteCond %{REQUEST_FILENAME} !-d
33
RewriteCond %{REQUEST_FILENAME} !-f
4-
#RewriteRule ^.*$ index.php
5-
RewriteRule ^.*$ /phprestsql/demo/index.php
4+
RewriteRule ^.*$ index.php
5+
#RewriteRule ^.*$ /phprestsql/demo/index.php

phprestsql.php

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ function connect() {
140140
trigger_error('Could not connect to server', E_USER_ERROR);
141141
}
142142
} elseif (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
143+
$this->config['database']['username'] = $_SERVER['PHP_AUTH_USER'];
144+
$this->config['database']['password'] = $_SERVER['PHP_AUTH_PW'];
143145
if (!$this->db->connect($this->config['database'])) {
144146
$this->unauthorized();
145147
exit;

0 commit comments

Comments
 (0)