fix: AddDisk with no driver name

#449 .
pull/453/head
qkqpttgf 2021-10-20 09:49:55 +08:00 committed by GitHub
parent 04721295fa
commit d4adc8233e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -262,6 +262,10 @@ function main($path)
// Add disk // Add disk
if (isset($_GET['AddDisk'])) { if (isset($_GET['AddDisk'])) {
if ($_GET['AddDisk']===true) {
$tmp = path_format($_SERVER['base_path'] . '/' . $path);
return output('Please visit <a href="' . $tmp . '">' . $tmp . '</a>.', 301, [ 'Location' => $tmp ]);
}
if ($_SERVER['admin']) { if ($_SERVER['admin']) {
if (!class_exists($_GET['AddDisk'])) require 'disk' . $slash . $_GET['AddDisk'] . '.php'; if (!class_exists($_GET['AddDisk'])) require 'disk' . $slash . $_GET['AddDisk'] . '.php';
$drive = new $_GET['AddDisk']($_GET['disktag']); $drive = new $_GET['AddDisk']($_GET['disktag']);