From 8677a5e492c38cdf22e49d240f423877e8b1c8fb Mon Sep 17 00:00:00 2001 From: Bryan Burgers Date: Mon, 16 Feb 2015 09:39:02 -0600 Subject: [PATCH] URL-encode query parameter to Google URL-encode the query that gets sent to Google so we can send any user-entered data to Google without worrying whether it has invalid characters. --- .../third_party/mx_google_map/mod.mx_google_map.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/expressionengine/third_party/mx_google_map/mod.mx_google_map.php b/system/expressionengine/third_party/mx_google_map/mod.mx_google_map.php index b510576..7e77bb6 100644 --- a/system/expressionengine/third_party/mx_google_map/mod.mx_google_map.php +++ b/system/expressionengine/third_party/mx_google_map/mod.mx_google_map.php @@ -398,7 +398,7 @@ function js() { function GetLatLong( $query, $mode ) { - $query = str_replace( " ", "+", trim( $query ) ); + $query = urlencode(trim($query)); $xml_url = "http://maps.googleapis.com/maps/api/geocode/xml?address=".$query."&ie=utf-8&oe=utf-8&sensor=false"; if ( !$out = $this->_readCache( md5( $query ) ) ) {