mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-11-29 04:24:11 +01:00
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
diff a/bookmarks/bookmarksHelper.php b/bookmarks/bookmarksHelper.php (rejected hunks)
|
|
@@ -79,29 +79,21 @@ function addBookmark($url, $title, $tags='') {
|
|
} else {
|
|
$_ut = "UNIX_TIMESTAMP()";
|
|
}
|
|
-
|
|
+
|
|
+ $is_public = $is_public ? 1 : 0;
|
|
//FIXME: Detect when user adds a known URL
|
|
$query = OCP\DB::prepare("
|
|
INSERT INTO *PREFIX*bookmarks
|
|
- (url, title, user_id, public, added, lastmodified)
|
|
- VALUES (?, ?, ?, 0, $_ut, $_ut)
|
|
+ (url, title, user_id, public, added, lastmodified, description)
|
|
+ VALUES (?, ?, ?, ?, $_ut, $_ut, ?)
|
|
");
|
|
-
|
|
- if(empty($title)) {
|
|
- $metadata = getURLMetadata($url);
|
|
- if(isset($metadata['title'])) // Check for problems fetching the title
|
|
- $title = $metadata['title'];
|
|
- }
|
|
-
|
|
- if(empty($title)) {
|
|
- $l = OC_L10N::get('bookmarks');
|
|
- $title = $l->t('unnamed');
|
|
- }
|
|
-
|
|
+
|
|
$params=array(
|
|
- htmlspecialchars_decode($url),
|
|
- htmlspecialchars_decode($title),
|
|
- OCP\USER::getUser()
|
|
+ htmlspecialchars_decode($url),
|
|
+ htmlspecialchars_decode($title),
|
|
+ OCP\USER::getUser(),
|
|
+ $is_public,
|
|
+ $description,
|
|
);
|
|
$query->execute($params);
|
|
|