فهرست منبع

Re-checkin some changes which were lost on Doomshammers checkin.
Also include some convertions for Danish entities.

Morten Brix Pedersen 25 سال پیش
والد
کامیت
bab8bcf38e
1فایلهای تغییر یافته به همراه11 افزوده شده و 7 حذف شده
  1. 11 7
      pisg.pl

+ 11 - 7
pisg.pl

@@ -127,11 +127,11 @@ sub init_pisg
 
     $timestamp = time;
 
-    if ($timeoffset =~ /\+(\d)/) {
+    if ($timeoffset =~ /\+(\d+)/) {
         # We must plus some hours to the time
         $timestamp += 3600 * $1; # 3600 seconds per hour
 
-    } elsif ($timeoffset =~ /-(\d)/) {
+    } elsif ($timeoffset =~ /-(\d+)/) {
         # We must remove some hours from the time
         $timestamp -= 3600 * $1; # 3600 seconds per hour
     }
@@ -760,6 +760,10 @@ sub template_text
         $text =~ s/ö/ö/g;
         $text =~ s/ä/ä/g;
         $text =~ s/ß/&szlig/g;
+        $text =~ s/&/&/g;
+        $text =~ s/å/å/g;
+        $text =~ s/æ/æ/g;
+        $text =~ s/ø/ø/g;
     }
 
     return $text;
@@ -879,21 +883,21 @@ sub activetimes
         debug("Time: $hour => ". $times{$hour});
         if ($toptime[0] == $hour) {
             $image = $pic2;
-		} else { 
-			$image = $pic1; 
-        } 
+        } else {
+            $image = $pic1;
+        }
 
         my $size = ($times{$hour} / $highest_value) * 100;
         my $percent = ($times{$hour} / $lines) * 100;
         $percent =~ s/(\.\d)\d+/$1/;
 
-        if ($timeoffset =~ /\+(\d)/) {
+        if ($timeoffset =~ /\+(\d+)/) {
             # We must plus some hours to the time
             $hour += $1;
             $hour = $hour % 24;
             if ($hour < 10) { $hour = "0" . $hour; }
 
-        } elsif ($timeoffset =~ /-(\d)/) {
+        } elsif ($timeoffset =~ /-(\d+)/) {
             # We must remove some hours from the time
             $hour -= $1;
             $hour = $hour % 24;