projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6422e16
)
compatibility fix for FFIEC census tract lookup, #25258
author
Mark Wells
<mark@freeside.biz>
Tue, 15 Oct 2013 20:04:17 +0000
(13:04 -0700)
committer
Mark Wells
<mark@freeside.biz>
Tue, 15 Oct 2013 20:04:17 +0000
(13:04 -0700)
FS/FS/Misc/Geo.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Misc/Geo.pm
b/FS/FS/Misc/Geo.pm
index
b5cc325
..
c6d6f1f
100644
(file)
--- 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 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;
use HTML::TokeParser;
use URI::Escape 3.31;
use Data::Dumper;
@@
-48,19
+49,20
@@
sub get_censustract_ffiec {
my $return = {};
my $error = '';
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;
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;
$error = $res->message;
} else {
my $content = $res->content;
+
my $p = new HTML::TokeParser \$content;
my $viewstate;
my $eventvalidation;
my $p = new HTML::TokeParser \$content;
my $viewstate;
my $eventvalidation;
@@
-74,7
+76,7
@@
sub get_censustract_ffiec {
last if $viewstate && $eventvalidation;
}
last if $viewstate && $eventvalidation;
}
-
unless ($viewstate &&
$eventvalidation ) {
+
if (!$viewstate or !
$eventvalidation ) {
$error = "either no __VIEWSTATE or __EVENTVALIDATION found";
$error = "either no __VIEWSTATE or __EVENTVALIDATION found";
@@
-86,6
+88,7
@@
sub get_censustract_ffiec {
my @ffiec_args = (
__VIEWSTATE => $viewstate,
__EVENTVALIDATION => $eventvalidation,
my @ffiec_args = (
__VIEWSTATE => $viewstate,
__EVENTVALIDATION => $eventvalidation,
+ __VIEWSTATEENCRYPTED => '',
ddlbYear => $year,
txtAddress => $location->{address1},
txtCity => $location->{city},
ddlbYear => $year,
txtAddress => $location->{address1},
txtCity => $location->{city},