Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
UK Postcodes
Commits
bb8c64ca
Commit
bb8c64ca
authored
Oct 12, 2021
by
mattwire
Browse files
Fix PHP notice
parent
68112be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
CRM/Civicrmpostcodelookup/Page/Civipostcode.php
View file @
bb8c64ca
...
...
@@ -49,21 +49,23 @@ class CRM_Civicrmpostcodelookup_Page_Civipostcode extends CRM_Civicrmpostcodeloo
// Open the JSON document
$filetoparse
=
fopen
(
"
$querystring
"
,
"r"
)
or
die
(
"Error reading JSON data."
);
$data
=
stream_get_contents
(
$filetoparse
);
// Close the JSON source
fclose
(
$filetoparse
);
$simpleJSONData
=
json_decode
(
$data
);
$addressList
=
NULL
;
if
(
!
empty
(
$simpleJSONData
))
{
if
(
$simpleJSONData
->
is_error
==
1
)
{
$address
l
ist
[
0
][
'value'
]
=
''
;
$address
l
ist
[
0
][
'label'
]
=
$simpleJSONData
->
error
;
$address
L
ist
[
0
][
'value'
]
=
''
;
$address
L
ist
[
0
][
'label'
]
=
$simpleJSONData
->
error
;
}
else
{
$address
l
ist
=
self
::
getAddressList
(
$simpleJSONData
,
$postcode
);
$address
L
ist
=
self
::
getAddressList
(
$simpleJSONData
,
$postcode
);
}
}
// Close the JSON source
fclose
(
$filetoparse
);
echo
json_encode
(
$addresslist
);
echo
json_encode
(
$addressList
);
exit
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment