Browse Source

Fixed dbTablePrefix starting with an underscore when using an old Lychee installation

Tobias Reich 8 years ago
parent
commit
9198b4ec2f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      php/define.php

+ 2 - 1
php/define.php

@@ -26,7 +26,7 @@ define('LYCHEE_URL_UPLOADS_BIG', 'uploads/big/');
 define('LYCHEE_URL_UPLOADS_MEDIUM', 'uploads/medium/');
 define('LYCHEE_URL_UPLOADS_THUMB', 'uploads/thumb/');
 
-function defineTablePrefix($dbTablePrefix = '') {
+function defineTablePrefix($dbTablePrefix) {
 
 	// This part is wrapped into a function, because it needs to be called
 	// after the config-file has been loaded. Other defines are available
@@ -34,6 +34,7 @@ function defineTablePrefix($dbTablePrefix = '') {
 
 	// Parse table prefix
 	// Old users do not have the table prefix stored in their config-file
+	if (isset($dbTablePrefix)===false) $dbTablePrefix = '';
 	if ($dbTablePrefix!=='') $dbTablePrefix .= '_';
 
 	// Define tables