[freeside-commits] branch FREESIDE_3_BRANCH updated. 85d7ec5cab08971dd80447c3cc62e962ba6227d5

Ivan ivan at 420.am
Wed Dec 9 16:56:20 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  85d7ec5cab08971dd80447c3cc62e962ba6227d5 (commit)
      from  0efd28a530593574f40dcfab69eaae2b3f0da388 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 85d7ec5cab08971dd80447c3cc62e962ba6227d5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 9 16:56:15 2015 -0800

    deal when Net::MAC::Vendor-lookup doesn't return an arrayref, RT#39384

diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html
index 771bfb2..2078387 100644
--- a/httemplate/view/elements/svc_Common.html
+++ b/httemplate/view/elements/svc_Common.html
@@ -283,8 +283,8 @@ my $format_field = sub {
   } elsif ( $type eq 'checkbox' ) {
     $value = $value eq 'Y' ? emt('Yes') : emt('No');
   } elsif ( $type =~ /(input-)?mac_addr/ and $value =~ /\w/) {
-    my $vendor = Net::MAC::Vendor::lookup($value)->[0];
-    $value .= " ($vendor)" if $vendor;
+    my $vendor = Net::MAC::Vendor::lookup($value);
+    $value .= ' ('. $vendor->[0]. ')' if $vendor;
     $value = $m->scomp('/elements/mac_addr.html', $value);
   }
 
diff --git a/httemplate/view/elements/svc_radius_usage.html b/httemplate/view/elements/svc_radius_usage.html
index 08d6d53..5a958ee 100644
--- a/httemplate/view/elements/svc_radius_usage.html
+++ b/httemplate/view/elements/svc_radius_usage.html
@@ -27,8 +27,11 @@
 %  ) / 1048576;
 %
 %  my $last_mac = $svc->attribute_last_sqlradacct( 'CallingStationId' );
-%  if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
-%    $last_mac .= ' ('. (Net::MAC::Vendor::lookup($1))->[0]. ')';
+%  if (    $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i
+%       && my $vendor = Net::MAC::Vendor::lookup($1)
+%     )
+%  {
+%    $last_mac .= ' ('. $vendor->[0]. ')';
 %  }
 
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/elements/svc_Common.html       |    4 ++--
 httemplate/view/elements/svc_radius_usage.html |    7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list