Skip to content

Commit

Permalink
Item11780: ASSERT if expandCommon called in init
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@14644 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Apr 19, 2012
1 parent 156c50d commit 18718d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/lib/Foswiki/Func.pm
Expand Up @@ -2481,11 +2481,22 @@ Return: =$text= Expanded text, e.g. ='Current user is <nop>WikiGuest'=
See also: expandVariablesOnTopicCreation
*Caution:* This function needs all the installed plugins to have gone through initialization.
Never call this function from within an initPlugin handler, bad things happen.
=cut

sub expandCommonVariables {
my ( $text, $topic, $web, $meta ) = @_;
ASSERT($Foswiki::Plugins::SESSION) if DEBUG;

if (DEBUG) {
for ( my $i = 4 ; $i <= 7 ; $i++ ) {
ASSERT( 0, "expandCommonVariables called during registration" )
if ( ( caller($i) )[3] eq 'Foswiki::Plugin::registerHandlers' );
}
}

( $web, $topic ) = _validateWTA(
$web || $Foswiki::Plugins::SESSION->{webName},
$topic || $Foswiki::Plugins::SESSION->{topicName}
Expand Down

0 comments on commit 18718d8

Please sign in to comment.