1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 07:30:10 +01:00

Fix for empty() on a constant

This commit is contained in:
Savetheinternet 2011-01-15 14:59:27 +11:00
parent c17a26d689
commit ee6af9bfba

View File

@ -5,7 +5,7 @@
if($pdo) return true;
$dsn = DB_TYPE . ':host=' . DB_SERVER . ';dbname=' . DB_DATABASE;
if(!empty(DB_DSN))
if((bool)DB_DSN) // empty() doesn't work on constants
$dsn .= ';' . DB_DSN;
try {
return $pdo = new PDO($dsn, DB_USER, DB_PASSWORD);