holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r12594: LJSUP-12885: SMS notification - Add Taji...

Committer: akanashin
LJSUP-12885: SMS notification - Add Tajikistan
U   trunk/bin/misc/smsru_stats.pl
Modified: trunk/bin/misc/smsru_stats.pl
===================================================================
--- trunk/bin/misc/smsru_stats.pl	2012-08-30 15:00:46 UTC (rev 12593)
+++ trunk/bin/misc/smsru_stats.pl	2012-08-31 06:52:35 UTC (rev 12594)
@@ -263,19 +263,19 @@
 
     return $PHONES{$number} if exists $PHONES{$number};
 
-    my $provider_name;
     for my $provider (keys %{$LJ::SMSRU{provider}}) {
-        my $code = $LJ::SMSRU{provider}->{$provider}->{code};
+        if (my $check_number = $LJ::SMSRU{provider}->{$provider}->{check_number}) {
+            &$check_number($number);
+            $PHONES{$number} = $provider;
+            return $provider;
+        } 
+    }
 
-        my ($def) = $number =~ /^$code(\d\d\d)\d{7}$/;
-
-        next unless $def;
-
-        $provider_name = $LJ::SMSRU{provider_by_code_def}->{$code.$def};
-        if ($provider_name) {
-            $PHONES{$number} = $provider_name;
-            return $provider_name;
-        }
+    my ($def) = $number =~ /^7(\d\d\d)\d{7}$/; 
+    my $provider_name = $LJ::SMSRU{provider_by_code_def}->{'7'.$def};
+    if ($provider_name) {
+        $PHONES{$number} = $provider_name;
+        return $provider_name;
     }
 
     unless ($provider_name) {

Tags: akanashin, holyandrew, ljcom, pl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments