]> source.dussan.org Git - nextcloud-server.git/commitdiff
Using POST instead of GET.
authorLukas Reschke <lukas@statuscode.ch>
Sun, 10 Jun 2012 21:38:26 +0000 (23:38 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 11 Jun 2012 09:56:11 +0000 (11:56 +0200)
apps/bookmarks/addBm.php
apps/bookmarks/ajax/addBookmark.php
apps/bookmarks/ajax/delBookmark.php
apps/bookmarks/ajax/editBookmark.php
apps/bookmarks/ajax/recordClick.php
apps/bookmarks/ajax/updateList.php
apps/bookmarks/js/addBm.js
apps/bookmarks/js/bookmarks.js
apps/bookmarks/js/bookmarksearch.js

index 313489d22fbf822f03162625973945b60c2c7fb6..866fa1e7b1e02e5f2a7354947cd877ba6f87b1fe 100644 (file)
@@ -28,6 +28,6 @@ OCP\User::checkLoggedIn();
 OCP\App::checkAppEnabled('bookmarks');
 
 require_once('bookmarksHelper.php');
-addBookmark($_GET['url'], '', 'Read-Later');
+addBookmark($_POST['url'], '', 'Read-Later');
 
 include 'templates/addBm.php';
index 9241dc8ddf6c3f0a22fbf83df8ee178270f5a2a5..a2eb506f85e6740df84ad1faee2081dfc8ee6cbc 100644 (file)
@@ -31,5 +31,5 @@ OCP\JSON::checkLoggedIn();
 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));
\ No newline at end of file
index 0b5689811aeebaffd774557a3dbe289e39718c54..5a067701c9fb165ba9e870a9b7f23680cd829e47 100644 (file)
@@ -30,7 +30,7 @@ $RUNTIME_NOSETUPFS=true;
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('bookmarks');
 
-$id = $_GET['id'];
+$id = $_POST['id'];
 if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
        OC_JSON::error();
        exit();
index db349af35c13f0d08a45316aa707b1a06e6800f3..fcec2e1cedb7302481eb175a33a329bbdc0c7517 100644 (file)
@@ -39,7 +39,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
        $_ut = "UNIX_TIMESTAMP()";
 }
 
-$bookmark_id = (int)$_GET["id"];
+$bookmark_id = (int)$_POST["id"];
 
 $query = OCP\DB::prepare("
        UPDATE *PREFIX*bookmarks
@@ -48,8 +48,8 @@ $query = OCP\DB::prepare("
        ");
 
 $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 @@ $query = OCP\DB::prepare("
        VALUES (?, ?)
        ");
        
-$tags = explode(' ', urldecode($_GET["tags"]));
+$tags = explode(' ', urldecode($_POST["tags"]));
 foreach ($tags as $tag) {
        if(empty($tag)) {
                //avoid saving blankspaces
index 2bd91f232a4801162e7d9b06c3ec3a39ed2296bc..1eee1718d1319ed248e455eec6b017f1d5f4815e 100644 (file)
@@ -37,7 +37,7 @@ $query = OCP\DB::prepare("
                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" );
index c919a5fc4392d17f586edef3ab8d10c8abf41ad3..4de2475d06771204649d022c738d9e51ac71ead8 100644 (file)
@@ -33,11 +33,11 @@ OCP\JSON::checkAppEnabled('bookmarks');
 
 
 //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 {
index d64e55e8920c0ab16af88f79d276b626dd6ae19b..625ac8420a83df57e91a20b0968f177ed1984995 100644 (file)
@@ -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){ 
index a746cf437bf9d209cee4b5debee629b2984801b8..7f3104e812f1cea22d03bc1491ae5bc98ac8d27d 100644 (file)
@@ -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')),
        });
index e7a4fb18393e53c6ddcda1778c43a1f5d218d2e2..e8f5363c9354e902d3def8e7111f36ef46ea48da 100644 (file)
@@ -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')),
        });