Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\GeoLocation;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\GeoLocation\GeoCoder;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -38,7 +38,7 @@ class _Google extends \IPS\GeoLocation\GeoCoder
|
||||
$data = \IPS\Http\Url::external( "https://maps.googleapis.com/maps/api/geocode/json" )->setQueryString( array(
|
||||
'latlng' => "{$lat},{$long}",
|
||||
'sensor' => 'false',
|
||||
'key' => \IPS\Settings::i()->google_maps_api_key
|
||||
'key' => \IPS\Settings::i()->google_maps_api_key_secret ?: \IPS\Settings::i()->google_maps_api_key
|
||||
) )->request()->get()->decodeJson();
|
||||
|
||||
$obj = new \IPS\GeoLocation;
|
||||
@@ -48,7 +48,7 @@ class _Google extends \IPS\GeoLocation\GeoCoder
|
||||
$_address = '';
|
||||
|
||||
/* Make sure the response from Google is valid */
|
||||
if( isset( $data['results'] ) AND is_array( $data['results'] ) AND count( $data['results'] ) )
|
||||
if( isset( $data['results'] ) AND \is_array( $data['results'] ) AND \count( $data['results'] ) )
|
||||
{
|
||||
foreach( $data['results'][0]['address_components'] as $component )
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class _Google extends \IPS\GeoLocation\GeoCoder
|
||||
$data = \IPS\Http\Url::external( "https://maps.googleapis.com/maps/api/geocode/json" )->setQueryString( array(
|
||||
'address' => $geoLocation->toString(),
|
||||
'sensor' => 'false',
|
||||
'key' => \IPS\Settings::i()->google_maps_api_key
|
||||
'key' => \IPS\Settings::i()->google_maps_api_key_secret ?: \IPS\Settings::i()->google_maps_api_key
|
||||
) )->request()->get()->decodeJson();
|
||||
}
|
||||
catch( \RuntimeException $e )
|
||||
@@ -121,7 +121,7 @@ class _Google extends \IPS\GeoLocation\GeoCoder
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !count( $data['results'] ) )
|
||||
if ( !\count( $data['results'] ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\GeoLocation\GeoCoder;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -47,7 +47,7 @@ class _Mapbox extends \IPS\GeoLocation\GeoCoder
|
||||
$_address = '';
|
||||
|
||||
/* Make sure the response from Mapbox is valid */
|
||||
if( isset( $data['results'] ) AND is_array( $data['results'] ) AND count( $data['results'] ) )
|
||||
if( isset( $data['results'] ) AND \is_array( $data['results'] ) AND \count( $data['results'] ) )
|
||||
{
|
||||
foreach( $data['results'][0]['address_components'] as $component )
|
||||
{
|
||||
@@ -118,7 +118,7 @@ class _Mapbox extends \IPS\GeoLocation\GeoCoder
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isset( $data['features'] ) or !count( $data['features'] ) )
|
||||
if ( !isset( $data['features'] ) or !\count( $data['features'] ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ class _Mapbox extends \IPS\GeoLocation\GeoCoder
|
||||
|
||||
if( $setAddress === TRUE )
|
||||
{
|
||||
if( isset( $data['results'] ) AND is_array( $data['results'] ) AND count( $data['results'] ) )
|
||||
if( isset( $data['results'] ) AND \is_array( $data['results'] ) AND \count( $data['results'] ) )
|
||||
{
|
||||
foreach( $data['results'][0]['address_components'] as $component )
|
||||
{
|
||||
|
||||
Whitespace-only changes.
Reference in new issue
Block a user