[freeside-commits] branch FREESIDE_3_BRANCH updated. fdf0b627e05c35a2df7d94bcaa0fb8ddb0e49374

Mark Wells mark at 420.am
Tue Oct 15 13:08:39 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  fdf0b627e05c35a2df7d94bcaa0fb8ddb0e49374 (commit)
      from  ddb0ff57880eeb2183b227592545f2619079d221 (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 fdf0b627e05c35a2df7d94bcaa0fb8ddb0e49374
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Oct 15 13:04:06 2013 -0700

    compatibility fix for FFIEC census tract lookup, #25258

diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index b5cc325..c6d6f1f 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -6,6 +6,7 @@ use vars qw( $DEBUG @EXPORT_OK $conf );
 use LWP::UserAgent;
 use HTTP::Request;
 use HTTP::Request::Common qw( GET POST );
+use HTTP::Cookies;
 use HTML::TokeParser;
 use URI::Escape 3.31;
 use Data::Dumper;
@@ -48,19 +49,20 @@ sub get_censustract_ffiec {
   my $return = {};
   my $error = '';
 
-  my $ua = new LWP::UserAgent;
+  my $ua = new LWP::UserAgent('cookie_jar' => HTTP::Cookies->new);
   my $res = $ua->request( GET( $url ) );
 
   warn $res->as_string
     if $DEBUG > 2;
 
-  unless ($res->code  eq '200') {
+  if (!$res->is_success) {
 
     $error = $res->message;
 
   } else {
 
     my $content = $res->content;
+
     my $p = new HTML::TokeParser \$content;
     my $viewstate;
     my $eventvalidation;
@@ -74,7 +76,7 @@ sub get_censustract_ffiec {
       last if $viewstate && $eventvalidation;
     }
 
-    unless ($viewstate && $eventvalidation ) {
+    if (!$viewstate or !$eventvalidation ) {
 
       $error = "either no __VIEWSTATE or __EVENTVALIDATION found";
 
@@ -86,6 +88,7 @@ sub get_censustract_ffiec {
       my @ffiec_args = (
         __VIEWSTATE => $viewstate,
         __EVENTVALIDATION => $eventvalidation,
+        __VIEWSTATEENCRYPTED => '',
         ddlbYear    => $year,
         txtAddress  => $location->{address1},
         txtCity     => $location->{city},  

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

Summary of changes:
 FS/FS/Misc/Geo.pm |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list