summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2012-06-14 21:16:59 +0000
committerBrice Maron <brice@bmaron.net>2012-06-14 21:16:59 +0000
commit4753cc3ebde9867ab4deb1979fb4231b0c847426 (patch)
treec6944e947bc84c8716b57b7e2b06ef51efccb3db /apps/bookmarks
parent6da5a2fdd4e8a19ab993b4a1f7de7e45b8922a16 (diff)
parentf3b30e4658c4dde82b56b458c672fa5edcba5d6b (diff)
downloadnextcloud-server-4753cc3ebde9867ab4deb1979fb4231b0c847426.tar.gz
nextcloud-server-4753cc3ebde9867ab4deb1979fb4231b0c847426.zip
Merge branch 'master' into multi_app_dir
Conflicts: apps/bookmarks/ajax/addBookmark.php config/config.sample.php lib/app.php remote.php
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/addBm.php2
-rw-r--r--apps/bookmarks/ajax/delBookmark.php2
-rw-r--r--apps/bookmarks/ajax/editBookmark.php8
-rw-r--r--apps/bookmarks/ajax/recordClick.php2
-rw-r--r--apps/bookmarks/ajax/updateList.php6
-rw-r--r--apps/bookmarks/appinfo/database.xml2
-rw-r--r--apps/bookmarks/js/addBm.js1
-rw-r--r--apps/bookmarks/js/bookmarks.js5
-rw-r--r--apps/bookmarks/js/bookmarksearch.js1
9 files changed, 18 insertions, 11 deletions
diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php
index 313489d22fb..866fa1e7b1e 100644
--- a/apps/bookmarks/addBm.php
+++ b/apps/bookmarks/addBm.php
@@ -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';
diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php
index 0b5689811ae..5a067701c9f 100644
--- a/apps/bookmarks/ajax/delBookmark.php
+++ b/apps/bookmarks/ajax/delBookmark.php
@@ -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();
diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php
index db349af35c1..fcec2e1cedb 100644
--- a/apps/bookmarks/ajax/editBookmark.php
+++ b/apps/bookmarks/ajax/editBookmark.php
@@ -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
diff --git a/apps/bookmarks/ajax/recordClick.php b/apps/bookmarks/ajax/recordClick.php
index 2bd91f232a4..1eee1718d13 100644
--- a/apps/bookmarks/ajax/recordClick.php
+++ b/apps/bookmarks/ajax/recordClick.php
@@ -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" );
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php
index c919a5fc439..4de2475d067 100644
--- a/apps/bookmarks/ajax/updateList.php
+++ b/apps/bookmarks/ajax/updateList.php
@@ -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 {
diff --git a/apps/bookmarks/appinfo/database.xml b/apps/bookmarks/appinfo/database.xml
index f2fc68e4b58..b03c1fb2c89 100644
--- a/apps/bookmarks/appinfo/database.xml
+++ b/apps/bookmarks/appinfo/database.xml
@@ -3,7 +3,7 @@
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
- <charset>latin1</charset>
+ <charset>utf8</charset>
<table>
<name>*dbprefix*bookmarks</name>
<declaration>
diff --git a/apps/bookmarks/js/addBm.js b/apps/bookmarks/js/addBm.js
index d64e55e8920..625ac8420a8 100644
--- a/apps/bookmarks/js/addBm.js
+++ b/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){
diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js
index a746cf437bf..7f3104e812f 100644
--- a/apps/bookmarks/js/bookmarks.js
+++ b/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')),
});
diff --git a/apps/bookmarks/js/bookmarksearch.js b/apps/bookmarks/js/bookmarksearch.js
index e7a4fb18393..e8f5363c935 100644
--- a/apps/bookmarks/js/bookmarksearch.js
+++ b/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')),
});