1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-19 15:52:10 +01:00

[Bookmark] Correct adding bookmarks pbm thx fossxplorer

This commit is contained in:
Brice Maron 2013-01-30 23:28:51 +01:00
parent f32d9f0806
commit fbf942884d

View File

@ -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)