From 893a9068e1f2d8179fae2a23e67b16d13652a3cd Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 9 Nov 2009 12:01:31 -0500 Subject: [PATCH] Update geotag ajax action to properly accept POST only --- ansel/js/googlemap_edit.js | 10 ++-------- ansel/lib/Ajax/Imple/ImageSaveGeotag.php | 11 +++++------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ansel/js/googlemap_edit.js b/ansel/js/googlemap_edit.js index 8a8ddf3a0..423c39e2b 100644 --- a/ansel/js/googlemap_edit.js +++ b/ansel/js/googlemap_edit.js @@ -76,14 +76,8 @@ Ansel_MapEdit.prototype = { handleSave: function(id) { var o = this._options; - params = { - img: id, - lat: this._map.points[0].getLatLng().lat(), - lng: this._map.points[0].getLatLng().lng(), - type: 'geotag' - }; - - new Ajax.Request(o.xurl, { + var params = { "values": "img=" + id + "/lat=" + this._map.points[0].getLatLng().lat() + "/lng=" + this._map.points[0].getLatLng().lng() }; + new Ajax.Request(o.xurl + "/action=geotag/post=values", { method: 'post', parameters: params, onComplete: function(transport) { diff --git a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php index bce0d1638..dd86d2e62 100644 --- a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php +++ b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php @@ -25,12 +25,11 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base { include_once dirname(__FILE__) . '/../../base.php'; - /* Require type, location, img to be from POST */ - $type = Horde_Util::getPost('type'); - $location = Horde_Util::getPost('location'); - $img = Horde_Util::getPost('img'); - $lat = Horde_Util::getPost('lat'); - $lng = Horde_Util::getPost('lng'); + $type = $args['action']; + $location = empty($post['location']) ? '' : $post['location']; + $img = $post['img']; + $lat = $post['lat']; + $lng = $post['lng']; if (empty($img) || ($type == 'location' && empty($location)) || -- 2.11.0