]> matita.cs.unibo.it Git - helm.git/commitdiff
1. syntax error fixed
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 Oct 2005 21:31:01 +0000 (21:31 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 Oct 2005 21:31:01 +0000 (21:31 +0000)
2. r.e. for the time format fixed

helm/matita/scripts/public_html/common.php

index 10aeb8d823a025758c0a51dc349917c1fb48be84..e1bef4dd71599bd3385a8ab28749f239f062d358 100644 (file)
@@ -27,9 +27,9 @@ function query($q) {
 
 function time_2_cents($t) {
   $matches = array();
-  $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+  $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
   $m = preg_match($rex,$t,$matches);
-  if ( $m == 0 ) exit 1;
+  if ( $m == 0 ) exit(1);
   $t_minutes = $matches[1];
   $t_secs = $matches[2];
   $t_cents = $matches[3];
@@ -39,7 +39,7 @@ function time_2_cents($t) {
 function sum_time($t1, $t2) {
   $matches1 = array();
   $matches2 = array();
-  $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+  $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
   $m1 = preg_match($rex,$t1,$matches1);
   $m2 = preg_match($rex,$t2,$matches2);
   if ($m1 != 0 && $m2 != 0) {