[otrs-cvs] otrs/Kernel/System Stats.pm,1.44,1.45

CVS commits notifications of OTRS.org cvs-log at otrs.org
Tue Apr 29 22:05:13 GMT 2008


Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv3820/Kernel/System

Modified Files:
	Stats.pm 
Log Message:
Moved to FilenameCleanUp() of MainObject to check file names.

Author: martin

Index: Stats.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Stats.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** Stats.pm	23 Apr 2008 11:01:54 -0000	1.44
--- Stats.pm	29 Apr 2008 22:05:08 -0000	1.45
***************
*** 133,138 ****
      }
  
!     my $TimeStamp = $Self->{TimeObject}
!         ->SystemTime2TimeStamp( SystemTime => $Self->{TimeObject}->SystemTime(), );
  
      # meta tags
--- 133,139 ----
      }
  
!     my $TimeStamp = $Self->{TimeObject}->SystemTime2TimeStamp(
!         SystemTime => $Self->{TimeObject}->SystemTime(),
!     );
  
      # meta tags
***************
*** 156,161 ****
          )
      {
!         $Self->{LogObject}
!             ->Log( Priority => 'error', Message => "StatsAdd: Can not add a new Stat!" );
          return 0;
      }
--- 157,164 ----
          )
      {
!         $Self->{LogObject}->Log(
!             Priority => 'error',
!             Message  => 'StatsAdd: Can not add a new Stat!',
!         );
          return 0;
      }
***************
*** 2629,2638 ****
          return $Self->{LogObject}->Log(
              Priority => 'error',
!             Message  => "StringAndTimestamp2Filename: Need String!"
          );
      }
  
!     my ( $s, $m, $h, $D, $M, $Y )
!         = $Self->{TimeObject}->SystemTime2Date( SystemTime => $Self->{TimeObject}->SystemTime(), );
      $M = sprintf( "%02d", $M );
      $D = sprintf( "%02d", $D );
--- 2632,2642 ----
          return $Self->{LogObject}->Log(
              Priority => 'error',
!             Message  => 'StringAndTimestamp2Filename: Need String!'
          );
      }
  
!     my ( $s, $m, $h, $D, $M, $Y ) = $Self->{TimeObject}->SystemTime2Date(
!         SystemTime => $Self->{TimeObject}->SystemTime(),
!     );
      $M = sprintf( "%02d", $M );
      $D = sprintf( "%02d", $D );
***************
*** 2640,2660 ****
      $m = sprintf( "%02d", $m );
  
!     # replace invalid token like < > ? " : | \ or *
!     $Param{String} =~ s{[\s <>\?":\\\*\|\/]} {-}xg;
!     $Param{String} =~ s{ä} {ae}xg;
!     $Param{String} =~ s{ö} {oe}xg;
!     $Param{String} =~ s{ü} {ue}xg;
!     $Param{String} =~ s{Ä} {Ae}xg;
!     $Param{String} =~ s{Ö} {Oe}xg;
!     $Param{String} =~ s{Ü} {Ue}xg;
!     $Param{String} =~ s{ß} {ss}xg;
!     $Param{String} =~ s{-+} {-}xg;
! 
!     # Cut the String if to long
!     if ( length( $Param{String} ) > 100 ) {
!         $Param{String} = substr( $Param{String}, 0, 100 );
!     }
  
!     my $Filename = $Param{String} . "_" . "$Y-$M-$D" . "_" . "$h-$m";
  
      return $Filename;
--- 2644,2653 ----
      $m = sprintf( "%02d", $m );
  
!     $Param{String} = $Self->{MainObject}->FilenameCleanUp(
!         Filename => $Param{String},
!         Type     => 'Attachment',
!     );
  
!     my $Filename = $Param{String} . '_' . "$Y-$M-$D" . '_' . "$h-$m";
  
      return $Filename;
***************
*** 2662,2668 ****
  
  sub _MonthArray {
!     my @MonthArray
!         = ( '', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
!         );
      return \@MonthArray;
  }
--- 2655,2659 ----
  
  sub _MonthArray {
!     my @MonthArray = ( '', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',);
      return \@MonthArray;
  }


More information about the cvs-log mailing list