+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
* Server to retrieve the lat/long
*
* @var string
- * @static
*/
static protected $_server = 'query.yahooapis.com';
/**
- * Uri of service
+ * Uri of service.
*
* @var string
- * @static
*/
static protected $_uri = '/v1/public/yql';
* @param bool $stateName
* This parameter currently has no function.
*
- * @return boolean
+ * @return bool
* true if we modified the address, false otherwise
- * @static
*/
public static function format(&$values, $stateName = FALSE) {
CRM_Utils_System::checkPHPVersion(5, TRUE);
$add = 'q=' . urlencode('select * from geo.placefinder where ');
- $add .= join(urlencode(' and '), $whereComponents);
+ $add .= implode(urlencode(' and '), $whereComponents);
$add .= "&appid=" . urlencode($config->mapAPIKey);
$values['postal_code'] = $ret['postal'];
/* the following logic to split the string was borrowed from
- CRM/Core/BAO/Address.php -- CRM_Core_BAO_Address::fixAddress.
- This is actually the function that calls the geocoding
- script to begin with, but the postal code business takes
- place before geocoding gets called.
- */
+ CRM/Core/BAO/Address.php -- CRM_Core_BAO_Address::fixAddress.
+ This is actually the function that calls the geocoding
+ script to begin with, but the postal code business takes
+ place before geocoding gets called.
+ */
if (preg_match('/^(\d{4,5})[+-](\d{4})$/',
$ret['postal'],
$values['geo_code_1'] = $values['geo_code_2'] = 'null';
return FALSE;
}
+
}