[Rt-commit] r12035 - in rt/branches/3.8-TESTING: .

sartak at bestpractical.com sartak at bestpractical.com
Fri May 2 20:08:45 EDT 2008


Author: sartak
Date: Fri May  2 20:08:31 2008
New Revision: 12035

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/lib/RT/Dashboard.pm

Log:
 r54845 at Macintosh:  sartak | 2008-05-02 20:08:02 -0400
 If _GetObject receives bad input, return undef sooner


Modified: rt/branches/3.8-TESTING/lib/RT/Dashboard.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Dashboard.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Dashboard.pm	Fri May  2 20:08:31 2008
@@ -205,12 +205,16 @@
     my $privacy = shift;
 
     my ($obj_type, $obj_id) = split(/\-/, $privacy);
+    if (!defined $obj_id) {
+        $RT::Logger->warning("Invalid privacy string \"$privacy\" passed to _GetObject");
+        return undef;
+    }
 
     my $object = $self->_load_privacy_object($obj_type, $obj_id);
 
     unless (ref($object) eq $obj_type) {
-	$RT::Logger->error("Could not load object of type $obj_type with ID $obj_id, got object of type " . (ref($object) || 'undef'));
-	return undef;
+        $RT::Logger->error("Could not load object of type $obj_type with ID $obj_id, got object of type " . (ref($object) || 'undef'));
+        return undef;
     }
 
     # Do not allow the loading of a user object other than the current


More information about the Rt-commit mailing list