google-code-export / candydolldb

Automatically exported from code.google.com/p/candydolldb
0 stars 0 forks source link

Empty password for database #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure your database account to require an empty password.
2. Call setup.php
3. Leave field for database password empty, enter all the other necessary data 
and hit "Setup".

What is the expected output?
Successful setup of the database.

What do you see instead?
The following error message: "Could not connect to the database, please 
re-enter the database-settings".

What version of the product are you using?
1.3

Fix:

Open setup.php

Find:
$DBPassword = isset($_POST['txtDBPassword']) && strlen($_POST['txtDBPassword']) 
> 0 ? (string)$_POST['txtDBPassword'] : null;

Inline find:
strlen($_POST['txtDBPassword']) > 0

Inline replace:
strlen($_POST['txtDBPassword']) >= 0

Open cd.php

Find:
!defined('DBPASSWORD') || strlen(DBPASSWORD) == 0

Replace with:
!defined('DBPASSWORD')

Original issue reported on code.google.com by kas...@inbox.ru on 18 Dec 2011 at 7:22

GoogleCodeExporter commented 9 years ago
Thank you for pointing this out. It never occurred to me to have a blank 
db-password. 

In rev.#197 I incorporated your proposed change.

Original comment by fwp...@gmail.com on 18 Dec 2011 at 7:32