修复系统设置中存在特殊字符导致异常的问题
This commit is contained in:
parent
e9f09faad1
commit
610609cd93
@ -175,8 +175,13 @@ class SiteConfig extends Model
|
|||||||
$data = array_map(function ($key, $value) {
|
$data = array_map(function ($key, $value) {
|
||||||
return "$key=$value";
|
return "$key=$value";
|
||||||
}, array_keys($env), $env);
|
}, array_keys($env), $env);
|
||||||
return !(file_put_contents(Yii::getAlias('@app/.env'), implode("\n", $data)) == false);
|
file_put_contents(Yii::getAlias('@app/.env.pending'), implode("\n", $data));
|
||||||
} catch (Exception) {
|
parse_ini_file(Yii::getAlias('@app/.env.pending'));
|
||||||
|
$result= file_put_contents(Yii::getAlias('@app/.env.pending'), implode("\n", $data)) == false;
|
||||||
|
unlink(Yii::getAlias('@app/.env.pending'));
|
||||||
|
return !($result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
unlink(Yii::getAlias('@app/.env.pending'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user