mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: conf file corrupted when using password with special char
This commit is contained in:
parent
ebf8a6eef4
commit
896cfe62ba
|
|
@ -427,7 +427,8 @@ print '</form>';
|
|||
|
||||
print '</div>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -416,11 +416,11 @@ function encodedecode_dbpassconf($level=0)
|
|||
// Add value at end of file
|
||||
if ($level == 0)
|
||||
{
|
||||
$config .= '$dolibarr_main_db_pass="'.$passwd.'";'."\n";
|
||||
$config .= '$dolibarr_main_db_pass=\''.$passwd.'\';'."\n";
|
||||
}
|
||||
if ($level == 1)
|
||||
{
|
||||
$config .= '$dolibarr_main_db_pass="crypted:'.$passwd_crypted.'";'."\n";
|
||||
$config .= '$dolibarr_main_db_pass=\'crypted:'.$passwd_crypted.'\';'."\n";
|
||||
}
|
||||
|
||||
//print 'passwd = '.$passwd.' - passwd_crypted = '.$passwd_crypted;
|
||||
|
|
@ -437,7 +437,7 @@ function encodedecode_dbpassconf($level=0)
|
|||
$file=DOL_DOCUMENT_ROOT.'/conf/conf.php';
|
||||
if ($fp = @fopen($file,'w'))
|
||||
{
|
||||
fputs($fp, $config, dol_strlen($config));
|
||||
fputs($fp, $config);
|
||||
fclose($fp);
|
||||
// It's config file, so we set read permission for creator only.
|
||||
// Should set permission to web user and groups for users used by batch
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user