Closed jaanush closed 8 years ago
Hi @jaanush I will investigate about this issue.
I did this quick-fix to make it work temporarily:
Changed:
if (!@file_put_contents(ABSPATH . 'wp-config.php', implode("", $newWPConfig))) {
to:
if (!file_exists(ABSPATH . 'wp-config.php') || !@file_put_contents(ABSPATH . 'wp-config.php', implode("", $newWPConfig))) {
Thanks @jaanush, I will deeply check the issue to ensure that the contents will be written however in the wp-config.php
file. Wherever it would be.
Hi @jaanush sorry for the delay,
I've made changes checking for existence of wp-config.php
before writing data into it. However according to the best practice about Securing wp-config.php the file should be however generate with a simple line of include about the wp-config.php
new path.
In the next release this changes will be available.
Currently you presume wp-config.php is located in ABSPATH but that is not allways the case. In my case i user Bedrock from toots to develop my site and then the config is outside the wp folder. Wordpress checks for this and so should you.
At least check for the file before you use file_put_contents. That creates an empty file which totally breaks wp since that empty file is loaded instead of the proper wp-config.php.