• Resolved Marc Nilius

    (@zottto)


    Hi!

    I found out, that the firewall does not work correctly, if some characters appear in the DB password. The firewall than shows the error message “Cannot connect to database”.

    The reason for this was a DB password containing \\ (two backslashes) which seems to be interpreted as an escaping of characters.
    It would help if the firewall DB connection is as robust as the WP DB connection itself.

    Changing the DB password helped and the firewall is now working correctly.

    By the way, your WP DB test script also has a bug, that appears, if your wp-config.php is not in the same directory as the wp-db.php script. In my case, the wp-config.php is one level higher and because in line 33 the fopen directly tries to load “wp-config.php” instead of the $wp_config variable that was filled before, teh wp-config.php cannot be found in this case.

    Thanks for listening and fixing. ??

    Marc

Viewing 1 replies (of 1 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Hi,

    I just fixed the wp-db.php script, thanks for pointing the bug.
    Regarding the slash, that works with WordPress, because it loads the file using require() and lets PHP do the work. But NinjaFirewall cannot do that because that would load WordPress. Instead it has to read the wp-config.php file line by line, and PHP will turn the double slash into a single one.

Viewing 1 replies (of 1 total)
  • The topic ‘Problems with some DB passwords’ is closed to new replies.