wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r11299: LJSUP-10889: Get rid of "Use of uninitia...

Committer: gprochaev
LJSUP-10889: Get rid of "Use of uninitialized value in concatenation" message in LJ::EventsFeed module

U   trunk/cgi-bin/LJ/EventsFeed.pm
Modified: trunk/cgi-bin/LJ/EventsFeed.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed.pm	2011-12-23 15:09:07 UTC (rev 11298)
+++ trunk/cgi-bin/LJ/EventsFeed.pm	2011-12-26 11:04:05 UTC (rev 11299)
@@ -76,9 +76,14 @@
 # prepare XML head for event: type + 'occured'
 sub xml_head {
     my $self = shift;
-    my $type = shift;
+    my $type = shift || '';
 
-    return '<event type="' . $type . '" occured="' . DateTime->from_epoch( epoch => $self->params->{'time'} )->datetime . '" ip="' . $self->params->{'remote_ip'} . '" uniqcookie="' . $self->params->{uniq_cookie} .'">';
+    my $time        = $self->params->{'time'} || 0;
+    my $datetime    = DateTime->from_epoch( epoch => $time )->datetime;
+    my $remote_ip   = $self->params->{'remote_ip'} || '';
+    my $uniq_cookie = $self->params->{'uniq_cookie'} || '';
+
+    return '<event type="' . $type . '" occured="' . $datetime . '" ip="' . $remote_ip . '" uniqcookie="' . $uniq_cookie .'">';
 }
 
 # closing part of XML event, pair to xml_head subroutine

Tags: gprochaev, ljcom, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments