Răsfoiți Sursa

make sure db ends with .db - Fix #971

causefx 7 ani în urmă
părinte
comite
5f8e141695

+ 5 - 0
api/functions/normal-functions.php

@@ -578,4 +578,9 @@ function gen_uuid()
 		// 48 bits for "node"
 		mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
 	);
+}
+
+function dbExtension($string)
+{
+	return (substr($string, -3) == '.db') ? $string : $string . '.db';
 }

+ 1 - 1
api/functions/organizr-functions.php

@@ -111,7 +111,7 @@ function wizardConfig($array)
 		}
 	}
 	$location = cleanDirectory($location);
-	$dbName = $dbName . '.db';
+	$dbName = dbExtension($dbName);
 	$configVersion = $GLOBALS['installedVersion'];
 	$configArray = array(
 		'dbName' => $dbName,