diff options
author | Golnaz Nilieh <g382nilieh@gmail.com> | 2011-08-20 12:38:15 +0430 |
---|---|---|
committer | Golnaz Nilieh <g382nilieh@gmail.com> | 2011-08-20 12:38:15 +0430 |
commit | eac4d4ff06e9d96fb05b5fb9c6f2eb7cc9d4256e (patch) | |
tree | 37044b10a8728075d99033a6cc1c85e59f8f3e8b /apps/bookmarks/ajax | |
parent | add0a90e1e2de05159f9ec81a44336b61307ec62 (diff) | |
download | nextcloud-server-eac4d4ff06e9d96fb05b5fb9c6f2eb7cc9d4256e.tar.gz nextcloud-server-eac4d4ff06e9d96fb05b5fb9c6f2eb7cc9d4256e.zip |
When deleting a bookmark, remove its tags from database.
Diffstat (limited to 'apps/bookmarks/ajax')
-rw-r--r-- | apps/bookmarks/ajax/delBookmark.php | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php index a47bd2b9ea4..99a618a7d14 100644 --- a/apps/bookmarks/ajax/delBookmark.php +++ b/apps/bookmarks/ajax/delBookmark.php @@ -35,18 +35,33 @@ if( !OC_User::isLoggedIn()){ exit(); } +$params=array( + urldecode($_GET["url"]), + OC_User::getUser() + ); + $query = OC_DB::prepare(" - DELETE FROM *PREFIX*bookmarks + SELECT id FROM *PREFIX*bookmarks WHERE url LIKE ? AND user_id = ? "); + +$id = $query->execute($params)->fetchOne(); + +$query = OC_DB::prepare(" + DELETE FROM *PREFIX*bookmarks + WHERE id = $id + "); -$params=array( - urldecode($_GET["url"]), - OC_User::getUser() - ); -$result = $query->execute($params); +$result = $query->execute(); + +$query = OC_DB::prepare(" + DELETE FROM *PREFIX*bookmarks_tags + WHERE bookmark_id = $id + "); + +$result = $query->execute(); // var_dump($params); echo json_encode( array( "status" => "success", "data" => array())); |