diff --git a/src/mibew/libs/common.php b/src/mibew/libs/common.php index 2d046317..a96a2c2e 100644 --- a/src/mibew/libs/common.php +++ b/src/mibew/libs/common.php @@ -15,12 +15,14 @@ * limitations under the License. */ -// Prevent Mibew from access to files outside the installation -@ini_set('open_basedir', dirname(dirname(__FILE__))); - require_once(dirname(__FILE__) . '/converter.php'); require_once(dirname(__FILE__) . '/config.php'); +if (isset($use_open_basedir_protection) && $use_open_basedir_protection) { +// Prevent Mibew from access to files outside the installation + @ini_set('open_basedir', dirname(dirname(__FILE__))); +} + // Sanitize path to application and remove extra slashes $mibewroot = join("/", array_map("urlencode", preg_split('/\//', preg_replace('/\/+$/', '', preg_replace('/\/{2,}/', '/', '/' . $mibewroot))))); diff --git a/src/mibew/libs/config.php b/src/mibew/libs/config.php index d61bc744..3b45e7b3 100644 --- a/src/mibew/libs/config.php +++ b/src/mibew/libs/config.php @@ -49,4 +49,9 @@ $mail_encoding = "utf-8"; $home_locale = "en"; /* native name will be used in this locale */ $default_locale = "en"; /* if user does not provide known lang */ +/* + * Additional protection using open_basedir + */ +$use_open_basedir_protection = false; + ?> \ No newline at end of file