Support Forum

SP5-Importer and location of wp-config.php – script fails silently if not found

AZ Azti
Azti
Member

Greetings,

For the last couple of hours I have been attempting to import my data from a phpbb3 forum, having converted Icy Phoenix back to phpbb2, then to phpbb3. Upon running the SP5-Importer plugin, having selected the phpbb importer, on submit to run the conversion, the process finished almost instantly and with no mention of any issues… I obviously suspected a problem as its a large database with thousands of posts… Checking the Forums and Users, nothing came across…

I tried an absolutely fresh install with no other plugins, but got the same results…

So, I went trolling through the code… What I found is the following:

In line 5 of ./plugins/sp-import/engine/spimport.php
require_once(“../../../../wp-config.php”);

I had moved wp-config.php up one directory as per a number of recommendations for security. However, having now read this: http://iandunn.name/dont-move-wp-config-php-outside-the-document-root/ I may move it back and block its access, selectively, in my nginx config…

So, I guess I would recommend either, or both, of two things.

1. Please add code that indicates that wp-config.php is not accessible, rather than the script failing silently.

and/or

2. add some manner of conditional to also select for:
require_once(“../../../../../wp-config.php”);

If I have a chance I will work on a patch and submit it (though my php chops are still abysmally deficient compared to my perl chops).

Thanks :-)

–Azti

 

1 Answer

New Answer

MP Mr Papa
Mr Papa
Member

thanks for the heads up…  of course, we know the wp config file is relocatable, just slipped through and no on has ever had an issue before – guess that shows how many folks actually do that… ;)  

will open a ticket on the importer…