[Rt-commit] r7027 - rt/branches/3.6-RELEASE/lib/RT/Interface
ruz at bestpractical.com
ruz at bestpractical.com
Sun Feb 18 20:47:25 EST 2007
Author: ruz
Date: Sun Feb 18 20:47:24 2007
New Revision: 7027
Modified:
rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm
Log:
* resolve a clobbered regex-match $1 by stashing the principal ID in a
temporary variable. Thanks to Richard Harman.
* type was set incorrect in a case of multiple parameters
Modified: rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm Sun Feb 18 20:47:24 2007
@@ -1414,18 +1414,16 @@
# Add new watchers by owner
elsif ( $key =~ /^Ticket-AddWatcher-Principal-(\d*)$/ ) {
+ my $principal_id = $1;
my $form = $ARGSRef->{$key};
foreach my $value ( ref($form) ? @{$form} : ($form) ) {
+ next unless $value =~ /^(?:AdminCc|Cc|Requestor)$/i;
- if ( $value =~ /^(AdminCc|Cc|Requestor)$/ ) {
-
- #They're in this order because otherwise $1 gets clobbered :/
- my ( $code, $msg ) = $Ticket->AddWatcher(
- Type => $ARGSRef->{$key},
- PrincipalId => $1
- );
- push @results, $msg;
- }
+ my ( $code, $msg ) = $Ticket->AddWatcher(
+ Type => $value,
+ PrincipalId => $principal_id
+ );
+ push @results, $msg;
}
}
More information about the Rt-commit
mailing list