mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 00:14:40 +03:00
Make open_basedir protection optional (opt-in policy)
This commit is contained in:
parent
f3ec6dd53b
commit
2ff5ea3fb6
@ -15,12 +15,14 @@
|
|||||||
* limitations under the License.
|
* 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__) . '/converter.php');
|
||||||
require_once(dirname(__FILE__) . '/config.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
|
// Sanitize path to application and remove extra slashes
|
||||||
$mibewroot = join("/", array_map("urlencode", preg_split('/\//', preg_replace('/\/+$/', '', preg_replace('/\/{2,}/', '/', '/' . $mibewroot)))));
|
$mibewroot = join("/", array_map("urlencode", preg_split('/\//', preg_replace('/\/+$/', '', preg_replace('/\/{2,}/', '/', '/' . $mibewroot)))));
|
||||||
|
|
||||||
|
@ -49,4 +49,9 @@ $mail_encoding = "utf-8";
|
|||||||
$home_locale = "en"; /* native name will be used in this locale */
|
$home_locale = "en"; /* native name will be used in this locale */
|
||||||
$default_locale = "en"; /* if user does not provide known lang */
|
$default_locale = "en"; /* if user does not provide known lang */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additional protection using open_basedir
|
||||||
|
*/
|
||||||
|
$use_open_basedir_protection = false;
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user