Skip to content
Snippets Groups Projects
Commit 94024405 authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

Do not force _config.php safe mode

parent e0976117
No related branches found
No related tags found
No related merge requests found
......@@ -229,23 +229,11 @@ function run_integrity_check(bool $basic = false, bool $allow_merging = true, bo
// Output integrity check results
if ($outdated__addon != '') {
if ($basic) {
$ret_str .= '<p>The following addons are not compatible with the current version of the software. To update an addon, download the latest version from the homesite and import it under Admin Zone > Structure > Addon management. Sometimes, updated non-bundled addons can automatically be imported on that page.</p><p><strong>Safe mode has been activated on your site</strong> to prevent critical errors. After upgrading these addons, remove or edit safe_mode in _config.php, or use the config_editor.php tool to do so.</p><ul>' . $outdated__addon . '</ul>';
$ret_str .= '<p>The following addons are not compatible with the current version of the software. <strong>You should launch your site in safe mode</strong> after upgrading as it could be in a broken state. Then, to update these addons, download the latest version from the homesite and import it under Admin Zone > Structure > Addon management. Sometimes, updated non-bundled addons can automatically be imported on that page.</p><ul>' . $outdated__addon . '</ul>';
} else {
$ret_str .= do_lang('WARNING_FILE_OUTDATED_ADDON', $outdated__addon);
}
$found_something = true;
// Also force safe mode on
$path = $FILE_BASE . '/_config.php';
$config_contents = file_get_contents($path);
$orig_config_contents = $config_contents;
$config_contents = preg_replace('#^(\$SITE_INFO\[\'safe_mode\'\]\s*=\s*\')[^\']+(\';)#m', '', $config_contents);
$config_contents .= '$SITE_INFO[\'safe_mode\'] = \'1\';' . "\n";
if ($orig_config_contents != $config_contents) { // No change needed
file_put_contents($path, $config_contents);
$SITE_INFO['safe_mode'] = '1';
}
}
if ($outdated__possibly_outdated_override != '') {
if ($basic) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment