1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/15243] Check permissions before installing with SQLite

PHPBB3-15243
This commit is contained in:
Rubén Calvo
2017-06-15 16:56:19 +02:00
parent eafbaf4c30
commit e6bdba7da1
2 changed files with 10 additions and 0 deletions

View File

@@ -336,6 +336,15 @@ class database
);
}
// Check if SQLite database is writable
if ($dbms_info['SCHEMA'] === 'sqlite'
&& (!$this->filesystem->is_writable($dbhost) || !$this->filesystem->is_writable(pathinfo($dbhost, PATHINFO_DIRNAME))))
{
$errors[] = array(
'title' =>'INST_ERR_DB_NO_WRITABLE',
);
}
// Try to connect to db
if (is_array($db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, false, true)))
{