Skip to content
Browse files

Using POST instead of GET.

  • Loading branch information...
1 parent cc653a8 commit f8337c9d723039760eecccf68bcb02752551e254 @LukasReschke LukasReschke committed Jun 10, 2012
View
2 apps/bookmarks/addBm.php
@@ -28,6 +28,6 @@
OCP\App::checkAppEnabled('bookmarks');
require_once('bookmarksHelper.php');
-addBookmark($_GET['url'], '', 'Read-Later');
+addBookmark($_POST['url'], '', 'Read-Later');
include 'templates/addBm.php';
View
2 apps/bookmarks/ajax/addBookmark.php
@@ -31,5 +31,5 @@
OCP\JSON::checkAppEnabled('bookmarks');
require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
-$id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']);
+$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
OCP\JSON::success(array('data' => $id));
View
2 apps/bookmarks/ajax/delBookmark.php
@@ -30,7 +30,7 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('bookmarks');
-$id = $_GET['id'];
+$id = $_POST['id'];
if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
OC_JSON::error();
exit();
View
8 apps/bookmarks/ajax/editBookmark.php
@@ -39,7 +39,7 @@
$_ut = "UNIX_TIMESTAMP()";
}
-$bookmark_id = (int)$_GET["id"];
+$bookmark_id = (int)$_POST["id"];
$query = OCP\DB::prepare("
UPDATE *PREFIX*bookmarks
@@ -48,8 +48,8 @@
");
$params=array(
- htmlspecialchars_decode($_GET["url"]),
- htmlspecialchars_decode($_GET["title"]),
+ htmlspecialchars_decode($_POST["url"]),
+ htmlspecialchars_decode($_POST["title"]),
);
$query->execute($params);
@@ -67,7 +67,7 @@
VALUES (?, ?)
");
-$tags = explode(' ', urldecode($_GET["tags"]));
+$tags = explode(' ', urldecode($_POST["tags"]));
foreach ($tags as $tag) {
if(empty($tag)) {
//avoid saving blankspaces
View
2 apps/bookmarks/ajax/recordClick.php
@@ -37,7 +37,7 @@
AND url LIKE ?
");
-$params=array(OCP\USER::getUser(), htmlspecialchars_decode($_GET["url"]));
+$params=array(OCP\USER::getUser(), htmlspecialchars_decode($_POST["url"]));
$bookmarks = $query->execute($params);
header( "HTTP/1.1 204 No Content" );
View
6 apps/bookmarks/ajax/updateList.php
@@ -33,11 +33,11 @@
//Filter for tag?
-$filterTag = isset($_GET['tag']) ? htmlspecialchars_decode($_GET['tag']) : false;
+$filterTag = isset($_POST['tag']) ? htmlspecialchars_decode($_POST['tag']) : false;
-$offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0;
+$offset = isset($_POST['page']) ? intval($_POST['page']) * 10 : 0;
-$sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent';
+$sort = isset($_POST['sort']) ? ($_POST['sort']) : 'bookmarks_sorting_recent';
if($sort == 'bookmarks_sorting_clicks') {
$sqlSortColumn = 'clickcount';
} else {
View
1 apps/bookmarks/js/addBm.js
@@ -6,6 +6,7 @@ function addBookmark(event) {
var url = $('#bookmark_add_url').val();
var tags = $('#bookmark_add_tags').val();
$.ajax({
+ type: 'POST',
url: 'ajax/addBookmark.php',
data: 'url=' + encodeURI(url) + '&tags=' + encodeURI(tags),
success: function(data){
View
5 apps/bookmarks/js/bookmarks.js
@@ -20,6 +20,7 @@ function getBookmarks() {
}
$.ajax({
+ type: 'POST',
url: OC.filePath('bookmarks', 'ajax', 'updateList.php'),
data: 'tag=' + encodeURIComponent($('#bookmarkFilterTag').val()) + '&page=' + bookmarks_page + '&sort=' + bookmarks_sorting,
success: function(bookmarks){
@@ -70,6 +71,7 @@ function addOrEditBookmark(event) {
}
if (id == 0) {
$.ajax({
+ type: 'POST',
url: OC.filePath('bookmarks', 'ajax', 'addBookmark.php'),
data: 'url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags),
success: function(response){
@@ -82,6 +84,7 @@ function addOrEditBookmark(event) {
}
else {
$.ajax({
+ type: 'POST',
url: OC.filePath('bookmarks', 'ajax', 'editBookmark.php'),
data: 'id=' + id + '&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags),
success: function(){
@@ -99,6 +102,7 @@ function addOrEditBookmark(event) {
function delBookmark(event) {
var record = $(this).parent().parent();
$.ajax({
+ type: 'POST',
url: OC.filePath('bookmarks', 'ajax', 'delBookmark.php'),
data: 'id=' + record.data('id'),
success: function(data){
@@ -177,6 +181,7 @@ function updateOnBottom() {
function recordClick(event) {
$.ajax({
+ type: 'POST',
url: OC.filePath('bookmarks', 'ajax', 'recordClick.php'),
data: 'url=' + encodeURIComponent($(this).attr('href')),
});
View
1 apps/bookmarks/js/bookmarksearch.js
@@ -16,6 +16,7 @@ function recordClick(event) {
var jsFileLocation = $('script[src*=bookmarksearch]').attr('src');
jsFileLocation = jsFileLocation.replace('js/bookmarksearch.js', '');
$.ajax({
+ type: 'POST',
url: jsFileLocation + 'ajax/recordClick.php',
data: 'url=' + encodeURI($(this).attr('href')),
});

0 comments on commit f8337c9

Please sign in to comment.
Something went wrong with that request. Please try again.