Skip to content

Commit

Permalink
Verifica se existe a variável no .env antes de modificar
Browse files Browse the repository at this point in the history
  • Loading branch information
juliolobo committed Jul 18, 2024
1 parent d14fb8f commit bb411eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/controllers/Mapos.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,9 @@ private function editDontEnv(array $data)
$valor = '"' . $base64 . '"';
$env_file = str_replace("$constante=" . '"' . $_ENV[$constante] . '"', "$constante={$valor}", $env_file);
} else {
$env_file = str_replace("$constante={$_ENV[$constante]}", "$constante={$valor}", $env_file);
if (isset($_ENV[$constante])) {
$env_file = str_replace("$constante={$_ENV[$constante]}", "$constante={$valor}", $env_file);
}
}
}
return file_put_contents($env_file_path, $env_file) ? true : false;
Expand Down

0 comments on commit bb411eb

Please sign in to comment.