Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying URLs from Google Maps fails validation #75

Open
timClicks opened this issue Feb 27, 2011 · 1 comment
Open

Copying URLs from Google Maps fails validation #75

timClicks opened this issue Feb 27, 2011 · 1 comment

Comments

@timClicks
Copy link
Member

Just had feedback from a user. They used Google Maps to find a location. Then they copied that URL into our form for location on the form submission field. The validation failed.

It would be useful to allow people to do this, to avoid them needing to do things twice.

@meshage
Copy link

meshage commented Feb 27, 2011

function llextract( $in ) {
$llregex = "/[&?]ll=(-{0,1}\d{1,2}.\d{1,9}),(-{0,1}\d{1,3}.\d{1,9})/"; //
$matches = preg_match( $llregex, $in, $res );
if ($matches != 1) return FALSE;
elseif ((abs($res[1])>90) || (abs($res[2])>180)) return FALSE;
else {
$res["lon"] = $res[2]; // 4 with old regex
$res["lat"] = $res[1]; // 2 with old regex
$res["datum"] = "WGS84";
return $res;
}
};

partial list of possibly relevant files manually selected from 'grep -ri location *':
application/libraries/api/MY_Report_Api_Object.php
application/libraries/api/MY_Checkin_Api_Object.php
application/helpers/sms.php: $incident->location_id = $reporter_location->id;
application/helpers/upload.php: * Save an uploaded file to a new location.
application/hooks/https_check.php: * Not an optimal solution but works for now; index.php with cause get_headers to follow the "Location:"
application/hooks/https_check.php: // Disable following every "Location:" that is sent as part of the HTTP(S) header
application/libraries/ReportsImporter.php: $location = new Location_Model();

application/models/location.php:* Model for Locations

application/views/reports_submit_js.php: required: "Please enter a Location Name"
application/views/admin/reports_edit.php:


application/views/admin/reporters.php:

application/controllers/scheduler/s_feeds.php: // STEP 1: SAVE LOCATION
application/controllers/scheduler/s_twitter.php: $reporter_location = $reporter->location;
application/controllers/scheduler/s_email.php: $reporter_location = $reporter->location;
application/controllers/j2me.php: $url = "http://maps.google.com/maps/geo?q=".urlencode($location_name)."&output=csv&key=".$key;
application/controllers/reports.php: $location = new Location_Model();
application/controllers/json.php: $location_ids = array();
application/controllers/admin/reports.php: // STEP 1a: SAVE LOCATION

application/controllers/admin/messages/reporters.php: // If any location data is provided, require all location parameters

application/controllers/admin/settings.php: // Disable following any "Location:" sent as part of the HTTP header
settings-org.php: // Disable following any "Location:" sent as part of the HTTP header
settings.php: // Disable following any "Location:" sent as part of the HTTP header
system/helpers/url.php: header('Location: '.$uri);
system/core/Event.php: * Inserts a new event at a specfic key location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants