projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compatibility fix for FFIEC census tract lookup, #25258
[freeside.git]
/
FS
/
FS
/
Misc
/
Geo.pm
diff --git
a/FS/FS/Misc/Geo.pm
b/FS/FS/Misc/Geo.pm
index
d7375b0
..
e5355cc
100644
(file)
--- a/
FS/FS/Misc/Geo.pm
+++ b/
FS/FS/Misc/Geo.pm
@@
-6,8
+6,9
@@
use vars qw( $DEBUG @EXPORT_OK );
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 HTML::TokeParser;
-use URI::Escape;
+use URI::Escape
3.31
;
use Data::Dumper;
$DEBUG = 0;
use Data::Dumper;
$DEBUG = 0;
@@
-41,13
+42,13
@@
sub get_censustract {
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 > 1;
my $res = $ua->request( GET( $url ) );
warn $res->as_string
if $DEBUG > 1;
-
unless ($res->code eq '200'
) {
+
if (!$res->is_success
) {
$error = $res->message;
$error = $res->message;
@@
-67,7
+68,7
@@
sub get_censustract {
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";
@@
-75,10
+76,11
@@
sub get_censustract {
my($zip5, $zip4) = split('-',$location->{zip});
my($zip5, $zip4) = split('-',$location->{zip});
- $year ||= '201
1'; #2012 per http://transition.fcc.gov/form477/techfaqs.html soon/now?
+ $year ||= '201
2';
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},