fix: resolve sqlite database path for backup download
This commit is contained in:
parent
ad00736707
commit
ff61364ec4
|
|
@ -43,7 +43,10 @@
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
ini_set('memory_limit', '256M');
|
ini_set('memory_limit', '256M');
|
||||||
|
|
||||||
$dbPath = database_path('database.sqlite');
|
$dbRaw = config('database.connections.sqlite.database', 'database/database.sqlite');
|
||||||
|
$dbPath = str_starts_with($dbRaw, '/') || preg_match('/^[A-Za-z]:/', $dbRaw)
|
||||||
|
? $dbRaw
|
||||||
|
: base_path($dbRaw);
|
||||||
if (! file_exists($dbPath)) {
|
if (! file_exists($dbPath)) {
|
||||||
abort(404, 'Database not found.');
|
abort(404, 'Database not found.');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue