[ticket/15563] Check if database file is writable only if exists

PHPBB3-15563
This commit is contained in:
Rubén Calvo 2018-02-17 18:50:04 +01:00
parent 7dca3f4d6c
commit c160882cdb

View file

@ -338,7 +338,7 @@ class database
// Check if SQLite database is writable // Check if SQLite database is writable
if ($dbms_info['SCHEMA'] === 'sqlite' if ($dbms_info['SCHEMA'] === 'sqlite'
&& (!$this->filesystem->is_writable($dbhost) || !$this->filesystem->is_writable(pathinfo($dbhost, PATHINFO_DIRNAME)))) && (($this->filesystem->exists($dbhost) && !$this->filesystem->is_writable($dbhost)) || !$this->filesystem->is_writable(pathinfo($dbhost, PATHINFO_DIRNAME))))
{ {
$errors[] = array( $errors[] = array(
'title' =>'INST_ERR_DB_NO_WRITABLE', 'title' =>'INST_ERR_DB_NO_WRITABLE',