Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3582

Extra '?' in Google Geocode query causes batch update query failure

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      The current code for the Google Geocode script results in a query that looks like the following:

      http://maps.google.com/maps/geo?q=?481+Giddyup+Dr,++Mytown,++Mystate,++11223

      The extra '?' after the q= is ignored on the first few queries, but after 50-100 queries, Google starts to fail the requests with an error indicating that the request looks like a hacking attempt.

      Line 123 of the Google Geocode script looks like this:

      $query = 'http://' . self::$_server . self::$_uri . '?' . $add . $arg;

      self:$_uri is set to '?q=' at the top of the script, so simply modifying this to:

      $query = 'http://' . self::$_server . self::$_uri . $add . $arg;

      takes care of the issue.

        Attachments

          Activity

            People

            • Assignee:
              kiran.jagtap Kiran Jagtap
              Reporter:
              bobrich Bob Rich
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: