Secure database tables prefix

This commit is contained in:
Fedor A. Fetisov 2013-10-28 15:54:46 +04:00
parent 0fc7477672
commit 255ac6220c

View File

@ -169,13 +169,14 @@ Class Database{
// Create database instance
$instance = new Database();
// Set database and connection properties
$instance->dbHost = $host;
$instance->dbLogin = $user;
$instance->dbPass = $pass;
$instance->dbName = $db;
$instance->dbEncoding = $encoding;
$instance->tablesPrefix = $prefix;
$instance->tablesPrefix = preg_replace('/[^A-Za-z0-9_$]/', '', $prefix);
$instance->forceCharsetInConnection = $force_charset;
$instance->usePersistentConnection = $use_pconn;