Error when importing config file on windows
-
Hi
When i import a config .json file on windows i always get an error “Configuration file could not be imported.”. After long research i found the bug in code:
In Generic_AdminActions_Config.php > w3tc_config_import() the temp file’s path gets unslashed:
isset( $_FILES[‘config_file’][‘tmp_name’] ) ? esc_url_raw( wp_unslash( $_FILES[‘config_file’][‘tmp_name’] ) ) : ”
This is wrongly done for windows because windows uses backslashes instead of forward slashes and the path to the imported temp-file is not a path anymore after the backslashes got removed with wp_unslash().
As far as i see this piece of code was last modified in 2022, so that bus exists since 3 years.
Thanks for fixing in advance.
The topic ‘Error when importing config file on windows’ is closed to new replies.