]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Id.pm
fixed an 'uninitialized' warning
[selfforum.git] / selfforum-cgi / shared / Id.pm
index 480a57e2da7ff21179a7f10ca9482e4f3736ff2b..8e9137920b377dfe2b049ce63147e24f09721206 100644 (file)
@@ -14,8 +14,15 @@ use strict;
 use vars qw(
   @table
   @EXPORT
 use vars qw(
   @table
   @EXPORT
+  $VERSION
 );
 
 );
 
+################################################################################
+#
+# Version check
+#
+$VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+
 ################################################################################
 #
 # Export
 ################################################################################
 #
 # Export
@@ -59,6 +66,8 @@ sub unique_id () {
 #
 sub to_base64 ($) {
   my $x = shift;
 #
 sub to_base64 ($) {
   my $x = shift;
+  return '' unless defined $x;
+
   my $y = $table[$x % 64];
 
   $y = $table[$x % 64].$y while ($x = int ($x/64));
   my $y = $table[$x % 64];
 
   $y = $table[$x % 64].$y while ($x = int ($x/64));
@@ -79,7 +88,7 @@ BEGIN {
   );
 }
 
   );
 }
 
-# keep require happy
+# keep 'require' happy
 1;
 
 #
 1;
 
 #

patrick-canterino.de