--- loncom/interface/lonmysql.pm 2011/05/31 02:40:02 1.39 +++ loncom/interface/lonmysql.pm 2019/11/20 18:02:55 1.41 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # MySQL utility functions # -# $Id: lonmysql.pm,v 1.39 2011/05/31 02:40:02 raeburn Exp $ +# $Id: lonmysql.pm,v 1.41 2019/11/20 18:02:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1259,6 +1259,7 @@ Fixes a table name so that it will work sub fix_table_name { my ($name) = @_; $name =~ s/^(\d+[eE]\d+)/_$1/; + $name =~ s/\W//g; return $name; } @@ -1287,7 +1288,7 @@ sub unsqltime { my $timestamp=shift; if ($timestamp=~/^(\d+)\-(\d+)\-(\d+)\s+(\d+)\:(\d+)\:(\d+)$/) { $timestamp=&maketime('year'=>$1,'month'=>$2,'day'=>$3, - 'hours'=>$4,'minutes'=>$5,'seconds'=>$6); + 'hours'=>$4,'minutes'=>$5,'seconds'=>$6,'dlsav'=>-1); } return $timestamp; }