aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-05 03:29:02 -0800
committerfriendica <info@friendica.com>2014-02-05 03:29:02 -0800
commit24f32e55c88311867218c1d93c808cd842453078 (patch)
treed7a34f8a81e465036ca601e88734ade4b3e09410 /mod
parentf30a39f9df5dc0cc70a9cb9befe87a8723c75721 (diff)
downloadvolse-hubzilla-24f32e55c88311867218c1d93c808cd842453078.tar.gz
volse-hubzilla-24f32e55c88311867218c1d93c808cd842453078.tar.bz2
volse-hubzilla-24f32e55c88311867218c1d93c808cd842453078.zip
bookmarking bugfix
Diffstat (limited to 'mod')
-rw-r--r--mod/bookmarks.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/mod/bookmarks.php b/mod/bookmarks.php
index 73958ff2f..de30d9bb6 100644
--- a/mod/bookmarks.php
+++ b/mod/bookmarks.php
@@ -8,11 +8,12 @@ function bookmarks_init(&$a) {
return;
$u = $a->get_channel();
-
+
$i = q("select * from item where id = %d and uid = %d limit 1",
intval($item_id),
intval(local_user())
);
+
if(! $i)
return;
@@ -22,16 +23,18 @@ function bookmarks_init(&$a) {
$terms = get_terms_oftype($item['term'],TERM_BOOKMARK);
- if($terms && (! $i[0]['item_restrict'])) {
+ if($terms && (! $item['item_restrict'])) {
require_once('include/bookmarks.php');
- require_once('include/Contact.php');
- $s = channelx_by_hash($i[0]['author_xchan']);
+
+ $s = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($item['author_xchan'])
+ );
if(! $s) {
- notice( t('Author lookup failed') . EOL);
+ logger('mod_bookmarks: author lookup failed.');
killme();
}
foreach($terms as $t) {
- bookmark_add($u,$s[0],$t,$i[0]['item_private']);
+ bookmark_add($u,$s[0],$t,$item['item_private']);
notice( t('Bookmark added') . EOL);
}
}