$filename = $path_to_root . "/config_db.php";
// Check if the file exists and is writable first.
- if (!file_exists($filename) || (is_writable($path_to_root) && is_writable($filename)))
+ if ((!file_exists($filename) && is_writable($path_to_root)) || is_writable($filename))
{
if (!$zp = fopen($filename, 'w'))
{
$all = implode("", file($path));
// convert path to name of ziped file
- $filename = ereg_replace(".*/", "", $path);
+ $filename = preg_replace("/.*\//", "", $path);
$filename = substr($filename, 0, strlen($filename) - 4);
// compare filname in zip and filename from $_GET