Forums / Bug Reports / [Done v1.5.4] Admin local configure.php, preg_replace not working on windows server

[Done v1.5.4] Admin local configure.php, preg_replace not working on windows server

Locked

Views: 2,115

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
6 Aug 2014, 10:14 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

[Done v1.5.4] Admin local configure.php, preg_replace not working on windows server

In the admin configure.php there is this:

define('DIR_FS_ADMIN', preg_replace('#/includes/$#', '/', realpath(dirname(__FILE__) . '/../') . '/'));

I assume the preg_replace was introduced in 1.53 to ensure that a /local version of this file produced the correct path as otherwise it has /includes on the end...or** \includes** for a windows server, in which case this regex does not work and the define is incorrect.

I have changed it to this:

define('DIR_FS_ADMIN', preg_replace('#.includes$#', '', realpath(dirname(__FILE__) . '/../')) . '/');

which seems to work ok in windows and linux in /includes/local and /includes.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...