Skip to content

Commit

Permalink
[#691] $MT::CB_ERR is now lexically scoped within a closure and can…
Browse files Browse the repository at this point in the history
…not be accessed/changed directly. Please use the accessor/mutator methods `MT::callback_error()` and `MT::callback_errstr()` instead
  • Loading branch information
jayallen committed Jan 25, 2011
1 parent 66fdc3d commit a0f5b1a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/MT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,12 @@ sub register_callbacks {
1;
}

our $CB_ERR;
sub callback_error { $CB_ERR = $_[0]; }
sub callback_errstr {$CB_ERR}
{
our $CB_ERR;
# TODO Convert function to method in appropriate package
sub callback_error { $CB_ERR = $_[0]; }
sub callback_errstr {$CB_ERR}
}

sub run_callback {
my $class = shift;
Expand Down Expand Up @@ -845,6 +848,7 @@ sub run_callbacks {
}
}

# TODO Convert to method in appropriate package
callback_error( join( '', @errors ) );

$CallbacksEnabled{$_} = 1 for @methods;
Expand Down

0 comments on commit a0f5b1a

Please sign in to comment.