From fbf942884de3291473de8804bec0d2bd2d0a8555 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Wed, 30 Jan 2013 23:28:51 +0100 Subject: [PATCH] [Bookmark] Correct adding bookmarks pbm thx fossxplorer --- lib/bookmarks.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/bookmarks.php b/lib/bookmarks.php index 89d01064..4af7a4d2 100644 --- a/lib/bookmarks.php +++ b/lib/bookmarks.php @@ -315,13 +315,11 @@ class OC_Bookmarks_Bookmarks{ $is_public = $is_public ? 1 : 0; $enc_url = htmlspecialchars_decode($url); $_ut = self::getNowValue(); - // Change lastmodified date if the record if already exists $sql = "SELECT * from *PREFIX*bookmarks WHERE url = ? and user_id = ?"; $query = OCP\DB::prepare($sql, 1); $result = $query->execute(array($enc_url, OCP\USER::getUser())); - if(count($result) != 0) { - $row = $result->fetchRow(); + if ($row = $result->fetchRow()){ $params = array(); $title_str = ''; if(trim($title) != '') { // Do we replace the old title @@ -340,8 +338,6 @@ class OC_Bookmarks_Bookmarks{ $query->execute($params); return $row['id']; } - - $query = OCP\DB::prepare(" INSERT INTO *PREFIX*bookmarks (url, title, user_id, public, added, lastmodified, description)