From 6a88fa5ca2f1a056977a5aaa19a061815641e51d Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 8 Aug 2006 17:20:22 +0000 Subject: [PATCH] fix Asset.pm so that it returns undef if no valid Asset className is passed --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset.pm | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6e06ee51b..c44fb13d3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,8 @@ - Fixed the test skeleton - Fixed some bugs regarding Search relevance sorting (Len Kranendonk / www.ilance.nl) - Added an option to override the session cookie name. + - Fix Asset.pm so that if no className is passed primeval Assets are not + returned. 7.0.4 diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 2cf9c2df4..e52ef8f63 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1406,6 +1406,7 @@ sub new { } $class = $className; } + return undef if $class eq 'WebGUI::Asset'; my $cache = WebGUI::Cache->new($session, ["asset",$assetId,$revisionDate]); my $properties = $cache->get; if (exists $properties->{assetId}) {