Add check for backupId to start with "box"

This commit is contained in:
Girish Ramakrishnan
2019-11-11 09:46:47 -08:00
parent f679746e63
commit 7f1c505303

View File

@@ -172,6 +172,13 @@ app.controller('RestoreController', ['$scope', 'Client', function ($scope, Clien
return;
}
if ($scope.backupId.indexOf('box') !== 0) {
$scope.error.generic = 'Backup id must start with "box"';
$scope.error.backupId = true;
$scope.busy = false;
return;
}
var version = $scope.backupId.match(/_v(\d+.\d+.\d+)/);
if (!version) {
$scope.error.generic = 'Backup id is missing version information';