Prevent an empty AssetProxy macro from causing an infinite loop. Fixes bug #12046. Thanks to Trex for the patch!

This commit is contained in:
Colin Kuskie 2011-02-14 17:49:47 -08:00
parent 6865fda6e1
commit 90dec24634
3 changed files with 20 additions and 12 deletions

View file

@ -42,6 +42,15 @@ Defaults to 'url'. But if you want to use an assetId as the first parameter, the
#-------------------------------------------------------------------
sub process {
my ($session, $identifier, $type) = @_;
if (!$identifier) {
$session->errorHandler->warn('AssetProxy macro called without an asset to proxy. '
. 'The macro was called through this url: '.$session->asset->get('url'));
if ($session->var->isAdminOn) {
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
return $i18n->get('invalid url');
}
return;
}
my $t = ($session->errorHandler->canShowPerformanceIndicators()) ? [Time::HiRes::gettimeofday()] : undef;
my $asset;
if ($type eq 'assetId') {