зеркало из https://github.com/mozilla/pjs.git
Check for valid regexp and access to plan before cloning.
This commit is contained in:
Родитель
2c05081860
Коммит
e412ec7a35
|
@ -840,6 +840,8 @@ sub set_tester_regexp {
|
|||
sub derive_regexp_testers {
|
||||
my $self = shift;
|
||||
my $regexp = shift;
|
||||
eval{ "" =~ $regexp; };
|
||||
ThrowUserError('invalid_regexp') if $@;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
# Get the permissions of the regexp testers so we can set it later.
|
||||
my ($permissions) = $dbh->selectrow_array(
|
||||
|
|
|
@ -112,7 +112,11 @@ elsif ($action eq 'do_clone'){
|
|||
foreach my $pid (@planids){
|
||||
$count++;
|
||||
my $plan = Bugzilla::Testopia::TestPlan->new($pid);
|
||||
next unless $plan->canedit;
|
||||
unless ($plan->canedit){
|
||||
$count--;
|
||||
$vars->{'tr_error'} = "Could not link to at least one plan";
|
||||
next;
|
||||
}
|
||||
my $newcaseid = $case->copy($pid, $author, $cgi->param('copy_doc'));
|
||||
$case->link_plan($pid, $newcaseid);
|
||||
$newcase = Bugzilla::Testopia::TestCase->new($newcaseid);
|
||||
|
|
Загрузка…
Ссылка в новой задаче